@box/box-ai-content-answers 0.148.8 → 0.148.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/lib/box-ai-content-answers.js +28 -26
- package/dist/esm/lib/components/answer/answer-content.js +33 -23
- package/dist/esm/lib/components/answer/answer.js +53 -51
- package/dist/esm/lib/components/api-wrapper/content-answers-component.js +65 -63
- package/dist/esm/lib/components/chat/chat.js +50 -48
- package/dist/esm/lib/components/common/markdown-react.js +99 -0
- package/dist/esm/lib/components/common/markdown.js +337 -339
- package/dist/types/lib/box-ai-content-answers.d.ts +2 -0
- package/dist/types/lib/components/answer/answer-content.d.ts +3 -1
- package/dist/types/lib/components/answer/answer.d.ts +2 -0
- package/dist/types/lib/components/api-wrapper/types.d.ts +2 -0
- package/dist/types/lib/components/chat/chat.d.ts +1 -1
- package/dist/types/lib/components/common/markdown-react.d.ts +26 -0
- package/dist/types/lib/types.d.ts +2 -0
- package/package.json +8 -4
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import p from "clsx";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import { C as
|
|
4
|
-
import { jsx as u, jsxs as
|
|
5
|
-
import { Content as
|
|
6
|
-
import { Footer as
|
|
7
|
-
import '../../styles/box-ai-content-answers.css';const
|
|
8
|
-
container:
|
|
9
|
-
contentAnswers:
|
|
10
|
-
sidebar:
|
|
11
|
-
},
|
|
3
|
+
import { C as K } from "../../chunks/types.js";
|
|
4
|
+
import { jsx as u, jsxs as V } from "react/jsx-runtime";
|
|
5
|
+
import { Content as W } from "./components/content/content.js";
|
|
6
|
+
import { Footer as X } from "./components/footer/footer.js";
|
|
7
|
+
import '../../styles/box-ai-content-answers.css';const Y = "_container_1p5tb_1", Z = "_contentAnswers_1p5tb_8", $ = "_sidebar_1p5tb_19", a = {
|
|
8
|
+
container: Y,
|
|
9
|
+
contentAnswers: Z,
|
|
10
|
+
sidebar: $
|
|
11
|
+
}, ee = ({
|
|
12
12
|
className: _,
|
|
13
13
|
contentType: h,
|
|
14
14
|
contentName: Q,
|
|
@@ -27,33 +27,34 @@ import '../../styles/box-ai-content-answers.css';const X = "_container_1p5tb_1",
|
|
|
27
27
|
submitQuestion: C,
|
|
28
28
|
suggestedQuestions: F,
|
|
29
29
|
useAnimation: D,
|
|
30
|
-
onAgentEditorToggle:
|
|
30
|
+
onAgentEditorToggle: v,
|
|
31
31
|
onUserIntentToUseAI: e,
|
|
32
32
|
promptButtonClickHandler: N,
|
|
33
33
|
variant: o = "modal",
|
|
34
34
|
hostAppName: k,
|
|
35
|
-
|
|
35
|
+
isReactMarkdownEnabled: j,
|
|
36
|
+
...y
|
|
36
37
|
}) => {
|
|
37
|
-
const [f, m] = s.useState(null), [S,
|
|
38
|
+
const [f, m] = s.useState(null), [S, O] = s.useState(t != null), [c, z] = s.useState(!1), B = t === K.LARGE_FILE, G = (!S || B) && !g, b = (r) => {
|
|
38
39
|
l && l({
|
|
39
40
|
...r,
|
|
40
41
|
component: o
|
|
41
42
|
});
|
|
42
|
-
},
|
|
43
|
+
}, L = () => {
|
|
43
44
|
e && e(!1);
|
|
44
|
-
},
|
|
45
|
+
}, H = (r) => {
|
|
45
46
|
m(r), e && e(!0);
|
|
46
|
-
},
|
|
47
|
+
}, J = () => {
|
|
47
48
|
e && e(!0);
|
|
48
49
|
};
|
|
49
50
|
return s.useEffect(() => {
|
|
50
|
-
|
|
51
|
+
O(t != null);
|
|
51
52
|
}, [t]), /* @__PURE__ */ u("div", {
|
|
52
53
|
className: p(_, a.container),
|
|
53
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ V("div", {
|
|
54
55
|
className: p(a.contentAnswers, o === "sidebar" && a.sidebar),
|
|
55
|
-
children: [!c && /* @__PURE__ */ u(
|
|
56
|
-
...
|
|
56
|
+
children: [!c && /* @__PURE__ */ u(W, {
|
|
57
|
+
...y,
|
|
57
58
|
askSuggestedQuestion: f,
|
|
58
59
|
contentName: Q,
|
|
59
60
|
contentType: h,
|
|
@@ -62,16 +63,17 @@ import '../../styles/box-ai-content-answers.css';const X = "_container_1p5tb_1",
|
|
|
62
63
|
hasRequestInProgress: d,
|
|
63
64
|
hostAppName: k,
|
|
64
65
|
isErrorMessageShown: S,
|
|
66
|
+
isReactMarkdownEnabled: j,
|
|
65
67
|
isStreamingEnabled: n,
|
|
66
|
-
onSuggestedQuestionInteraction:
|
|
68
|
+
onSuggestedQuestionInteraction: L,
|
|
67
69
|
questions: i,
|
|
68
70
|
recordAction: b,
|
|
69
|
-
setAskSuggestedQuestion:
|
|
71
|
+
setAskSuggestedQuestion: H,
|
|
70
72
|
showLoadingIndicator: g,
|
|
71
73
|
suggestedQuestions: F,
|
|
72
74
|
useAnimation: n && D,
|
|
73
75
|
variant: o
|
|
74
|
-
}),
|
|
76
|
+
}), G && /* @__PURE__ */ u(X, {
|
|
75
77
|
askSuggestedQuestion: f,
|
|
76
78
|
enableDebugMode: E,
|
|
77
79
|
hasRequestInProgress: d,
|
|
@@ -82,13 +84,13 @@ import '../../styles/box-ai-content-answers.css';const X = "_container_1p5tb_1",
|
|
|
82
84
|
lastQuestion: i[i.length - 1],
|
|
83
85
|
onRetryQuestion: R,
|
|
84
86
|
onStopQuestion: x,
|
|
85
|
-
onUserInteraction:
|
|
87
|
+
onUserInteraction: J,
|
|
86
88
|
promptButtonClickHandler: N,
|
|
87
89
|
recordAction: b,
|
|
88
90
|
sendQuestion: C,
|
|
89
91
|
setAskSuggestedQuestion: m,
|
|
90
92
|
toggleDebugMode: () => {
|
|
91
|
-
|
|
93
|
+
z(!c);
|
|
92
94
|
},
|
|
93
95
|
variant: o
|
|
94
96
|
})]
|
|
@@ -96,6 +98,6 @@ import '../../styles/box-ai-content-answers.css';const X = "_container_1p5tb_1",
|
|
|
96
98
|
});
|
|
97
99
|
};
|
|
98
100
|
export {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
ee as BoxAiContentAnswers,
|
|
102
|
+
ee as default
|
|
101
103
|
};
|
|
@@ -1,33 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import i from "clsx";
|
|
2
|
+
import _ from "../common/markdown-react.js";
|
|
3
|
+
import f from "../common/markdown.js";
|
|
4
|
+
import { jsxs as h, Fragment as u, jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import '../../../../styles/answer-content.css';const C = "_answerContent_uoab3_1", x = "_answerMarkdown_uoab3_16", n = {
|
|
6
|
+
answerContent: C,
|
|
7
|
+
answerMarkdown: x
|
|
8
|
+
}, v = ({
|
|
8
9
|
answer: e,
|
|
9
10
|
isMarkdownEnabled: t,
|
|
10
|
-
|
|
11
|
+
isReactMarkdownEnabled: w = !1,
|
|
12
|
+
className: o,
|
|
11
13
|
variant: m = "modal",
|
|
12
|
-
...
|
|
14
|
+
...s
|
|
13
15
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}), t && /* @__PURE__ */ i("div", {
|
|
22
|
-
className: d(n.answerContent, n.answerMarkdown, s && n.sidebar, "Answer-text", r),
|
|
16
|
+
const a = m === "sidebar", c = (d) => {
|
|
17
|
+
if (w)
|
|
18
|
+
return /* @__PURE__ */ r(_, {
|
|
19
|
+
children: d
|
|
20
|
+
});
|
|
21
|
+
const l = f.render(d);
|
|
22
|
+
return /* @__PURE__ */ r("div", {
|
|
23
23
|
dangerouslySetInnerHTML: {
|
|
24
|
-
__html:
|
|
25
|
-
}
|
|
26
|
-
|
|
24
|
+
__html: l
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ h(u, {
|
|
29
|
+
children: [!t && /* @__PURE__ */ r("div", {
|
|
30
|
+
className: i(n.answerContent, a && n.sidebar, "Answer-text", o),
|
|
31
|
+
...s,
|
|
32
|
+
children: e
|
|
33
|
+
}), t && e && /* @__PURE__ */ r("div", {
|
|
34
|
+
className: i(n.answerContent, n.answerMarkdown, a && n.sidebar, "Answer-text", o),
|
|
35
|
+
...s,
|
|
36
|
+
children: c(e)
|
|
27
37
|
})]
|
|
28
38
|
});
|
|
29
39
|
};
|
|
30
40
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
41
|
+
v as AnswerContent,
|
|
42
|
+
v as default
|
|
33
43
|
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { Text as
|
|
2
|
-
import { AlertTriangle as
|
|
3
|
-
import { Gray65 as
|
|
1
|
+
import { Text as J } from "@box/blueprint-web";
|
|
2
|
+
import { AlertTriangle as K } from "@box/blueprint-web-assets/icons/Line";
|
|
3
|
+
import { Gray65 as Q, Size4 as g } from "@box/blueprint-web-assets/tokens/tokens";
|
|
4
4
|
import S from "clsx";
|
|
5
5
|
import * as f from "react";
|
|
6
|
-
import { useIntl as
|
|
6
|
+
import { useIntl as X } from "react-intl";
|
|
7
7
|
import { A as e } from "../../../../chunks/types.js";
|
|
8
|
-
import { extractBoxLinks as
|
|
8
|
+
import { extractBoxLinks as Y, extractFileNames as Z } from "../../utils/getBoxLinks.js";
|
|
9
9
|
import { MediaContainer as R } from "../common/media-container.js";
|
|
10
|
-
import { AnswerContent as
|
|
11
|
-
import { CopyButton as
|
|
12
|
-
import { InlineError as
|
|
13
|
-
import { LoadingIndicator as
|
|
10
|
+
import { AnswerContent as tt } from "./answer-content.js";
|
|
11
|
+
import { CopyButton as ot } from "./copy-button.js";
|
|
12
|
+
import { InlineError as nt } from "./inline-error.js";
|
|
13
|
+
import { LoadingIndicator as et } from "./loading-indicator.js";
|
|
14
14
|
import h from "./messages.js";
|
|
15
|
-
import { References as
|
|
16
|
-
import { ThumbButtons as
|
|
15
|
+
import { References as rt } from "./references.js";
|
|
16
|
+
import { ThumbButtons as st } from "./thumb-buttons.js";
|
|
17
17
|
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
18
|
-
import '../../../../styles/answer.css';const
|
|
19
|
-
answer:
|
|
20
|
-
alertIcon:
|
|
21
|
-
error:
|
|
22
|
-
footer:
|
|
23
|
-
copyButtonContainer:
|
|
24
|
-
feedbackButtonsContainer:
|
|
25
|
-
shouldHaveMarginTop:
|
|
26
|
-
shouldUseAnimation:
|
|
27
|
-
shouldAnimateHeight:
|
|
28
|
-
footerButtons:
|
|
29
|
-
iconAvatar:
|
|
30
|
-
buttonsVisible:
|
|
31
|
-
},
|
|
18
|
+
import '../../../../styles/answer.css';const at = "_answer_140hd_1", it = "_alertIcon_140hd_5", lt = "_error_140hd_8", ct = "_footer_140hd_12", dt = "_copyButtonContainer_140hd_18", ft = "_feedbackButtonsContainer_140hd_19", ut = "_shouldHaveMarginTop_140hd_23", mt = "_shouldUseAnimation_140hd_26", _t = "_shouldAnimateHeight_140hd_30", ht = "_footerButtons_140hd_34", Et = "_iconAvatar_140hd_40", pt = "_buttonsVisible_140hd_56", t = {
|
|
19
|
+
answer: at,
|
|
20
|
+
alertIcon: it,
|
|
21
|
+
error: lt,
|
|
22
|
+
footer: ct,
|
|
23
|
+
copyButtonContainer: dt,
|
|
24
|
+
feedbackButtonsContainer: ft,
|
|
25
|
+
shouldHaveMarginTop: ut,
|
|
26
|
+
shouldUseAnimation: mt,
|
|
27
|
+
shouldAnimateHeight: _t,
|
|
28
|
+
footerButtons: ht,
|
|
29
|
+
iconAvatar: Et,
|
|
30
|
+
buttonsVisible: pt
|
|
31
|
+
}, Nt = /* @__PURE__ */ new Set([e.RATE_LIMITING, e.NO_CONTENT, e.PRECONDITION_FAILED, e.GENERAL, e.AGENT_NOT_FOUND]), Dt = /* @__PURE__ */ f.memo(({
|
|
32
32
|
answer: r,
|
|
33
33
|
citations: T,
|
|
34
34
|
error: o,
|
|
@@ -53,15 +53,16 @@ import '../../../../styles/answer.css';const st = "_answer_140hd_1", at = "_aler
|
|
|
53
53
|
shouldFeedbackFormIncludeFeedbackText: H,
|
|
54
54
|
useAnimation: U = !0,
|
|
55
55
|
variant: i = "modal",
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
isReactMarkdownEnabled: k,
|
|
57
|
+
setAnswerFeedback: x,
|
|
58
|
+
questionId: G
|
|
58
59
|
}) => {
|
|
59
|
-
const p =
|
|
60
|
+
const p = Nt.has(o), N = C && !r && !o, [V, $] = f.useState(a), {
|
|
60
61
|
formatMessage: _
|
|
61
|
-
} =
|
|
62
|
+
} = X();
|
|
62
63
|
f.useEffect(() => {
|
|
63
64
|
if (r && c && a) {
|
|
64
|
-
const s =
|
|
65
|
+
const s = Y(r), l = Z(r);
|
|
65
66
|
(s.length > 0 || l.length > 0) && c({
|
|
66
67
|
action: "programmatic",
|
|
67
68
|
component: i,
|
|
@@ -75,29 +76,29 @@ import '../../../../styles/answer.css';const st = "_answer_140hd_1", at = "_aler
|
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
78
|
}, [r, i, u, a]), f.useEffect(() => {
|
|
78
|
-
setTimeout(() =>
|
|
79
|
+
setTimeout(() => $(a), 0);
|
|
79
80
|
}, [a]);
|
|
80
|
-
const I = () => /* @__PURE__ */ n(
|
|
81
|
+
const I = () => /* @__PURE__ */ n(K, {
|
|
81
82
|
className: t.alertIcon,
|
|
82
|
-
color:
|
|
83
|
+
color: Q,
|
|
83
84
|
"data-testid": "content-answers-error-alert-icon",
|
|
84
85
|
height: g,
|
|
85
86
|
role: "presentation",
|
|
86
87
|
width: g
|
|
87
|
-
}),
|
|
88
|
+
}), j = () => /* @__PURE__ */ d(J, {
|
|
88
89
|
as: "p",
|
|
89
90
|
className: t.error,
|
|
90
91
|
color: "textOnLightSecondary",
|
|
91
92
|
"data-testid": "content-answers-error",
|
|
92
93
|
variant: "caption",
|
|
93
94
|
children: [o === e.RESPONSE_INTERRUPTED && _(h.responseInterruptedError), o === e.RESPONSE_FAILED && _(h.responseFailedError), o === e.RESPONSE_STOPPED && _(h.responseStoppedError), o !== e.RESPONSE_STOPPED && I()]
|
|
94
|
-
}),
|
|
95
|
+
}), z = () => o !== e.RESPONSE_STOPPED ? /* @__PURE__ */ d("div", {
|
|
95
96
|
className: S(t.footerButtons, "footer-buttons-container", {
|
|
96
97
|
[t.buttonsVisible]: E
|
|
97
98
|
}),
|
|
98
99
|
children: [B ? /* @__PURE__ */ n("div", {
|
|
99
100
|
className: t.feedbackButtonsContainer,
|
|
100
|
-
children: /* @__PURE__ */ n(
|
|
101
|
+
children: /* @__PURE__ */ n(st, {
|
|
101
102
|
feedbackValue: b,
|
|
102
103
|
hostAppName: u,
|
|
103
104
|
isFeedbackFormEnabled: w,
|
|
@@ -106,55 +107,56 @@ import '../../../../styles/answer.css';const st = "_answer_140hd_1", at = "_aler
|
|
|
106
107
|
onFeedbackFormSubmit: y,
|
|
107
108
|
onFeedbackTooltipOpenChange: D,
|
|
108
109
|
promptType: F,
|
|
109
|
-
questionId:
|
|
110
|
+
questionId: G,
|
|
110
111
|
recordAction: c,
|
|
111
|
-
setAnswerFeedback:
|
|
112
|
+
setAnswerFeedback: x,
|
|
112
113
|
shouldFeedbackFormIncludeFeedbackText: H,
|
|
113
114
|
variant: i
|
|
114
115
|
})
|
|
115
116
|
}) : null, /* @__PURE__ */ n("div", {
|
|
116
117
|
className: t.copyButtonContainer,
|
|
117
|
-
children: /* @__PURE__ */ n(
|
|
118
|
+
children: /* @__PURE__ */ n(ot, {
|
|
118
119
|
answer: r,
|
|
119
120
|
onAnswerCopy: v,
|
|
120
121
|
recordAction: c
|
|
121
122
|
})
|
|
122
123
|
})]
|
|
123
|
-
}) : r ? null : I(),
|
|
124
|
+
}) : r ? null : I(), W = (s) => (!m || !a || !P || m.forEach((l) => {
|
|
124
125
|
if (s.includes(l.name)) {
|
|
125
|
-
const
|
|
126
|
-
s = s.replaceAll(l.name, `[${l.name}](${
|
|
126
|
+
const q = `${window.location.origin}/file/${l.id}`;
|
|
127
|
+
s = s.replaceAll(l.name, `[${l.name}](${q})`);
|
|
127
128
|
}
|
|
128
129
|
}), s);
|
|
129
130
|
return /* @__PURE__ */ d("div", {
|
|
130
131
|
"aria-live": "polite",
|
|
131
132
|
className: t.answer,
|
|
132
133
|
"data-testid": "content-answers-answer",
|
|
133
|
-
children: [N && /* @__PURE__ */ n(
|
|
134
|
+
children: [N && /* @__PURE__ */ n(et, {}), !p && !N && /* @__PURE__ */ n(R, {
|
|
134
135
|
className: "answer",
|
|
135
136
|
variant: i,
|
|
136
137
|
children: /* @__PURE__ */ d(R.Content, {
|
|
137
138
|
isUsedInsideSidebar: i === "sidebar",
|
|
138
139
|
variant: "answer",
|
|
139
|
-
children: [/* @__PURE__ */ n(
|
|
140
|
-
answer:
|
|
140
|
+
children: [/* @__PURE__ */ n(tt, {
|
|
141
|
+
answer: W(r),
|
|
141
142
|
isMarkdownEnabled: L,
|
|
143
|
+
isReactMarkdownEnabled: k,
|
|
142
144
|
variant: i
|
|
143
145
|
}), a && /* @__PURE__ */ d("div", {
|
|
144
146
|
className: S(t.footer, {
|
|
145
147
|
[t.shouldHaveMarginTop]: r,
|
|
146
|
-
[t.shouldAnimateHeight]:
|
|
148
|
+
[t.shouldAnimateHeight]: V,
|
|
147
149
|
[t.shouldUseAnimation]: U
|
|
148
150
|
}),
|
|
149
151
|
"data-testid": "content-answers-answer-footer",
|
|
150
|
-
children: [o &&
|
|
152
|
+
children: [o && j(), O && !o && /* @__PURE__ */ n(rt, {
|
|
151
153
|
citations: T,
|
|
152
154
|
onCitationClick: M,
|
|
153
155
|
recordAction: c
|
|
154
|
-
}),
|
|
156
|
+
}), z()]
|
|
155
157
|
})]
|
|
156
158
|
})
|
|
157
|
-
}), p && /* @__PURE__ */ n(
|
|
159
|
+
}), p && /* @__PURE__ */ n(nt, {
|
|
158
160
|
contentType: A,
|
|
159
161
|
error: o,
|
|
160
162
|
recordAction: c,
|
|
@@ -163,6 +165,6 @@ import '../../../../styles/answer.css';const st = "_answer_140hd_1", at = "_aler
|
|
|
163
165
|
});
|
|
164
166
|
});
|
|
165
167
|
export {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
+
Dt as Answer,
|
|
169
|
+
Dt as default
|
|
168
170
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useReducer as
|
|
1
|
+
import { useReducer as re, useEffect as de } from "react";
|
|
2
2
|
import { R as m } from "../../../../chunks/types.js";
|
|
3
|
-
import { useContentAnswers as
|
|
4
|
-
import { ContentAnswersRecord as
|
|
5
|
-
import
|
|
6
|
-
import { jsx as
|
|
7
|
-
const
|
|
3
|
+
import { useContentAnswers as ae } from "./hooks/useContentAnswers.js";
|
|
4
|
+
import { ContentAnswersRecord as ue, ContentAnswersItemRecord as ge } from "./records.js";
|
|
5
|
+
import ce from "./reducer.js";
|
|
6
|
+
import { jsx as Se } from "react/jsx-runtime";
|
|
7
|
+
const Qe = (t) => {
|
|
8
8
|
const {
|
|
9
9
|
WrappedComponent: f,
|
|
10
10
|
cachedSuggestedQuestions: r = [],
|
|
@@ -22,45 +22,46 @@ const we = (t) => {
|
|
|
22
22
|
isCitationsEnabled: d,
|
|
23
23
|
isDebugModeEnabled: q,
|
|
24
24
|
isMarkdownEnabled: T,
|
|
25
|
+
isReactMarkdownEnabled: L,
|
|
25
26
|
isOpen: n,
|
|
26
|
-
isStopResponseEnabled:
|
|
27
|
+
isStopResponseEnabled: k,
|
|
27
28
|
isStreamingEnabled: a,
|
|
28
29
|
itemID: o,
|
|
29
30
|
items: u,
|
|
30
31
|
onCitationClick: P,
|
|
31
|
-
onCloseModal:
|
|
32
|
-
onItemClick:
|
|
32
|
+
onCloseModal: D,
|
|
33
|
+
onItemClick: M,
|
|
33
34
|
onSuggestedQuestionsFetched: N,
|
|
34
35
|
parentItem: O,
|
|
35
36
|
restoredQuestions: j = [],
|
|
36
37
|
restoredSession: v = null,
|
|
37
|
-
restoredShouldShowLandingPage:
|
|
38
|
-
sendErrorLog:
|
|
39
|
-
shouldRenderProviders:
|
|
40
|
-
suggestedQuestions:
|
|
41
|
-
userId:
|
|
42
|
-
warningNotice:
|
|
43
|
-
warningNoticeAriaLabel:
|
|
44
|
-
} = t, [g,
|
|
45
|
-
item: new
|
|
38
|
+
restoredShouldShowLandingPage: U = !0,
|
|
39
|
+
sendErrorLog: _,
|
|
40
|
+
shouldRenderProviders: x = !0,
|
|
41
|
+
suggestedQuestions: F,
|
|
42
|
+
userId: y,
|
|
43
|
+
warningNotice: W,
|
|
44
|
+
warningNoticeAriaLabel: z
|
|
45
|
+
} = t, [g, B] = re(ce, new ue({
|
|
46
|
+
item: new ge({
|
|
46
47
|
id: o
|
|
47
48
|
}),
|
|
48
49
|
questions: j,
|
|
49
50
|
encodedSession: v,
|
|
50
|
-
shouldShowLandingPage:
|
|
51
|
+
shouldShowLandingPage: U
|
|
51
52
|
})), {
|
|
52
|
-
clearConversation:
|
|
53
|
-
createSession:
|
|
53
|
+
clearConversation: G,
|
|
54
|
+
createSession: H,
|
|
54
55
|
fetchAgentConfig: c,
|
|
55
56
|
fetchSuggestedQuestions: S,
|
|
56
|
-
retryQuestion:
|
|
57
|
-
sendQuestion:
|
|
58
|
-
setAnswerFeedback:
|
|
59
|
-
stopQuestion:
|
|
60
|
-
} =
|
|
57
|
+
retryQuestion: J,
|
|
58
|
+
sendQuestion: K,
|
|
59
|
+
setAnswerFeedback: V,
|
|
60
|
+
stopQuestion: X
|
|
61
|
+
} = ae({
|
|
61
62
|
contentAnswers: g,
|
|
62
63
|
createSessionRequest: A,
|
|
63
|
-
dispatchStateUpdate:
|
|
64
|
+
dispatchStateUpdate: B,
|
|
64
65
|
enterpriseId: h,
|
|
65
66
|
fetchTimeout: C,
|
|
66
67
|
formatCitations: p,
|
|
@@ -69,71 +70,72 @@ const we = (t) => {
|
|
|
69
70
|
getAnswer: E,
|
|
70
71
|
getSuggestedQuestions: s,
|
|
71
72
|
isCitationsEnabled: d,
|
|
72
|
-
isStopResponseEnabled:
|
|
73
|
+
isStopResponseEnabled: k,
|
|
73
74
|
isStreamingEnabled: a,
|
|
74
75
|
itemID: o,
|
|
75
76
|
items: u,
|
|
76
77
|
onSuggestedQuestionsFetched: N,
|
|
77
|
-
sendErrorLog:
|
|
78
|
-
userId:
|
|
78
|
+
sendErrorLog: _,
|
|
79
|
+
userId: y,
|
|
79
80
|
...t
|
|
80
81
|
}), {
|
|
81
|
-
encodedSession:
|
|
82
|
-
error:
|
|
83
|
-
isLoading:
|
|
84
|
-
hasRequestInProgress:
|
|
85
|
-
questions:
|
|
86
|
-
shouldShowLandingPage:
|
|
82
|
+
encodedSession: Y,
|
|
83
|
+
error: Z,
|
|
84
|
+
isLoading: $,
|
|
85
|
+
hasRequestInProgress: ee = !1,
|
|
86
|
+
questions: te,
|
|
87
|
+
shouldShowLandingPage: se,
|
|
87
88
|
suggestedQuestions: e
|
|
88
89
|
} = g;
|
|
89
|
-
|
|
90
|
+
de(() => {
|
|
90
91
|
n && e.requestState === m.NOT_STARTED && S();
|
|
91
92
|
}, [n, S, e.requestState]);
|
|
92
|
-
const
|
|
93
|
-
let i =
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
createSession:
|
|
97
|
-
encodedSession:
|
|
98
|
-
error:
|
|
93
|
+
const ne = r.length > 0;
|
|
94
|
+
let i = F, l = m.SUCCESS;
|
|
95
|
+
ne ? i = r : s && (i = e.suggestions, l = e.requestState);
|
|
96
|
+
const oe = Object.fromEntries(Object.entries({
|
|
97
|
+
createSession: H,
|
|
98
|
+
encodedSession: Y,
|
|
99
|
+
error: Z,
|
|
99
100
|
getAIStudioAgents: w,
|
|
100
101
|
hostAppName: b,
|
|
101
102
|
hasCustomSuggestedQuestions: !!s,
|
|
102
|
-
hasRequestInProgress:
|
|
103
|
+
hasRequestInProgress: ee,
|
|
103
104
|
isAIStudioAgentSelectorEnabled: I,
|
|
104
105
|
isCitationsEnabled: d,
|
|
105
106
|
isDebugModeEnabled: q,
|
|
106
107
|
isMarkdownEnabled: T,
|
|
107
|
-
|
|
108
|
+
isReactMarkdownEnabled: L,
|
|
109
|
+
isLoading: $,
|
|
108
110
|
isOpen: n,
|
|
109
111
|
isStreamingEnabled: a,
|
|
110
112
|
itemID: o,
|
|
111
113
|
items: u,
|
|
112
|
-
onClearAction:
|
|
113
|
-
onCloseModal:
|
|
114
|
+
onClearAction: G,
|
|
115
|
+
onCloseModal: D,
|
|
114
116
|
onCitationClick: P,
|
|
115
|
-
onItemClick:
|
|
117
|
+
onItemClick: M,
|
|
116
118
|
onSelectAgent: c,
|
|
117
119
|
onAgentEditorToggle: c,
|
|
118
120
|
parentItem: O,
|
|
119
|
-
questions:
|
|
120
|
-
retryQuestion:
|
|
121
|
-
sendQuestion:
|
|
122
|
-
setAnswerFeedback:
|
|
123
|
-
shouldRenderProviders:
|
|
124
|
-
shouldShowLandingPage:
|
|
125
|
-
stopQuestion:
|
|
121
|
+
questions: te,
|
|
122
|
+
retryQuestion: J,
|
|
123
|
+
sendQuestion: K,
|
|
124
|
+
setAnswerFeedback: V,
|
|
125
|
+
shouldRenderProviders: x,
|
|
126
|
+
shouldShowLandingPage: se,
|
|
127
|
+
stopQuestion: X,
|
|
126
128
|
suggestedQuestionsRequestState: l,
|
|
127
129
|
suggestedQuestions: i,
|
|
128
|
-
warningNotice:
|
|
129
|
-
warningNoticeAriaLabel:
|
|
130
|
-
}).filter(([
|
|
131
|
-
return /* @__PURE__ */
|
|
130
|
+
warningNotice: W,
|
|
131
|
+
warningNoticeAriaLabel: z
|
|
132
|
+
}).filter(([me, ie]) => ie !== void 0));
|
|
133
|
+
return /* @__PURE__ */ Se(f, {
|
|
132
134
|
...t,
|
|
133
|
-
...
|
|
135
|
+
...oe
|
|
134
136
|
});
|
|
135
137
|
};
|
|
136
138
|
export {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
+
Qe as ContentAnswersComponent,
|
|
140
|
+
Qe as default
|
|
139
141
|
};
|