@gooddata/sdk-ui-gen-ai 11.65.0-alpha.1 → 11.65.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/NOTICE +2 -2
  2. package/esm/components/GenAIChatDialogConnected.d.ts +12 -3
  3. package/esm/components/GenAIChatDialogConnected.d.ts.map +1 -1
  4. package/esm/components/GenAIChatDialogConnected.js +17 -6
  5. package/esm/components/Messages.d.ts.map +1 -1
  6. package/esm/components/Messages.js +4 -1
  7. package/esm/components/hooks/usePublisherDocumentSavedSync.d.ts +2 -0
  8. package/esm/components/hooks/usePublisherDocumentSavedSync.d.ts.map +1 -1
  9. package/esm/components/messages/AssistantItem.d.ts.map +1 -1
  10. package/esm/components/messages/AssistantItem.js +26 -1
  11. package/esm/components/messages/AssistantItemFeedback.d.ts.map +1 -1
  12. package/esm/components/messages/AssistantItemFeedback.js +4 -3
  13. package/esm/components/messages/FeedbackPopup.d.ts +3 -2
  14. package/esm/components/messages/FeedbackPopup.d.ts.map +1 -1
  15. package/esm/components/messages/FeedbackPopup.js +7 -3
  16. package/esm/components/messages/ItemsGroup.d.ts.map +1 -1
  17. package/esm/components/messages/ItemsGroup.js +1 -1
  18. package/esm/components/messages/contents/CustomHyperlink.js +1 -1
  19. package/esm/components/messages/conversationContents/ConversationMultipartContent.d.ts.map +1 -1
  20. package/esm/components/messages/conversationContents/ConversationMultipartContent.js +3 -2
  21. package/esm/components/messages/conversationContents/ConversationPublisherDocumentContent.d.ts +3 -5
  22. package/esm/components/messages/conversationContents/ConversationPublisherDocumentContent.d.ts.map +1 -1
  23. package/esm/components/messages/conversationContents/ConversationPublisherDocumentContent.js +18 -7
  24. package/esm/context/addContextReference.d.ts.map +1 -1
  25. package/esm/context/addContextReference.js +2 -1
  26. package/esm/context/build.d.ts.map +1 -1
  27. package/esm/context/build.js +2 -0
  28. package/esm/context/collectContextReferences.d.ts.map +1 -1
  29. package/esm/context/collectContextReferences.js +2 -2
  30. package/esm/context/removeContextReference.d.ts.map +1 -1
  31. package/esm/context/removeContextReference.js +3 -2
  32. package/esm/context/selectContextReferences.js +2 -2
  33. package/esm/context/viewedPublisherDocument.d.ts +3 -1
  34. package/esm/context/viewedPublisherDocument.d.ts.map +1 -1
  35. package/esm/context/viewedPublisherDocument.js +10 -1
  36. package/esm/index.d.ts +1 -1
  37. package/esm/index.d.ts.map +1 -1
  38. package/esm/index.js +1 -1
  39. package/esm/localization/bundles/de-DE.localization-bundle.js +2 -2
  40. package/esm/localization/bundles/en-US.localization-bundle.d.ts +8 -0
  41. package/esm/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
  42. package/esm/localization/bundles/en-US.localization-bundle.js +8 -0
  43. package/esm/localization/bundles/fr-FR.localization-bundle.js +1 -1
  44. package/esm/publisherDocumentPart.d.ts +20 -0
  45. package/esm/publisherDocumentPart.d.ts.map +1 -0
  46. package/esm/publisherDocumentPart.js +42 -0
  47. package/esm/sdk-ui-gen-ai.d.ts +38 -3
  48. package/esm/store/chatWindow/chatWindowSelectors.d.ts.map +1 -1
  49. package/esm/store/chatWindow/chatWindowSelectors.js +3 -3
  50. package/esm/store/chatWindow/chatWindowSlice.d.ts +3 -3
  51. package/esm/store/chatWindow/chatWindowSlice.d.ts.map +1 -1
  52. package/esm/store/events.d.ts +34 -4
  53. package/esm/store/events.d.ts.map +1 -1
  54. package/esm/store/events.js +7 -0
  55. package/esm/store/messages/messagesSlice.d.ts +7 -4
  56. package/esm/store/messages/messagesSlice.d.ts.map +1 -1
  57. package/esm/store/messages/messagesSlice.js +14 -5
  58. package/esm/store/sideEffects/onDefinitionReceivedTrigger.d.ts.map +1 -1
  59. package/esm/store/sideEffects/onDefinitionReceivedTrigger.js +15 -1
  60. package/esm/store/sideEffects/onEvent.d.ts +10 -2
  61. package/esm/store/sideEffects/onEvent.d.ts.map +1 -1
  62. package/esm/store/sideEffects/onEvent.js +18 -9
  63. package/esm/store/sideEffects/onPublisherDocumentSaved.d.ts.map +1 -1
  64. package/esm/store/sideEffects/onPublisherDocumentSaved.js +13 -2
  65. package/esm/store/sideEffects/onUserMessage.d.ts +1 -1
  66. package/esm/store/sideEffects/onUserMessage.d.ts.map +1 -1
  67. package/esm/store/sideEffects/onUserMessage.js +27 -2
  68. package/esm/utils.d.ts +6 -4
  69. package/esm/utils.d.ts.map +1 -1
  70. package/esm/utils.js +8 -7
  71. package/package.json +22 -22
  72. package/styles/css/conversations.css +3 -3
  73. package/styles/css/input.css +2 -2
  74. package/styles/css/intelligence.css +2 -2
  75. package/styles/css/main.css +55 -55
  76. package/styles/css/messages.css +15 -15
  77. package/styles/css/tooltip.css +1 -1
  78. package/styles/scss/conversations.scss +2 -2
  79. package/styles/scss/intelligence.scss +2 -2
package/NOTICE CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/NOTICE
3
- size: 39597543 bytes
4
- sha256: 81307e55f085247531bd92262545e38f82b4cdbf81094518356dacdc785d0fd4
3
+ size: 39823365 bytes
4
+ sha256: 460797e34d06f626c18b4f9c722107dee6eff2dc4a9fc9839053ccb0c288b29e
@@ -1,7 +1,7 @@
1
1
  import { type RefObject } from "react";
2
2
  import { type IAnalyticalBackend, type IUserWorkspaceSettings } from "@gooddata/sdk-backend-spi";
3
3
  import type { GenAIChatEffort, GenAIObjectType, IColorPalette, IGenAIUserContext } from "@gooddata/sdk-model";
4
- import { type ChatAssistantMessageEvent, type ChatClarificationQuestionsEvent, type ChatClosedEvent, type ChatCopyToClipboardEvent, type ChatDefinitionReceivedEvent, type ChatEvent, type ChatFeedbackErrorEvent, type ChatFeedbackEvent, type ChatModeChangeEvent, type ChatOpenedEvent, type ChatResetEvent, type ChatSaveVisualizationErrorEvent, type ChatSaveVisualizationSuccessEvent, type ChatUserMessageEvent } from "../store/events.js";
4
+ import { type ChatAssistantMessageEvent, type ChatClarificationQuestionsEvent, type ChatClosedEvent, type ChatConversationChangedEvent, type ChatCopyToClipboardEvent, type ChatDefinitionReceivedEvent, type ChatEvent, type ChatFeedbackErrorEvent, type ChatFeedbackEvent, type ChatModeChangeEvent, type ChatOpenedEvent, type ChatReasoningEvent, type ChatResetEvent, type ChatSaveVisualizationErrorEvent, type ChatSaveVisualizationSuccessEvent, type ChatUserMessageEvent } from "../store/events.js";
5
5
  import { type GenAIAssistantDisplayMode, type LinkHandlerEvent } from "./ConfigContext.js";
6
6
  import { type GenAIChatDialogProps } from "./GenAIChatDialog.js";
7
7
  import { type IDashboardSaved } from "./hooks/useDashboardSavedSync.js";
@@ -25,12 +25,18 @@ export type GenAIChatConnectedEvent = {
25
25
  } | {
26
26
  name: "reset";
27
27
  payload: ChatResetEvent;
28
+ } | {
29
+ name: "conversation-changed";
30
+ payload: ChatConversationChangedEvent;
28
31
  } | {
29
32
  name: "user-message";
30
33
  payload: ChatUserMessageEvent;
31
34
  } | {
32
35
  name: "assistant-message";
33
36
  payload: ChatAssistantMessageEvent;
37
+ } | {
38
+ name: "reasoning";
39
+ payload: ChatReasoningEvent;
34
40
  } | {
35
41
  name: "feedback";
36
42
  payload: ChatFeedbackEvent;
@@ -65,6 +71,7 @@ type SeedAction = Parameters<Dispatch>[0];
65
71
  * @internal
66
72
  */
67
73
  export type SeedInput = {
74
+ conversationId?: string;
68
75
  agentId?: string;
69
76
  effort?: GenAIChatEffort;
70
77
  askedQuestion?: string | null;
@@ -83,7 +90,7 @@ export type SeedInput = {
83
90
  *
84
91
  * @internal
85
92
  */
86
- export declare function buildSeedActions({ agentId, effort, askedQuestion, userContext, replaceUserContext, appendToChat, }: SeedInput): SeedAction[];
93
+ export declare function buildSeedActions({ conversationId, agentId, effort, askedQuestion, userContext, replaceUserContext, appendToChat, }: SeedInput): SeedAction[];
87
94
  /**
88
95
  * Props for {@link GenAIChatDialogConnected}.
89
96
  *
@@ -121,6 +128,8 @@ export interface IGenAIChatDialogConnectedProps {
121
128
  displayMode?: GenAIAssistantDisplayMode;
122
129
  /** A question to seed into the chat when it opens. */
123
130
  askedQuestion?: string | null;
131
+ /** Existing conversation to activate for this request, without clearing or seeding it. */
132
+ conversationId?: string;
124
133
  /**
125
134
  * Monotonic counter bumped on every ask. Keying the seeding effect on it re-seeds the chat
126
135
  * (clear thread + send message) even when `askedQuestion` is identical to the previous ask.
@@ -187,6 +196,6 @@ export interface IGenAIChatDialogConnectedProps {
187
196
  *
188
197
  * @internal
189
198
  */
190
- export declare function GenAIChatDialogConnected({ backend, workspace, locale, canManage, canAnalyze, canFullControl, settings, agentId, effort, isOpen, isDisabled, displayMode, onOpen, onClose, askedQuestion, askSeq, userContext, ambientUserContext, ambientUserContextLoading, publisherDocumentSaved, dashboardSaved, appendToChat, replaceUserContext, includeTags, excludeTags, objectTypes: objectTypesOverride, onEvent, onAnyEvent, dialogPosition, className, colorPalette, allowNativeLinks, onLinkClick, returnFocusTo, }: IGenAIChatDialogConnectedProps): import("react/jsx-runtime").JSX.Element;
199
+ export declare function GenAIChatDialogConnected({ backend, workspace, locale, canManage, canAnalyze, canFullControl, settings, agentId, effort, isOpen, isDisabled, displayMode, onOpen, onClose, askedQuestion, conversationId, askSeq, userContext, ambientUserContext, ambientUserContextLoading, publisherDocumentSaved, dashboardSaved, appendToChat, replaceUserContext, includeTags, excludeTags, objectTypes: objectTypesOverride, onEvent, onAnyEvent, dialogPosition, className, colorPalette, allowNativeLinks, onLinkClick, returnFocusTo, }: IGenAIChatDialogConnectedProps): import("react/jsx-runtime").JSX.Element;
191
200
  export {};
192
201
  //# sourceMappingURL=GenAIChatDialogConnected.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GenAIChatDialogConnected.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatDialogConnected.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAqD,MAAM,OAAO,CAAC;AAE1F,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACjG,OAAO,KAAK,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EAAE,eAAe,EAAE,CAAC;IAEhC,wEAAwE;IACxE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACnD,sFAAsF;IACtF,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAExC,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4EAA4E;IAC5E,WAAW,CAAC,EAAE,CAAC,cAAc,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAAS,CAAC;IACvE,iDAAiD;IACjD,aAAa,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC;CAC1D;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,EACrC,OAAO,EACP,SAAS,EACT,MAAM,EACN,SAAS,EACT,UAAU,EACV,cAAc,EACd,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,UAAiB,EACjB,WAAW,EACX,MAAM,EACN,OAAO,EACP,aAAa,EACb,MAAM,EACN,WAAW,EACX,kBAAkB,EAClB,yBAAyB,EACzB,sBAAsB,EACtB,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,WAAW,EAAE,mBAAmB,EAChC,OAAO,EACP,UAAU,EACV,cAAc,EACd,SAAS,EACT,YAAY,EACZ,gBAAuB,EACvB,WAAW,EACX,aAAa,GAChB,EAAE,8BAA8B,2CA8IhC"}
1
+ {"version":3,"file":"GenAIChatDialogConnected.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatDialogConnected.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAqD,MAAM,OAAO,CAAC;AAE1F,OAAO,EAAE,KAAK,kBAAk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EACZ,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,WAAW,EAAE,mBAAmB,EAChC,OAAO,EACP,UAAU,EACV,cAAc,EACd,SAAS,EACT,YAAY,EACZ,gBAAuB,EACvB,WAAW,EACX,aAAa,GAChB,EAAE,8BAA8B,2CAgJhC"}
@@ -2,9 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  // (C) 2026 GoodData Corporation
3
3
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
4
4
  import { makeUserItem } from "../model.js";
5
- import { setAmbientUserContextAction, setUserContextAction } from "../store/chatWindow/chatWindowSlice.js";
6
- import { isChatAssistantMessageEvent, isChatClarificationQuestionsEvent, isChatClosedEvent, isChatCopyToClipboardEvent, isChatDefinitionReceivedEvent, isChatFeedbackErrorEvent, isChatFeedbackEvent, isChatModeChangeEvent, isChatOpenedEvent, isChatResetEvent, isChatSaveVisualizationErrorEvent, isChatSaveVisualizationSuccessEvent, isChatUserMessageEvent, } from "../store/events.js";
7
- import { clearThreadAction, newMessageAction, setSelectedAgentAction, setSelectedEffortAction, } from "../store/messages/messagesSlice.js";
5
+ import { setAmbientUserContextAction, setHistoryAction, setUserContextAction, } from "../store/chatWindow/chatWindowSlice.js";
6
+ import { isChatAssistantMessageEvent, isChatClarificationQuestionsEvent, isChatClosedEvent, isChatConversationChangedEvent, isChatCopyToClipboardEvent, isChatDefinitionReceivedEvent, isChatFeedbackErrorEvent, isChatFeedbackEvent, isChatModeChangeEvent, isChatOpenedEvent, isChatReasoningEvent, isChatResetEvent, isChatSaveVisualizationErrorEvent, isChatSaveVisualizationSuccessEvent, isChatUserMessageEvent, } from "../store/events.js";
7
+ import { activateConversationAction, clearThreadAction, newMessageAction, setSelectedAgentAction, setSelectedEffortAction, } from "../store/messages/messagesSlice.js";
8
8
  import { GenAIChatDialog } from "./GenAIChatDialog.js";
9
9
  import { useDashboardSavedSync } from "./hooks/useDashboardSavedSync.js";
10
10
  import { usePublisherDocumentSavedSync, } from "./hooks/usePublisherDocumentSavedSync.js";
@@ -19,12 +19,18 @@ export function toGenAIChatConnectedEvent(event) {
19
19
  else if (isChatResetEvent(event)) {
20
20
  return { name: "reset", payload: event };
21
21
  }
22
+ else if (isChatConversationChangedEvent(event)) {
23
+ return { name: "conversation-changed", payload: event };
24
+ }
22
25
  else if (isChatUserMessageEvent(event)) {
23
26
  return { name: "user-message", payload: event };
24
27
  }
25
28
  else if (isChatAssistantMessageEvent(event)) {
26
29
  return { name: "assistant-message", payload: event };
27
30
  }
31
+ else if (isChatReasoningEvent(event)) {
32
+ return { name: "reasoning", payload: event };
33
+ }
28
34
  else if (isChatFeedbackEvent(event)) {
29
35
  return { name: "feedback", payload: event };
30
36
  }
@@ -62,7 +68,10 @@ export function toGenAIChatConnectedEvent(event) {
62
68
  *
63
69
  * @internal
64
70
  */
65
- export function buildSeedActions({ agentId, effort, askedQuestion, userContext, replaceUserContext, appendToChat, }) {
71
+ export function buildSeedActions({ conversationId, agentId, effort, askedQuestion, userContext, replaceUserContext, appendToChat, }) {
72
+ if (conversationId) {
73
+ return [activateConversationAction({ conversationId }), setHistoryAction({ isHistory: false })];
74
+ }
66
75
  const actions = [];
67
76
  const seeding = Boolean(askedQuestion || userContext);
68
77
  if (seeding) {
@@ -93,7 +102,7 @@ export function buildSeedActions({ agentId, effort, askedQuestion, userContext,
93
102
  *
94
103
  * @internal
95
104
  */
96
- export function GenAIChatDialogConnected({ backend, workspace, locale, canManage, canAnalyze, canFullControl, settings, agentId, effort, isOpen, isDisabled = true, displayMode, onOpen, onClose, askedQuestion, askSeq, userContext, ambientUserContext, ambientUserContextLoading, publisherDocumentSaved, dashboardSaved, appendToChat, replaceUserContext, includeTags, excludeTags, objectTypes: objectTypesOverride, onEvent, onAnyEvent, dialogPosition, className, colorPalette, allowNativeLinks = true, onLinkClick, returnFocusTo, }) {
105
+ export function GenAIChatDialogConnected({ backend, workspace, locale, canManage, canAnalyze, canFullControl, settings, agentId, effort, isOpen, isDisabled = true, displayMode, onOpen, onClose, askedQuestion, conversationId, askSeq, userContext, ambientUserContext, ambientUserContextLoading, publisherDocumentSaved, dashboardSaved, appendToChat, replaceUserContext, includeTags, excludeTags, objectTypes: objectTypesOverride, onEvent, onAnyEvent, dialogPosition, className, colorPalette, allowNativeLinks = true, onLinkClick, returnFocusTo, }) {
97
106
  const defaultLinkClick = useCallback(({ itemUrl, newTab, preventDefault, type, dashboardStatus, }) => {
98
107
  // NOTE: If dashboard is draft, do nothing for now
99
108
  if (type === "dashboard" && dashboardStatus === "draft") {
@@ -159,12 +168,13 @@ export function GenAIChatDialogConnected({ backend, workspace, locale, canManage
159
168
  if (!isOpen || !chatDispatcher || !settings) {
160
169
  return;
161
170
  }
162
- const seedToken = askSeq ?? askedQuestion ?? JSON.stringify(userContext ?? {});
171
+ const seedToken = askSeq ?? conversationId ?? askedQuestion ?? JSON.stringify(userContext ?? {});
163
172
  if (lastSeedTokenRef.current === seedToken) {
164
173
  return;
165
174
  }
166
175
  lastSeedTokenRef.current = seedToken;
167
176
  buildSeedActions({
177
+ conversationId,
168
178
  agentId,
169
179
  effort,
170
180
  askedQuestion,
@@ -178,6 +188,7 @@ export function GenAIChatDialogConnected({ backend, workspace, locale, canManage
178
188
  effort,
179
189
  chatDispatcher,
180
190
  askedQuestion,
191
+ conversationId,
181
192
  askSeq,
182
193
  userContext,
183
194
  appendToChat,
@@ -1 +1 @@
1
- {"version":3,"file":"Messages.d.ts","sourceRoot":"","sources":["../../src/components/Messages.tsx"],"names":[],"mappings":"AA8BA,KAAK,sBAAsB,GAAG;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EAAE,YAAY,EAAE,EAAE,sBAAsB,2CA4ChE"}
1
+ {"version":3,"file":"Messages.d.ts","sourceRoot":"","sources":["../../src/components/Messages.tsx"],"names":[],"mappings":"AA+BA,KAAK,sBAAsB,GAAG;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EAAE,YAAY,EAAE,EAAE,sBAAsB,2CAiDhE"}
@@ -4,6 +4,7 @@ import { useMemo } from "react";
4
4
  import cx from "classnames";
5
5
  import { useIntl } from "react-intl";
6
6
  import { useSelector } from "react-redux";
7
+ import { GOODSTRAP_SCROLLED_EVENT } from "@gooddata/sdk-ui-kit";
7
8
  import { agentSwitchingActiveSelector, catalogItemsSelector, } from "../store/chatWindow/chatWindowSelectors.js";
8
9
  import { asyncProcessSelector, conversationMessagesSelector, conversationSelector, } from "../store/messages/messagesSelectors.js";
9
10
  import { ChatSkeleton } from "./ChatSkeleton.js";
@@ -33,7 +34,9 @@ export function Messages({ initializing }) {
33
34
  "gd-gen-ai-chat__messages--small-screen": isSmallScreen,
34
35
  "gd-gen-ai-chat__messages--empty": isEmpty,
35
36
  "gd-gen-ai-chat__messages--agent-switching": agentSwitchingActive,
36
- }), ref: scrollerRef, children: _jsxs("div", { className: "gd-gen-ai-chat__messages__scroll", role: "log", "aria-relevant": isEmpty || isLoading ? undefined : "additions", "aria-label": intl.formatMessage({ id: "gd.gen-ai.messages.label" }), children: [isEmpty ? _jsx(LandingScreenComponent, {}) : null, isLoading ? _jsx(ChatSkeleton, {}) : null, isLoading ? null : (_jsx(ConversationMessages, { catalogItems: catalogItems, conversation: conversation, messages: conversationMessages }))] }) }));
37
+ }), ref: scrollerRef, onScroll: (event) => {
38
+ event.currentTarget.dispatchEvent(new CustomEvent(GOODSTRAP_SCROLLED_EVENT, { bubbles: true }));
39
+ }, children: _jsxs("div", { className: "gd-gen-ai-chat__messages__scroll", role: "log", "aria-relevant": isEmpty || isLoading ? undefined : "additions", "aria-label": intl.formatMessage({ id: "gd.gen-ai.messages.label" }), children: [isEmpty ? _jsx(LandingScreenComponent, {}) : null, isLoading ? _jsx(ChatSkeleton, {}) : null, isLoading ? null : (_jsx(ConversationMessages, { catalogItems: catalogItems, conversation: conversation, messages: conversationMessages }))] }) }));
37
40
  }
38
41
  function ConversationMessages({ messages, catalogItems }) {
39
42
  const currentMessages = useMemo(() => {
@@ -1,3 +1,4 @@
1
+ import { type GenAIPublisherDocumentFormat } from "@gooddata/sdk-backend-spi";
1
2
  import { publisherDocumentSavedAction } from "../../store/messages/messagesSlice.js";
2
3
  /**
3
4
  * A document of the chat that an application saved. `seq` tells one save from the next, so saving the
@@ -9,6 +10,7 @@ export interface IPublisherDocumentSaved {
9
10
  itemId: string;
10
11
  documentRef?: string;
11
12
  savedDocumentId: string;
13
+ format?: GenAIPublisherDocumentFormat;
12
14
  }
13
15
  /**
14
16
  * Tells the chat store about a document an application saved, so the document in the chat reads as saved
@@ -1 +1 @@
1
- {"version":3,"file":"usePublisherDocumentSavedSync.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/usePublisherDocumentSavedSync.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAErF;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CACzC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,4BAA4B,CAAC,KAAK,IAAI,CAAC,GAAG,IAAI,EACpF,aAAa,EAAE,uBAAuB,GAAG,SAAS,QAYrD"}
1
+ {"version":3,"file":"usePublisherDocumentSavedSync.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/usePublisherDocumentSavedSync.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAE9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAErF;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,4BAA4B,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CACzC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,4BAA4B,CAAC,KAAK,IAAI,CAAC,GAAG,IAAI,EACpF,aAAa,EAAE,uBAAuB,GAAG,SAAS,QAYrD"}
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantItem.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantItem.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAQjE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAOnE,KAAK,kBAAkB,GAAG;IACtB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,OAAO,EAAE,0BAA0B,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,kBAAkB,kDA2FrF"}
1
+ {"version":3,"file":"AssistantItem.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantItem.tsx"],"names":[],"mappings":"AAUA,OAAO,EACH,KAAK,0BAA0B,EAGlC,MAAM,gBAAgB,CAAC;AASxB,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAQnE,KAAK,kBAAkB,GAAG;IACtB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,OAAO,EAAE,0BAA0B,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,kBAAkB,kDA4FrF"}
@@ -4,13 +4,16 @@ import { useState } from "react";
4
4
  import cx from "classnames";
5
5
  import { useIntl } from "react-intl";
6
6
  import { useSelector } from "react-redux";
7
+ import { insightTitle } from "@gooddata/sdk-model";
7
8
  import { interactionIntelligenceEnabledSelector } from "../../store/chatWindow/chatWindowSelectors.js";
8
9
  import { isClarificationQuestionsItem } from "../../utils.js";
10
+ import { replaceReferences } from "../completion/references.js";
9
11
  import { useToolsReferences } from "../completion/useToolsReferences.js";
10
12
  import { useCustomization } from "../CustomizationContext.js";
11
13
  import { useInteractionIntelligenceTotals } from "../intelligence/data/useInteractionIntelligenceTotals.js";
12
14
  import { GenAiInteractionIntelligence } from "../intelligence/GenAiInteractionIntelligence.js";
13
15
  import { InteractionIntelligenceTrigger } from "../intelligence/InteractionIntelligenceTrigger.js";
16
+ import { removeMarkdown } from "../utils/markdownUtils.js";
14
17
  import { AssistantItemSuggestions } from "./AssistantItemSuggestions.js";
15
18
  import { ReasoningIcon } from "./contents/ReasoningIcon.js";
16
19
  import { ConversationItemContents } from "./ConversationItemContents.js";
@@ -42,5 +45,27 @@ export function AssistantItemComponent({ message, groups, isLast }) {
42
45
  return (_jsxs("div", { className: classNames, "data-state": messageState, "data-testid": "gen-ai-conversation-assistant-message", children: [_jsx("span", { className: "gd-gen-ai-chat__visually__hidden", children: intl.formatMessage({ id: "gd.gen-ai.message.label.assistant" }) }), _jsx(ReasoningIcon, { content: message.content }), _jsx(ConversationItemContents, { role: "assistant", message: message, groups: groups, references: references, isLoading: messageState === "loading", isLast: isLast }), _jsx(AssistantItemSuggestions, { type: "followUp", message: message, showSuggestions: true, references: references }), _jsxs("div", { className: "gd-gen-ai-chat__conversation__item__actions", children: [group.type === "assistant" &&
43
46
  message.content.type !== "reasoning" &&
44
47
  message.content.type !== "skillsActivated" &&
45
- !isFilledClarificationQuestion ? (_jsx(FeedbackComponent, { group: group, message: message, isLast: Boolean(isLast), isComplete: Boolean(message.complete), isHidden: Boolean(hasInteractionIntelligenceTrigger && !isLast) })) : null, showInteractionIntelligence ? (_jsx(InteractionIntelligenceTrigger, { totals: interactionIntelligenceTotals, isOpen: isInteractionIntelligenceOpen, onToggle: () => setIsInteractionIntelligenceOpen((current) => !current) })) : null] }), showInteractionIntelligence && isInteractionIntelligenceOpen ? (_jsx(GenAiInteractionIntelligence, { responseId: message.responseId, onClose: () => setIsInteractionIntelligenceOpen(false) })) : null, _jsx(AssistantItemSuggestions, { type: "actions", message: message, showSuggestions: isLast })] }));
48
+ !isFilledClarificationQuestion ? (_jsx(FeedbackComponent, { group: group, message: message, isLast: Boolean(isLast), isComplete: Boolean(message.complete), isHidden: Boolean(hasInteractionIntelligenceTrigger && !isLast) })) : null, showInteractionIntelligence ? (_jsx(InteractionIntelligenceTrigger, { totals: interactionIntelligenceTotals, isOpen: isInteractionIntelligenceOpen, onToggle: () => setIsInteractionIntelligenceOpen((current) => !current) })) : null] }), showInteractionIntelligence && isInteractionIntelligenceOpen ? (_jsx(GenAiInteractionIntelligence, { responseId: message.responseId, onClose: () => setIsInteractionIntelligenceOpen(false) })) : null, _jsx(AssistantItemSuggestions, { type: "actions", message: message, showSuggestions: isLast }), _jsx(AssistantItemAnnouncement, { message: message, references: references, isLast: isLast })] }));
49
+ }
50
+ function AssistantItemAnnouncement({ message, references, isLast }) {
51
+ if (!isLast) {
52
+ return null;
53
+ }
54
+ const isStreamedAnswer = getItemState(message) === "complete" && message.streaming === false;
55
+ return (_jsx("span", { className: "gd-gen-ai-chat__visually__hidden", "aria-live": "polite", "aria-atomic": "true", children: isStreamedAnswer ? getAnswerText(message.content, references) : "" }));
56
+ }
57
+ function getAnswerText(content, references) {
58
+ const parts = content.type === "multipart" ? (content.parts ?? []) : [content];
59
+ return parts
60
+ .map((part) => {
61
+ if (part.type === "text") {
62
+ return removeMarkdown(replaceReferences(part.text, [...(part.objects ?? []), ...references]));
63
+ }
64
+ if (part.type === "visualization" && part.visualization) {
65
+ return insightTitle(part.visualization);
66
+ }
67
+ return undefined;
68
+ })
69
+ .filter(Boolean)
70
+ .join(" ");
46
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantItemFeedback.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantItemFeedback.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAKnE,MAAM,WAAW,2BAA2B;IACxC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,OAAO,EAAE,0BAA0B,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,wBAAgB,qBAAqB,CAAC,EAClC,OAAO,EACP,MAAM,EACN,QAAQ,EACR,UAAU,GACb,EAAE,2BAA2B,kDAgF7B"}
1
+ {"version":3,"file":"AssistantItemFeedback.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantItemFeedback.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAKnE,MAAM,WAAW,2BAA2B;IACxC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,OAAO,EAAE,0BAA0B,CAAC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,wBAAgB,qBAAqB,CAAC,EAClC,OAAO,EACP,MAAM,EACN,QAAQ,EACR,UAAU,GACb,EAAE,2BAA2B,kDAmF7B"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // (C) 2024-2026 GoodData Corporation
3
- import { useCallback } from "react";
3
+ import { useCallback, useRef } from "react";
4
4
  import cx from "classnames";
5
5
  import { useIntl } from "react-intl";
6
6
  import { useDispatch } from "react-redux";
@@ -11,6 +11,7 @@ import { useUserFeedback } from "./useUserFeedback.js";
11
11
  export function AssistantItemFeedback({ message, isLast, isHidden, isComplete, }) {
12
12
  const intl = useIntl();
13
13
  const dispatch = useDispatch();
14
+ const containerRef = useRef(null);
14
15
  const setUserFeedbackAction = useCallback((payload) => {
15
16
  dispatch(setUserFeedback(payload));
16
17
  }, [dispatch]);
@@ -25,14 +26,14 @@ export function AssistantItemFeedback({ message, isLast, isHidden, isComplete, }
25
26
  if (isHidden && !isAssigned) {
26
27
  return null;
27
28
  }
28
- return (_jsxs("div", { className: cx({
29
+ return (_jsxs("div", { ref: containerRef, className: cx({
29
30
  "gd-gen-ai-chat__conversation__item__feedback": true,
30
31
  "gd-gen-ai-chat__conversation__item__feedback--assigned": isAssigned,
31
32
  "gd-gen-ai-chat__conversation__item__feedback--last": isLast,
32
33
  }), children: [_jsx(UiTooltip, { triggerBy: ["focus", "hover"], arrowPlacement: "bottom", anchor: _jsx(UiIconButton, { icon: "thumbsUp", variant: "tertiary", size: "small", isActive: type === "POSITIVE", onClick: handlePositiveFeedbackClick, accessibilityConfig: {
33
34
  ariaLabel: thumbsUpLabel,
34
35
  ariaPressed: type === "POSITIVE" ? "true" : "false",
35
- } }), content: thumbsUpLabel }), _jsx(FeedbackPopup, { anchor: (opened) => {
36
+ } }), content: thumbsUpLabel }), _jsx(FeedbackPopup, { containerRef: containerRef, anchor: (opened) => {
36
37
  return (_jsx(UiTooltip, { triggerBy: ["focus", "hover"], arrowPlacement: "bottom", anchor: _jsx(UiIconButton, { icon: "thumbsDown", variant: "tertiary", size: "small", isActive: type === "NEGATIVE" || opened, onClick: handleNegativeFeedbackClick, accessibilityConfig: {
37
38
  ariaLabel: thumbsDownLabel,
38
39
  ariaPressed: type === "NEGATIVE" ? "true" : "false",
@@ -1,6 +1,7 @@
1
- import { type ReactElement } from "react";
1
+ import { type ReactElement, type RefObject } from "react";
2
2
  export interface IFeedbackPopupProps {
3
3
  anchor: (opened: boolean) => ReactElement<any>;
4
+ containerRef: RefObject<HTMLElement | null>;
4
5
  onSubmit?: (feedback: IFeedbackData) => void;
5
6
  }
6
7
  export interface IFeedbackData {
@@ -10,5 +11,5 @@ export interface IFeedbackData {
10
11
  /**
11
12
  * @internal
12
13
  */
13
- export declare function FeedbackPopup({ anchor, onSubmit }: IFeedbackPopupProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function FeedbackPopup({ anchor, containerRef, onSubmit }: IFeedbackPopupProps): import("react/jsx-runtime").JSX.Element;
14
15
  //# sourceMappingURL=FeedbackPopup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FeedbackPopup.d.ts","sourceRoot":"","sources":["../../../src/components/messages/FeedbackPopup.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAY,MAAM,OAAO,CAAC;AAMpD,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,YAAY,CAAC,GAAG,CAAC,CAAC;IAC/C,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;CAChD;AAED,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CA6ItE"}
1
+ {"version":3,"file":"FeedbackPopup.d.ts","sourceRoot":"","sources":["../../../src/components/messages/FeedbackPopup.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAkB,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAapF,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,YAAY,CAAC,GAAG,CAAC,CAAC;IAC/C,YAAY,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;CAChD;AAED,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CA6IpF"}
@@ -2,11 +2,11 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
2
2
  // (C) 2024-2026 GoodData Corporation
3
3
  import { useState } from "react";
4
4
  import { useIntl } from "react-intl";
5
- import { EditableLabel, UiButton, UiCheckbox, UiPopover, useIdPrefixed } from "@gooddata/sdk-ui-kit";
5
+ import { EditableLabel, UiButton, UiCheckbox, UiPopover, useCloseOnParentScroll, useIdPrefixed, } from "@gooddata/sdk-ui-kit";
6
6
  /**
7
7
  * @internal
8
8
  */
9
- export function FeedbackPopup({ anchor, onSubmit }) {
9
+ export function FeedbackPopup({ anchor, containerRef, onSubmit }) {
10
10
  const intl = useIntl();
11
11
  const [opened, setOpened] = useState(false);
12
12
  const [selectedReasons, setSelectedReasons] = useState([]);
@@ -64,7 +64,7 @@ export function FeedbackPopup({ anchor, onSubmit }) {
64
64
  handleCancel();
65
65
  }, onOpen: () => {
66
66
  setOpened(true);
67
- }, content: () => (_jsxs("div", { className: "gd-gen-ai-feedback-popup__body", children: [_jsx("div", { className: "gd-gen-ai-feedback-popup__section", children: _jsxs("fieldset", { children: [_jsx("legend", { className: "gd-label gd-gen-ai-feedback-popup__legend", children: intl.formatMessage({ id: "gd.gen-ai.feedback.popup.reasons-label" }) }), _jsx("div", { className: "gd-gen-ai-feedback-popup__checkboxes", children: feedbackReasons.map((reason) => (_jsx(UiCheckbox, { label: reason.label, checked: selectedReasons.includes(reason.id), onChange: (e) => handleReasonChange(reason.id, e.target.checked), accessibilityConfig: reason.id === "other"
67
+ }, content: ({ onClose }) => (_jsxs(FeedbackPopupBody, { containerRef: containerRef, onClose: () => handleCancel(onClose), children: [_jsx("div", { className: "gd-gen-ai-feedback-popup__section", children: _jsxs("fieldset", { children: [_jsx("legend", { className: "gd-label gd-gen-ai-feedback-popup__legend", children: intl.formatMessage({ id: "gd.gen-ai.feedback.popup.reasons-label" }) }), _jsx("div", { className: "gd-gen-ai-feedback-popup__checkboxes", children: feedbackReasons.map((reason) => (_jsx(UiCheckbox, { label: reason.label, checked: selectedReasons.includes(reason.id), onChange: (e) => handleReasonChange(reason.id, e.target.checked), accessibilityConfig: reason.id === "other"
68
68
  ? {
69
69
  ariaControls: textareaWrapperId,
70
70
  ariaExpanded: selectedReasons.includes("other")
@@ -75,3 +75,7 @@ export function FeedbackPopup({ anchor, onSubmit }) {
75
75
  id: "gd.gen-ai.feedback.popup.description-label",
76
76
  }) }), _jsx(EditableLabel, { autofocus: true, value: description, onChange: setDescription, onSubmit: setDescription, maxRows: 4, className: "gd-label gd-gen-ai-feedback-popup__textarea", id: textareaId })] }))] })), footer: ({ onClose }) => (_jsxs(_Fragment, { children: [_jsx(UiButton, { label: intl.formatMessage({ id: "gd.gen-ai.feedback.popup.cancel" }), variant: "secondary", onClick: () => handleCancel(onClose), size: "small" }), _jsx(UiButton, { label: intl.formatMessage({ id: "gd.gen-ai.feedback.popup.send" }), variant: "primary", isDisabled: false, onClick: () => handleSubmit(onClose), size: "small" })] })) }));
77
77
  }
78
+ function FeedbackPopupBody({ containerRef, onClose, children }) {
79
+ useCloseOnParentScroll(true, onClose, containerRef);
80
+ return _jsx("div", { className: "gd-gen-ai-feedback-popup__body", children: children });
81
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"ItemsGroup.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ItemsGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAG1D,OAAO,EAAE,KAAK,SAAS,EAA2B,MAAM,YAAY,CAAC;AAKrE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGnE,UAAU,gBAAgB;IACtB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,gBAAgB,2CAsB9E;AA6ID,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAqBlE"}
1
+ {"version":3,"file":"ItemsGroup.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ItemsGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAG1D,OAAO,EAAE,KAAK,SAAS,EAA2B,MAAM,YAAY,CAAC;AAKrE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGnE,UAAU,gBAAgB;IACtB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,gBAAgB,2CAsB9E;AAgJD,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAqBlE"}
@@ -29,7 +29,7 @@ function ReasoningItemsGroup({ classNames, group, previousGroup, children }) {
29
29
  "gd-gen-ai-chat__messages__conversation-group--expanded": isExpanded,
30
30
  }), children: [_jsxs("div", { className: cx("gd-gen-ai-chat__messages__conversation-group--header", {
31
31
  "gd-gen-ai-chat__messages__conversation-group--header--completed": isCompleted,
32
- }), children: [_jsx("span", { className: "gd-gen-ai-chat__visually__hidden", "aria-live": "polite", "aria-atomic": "true", children: headings[headings.length - 1] }), isCompleted ? (_jsx(UiButton, { label: intl.formatMessage({ id: "gd.gen-ai.routing.thinking-process" }), dataTestId: "reasoning", onClick: () => setIsExpanded(!isExpanded), accessibilityConfig: { ariaExpanded: isExpanded }, iconBefore: isExpanded ? "navigateDown" : "navigateRight", iconBeforeSize: 12, variant: "tertiary" })) : (_jsxs("div", { className: "gd-gen-ai-chat__messages__conversation-group--header--thinking", "data-testid": "reasoning", children: [_jsx(AIThinkingLoader, { size: 30 }), _jsx(AIThinkingSummary, { headings: headings })] })), isCompleted && duration ? (_jsx("div", { className: "gd-gen-ai-chat__messages__conversation-group--header--duration", children: duration })) : null] }), isExpanded ? (_jsx("div", { className: "gd-gen-ai-chat__messages__conversation-group--content", "data-testid": "gen-ai-reasoning-group-content", children: children })) : null] }));
32
+ }), children: [isCompleted ? null : (_jsx("span", { className: "gd-gen-ai-chat__visually__hidden", "aria-live": "polite", "aria-atomic": "true", children: headings[headings.length - 1] })), isCompleted ? (_jsx(UiButton, { label: intl.formatMessage({ id: "gd.gen-ai.routing.thinking-process" }), dataTestId: "reasoning", onClick: () => setIsExpanded(!isExpanded), accessibilityConfig: { ariaExpanded: isExpanded }, iconBefore: isExpanded ? "navigateDown" : "navigateRight", iconBeforeSize: 12, variant: "tertiary" })) : (_jsxs("div", { className: "gd-gen-ai-chat__messages__conversation-group--header--thinking", "data-testid": "reasoning", "aria-hidden": "true", children: [_jsx(AIThinkingLoader, { size: 30 }), _jsx(AIThinkingSummary, { headings: headings })] })), isCompleted && duration ? (_jsx("div", { className: "gd-gen-ai-chat__messages__conversation-group--header--duration", children: duration })) : null] }), isExpanded ? (_jsx("div", { className: "gd-gen-ai-chat__messages__conversation-group--content", "data-testid": "gen-ai-reasoning-group-content", children: children })) : null] }));
33
33
  }
34
34
  function useReasoningGroup(previousGroup, group) {
35
35
  const intl = useIntl();
@@ -96,7 +96,7 @@ const getItemUrl = (workspaceId, id, objectType, enableShellApplication_dashboar
96
96
  case "metric":
97
97
  return `/workspace/${workspaceId}/metrics/metric/${id}`;
98
98
  case "report":
99
- return getPublisherDocumentHref(workspaceId, id);
99
+ return getPublisherDocumentHref(workspaceId, id, "aac-v1");
100
100
  default:
101
101
  return null;
102
102
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationMultipartContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationMultipartContent.tsx"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EACxC,KAAK,iBAAiB,EACzB,MAAM,mBAAmB,CAAC;AAW3B,MAAM,MAAM,iCAAiC,GAAG;IAC5C,OAAO,EAAE,0BAA0B,CAAC;IACpC,KAAK,EAAE,mCAAmC,EAAE,CAAC;IAC7C,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,EACzC,OAAO,EACP,KAAK,EACL,UAAU,EACV,MAAM,GACT,EAAE,iCAAiC,2CA6GnC"}
1
+ {"version":3,"file":"ConversationMultipartContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationMultipartContent.tsx"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EACxC,KAAK,iBAAiB,EACzB,MAAM,mBAAmB,CAAC;AAY3B,MAAM,MAAM,iCAAiC,GAAG;IAC5C,OAAO,EAAE,0BAA0B,CAAC;IACpC,KAAK,EAAE,mCAAmC,EAAE,CAAC;IAC7C,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,EACzC,OAAO,EACP,KAAK,EACL,UAAU,EACV,MAAM,GACT,EAAE,iCAAiC,2CAqGnC"}
@@ -1,6 +1,7 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  // (C) 2024-2026 GoodData Corporation
3
3
  import { useIntl } from "react-intl";
4
+ import { isPublisherDocumentPart } from "../../../publisherDocumentPart.js";
4
5
  import { loadWhatIfScenarios } from "../../../whatIf/whatIfMapping.js";
5
6
  import { useCustomization } from "../../CustomizationContext.js";
6
7
  import { ConversationAlertProposalContent } from "./ConversationAlertProposalContent.js";
@@ -38,8 +39,8 @@ export function ConversationMultipartContent({ message, parts, references, isLas
38
39
  if (part.type === "dashboard") {
39
40
  return (_jsx(ConversationDashboardContent, { message: message, part: part, dashboard: part.dashboard, insights: part.insights, saved: part.saved }, index));
40
41
  }
41
- if (part.type === "publisherDocument") {
42
- return (_jsx(ConversationPublisherDocumentContent, { message: message, publisherDocument: part.publisherDocument, saved: part.saved, baseDocumentId: part.baseDocumentId }, index));
42
+ if (isPublisherDocumentPart(part)) {
43
+ return _jsx(ConversationPublisherDocumentContent, { message: message, part: part }, index);
43
44
  }
44
45
  // Add more multipart types if needed
45
46
  return null;
@@ -1,11 +1,9 @@
1
- import { type IPublisherDocumentDefinition } from "@gooddata/sdk-model";
2
1
  import type { IChatConversationLocalItem } from "../../../model.js";
2
+ import { type PublisherDocumentPart } from "../../../publisherDocumentPart.js";
3
3
  export type ConversationPublisherDocumentContentProps = {
4
4
  message: IChatConversationLocalItem;
5
- publisherDocument: IPublisherDocumentDefinition | null;
6
- saved?: string | null;
7
- baseDocumentId?: string | null;
5
+ part: PublisherDocumentPart;
8
6
  className?: string;
9
7
  };
10
- export declare function ConversationPublisherDocumentContent({ message, publisherDocument, saved, baseDocumentId, className, }: ConversationPublisherDocumentContentProps): import("react/jsx-runtime").JSX.Element | null;
8
+ export declare function ConversationPublisherDocumentContent({ message, part, className, }: ConversationPublisherDocumentContentProps): import("react/jsx-runtime").JSX.Element | null;
11
9
  //# sourceMappingURL=ConversationPublisherDocumentContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationPublisherDocumentContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationPublisherDocumentContent.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAIxE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAMpE,MAAM,MAAM,yCAAyC,GAAG;IACpD,OAAO,EAAE,0BAA0B,CAAC;IACpC,iBAAiB,EAAE,4BAA4B,GAAG,IAAI,CAAC;IACvD,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,oCAAoC,CAAC,EACjD,OAAO,EACP,iBAAiB,EACjB,KAAK,EACL,cAAc,EACd,SAAS,GACZ,EAAE,yCAAyC,kDAmG3C"}
1
+ {"version":3,"file":"ConversationPublisherDocumentContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationPublisherDocumentContent.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EACH,KAAK,qBAAqB,EAI7B,MAAM,mCAAmC,CAAC;AAM3C,MAAM,MAAM,yCAAyC,GAAG;IACpD,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,oCAAoC,CAAC,EACjD,OAAO,EACP,IAAI,EACJ,SAAS,GACZ,EAAE,yCAAyC,kDA+G3C"}
@@ -4,23 +4,33 @@ import { useIntl } from "react-intl";
4
4
  import { useSelector } from "react-redux";
5
5
  import { useWorkspaceStrict } from "@gooddata/sdk-ui";
6
6
  import { UiButton, UiIcon } from "@gooddata/sdk-ui-kit";
7
+ import { publisherDocumentFormatOf, publisherDocumentPartFormat, summarizePublisherDocument, } from "../../../publisherDocumentPart.js";
7
8
  import { isPreviewSelector, settingsSelector } from "../../../store/chatWindow/chatWindowSelectors.js";
8
9
  import { conversationSelector } from "../../../store/messages/messagesSelectors.js";
9
10
  import { formatPublisherDocumentPeriod, getPublisherDocumentItemUrl } from "../../../utils.js";
10
11
  import { useConfig } from "../../ConfigContext.js";
11
- export function ConversationPublisherDocumentContent({ message, publisherDocument, saved, baseDocumentId, className, }) {
12
+ export function ConversationPublisherDocumentContent({ message, part, className, }) {
12
13
  const intl = useIntl();
13
14
  const config = useConfig();
14
15
  const workspaceId = useWorkspaceStrict();
15
16
  const conversationId = useSelector(conversationSelector)?.id;
16
- const isPublisherAppEnabled = Boolean(useSelector(settingsSelector)?.enableBusinessBriefingReportsApp);
17
+ const settings = useSelector(settingsSelector);
17
18
  const isPreview = useSelector(isPreviewSelector);
18
- if (!isPublisherAppEnabled || isPreview) {
19
+ if (!settings?.enableBusinessBriefingReportsApp || isPreview) {
19
20
  return null;
20
21
  }
21
- if (!publisherDocument) {
22
+ // gen-ai answers a draft that no longer resolves with an empty report part, whatever its version.
23
+ const summary = summarizePublisherDocument(part);
24
+ if (!summary) {
22
25
  return (_jsx("div", { className: "gd-gen-ai-chat__conversation__item__content--error", children: intl.formatMessage({ id: "gd.gen-ai.publisherDocument.unavailable" }) }));
23
26
  }
27
+ const format = publisherDocumentPartFormat(part);
28
+ if (format !== publisherDocumentFormatOf(settings)) {
29
+ return (_jsx("div", { className: "gd-gen-ai-chat__conversation__item__content--error", children: format === "aac-v1"
30
+ ? intl.formatMessage({ id: "gd.gen-ai.publisherDocument.previousVersion" })
31
+ : intl.formatMessage({ id: "gd.gen-ai.publisherDocument.newerVersion" }) }));
32
+ }
33
+ const { saved, baseDocumentId } = part;
24
34
  // The Publisher app needs workspace manage; a user who has lost it gets a disabled Open button.
25
35
  const itemUrl = config.canManage
26
36
  ? getPublisherDocumentItemUrl({
@@ -29,6 +39,7 @@ export function ConversationPublisherDocumentContent({ message, publisherDocumen
29
39
  baseDocumentId,
30
40
  conversationId,
31
41
  itemId: message.id,
42
+ format,
32
43
  })
33
44
  : undefined;
34
45
  // The card only opens the version: a change to the document in the editor is applied there by the editor.
@@ -51,10 +62,10 @@ export function ConversationPublisherDocumentContent({ message, publisherDocumen
51
62
  });
52
63
  }
53
64
  : undefined;
54
- const period = formatPublisherDocumentPeriod(publisherDocument.periodStart, publisherDocument.periodEnd, intl);
55
- const count = publisherDocument.content.pages.length;
65
+ const period = summary.period && formatPublisherDocumentPeriod(summary.period.from, summary.period.to, intl);
66
+ const count = summary.pageCount;
56
67
  const details = period
57
68
  ? intl.formatMessage({ id: "gd.gen-ai.publisherDocument.details" }, { period, count })
58
69
  : intl.formatMessage({ id: "gd.gen-ai.publisherDocument.page-count" }, { count });
59
- return (_jsx("div", { className: cx("gd-gen-ai-chat__conversation__item__content", "gd-gen-ai-chat__conversation__item__content--publisherDocument", className), children: _jsxs("div", { className: "gd-gen-ai-chat__conversation__item__content-publisherDocument-frame", children: [_jsx("div", { className: "gd-gen-ai-chat__conversation__item__content-publisherDocument-icon", children: _jsx(UiIcon, { type: "file", size: 14, color: "complementary-6", backgroundSize: 26, backgroundColor: "complementary-2" }) }), _jsxs("div", { className: "gd-gen-ai-chat__conversation__item__content-publisherDocument-content", children: [_jsx("div", { className: "gd-gen-ai-chat__conversation__item__content-publisherDocument-content-title", children: publisherDocument.title }), _jsx("div", { className: "gd-gen-ai-chat__conversation__item__content-publisherDocument-content-details", children: details })] }), _jsx("div", { className: "gd-gen-ai-chat__conversation__item__content-publisherDocument-item-buttons", children: _jsx(UiButton, { label: buttonLabel, variant: "secondary", isDisabled: !handleOpen, onClick: handleOpen }) })] }) }));
70
+ return (_jsx("div", { className: cx("gd-gen-ai-chat__conversation__item__content", "gd-gen-ai-chat__conversation__item__content--publisherDocument", className), children: _jsxs("div", { className: "gd-gen-ai-chat__conversation__item__content-publisherDocument-frame", children: [_jsx("div", { className: "gd-gen-ai-chat__conversation__item__content-publisherDocument-icon", children: _jsx(UiIcon, { type: "file", size: 14, color: "complementary-6", backgroundSize: 26, backgroundColor: "complementary-2" }) }), _jsxs("div", { className: "gd-gen-ai-chat__conversation__item__content-publisherDocument-content", children: [_jsx("div", { className: "gd-gen-ai-chat__conversation__item__content-publisherDocument-content-title", children: summary.title }), _jsx("div", { className: "gd-gen-ai-chat__conversation__item__content-publisherDocument-content-details", children: details })] }), _jsx("div", { className: "gd-gen-ai-chat__conversation__item__content-publisherDocument-item-buttons", children: _jsx(UiButton, { label: buttonLabel, variant: "secondary", isDisabled: !handleOpen, onClick: handleOpen }) })] }) }));
60
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"addContextReference.d.ts","sourceRoot":"","sources":["../../src/context/addContextReference.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAG1E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,YAAY,CA8ExG"}
1
+ {"version":3,"file":"addContextReference.d.ts","sourceRoot":"","sources":["../../src/context/addContextReference.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAK1E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,YAAY,CA8ExG"}
@@ -1,6 +1,7 @@
1
1
  // (C) 2026 GoodData Corporation
2
2
  import { areObjRefsEqual } from "@gooddata/sdk-model";
3
3
  import { convertGenAiTypeToReferenceType } from "../utils.js";
4
+ import { publisherDocumentViews } from "./viewedPublisherDocument.js";
4
5
  export function addContextReference(context, reference) {
5
6
  const { active } = context;
6
7
  if (!reference) {
@@ -25,7 +26,7 @@ export function addContextReference(context, reference) {
25
26
  ...active,
26
27
  view: {
27
28
  ...active?.view,
28
- publisherDocument: context.ambient?.view?.publisherDocument,
29
+ ...publisherDocumentViews(context.ambient?.view),
29
30
  },
30
31
  },
31
32
  };
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/context/build.ts"],"names":[],"mappings":"AAEA,OAAO,EAIH,KAAK,iBAAiB,EAEzB,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAIjF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAE1E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,QAAQ,EAAE,CAAC,iBAAiB,GAAG,SAAS,CAAC,EAAE,GAAG,iBAAiB,GAAG,SAAS,CA2B3G"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/context/build.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,iBAAiB,EAGzB,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAIjF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAE1E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,QAAQ,EAAE,CAAC,iBAAiB,GAAG,SAAS,CAAC,EAAE,GAAG,iBAAiB,GAAG,SAAS,CAgC3G"}
@@ -21,9 +21,11 @@ export function mergeContexts(...contexts) {
21
21
  }
22
22
  const dashboard = mergeDashboard(context.view?.dashboard, acc.view?.dashboard);
23
23
  const publisherDocument = mergePublisherDocument(context.view?.publisherDocument, acc.view?.publisherDocument);
24
+ const publisherDocumentV2 = mergePublisherDocument(context.view?.publisherDocumentV2, acc.view?.publisherDocumentV2);
24
25
  const view = {
25
26
  ...(dashboard ? { dashboard } : {}),
26
27
  ...(publisherDocument ? { publisherDocument } : {}),
28
+ ...(publisherDocumentV2 ? { publisherDocumentV2 } : {}),
27
29
  };
28
30
  const activeObject = mergeActiveObject(context.activeObject, acc.activeObject);
29
31
  const referencedObjects = [...(acc?.referencedObjects ?? []), ...(context?.referencedObjects ?? [])];
@@ -1 +1 @@
1
- {"version":3,"file":"collectContextReferences.d.ts","sourceRoot":"","sources":["../../src/context/collectContextReferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,EAIzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAK7E,wBAAgB,wBAAwB,CACpC,WAAW,EAAE,iBAAiB,GAAG,SAAS,EAC1C,eAAe,EAAE,eAAe,GAAG,SAAS,EAC5C,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,CA6DvB;AAED,wBAAgB,0BAA0B,CACtC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,CAuFvB"}
1
+ {"version":3,"file":"collectContextReferences.d.ts","sourceRoot":"","sources":["../../src/context/collectContextReferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,EAIzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAS7E,wBAAgB,wBAAwB,CACpC,WAAW,EAAE,iBAAiB,GAAG,SAAS,EAC1C,eAAe,EAAE,eAAe,GAAG,SAAS,EAC5C,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,CA6DvB;AAED,wBAAgB,0BAA0B,CACtC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,CAuFvB"}
@@ -1,7 +1,7 @@
1
1
  // (C) 2026 GoodData Corporation
2
2
  import { areObjRefsEqual, isIdentifierRef, serializeObjRef, } from "@gooddata/sdk-model";
3
3
  import { convertReferenceTypeToGenAiType } from "../utils.js";
4
- import { isSameViewedPublisherDocument, viewObjectId } from "./viewedPublisherDocument.js";
4
+ import { isSameViewedPublisherDocument, viewObjectId, viewedPublisherDocument, } from "./viewedPublisherDocument.js";
5
5
  export function collectContextReferences(userContext, selectedContext, placeholderTitle) {
6
6
  const userReferences = [];
7
7
  // dashboard
@@ -21,7 +21,7 @@ export function collectContextReferences(userContext, selectedContext, placehold
21
21
  }
22
22
  }
23
23
  // document
24
- const userDocument = userContext?.view?.publisherDocument;
24
+ const userDocument = viewedPublisherDocument(userContext?.view);
25
25
  if (userDocument) {
26
26
  const ref = userDocument.ref;
27
27
  const id = viewObjectId(ref);
@@ -1 +1 @@
1
- {"version":3,"file":"removeContextReference.d.ts","sourceRoot":"","sources":["../../src/context/removeContextReference.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAK1E,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,YAAY,CAiD3G"}
1
+ {"version":3,"file":"removeContextReference.d.ts","sourceRoot":"","sources":["../../src/context/removeContextReference.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAK1E,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,YAAY,CAkD3G"}