@box/box-ai-content-answers 0.89.2 → 0.89.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.
- package/esm/lib/components/answer/answer.js +212 -208
- package/esm/lib/components/chat/chat.js +71 -68
- package/package.json +2 -2
- package/styles/answer.css +1 -1
|
@@ -2,11 +2,11 @@ import { c as k } from "../../../../chunks/markdown.js";
|
|
|
2
2
|
import { useBreakpoint as it, Breakpoint as vt, Text as st } from "@box/blueprint-web";
|
|
3
3
|
import { AlertTriangle as ct } from "@box/blueprint-web-assets/icons/Line";
|
|
4
4
|
import { BoxAiLogo as ut } from "@box/blueprint-web-assets/icons/Logo";
|
|
5
|
-
import { Size5 as lt, Size6 as ft, Gray65 as
|
|
6
|
-
import
|
|
5
|
+
import { Size5 as lt, Size6 as ft, Gray65 as dt, Size4 as xr } from "@box/blueprint-web-assets/tokens/tokens";
|
|
6
|
+
import pt from "clsx";
|
|
7
7
|
import * as Q from "react";
|
|
8
|
-
import { useIntl as
|
|
9
|
-
import { A as
|
|
8
|
+
import { useIntl as $t } from "react-intl";
|
|
9
|
+
import { A as d } from "../../../../chunks/types.js";
|
|
10
10
|
import { MediaContainer as rr } from "../common/media-container.js";
|
|
11
11
|
import { AnswerContent as yt } from "./answer-content.js";
|
|
12
12
|
import { CopyButton as ht } from "./copy-button.js";
|
|
@@ -14,13 +14,13 @@ import { InlineError as St } from "./inline-error.js";
|
|
|
14
14
|
import { ThumbButtons as mt } from "./thumb-buttons.js";
|
|
15
15
|
import er from "./messages.js";
|
|
16
16
|
import { References as gt } from "./references.js";
|
|
17
|
-
import { jsxs as
|
|
18
|
-
import '../../../../styles/answer.css';var
|
|
17
|
+
import { jsxs as _, jsx as u } from "react/jsx-runtime";
|
|
18
|
+
import '../../../../styles/answer.css';var C = function(r) {
|
|
19
19
|
return r && r.Math === Math && r;
|
|
20
|
-
},
|
|
20
|
+
}, p = (
|
|
21
21
|
// eslint-disable-next-line es/no-global-this -- safe
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
C(typeof globalThis == "object" && globalThis) || C(typeof window == "object" && window) || // eslint-disable-next-line no-restricted-globals -- safe
|
|
23
|
+
C(typeof self == "object" && self) || C(typeof k == "object" && k) || C(typeof k == "object" && k) || // eslint-disable-next-line no-new-func -- fallback
|
|
24
24
|
/* @__PURE__ */ function() {
|
|
25
25
|
return this;
|
|
26
26
|
}() || Function("return this")()
|
|
@@ -34,11 +34,11 @@ import '../../../../styles/answer.css';var M = function(r) {
|
|
|
34
34
|
return Object.defineProperty({}, 1, { get: function() {
|
|
35
35
|
return 7;
|
|
36
36
|
} })[1] !== 7;
|
|
37
|
-
}), Ot = S,
|
|
37
|
+
}), Ot = S, $e = !Ot(function() {
|
|
38
38
|
var r = (function() {
|
|
39
39
|
}).bind();
|
|
40
40
|
return typeof r != "function" || r.hasOwnProperty("prototype");
|
|
41
|
-
}), It =
|
|
41
|
+
}), It = $e, z = Function.prototype.call, N = It ? z.bind(z) : function() {
|
|
42
42
|
return z.apply(z, arguments);
|
|
43
43
|
}, ye = {}, he = {}.propertyIsEnumerable, Se = Object.getOwnPropertyDescriptor, Et = Se && !he.call({ 1: 2 }, 1);
|
|
44
44
|
ye.f = Et ? function(e) {
|
|
@@ -52,44 +52,44 @@ var me = function(r, e) {
|
|
|
52
52
|
writable: !(r & 4),
|
|
53
53
|
value: e
|
|
54
54
|
};
|
|
55
|
-
}, ge =
|
|
55
|
+
}, ge = $e, be = Function.prototype, Sr = be.call, wt = ge && be.bind.bind(Sr, Sr), s = ge ? wt : function(r) {
|
|
56
56
|
return function() {
|
|
57
57
|
return Sr.apply(r, arguments);
|
|
58
58
|
};
|
|
59
|
-
}, Oe = s, Pt = Oe({}.toString), Tt = Oe("".slice),
|
|
59
|
+
}, Oe = s, Pt = Oe({}.toString), Tt = Oe("".slice), _t = function(r) {
|
|
60
60
|
return Tt(Pt(r), 8, -1);
|
|
61
|
-
},
|
|
61
|
+
}, Rt = s, jt = S, Nt = _t, tr = Object, Dt = Rt("".split), Ct = jt(function() {
|
|
62
62
|
return !tr("z").propertyIsEnumerable(0);
|
|
63
63
|
}) ? function(r) {
|
|
64
64
|
return Nt(r) === "String" ? Dt(r, "") : tr(r);
|
|
65
65
|
} : tr, Ie = function(r) {
|
|
66
66
|
return r == null;
|
|
67
|
-
},
|
|
68
|
-
if (
|
|
67
|
+
}, Mt = Ie, At = TypeError, Ee = function(r) {
|
|
68
|
+
if (Mt(r)) throw new At("Can't call method on " + r);
|
|
69
69
|
return r;
|
|
70
|
-
}, Ft =
|
|
71
|
-
return Ft(
|
|
70
|
+
}, Ft = Ct, Bt = Ee, wr = function(r) {
|
|
71
|
+
return Ft(Bt(r));
|
|
72
72
|
}, ar = typeof document == "object" && document.all, $ = typeof ar > "u" && ar !== void 0 ? function(r) {
|
|
73
73
|
return typeof r == "function" || r === ar;
|
|
74
74
|
} : function(r) {
|
|
75
75
|
return typeof r == "function";
|
|
76
|
-
},
|
|
77
|
-
return typeof r == "object" ? r !== null :
|
|
78
|
-
}, nr =
|
|
76
|
+
}, Lt = $, A = function(r) {
|
|
77
|
+
return typeof r == "object" ? r !== null : Lt(r);
|
|
78
|
+
}, nr = p, xt = $, kt = function(r) {
|
|
79
79
|
return xt(r) ? r : void 0;
|
|
80
80
|
}, Pr = function(r, e) {
|
|
81
81
|
return arguments.length < 2 ? kt(nr[r]) : nr[r] && nr[r][e];
|
|
82
|
-
}, zt = s, Ut = zt({}.isPrototypeOf),
|
|
83
|
-
|
|
84
|
-
!
|
|
85
|
-
var
|
|
82
|
+
}, zt = s, Ut = zt({}.isPrototypeOf), qt = typeof navigator < "u" && String(navigator.userAgent) || "", we = p, or = qt, kr = we.process, zr = we.Deno, Ur = kr && kr.versions || zr && zr.version, qr = Ur && Ur.v8, c, V;
|
|
83
|
+
qr && (c = qr.split("."), V = c[0] > 0 && c[0] < 4 ? 1 : +(c[0] + c[1]));
|
|
84
|
+
!V && or && (c = or.match(/Edge\/(\d+)/), (!c || c[1] >= 74) && (c = or.match(/Chrome\/(\d+)/), c && (V = +c[1])));
|
|
85
|
+
var Gt = V, Gr = Gt, Kt = S, Ht = p, Vt = Ht.String, Pe = !!Object.getOwnPropertySymbols && !Kt(function() {
|
|
86
86
|
var r = Symbol("symbol detection");
|
|
87
|
-
return !
|
|
88
|
-
!Symbol.sham &&
|
|
89
|
-
}),
|
|
87
|
+
return !Vt(r) || !(Object(r) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
88
|
+
!Symbol.sham && Gr && Gr < 41;
|
|
89
|
+
}), Wt = Pe, Te = Wt && !Symbol.sham && typeof Symbol.iterator == "symbol", Yt = Pr, Xt = $, Zt = Ut, Jt = Te, Qt = Object, _e = Jt ? function(r) {
|
|
90
90
|
return typeof r == "symbol";
|
|
91
91
|
} : function(r) {
|
|
92
|
-
var e =
|
|
92
|
+
var e = Yt("Symbol");
|
|
93
93
|
return Xt(e) && Zt(e.prototype, Qt(r));
|
|
94
94
|
}, ra = String, ea = function(r) {
|
|
95
95
|
try {
|
|
@@ -100,64 +100,64 @@ var Kt = W, Kr = Kt, Ht = S, Vt = f, Wt = Vt.String, Pe = !!Object.getOwnPropert
|
|
|
100
100
|
}, ta = $, aa = ea, na = TypeError, Tr = function(r) {
|
|
101
101
|
if (ta(r)) return r;
|
|
102
102
|
throw new na(aa(r) + " is not a function");
|
|
103
|
-
}, oa = Tr, ia = Ie,
|
|
103
|
+
}, oa = Tr, ia = Ie, Re = function(r, e) {
|
|
104
104
|
var t = r[e];
|
|
105
105
|
return ia(t) ? void 0 : oa(t);
|
|
106
106
|
}, ir = N, vr = $, sr = A, va = TypeError, sa = function(r, e) {
|
|
107
107
|
var t, a;
|
|
108
108
|
if (e === "string" && vr(t = r.toString) && !sr(a = ir(t, r)) || vr(t = r.valueOf) && !sr(a = ir(t, r)) || e !== "string" && vr(t = r.toString) && !sr(a = ir(t, r))) return a;
|
|
109
109
|
throw new va("Can't convert object to primitive value");
|
|
110
|
-
},
|
|
110
|
+
}, je = { exports: {} }, Kr = p, ca = Object.defineProperty, _r = function(r, e) {
|
|
111
111
|
try {
|
|
112
|
-
ca(
|
|
112
|
+
ca(Kr, r, { value: e, configurable: !0, writable: !0 });
|
|
113
113
|
} catch {
|
|
114
|
-
|
|
114
|
+
Kr[r] = e;
|
|
115
115
|
}
|
|
116
116
|
return e;
|
|
117
|
-
}, ua =
|
|
118
|
-
(
|
|
117
|
+
}, ua = p, la = _r, Hr = "__core-js_shared__", Vr = je.exports = ua[Hr] || la(Hr, {});
|
|
118
|
+
(Vr.versions || (Vr.versions = [])).push({
|
|
119
119
|
version: "3.36.1",
|
|
120
120
|
mode: "global",
|
|
121
121
|
copyright: "© 2014-2024 Denis Pushkarev (zloirock.ru)",
|
|
122
122
|
license: "https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE",
|
|
123
123
|
source: "https://github.com/zloirock/core-js"
|
|
124
124
|
});
|
|
125
|
-
var
|
|
126
|
-
return
|
|
127
|
-
}, fa = Ee,
|
|
128
|
-
return
|
|
129
|
-
},
|
|
125
|
+
var Rr = je.exports, Wr = Rr, Ne = function(r, e) {
|
|
126
|
+
return Wr[r] || (Wr[r] = e || {});
|
|
127
|
+
}, fa = Ee, da = Object, pa = function(r) {
|
|
128
|
+
return da(fa(r));
|
|
129
|
+
}, $a = s, ya = pa, ha = $a({}.hasOwnProperty), O = Object.hasOwn || function(e, t) {
|
|
130
130
|
return ha(ya(e), t);
|
|
131
131
|
}, Sa = s, ma = 0, ga = Math.random(), ba = Sa(1 .toString), De = function(r) {
|
|
132
132
|
return "Symbol(" + (r === void 0 ? "" : r) + ")_" + ba(++ma + ga, 36);
|
|
133
|
-
}, Oa =
|
|
134
|
-
return
|
|
135
|
-
},
|
|
133
|
+
}, Oa = p, Ia = Ne, Yr = O, Ea = De, wa = Pe, Pa = Te, j = Oa.Symbol, cr = Ia("wks"), Ta = Pa ? j.for || j : j && j.withoutSetter || Ea, _a = function(r) {
|
|
134
|
+
return Yr(cr, r) || (cr[r] = wa && Yr(j, r) ? j[r] : Ta("Symbol." + r)), cr[r];
|
|
135
|
+
}, Ra = N, Xr = A, Zr = _e, ja = Re, Na = sa, Da = _a, Ca = TypeError, Ma = Da("toPrimitive"), Aa = function(r, e) {
|
|
136
136
|
if (!Xr(r) || Zr(r)) return r;
|
|
137
|
-
var t =
|
|
137
|
+
var t = ja(r, Ma), a;
|
|
138
138
|
if (t) {
|
|
139
|
-
if (e === void 0 && (e = "default"), a =
|
|
140
|
-
throw new
|
|
139
|
+
if (e === void 0 && (e = "default"), a = Ra(t, r, e), !Xr(a) || Zr(a)) return a;
|
|
140
|
+
throw new Ca("Can't convert object to primitive value");
|
|
141
141
|
}
|
|
142
142
|
return e === void 0 && (e = "number"), Na(r, e);
|
|
143
|
-
}, Fa = Aa,
|
|
143
|
+
}, Fa = Aa, Ba = _e, Ce = function(r) {
|
|
144
144
|
var e = Fa(r, "string");
|
|
145
|
-
return
|
|
146
|
-
},
|
|
145
|
+
return Ba(e) ? e : e + "";
|
|
146
|
+
}, La = p, Jr = A, mr = La.document, xa = Jr(mr) && Jr(mr.createElement), ka = function(r) {
|
|
147
147
|
return xa ? mr.createElement(r) : {};
|
|
148
|
-
}, za = b, Ua = S,
|
|
149
|
-
return Object.defineProperty(
|
|
148
|
+
}, za = b, Ua = S, qa = ka, Me = !za && !Ua(function() {
|
|
149
|
+
return Object.defineProperty(qa("div"), "a", {
|
|
150
150
|
get: function() {
|
|
151
151
|
return 7;
|
|
152
152
|
}
|
|
153
153
|
}).a !== 7;
|
|
154
|
-
}),
|
|
155
|
-
Er.f =
|
|
156
|
-
if (e =
|
|
154
|
+
}), Ga = b, Ka = N, Ha = ye, Va = me, Wa = wr, Ya = Ce, Xa = O, Za = Me, Qr = Object.getOwnPropertyDescriptor;
|
|
155
|
+
Er.f = Ga ? Qr : function(e, t) {
|
|
156
|
+
if (e = Wa(e), t = Ya(t), Za) try {
|
|
157
157
|
return Qr(e, t);
|
|
158
158
|
} catch {
|
|
159
159
|
}
|
|
160
|
-
if (Xa(e, t)) return
|
|
160
|
+
if (Xa(e, t)) return Va(!Ka(Ha.f, e, t), e[t]);
|
|
161
161
|
};
|
|
162
162
|
var X = {}, Ja = b, Qa = S, rn = Ja && Qa(function() {
|
|
163
163
|
return Object.defineProperty(function() {
|
|
@@ -168,11 +168,11 @@ var X = {}, Ja = b, Qa = S, rn = Ja && Qa(function() {
|
|
|
168
168
|
}), en = A, tn = String, an = TypeError, Z = function(r) {
|
|
169
169
|
if (en(r)) return r;
|
|
170
170
|
throw new an(tn(r) + " is not an object");
|
|
171
|
-
}, nn = b, on =
|
|
171
|
+
}, nn = b, on = Me, vn = rn, U = Z, re = Ce, sn = TypeError, ur = Object.defineProperty, cn = Object.getOwnPropertyDescriptor, lr = "enumerable", fr = "configurable", dr = "writable";
|
|
172
172
|
X.f = nn ? vn ? function(e, t, a) {
|
|
173
|
-
if (U(e), t = re(t), U(a), typeof e == "function" && t === "prototype" && "value" in a &&
|
|
173
|
+
if (U(e), t = re(t), U(a), typeof e == "function" && t === "prototype" && "value" in a && dr in a && !a[dr]) {
|
|
174
174
|
var n = cn(e, t);
|
|
175
|
-
n && n[
|
|
175
|
+
n && n[dr] && (e[t] = a.value, a = {
|
|
176
176
|
configurable: fr in a ? a[fr] : n[fr],
|
|
177
177
|
enumerable: lr in a ? a[lr] : n[lr],
|
|
178
178
|
writable: !1
|
|
@@ -191,70 +191,70 @@ var un = b, ln = X, fn = me, Ae = un ? function(r, e, t) {
|
|
|
191
191
|
return ln.f(r, e, fn(1, t));
|
|
192
192
|
} : function(r, e, t) {
|
|
193
193
|
return r[e] = t, r;
|
|
194
|
-
}, Fe = { exports: {} }, gr = b,
|
|
195
|
-
}).name === "something", yn =
|
|
196
|
-
EXISTS:
|
|
197
|
-
PROPER:
|
|
194
|
+
}, Fe = { exports: {} }, gr = b, dn = O, Be = Function.prototype, pn = gr && Object.getOwnPropertyDescriptor, jr = dn(Be, "name"), $n = jr && (function() {
|
|
195
|
+
}).name === "something", yn = jr && (!gr || gr && pn(Be, "name").configurable), hn = {
|
|
196
|
+
EXISTS: jr,
|
|
197
|
+
PROPER: $n,
|
|
198
198
|
CONFIGURABLE: yn
|
|
199
|
-
}, Sn = s, mn = $, br =
|
|
199
|
+
}, Sn = s, mn = $, br = Rr, gn = Sn(Function.toString);
|
|
200
200
|
mn(br.inspectSource) || (br.inspectSource = function(r) {
|
|
201
201
|
return gn(r);
|
|
202
202
|
});
|
|
203
|
-
var bn = br.inspectSource, On =
|
|
203
|
+
var bn = br.inspectSource, On = p, In = $, ee = On.WeakMap, En = In(ee) && /native code/.test(String(ee)), wn = Ne, Pn = De, te = wn("keys"), Tn = function(r) {
|
|
204
204
|
return te[r] || (te[r] = Pn(r));
|
|
205
|
-
},
|
|
206
|
-
return
|
|
205
|
+
}, Le = {}, _n = En, xe = p, Rn = A, jn = Ae, pr = O, $r = Rr, Nn = Tn, Dn = Le, ae = "Object already initialized", Or = xe.TypeError, Cn = xe.WeakMap, W, M, Y, Mn = function(r) {
|
|
206
|
+
return Y(r) ? M(r) : W(r, {});
|
|
207
207
|
}, An = function(r) {
|
|
208
208
|
return function(e) {
|
|
209
209
|
var t;
|
|
210
|
-
if (!
|
|
210
|
+
if (!Rn(e) || (t = M(e)).type !== r)
|
|
211
211
|
throw new Or("Incompatible receiver, " + r + " required");
|
|
212
212
|
return t;
|
|
213
213
|
};
|
|
214
214
|
};
|
|
215
|
-
if (
|
|
216
|
-
var
|
|
217
|
-
|
|
218
|
-
if (
|
|
219
|
-
return e.facade = r,
|
|
220
|
-
},
|
|
221
|
-
return
|
|
222
|
-
},
|
|
223
|
-
return
|
|
215
|
+
if (_n || $r.state) {
|
|
216
|
+
var l = $r.state || ($r.state = new Cn());
|
|
217
|
+
l.get = l.get, l.has = l.has, l.set = l.set, W = function(r, e) {
|
|
218
|
+
if (l.has(r)) throw new Or(ae);
|
|
219
|
+
return e.facade = r, l.set(r, e), e;
|
|
220
|
+
}, M = function(r) {
|
|
221
|
+
return l.get(r) || {};
|
|
222
|
+
}, Y = function(r) {
|
|
223
|
+
return l.has(r);
|
|
224
224
|
};
|
|
225
225
|
} else {
|
|
226
|
-
var
|
|
227
|
-
Dn[
|
|
228
|
-
if (
|
|
229
|
-
return e.facade = r,
|
|
230
|
-
},
|
|
231
|
-
return
|
|
232
|
-
},
|
|
233
|
-
return
|
|
226
|
+
var R = Nn("state");
|
|
227
|
+
Dn[R] = !0, W = function(r, e) {
|
|
228
|
+
if (pr(r, R)) throw new Or(ae);
|
|
229
|
+
return e.facade = r, jn(r, R, e), e;
|
|
230
|
+
}, M = function(r) {
|
|
231
|
+
return pr(r, R) ? r[R] : {};
|
|
232
|
+
}, Y = function(r) {
|
|
233
|
+
return pr(r, R);
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
236
|
var Fn = {
|
|
237
|
-
set:
|
|
238
|
-
get:
|
|
239
|
-
has:
|
|
240
|
-
enforce:
|
|
237
|
+
set: W,
|
|
238
|
+
get: M,
|
|
239
|
+
has: Y,
|
|
240
|
+
enforce: Mn,
|
|
241
241
|
getterFor: An
|
|
242
|
-
}, Nr = s,
|
|
243
|
-
return
|
|
242
|
+
}, Nr = s, Bn = S, Ln = $, q = O, Ir = b, xn = hn.CONFIGURABLE, kn = bn, ke = Fn, zn = ke.enforce, Un = ke.get, ne = String, H = Object.defineProperty, qn = Nr("".slice), Gn = Nr("".replace), Kn = Nr([].join), Hn = Ir && !Bn(function() {
|
|
243
|
+
return H(function() {
|
|
244
244
|
}, "length", { value: 8 }).length !== 8;
|
|
245
|
-
}),
|
|
246
|
-
|
|
245
|
+
}), Vn = String(String).split("String"), Wn = Fe.exports = function(r, e, t) {
|
|
246
|
+
qn(ne(e), 0, 7) === "Symbol(" && (e = "[" + Gn(ne(e), /^Symbol\(([^)]*)\).*$/, "$1") + "]"), t && t.getter && (e = "get " + e), t && t.setter && (e = "set " + e), (!q(r, "name") || xn && r.name !== e) && (Ir ? H(r, "name", { value: e, configurable: !0 }) : r.name = e), Hn && t && q(t, "arity") && r.length !== t.arity && H(r, "length", { value: t.arity });
|
|
247
247
|
try {
|
|
248
|
-
t &&
|
|
248
|
+
t && q(t, "constructor") && t.constructor ? Ir && H(r, "prototype", { writable: !1 }) : r.prototype && (r.prototype = void 0);
|
|
249
249
|
} catch {
|
|
250
250
|
}
|
|
251
251
|
var a = zn(r);
|
|
252
|
-
return
|
|
252
|
+
return q(a, "source") || (a.source = Kn(Vn, typeof e == "string" ? e : "")), r;
|
|
253
253
|
};
|
|
254
|
-
Function.prototype.toString =
|
|
255
|
-
return
|
|
254
|
+
Function.prototype.toString = Wn(function() {
|
|
255
|
+
return Ln(this) && Un(this).source || kn(this);
|
|
256
256
|
}, "toString");
|
|
257
|
-
var
|
|
257
|
+
var Yn = Fe.exports, Xn = $, Zn = X, Jn = Yn, Qn = _r, ro = function(r, e, t, a) {
|
|
258
258
|
a || (a = {});
|
|
259
259
|
var n = a.enumerable, o = a.name !== void 0 ? a.name : e;
|
|
260
260
|
if (Xn(t) && Jn(t, o, a), a.global)
|
|
@@ -284,11 +284,11 @@ var qn = Fe.exports, Xn = $, Zn = X, Jn = qn, Qn = Rr, ro = function(r, e, t, a)
|
|
|
284
284
|
}, co = Dr, uo = Math.min, lo = function(r) {
|
|
285
285
|
var e = co(r);
|
|
286
286
|
return e > 0 ? uo(e, 9007199254740991) : 0;
|
|
287
|
-
}, fo = lo,
|
|
287
|
+
}, fo = lo, po = function(r) {
|
|
288
288
|
return fo(r.length);
|
|
289
|
-
},
|
|
289
|
+
}, $o = wr, yo = so, ho = po, oe = function(r) {
|
|
290
290
|
return function(e, t, a) {
|
|
291
|
-
var n =
|
|
291
|
+
var n = $o(e), o = ho(n);
|
|
292
292
|
if (o === 0) return !r && -1;
|
|
293
293
|
var i = yo(a, o), v;
|
|
294
294
|
if (r && t !== t) {
|
|
@@ -305,7 +305,7 @@ var qn = Fe.exports, Xn = $, Zn = X, Jn = qn, Qn = Rr, ro = function(r, e, t, a)
|
|
|
305
305
|
// `Array.prototype.indexOf` method
|
|
306
306
|
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
307
307
|
indexOf: oe(!1)
|
|
308
|
-
}, mo = s, yr = O, go = wr, bo = So.indexOf, Oo =
|
|
308
|
+
}, mo = s, yr = O, go = wr, bo = So.indexOf, Oo = Le, ie = mo([].push), Io = function(r, e) {
|
|
309
309
|
var t = go(r), a = 0, n = [], o;
|
|
310
310
|
for (o in t) !yr(Oo, o) && yr(t, o) && ie(n, o);
|
|
311
311
|
for (; e.length > a; ) yr(t, o = e[a++]) && (~bo(n, o) || ie(n, o));
|
|
@@ -324,43 +324,43 @@ ze.f = Object.getOwnPropertyNames || function(e) {
|
|
|
324
324
|
};
|
|
325
325
|
var Ue = {};
|
|
326
326
|
Ue.f = Object.getOwnPropertySymbols;
|
|
327
|
-
var
|
|
328
|
-
var t =
|
|
329
|
-
return a ?
|
|
330
|
-
}, ve = O, Ao =
|
|
331
|
-
for (var a = Ao(e), n =
|
|
327
|
+
var _o = Pr, Ro = s, jo = ze, No = Ue, Do = Z, Co = Ro([].concat), Mo = _o("Reflect", "ownKeys") || function(e) {
|
|
328
|
+
var t = jo.f(Do(e)), a = No.f;
|
|
329
|
+
return a ? Co(t, a(e)) : t;
|
|
330
|
+
}, ve = O, Ao = Mo, Fo = Er, Bo = X, Lo = function(r, e, t) {
|
|
331
|
+
for (var a = Ao(e), n = Bo.f, o = Fo.f, i = 0; i < a.length; i++) {
|
|
332
332
|
var v = a[i];
|
|
333
333
|
!ve(r, v) && !(t && ve(t, v)) && n(r, v, o(e, v));
|
|
334
334
|
}
|
|
335
335
|
}, xo = S, ko = $, zo = /#|\.prototype\./, F = function(r, e) {
|
|
336
|
-
var t =
|
|
337
|
-
return t ===
|
|
336
|
+
var t = qo[Uo(r)];
|
|
337
|
+
return t === Ko ? !0 : t === Go ? !1 : ko(e) ? xo(e) : !!e;
|
|
338
338
|
}, Uo = F.normalize = function(r) {
|
|
339
339
|
return String(r).replace(zo, ".").toLowerCase();
|
|
340
|
-
},
|
|
341
|
-
var t = r.target, a = r.global, n = r.stat, o, i, v,
|
|
342
|
-
if (a ? i =
|
|
343
|
-
if (m = e[v], r.dontCallGetSet ? (D =
|
|
344
|
-
if (typeof m == typeof
|
|
345
|
-
Zo(m,
|
|
340
|
+
}, qo = F.data = {}, Go = F.NATIVE = "N", Ko = F.POLYFILL = "P", Ho = F, G = p, Vo = Er.f, Wo = Ae, Yo = ro, Xo = _r, Zo = Lo, Jo = Ho, I = function(r, e) {
|
|
341
|
+
var t = r.target, a = r.global, n = r.stat, o, i, v, h, m, D;
|
|
342
|
+
if (a ? i = G : n ? i = G[t] || Xo(t, {}) : i = G[t] && G[t].prototype, i) for (v in e) {
|
|
343
|
+
if (m = e[v], r.dontCallGetSet ? (D = Vo(i, v), h = D && D.value) : h = i[v], o = Jo(a ? v : t + (n ? "." : "#") + v, r.forced), !o && h !== void 0) {
|
|
344
|
+
if (typeof m == typeof h) continue;
|
|
345
|
+
Zo(m, h);
|
|
346
346
|
}
|
|
347
|
-
(r.sham ||
|
|
347
|
+
(r.sham || h && h.sham) && Wo(m, "sham", !0), Yo(i, v, m, r);
|
|
348
348
|
}
|
|
349
|
-
}, hr = s,
|
|
349
|
+
}, hr = s, K = Set.prototype, y = {
|
|
350
350
|
// eslint-disable-next-line es/no-set -- safe
|
|
351
351
|
Set,
|
|
352
|
-
add: hr(
|
|
353
|
-
has: hr(
|
|
354
|
-
remove: hr(
|
|
355
|
-
proto:
|
|
356
|
-
}, Qo =
|
|
352
|
+
add: hr(K.add),
|
|
353
|
+
has: hr(K.has),
|
|
354
|
+
remove: hr(K.delete),
|
|
355
|
+
proto: K
|
|
356
|
+
}, Qo = y.has, E = function(r) {
|
|
357
357
|
return Qo(r), r;
|
|
358
358
|
}, ri = N, w = function(r, e, t) {
|
|
359
359
|
for (var a = t ? r : r.iterator, n = r.next, o, i; !(o = ri(n, a)).done; )
|
|
360
360
|
if (i = e(o.value), i !== void 0) return i;
|
|
361
|
-
},
|
|
362
|
-
return t ? ei({ iterator:
|
|
363
|
-
},
|
|
361
|
+
}, qe = s, ei = w, Ge = y, ti = Ge.Set, Ke = Ge.proto, ai = qe(Ke.forEach), He = qe(Ke.keys), ni = He(new ti()).next, B = function(r, e, t) {
|
|
362
|
+
return t ? ei({ iterator: He(r), next: ni }, e) : ai(r, e);
|
|
363
|
+
}, Ve = y, oi = B, ii = Ve.Set, vi = Ve.add, Cr = function(r) {
|
|
364
364
|
var e = new ii();
|
|
365
365
|
return oi(r, function(t) {
|
|
366
366
|
vi(e, t);
|
|
@@ -370,33 +370,33 @@ var Ro = Pr, jo = s, _o = ze, No = Ue, Do = Z, Mo = jo([].concat), Co = Ro("Refl
|
|
|
370
370
|
return si(ci(Object.getOwnPropertyDescriptor(r, e)[t]));
|
|
371
371
|
} catch {
|
|
372
372
|
}
|
|
373
|
-
}, li = ui, fi =
|
|
373
|
+
}, li = ui, fi = y, L = li(fi.proto, "size", "get") || function(r) {
|
|
374
374
|
return r.size;
|
|
375
|
-
},
|
|
375
|
+
}, di = function(r) {
|
|
376
376
|
return {
|
|
377
377
|
iterator: r,
|
|
378
378
|
next: r.next,
|
|
379
379
|
done: !1
|
|
380
380
|
};
|
|
381
|
-
}, se = Tr,
|
|
381
|
+
}, se = Tr, We = Z, ce = N, pi = Dr, $i = di, ue = "Invalid size", yi = RangeError, hi = TypeError, Si = Math.max, Ye = function(r, e) {
|
|
382
382
|
this.set = r, this.size = Si(e, 0), this.has = se(r.has), this.keys = se(r.keys);
|
|
383
383
|
};
|
|
384
|
-
|
|
384
|
+
Ye.prototype = {
|
|
385
385
|
getIterator: function() {
|
|
386
|
-
return
|
|
386
|
+
return $i(We(ce(this.keys, this.set)));
|
|
387
387
|
},
|
|
388
388
|
includes: function(r) {
|
|
389
389
|
return ce(this.has, this.set, r);
|
|
390
390
|
}
|
|
391
391
|
};
|
|
392
392
|
var P = function(r) {
|
|
393
|
-
|
|
393
|
+
We(r);
|
|
394
394
|
var e = +r.size;
|
|
395
395
|
if (e !== e) throw new hi(ue);
|
|
396
|
-
var t =
|
|
396
|
+
var t = pi(e);
|
|
397
397
|
if (t < 0) throw new yi(ue);
|
|
398
|
-
return new
|
|
399
|
-
}, mi = E, Xe =
|
|
398
|
+
return new Ye(r, t);
|
|
399
|
+
}, mi = E, Xe = y, gi = Cr, bi = L, Oi = P, Ii = B, Ei = w, wi = Xe.has, le = Xe.remove, Pi = function(e) {
|
|
400
400
|
var t = mi(this), a = Oi(e), n = gi(t);
|
|
401
401
|
return bi(t) <= a.size ? Ii(t, function(o) {
|
|
402
402
|
a.includes(o) && le(n, o);
|
|
@@ -429,52 +429,52 @@ var P = function(r) {
|
|
|
429
429
|
} catch {
|
|
430
430
|
return !1;
|
|
431
431
|
}
|
|
432
|
-
},
|
|
433
|
-
|
|
434
|
-
difference:
|
|
432
|
+
}, _i = I, Ri = Pi, ji = T;
|
|
433
|
+
_i({ target: "Set", proto: !0, real: !0, forced: !ji("difference") }, {
|
|
434
|
+
difference: Ri
|
|
435
435
|
});
|
|
436
|
-
var Ni = E,
|
|
437
|
-
var t = Ni(this), a =
|
|
436
|
+
var Ni = E, Mr = y, Di = L, Ci = P, Mi = B, Ai = w, Fi = Mr.Set, de = Mr.add, Bi = Mr.has, Li = function(e) {
|
|
437
|
+
var t = Ni(this), a = Ci(e), n = new Fi();
|
|
438
438
|
return Di(t) > a.size ? Ai(a.getIterator(), function(o) {
|
|
439
|
-
|
|
440
|
-
}) :
|
|
441
|
-
a.includes(o) &&
|
|
439
|
+
Bi(t, o) && de(n, o);
|
|
440
|
+
}) : Mi(t, function(o) {
|
|
441
|
+
a.includes(o) && de(n, o);
|
|
442
442
|
}), n;
|
|
443
|
-
}, xi = I, ki = S, zi =
|
|
443
|
+
}, xi = I, ki = S, zi = Li, Ui = T, qi = !Ui("intersection") || ki(function() {
|
|
444
444
|
return String(Array.from((/* @__PURE__ */ new Set([1, 2, 3])).intersection(/* @__PURE__ */ new Set([3, 2])))) !== "3,2";
|
|
445
445
|
});
|
|
446
|
-
xi({ target: "Set", proto: !0, real: !0, forced:
|
|
446
|
+
xi({ target: "Set", proto: !0, real: !0, forced: qi }, {
|
|
447
447
|
intersection: zi
|
|
448
448
|
});
|
|
449
|
-
var
|
|
449
|
+
var Gi = N, pe = Z, Ki = Re, Ze = function(r, e, t) {
|
|
450
450
|
var a, n;
|
|
451
|
-
|
|
451
|
+
pe(r);
|
|
452
452
|
try {
|
|
453
|
-
if (a =
|
|
453
|
+
if (a = Ki(r, "return"), !a) {
|
|
454
454
|
if (e === "throw") throw t;
|
|
455
455
|
return t;
|
|
456
456
|
}
|
|
457
|
-
a =
|
|
457
|
+
a = Gi(a, r);
|
|
458
458
|
} catch (o) {
|
|
459
459
|
n = !0, a = o;
|
|
460
460
|
}
|
|
461
461
|
if (e === "throw") throw t;
|
|
462
462
|
if (n) throw a;
|
|
463
|
-
return
|
|
464
|
-
},
|
|
465
|
-
var t =
|
|
466
|
-
if (
|
|
463
|
+
return pe(a), t;
|
|
464
|
+
}, Hi = E, Vi = y.has, Wi = L, Yi = P, Xi = B, Zi = w, Ji = Ze, Qi = function(e) {
|
|
465
|
+
var t = Hi(this), a = Yi(e);
|
|
466
|
+
if (Wi(t) <= a.size) return Xi(t, function(o) {
|
|
467
467
|
if (a.includes(o)) return !1;
|
|
468
468
|
}, !0) !== !1;
|
|
469
469
|
var n = a.getIterator();
|
|
470
470
|
return Zi(n, function(o) {
|
|
471
|
-
if (
|
|
471
|
+
if (Vi(t, o)) return Ji(n, "normal", !1);
|
|
472
472
|
}) !== !1;
|
|
473
473
|
}, rv = I, ev = Qi, tv = T;
|
|
474
474
|
rv({ target: "Set", proto: !0, real: !0, forced: !tv("isDisjointFrom") }, {
|
|
475
475
|
isDisjointFrom: ev
|
|
476
476
|
});
|
|
477
|
-
var av = E, nv =
|
|
477
|
+
var av = E, nv = L, ov = B, iv = P, vv = function(e) {
|
|
478
478
|
var t = av(this), a = iv(e);
|
|
479
479
|
return nv(t) > a.size ? !1 : ov(t, function(n) {
|
|
480
480
|
if (!a.includes(n)) return !1;
|
|
@@ -483,46 +483,47 @@ var av = E, nv = B, ov = L, iv = P, vv = function(e) {
|
|
|
483
483
|
sv({ target: "Set", proto: !0, real: !0, forced: !uv("isSubsetOf") }, {
|
|
484
484
|
isSubsetOf: cv
|
|
485
485
|
});
|
|
486
|
-
var lv = E, fv =
|
|
487
|
-
var t = lv(this), a =
|
|
488
|
-
if (
|
|
486
|
+
var lv = E, fv = y.has, dv = L, pv = P, $v = w, yv = Ze, hv = function(e) {
|
|
487
|
+
var t = lv(this), a = pv(e);
|
|
488
|
+
if (dv(t) < a.size) return !1;
|
|
489
489
|
var n = a.getIterator();
|
|
490
|
-
return
|
|
490
|
+
return $v(n, function(o) {
|
|
491
491
|
if (!fv(t, o)) return yv(n, "normal", !1);
|
|
492
492
|
}) !== !1;
|
|
493
493
|
}, Sv = I, mv = hv, gv = T;
|
|
494
494
|
Sv({ target: "Set", proto: !0, real: !0, forced: !gv("isSupersetOf") }, {
|
|
495
495
|
isSupersetOf: mv
|
|
496
496
|
});
|
|
497
|
-
var bv = E, Ar =
|
|
497
|
+
var bv = E, Ar = y, Ov = Cr, Iv = P, Ev = w, wv = Ar.add, Pv = Ar.has, Tv = Ar.remove, _v = function(e) {
|
|
498
498
|
var t = bv(this), a = Iv(e).getIterator(), n = Ov(t);
|
|
499
499
|
return Ev(a, function(o) {
|
|
500
500
|
Pv(t, o) ? Tv(n, o) : wv(n, o);
|
|
501
501
|
}), n;
|
|
502
|
-
},
|
|
503
|
-
|
|
504
|
-
symmetricDifference:
|
|
502
|
+
}, Rv = I, jv = _v, Nv = T;
|
|
503
|
+
Rv({ target: "Set", proto: !0, real: !0, forced: !Nv("symmetricDifference") }, {
|
|
504
|
+
symmetricDifference: jv
|
|
505
505
|
});
|
|
506
|
-
var Dv = E,
|
|
507
|
-
var t = Dv(this), a = Av(e).getIterator(), n =
|
|
506
|
+
var Dv = E, Cv = y.add, Mv = Cr, Av = P, Fv = w, Bv = function(e) {
|
|
507
|
+
var t = Dv(this), a = Av(e).getIterator(), n = Mv(t);
|
|
508
508
|
return Fv(a, function(o) {
|
|
509
|
-
|
|
509
|
+
Cv(n, o);
|
|
510
510
|
}), n;
|
|
511
|
-
},
|
|
512
|
-
|
|
511
|
+
}, Lv = I, xv = Bv, kv = T;
|
|
512
|
+
Lv({ target: "Set", proto: !0, real: !0, forced: !kv("union") }, {
|
|
513
513
|
union: xv
|
|
514
514
|
});
|
|
515
|
-
const zv = "
|
|
515
|
+
const zv = "_answer_qd3qe_1", Uv = "_alertIcon_qd3qe_5", qv = "_error_qd3qe_8", Gv = "_footer_qd3qe_12", Kv = "_copyButtonContainer_qd3qe_18", Hv = "_shouldHaveMarginTop_qd3qe_22", Vv = "_shouldUseAnimation_qd3qe_25", Wv = "_shouldAnimateHeight_qd3qe_29", Yv = "_footerButtons_qd3qe_33", Xv = "_iconAvatar_qd3qe_38", f = {
|
|
516
516
|
answer: zv,
|
|
517
517
|
alertIcon: Uv,
|
|
518
|
-
error:
|
|
519
|
-
footer:
|
|
518
|
+
error: qv,
|
|
519
|
+
footer: Gv,
|
|
520
|
+
copyButtonContainer: Kv,
|
|
520
521
|
shouldHaveMarginTop: Hv,
|
|
521
522
|
shouldUseAnimation: Vv,
|
|
522
523
|
shouldAnimateHeight: Wv,
|
|
523
524
|
footerButtons: Yv,
|
|
524
|
-
iconAvatar:
|
|
525
|
-
},
|
|
525
|
+
iconAvatar: Xv
|
|
526
|
+
}, Zv = /* @__PURE__ */ new Set([d.RATE_LIMITING, d.NO_CONTENT, d.PRECONDITION_FAILED, d.GENERAL, d.AGENT_NOT_FOUND]), ys = /* @__PURE__ */ Q.memo(({
|
|
526
527
|
answer: r,
|
|
527
528
|
citations: e,
|
|
528
529
|
error: t,
|
|
@@ -531,7 +532,7 @@ const zv = "_answer_1l8if_1", Uv = "_alertIcon_1l8if_5", Gv = "_error_1l8if_8",
|
|
|
531
532
|
isCitationsEnabled: o = !1,
|
|
532
533
|
isCompleted: i = !1,
|
|
533
534
|
isFeedbackEnabled: v = !1,
|
|
534
|
-
isLoading:
|
|
535
|
+
isLoading: h = !1,
|
|
535
536
|
isMarkdownEnabled: m = !1,
|
|
536
537
|
items: D = [],
|
|
537
538
|
onCitationClick: Je,
|
|
@@ -540,78 +541,81 @@ const zv = "_answer_1l8if_1", Uv = "_alertIcon_1l8if_5", Gv = "_error_1l8if_8",
|
|
|
540
541
|
useAnimation: rt = !0,
|
|
541
542
|
variant: g = "modal"
|
|
542
543
|
}) => {
|
|
543
|
-
const Fr =
|
|
544
|
+
const Fr = Zv.has(t), et = h && !r && !t, [tt, at] = Q.useState(i), {
|
|
544
545
|
formatMessage: J
|
|
545
|
-
} =
|
|
546
|
+
} = $t(), Br = it() === vt.Small ? lt : ft;
|
|
546
547
|
Q.useEffect(() => {
|
|
547
548
|
setTimeout(() => at(i), 0);
|
|
548
549
|
}, [i]);
|
|
549
|
-
const
|
|
550
|
-
className:
|
|
551
|
-
color:
|
|
550
|
+
const Lr = () => /* @__PURE__ */ u(ct, {
|
|
551
|
+
className: f.alertIcon,
|
|
552
|
+
color: dt,
|
|
552
553
|
"data-testid": "content-answers-error-alert-icon",
|
|
553
554
|
height: xr,
|
|
554
555
|
role: "presentation",
|
|
555
556
|
width: xr
|
|
556
|
-
}), nt = () => /* @__PURE__ */
|
|
557
|
+
}), nt = () => /* @__PURE__ */ _(st, {
|
|
557
558
|
as: "p",
|
|
558
|
-
className:
|
|
559
|
+
className: f.error,
|
|
559
560
|
color: "textOnLightSecondary",
|
|
560
561
|
"data-testid": "content-answers-error",
|
|
561
562
|
variant: "caption",
|
|
562
|
-
children: [t ===
|
|
563
|
-
}), ot = () => t !==
|
|
564
|
-
className:
|
|
565
|
-
children: [v ? /* @__PURE__ */
|
|
563
|
+
children: [t === d.RESPONSE_INTERRUPTED && J(er.responseInterruptedError), t === d.RESPONSE_FAILED && J(er.responseFailedError), t === d.RESPONSE_STOPPED && J(er.responseStoppedError), t !== d.RESPONSE_STOPPED && Lr()]
|
|
564
|
+
}), ot = () => t !== d.RESPONSE_STOPPED ? /* @__PURE__ */ _("div", {
|
|
565
|
+
className: f.footerButtons,
|
|
566
|
+
children: [v ? /* @__PURE__ */ u(mt, {
|
|
566
567
|
hostAppName: n,
|
|
567
568
|
items: D,
|
|
568
569
|
recordAction: x,
|
|
569
570
|
variant: g
|
|
570
|
-
}) : null, /* @__PURE__ */
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
571
|
+
}) : null, /* @__PURE__ */ u("div", {
|
|
572
|
+
className: f.copyButtonContainer,
|
|
573
|
+
children: /* @__PURE__ */ u(ht, {
|
|
574
|
+
answer: r,
|
|
575
|
+
onAnswerCopy: Qe,
|
|
576
|
+
recordAction: x
|
|
577
|
+
})
|
|
574
578
|
})]
|
|
575
|
-
}) : r ? null :
|
|
576
|
-
return /* @__PURE__ */
|
|
579
|
+
}) : r ? null : Lr();
|
|
580
|
+
return /* @__PURE__ */ _("div", {
|
|
577
581
|
"aria-live": "polite",
|
|
578
|
-
className:
|
|
582
|
+
className: f.answer,
|
|
579
583
|
"data-testid": "content-answers-answer",
|
|
580
|
-
children: [!Fr && !et && /* @__PURE__ */
|
|
584
|
+
children: [!Fr && !et && /* @__PURE__ */ _(rr, {
|
|
581
585
|
className: "answer",
|
|
582
586
|
variant: g,
|
|
583
|
-
children: [g === "modal" && /* @__PURE__ */
|
|
587
|
+
children: [g === "modal" && /* @__PURE__ */ u(rr.Figure, {
|
|
584
588
|
variant: g,
|
|
585
|
-
children: /* @__PURE__ */
|
|
586
|
-
className:
|
|
587
|
-
children: /* @__PURE__ */
|
|
588
|
-
height:
|
|
589
|
+
children: /* @__PURE__ */ u("div", {
|
|
590
|
+
className: f.iconAvatar,
|
|
591
|
+
children: /* @__PURE__ */ u(ut, {
|
|
592
|
+
height: Br,
|
|
589
593
|
role: "presentation",
|
|
590
|
-
width:
|
|
594
|
+
width: Br
|
|
591
595
|
})
|
|
592
596
|
})
|
|
593
|
-
}), /* @__PURE__ */
|
|
597
|
+
}), /* @__PURE__ */ _(rr.Content, {
|
|
594
598
|
isUsedInsideSidebar: g === "sidebar",
|
|
595
599
|
variant: "answer",
|
|
596
|
-
children: [/* @__PURE__ */
|
|
600
|
+
children: [/* @__PURE__ */ u(yt, {
|
|
597
601
|
answer: r,
|
|
598
602
|
isMarkdownEnabled: m,
|
|
599
603
|
variant: g
|
|
600
|
-
}), i && /* @__PURE__ */
|
|
601
|
-
className:
|
|
602
|
-
[
|
|
603
|
-
[
|
|
604
|
-
[
|
|
604
|
+
}), i && /* @__PURE__ */ _("div", {
|
|
605
|
+
className: pt(f.footer, {
|
|
606
|
+
[f.shouldHaveMarginTop]: r,
|
|
607
|
+
[f.shouldAnimateHeight]: tt,
|
|
608
|
+
[f.shouldUseAnimation]: rt
|
|
605
609
|
}),
|
|
606
610
|
"data-testid": "content-answers-answer-footer",
|
|
607
|
-
children: [t && nt(), o && !t && /* @__PURE__ */
|
|
611
|
+
children: [t && nt(), o && !t && /* @__PURE__ */ u(gt, {
|
|
608
612
|
citations: e,
|
|
609
613
|
onCitationClick: Je,
|
|
610
614
|
recordAction: x
|
|
611
615
|
}), ot()]
|
|
612
616
|
})]
|
|
613
617
|
})]
|
|
614
|
-
}), Fr && /* @__PURE__ */
|
|
618
|
+
}), Fr && /* @__PURE__ */ u(St, {
|
|
615
619
|
contentType: a,
|
|
616
620
|
error: t,
|
|
617
621
|
recordAction: x,
|
|
@@ -620,6 +624,6 @@ const zv = "_answer_1l8if_1", Uv = "_alertIcon_1l8if_5", Gv = "_error_1l8if_8",
|
|
|
620
624
|
});
|
|
621
625
|
});
|
|
622
626
|
export {
|
|
623
|
-
|
|
624
|
-
|
|
627
|
+
ys as Answer,
|
|
628
|
+
ys as default
|
|
625
629
|
};
|
|
@@ -1,77 +1,80 @@
|
|
|
1
|
-
import { Answer as
|
|
2
|
-
import { Question as
|
|
3
|
-
import { SuggestedQuestions as
|
|
4
|
-
import { WelcomeMessage as
|
|
5
|
-
import { jsxs as
|
|
6
|
-
import '../../../../styles/chat.css';const
|
|
7
|
-
chat:
|
|
1
|
+
import { Answer as W } from "../answer/answer.js";
|
|
2
|
+
import { Question as b } from "../question/question.js";
|
|
3
|
+
import { SuggestedQuestions as g } from "../suggested-questions/suggested-questions.js";
|
|
4
|
+
import { WelcomeMessage as v } from "../welcome-message/welcome-message.js";
|
|
5
|
+
import { jsxs as h, jsx as t } from "react/jsx-runtime";
|
|
6
|
+
import '../../../../styles/chat.css';const z = "_chat_fj1ue_1", B = {
|
|
7
|
+
chat: z
|
|
8
8
|
}, J = ({
|
|
9
|
-
askSuggestedQuestion:
|
|
10
|
-
hasCustomSuggestedQuestions:
|
|
11
|
-
hasRequestInProgress:
|
|
12
|
-
isCitationsEnabled:
|
|
13
|
-
isFeedbackEnabled:
|
|
14
|
-
isMarkdownEnabled:
|
|
15
|
-
onCitationClick:
|
|
16
|
-
onAnswerCopy:
|
|
17
|
-
questions:
|
|
18
|
-
recordAction:
|
|
19
|
-
setAskSuggestedQuestion:
|
|
20
|
-
suggestedQuestions:
|
|
21
|
-
suggestedQuestionsRequestState:
|
|
9
|
+
askSuggestedQuestion: l,
|
|
10
|
+
hasCustomSuggestedQuestions: r,
|
|
11
|
+
hasRequestInProgress: c,
|
|
12
|
+
isCitationsEnabled: s,
|
|
13
|
+
isFeedbackEnabled: a,
|
|
14
|
+
isMarkdownEnabled: f,
|
|
15
|
+
onCitationClick: p,
|
|
16
|
+
onAnswerCopy: u,
|
|
17
|
+
questions: i,
|
|
18
|
+
recordAction: n,
|
|
19
|
+
setAskSuggestedQuestion: d,
|
|
20
|
+
suggestedQuestions: e,
|
|
21
|
+
suggestedQuestionsRequestState: j,
|
|
22
22
|
useAnimation: x,
|
|
23
23
|
variant: o = "modal",
|
|
24
24
|
hostAppName: y = "",
|
|
25
25
|
...m
|
|
26
|
-
}) =>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
isCompleted: L,
|
|
47
|
-
isLoading: N,
|
|
48
|
-
error: W,
|
|
49
|
-
prompt: b
|
|
50
|
-
}) => /* @__PURE__ */ e("li", {
|
|
51
|
-
children: [/* @__PURE__ */ t(v, {
|
|
52
|
-
prompt: b,
|
|
53
|
-
variant: o
|
|
54
|
-
}), /* @__PURE__ */ t(q, {
|
|
55
|
-
answer: _,
|
|
26
|
+
}) => {
|
|
27
|
+
const _ = !c && i.length === 0;
|
|
28
|
+
return /* @__PURE__ */ h("div", {
|
|
29
|
+
className: B.chat,
|
|
30
|
+
"data-testid": "content-answers-chat",
|
|
31
|
+
children: [/* @__PURE__ */ t(v, {
|
|
32
|
+
...m,
|
|
33
|
+
variant: o
|
|
34
|
+
}), _ && e !== void 0 && d !== void 0 && /* @__PURE__ */ t(g, {
|
|
35
|
+
askSuggestedQuestion: l,
|
|
36
|
+
hasCustomSuggestedQuestions: r,
|
|
37
|
+
isLoading: c,
|
|
38
|
+
recordAction: n,
|
|
39
|
+
setAskSuggestedQuestion: d,
|
|
40
|
+
suggestedQuestions: e,
|
|
41
|
+
suggestedQuestionsRequestState: j,
|
|
42
|
+
variant: o
|
|
43
|
+
}), /* @__PURE__ */ t("ul", {
|
|
44
|
+
children: i.map(({
|
|
45
|
+
answer: S,
|
|
56
46
|
citations: T,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
47
|
+
id: w,
|
|
48
|
+
isCompleted: C,
|
|
49
|
+
isLoading: L,
|
|
50
|
+
error: N,
|
|
51
|
+
prompt: Q
|
|
52
|
+
}) => /* @__PURE__ */ h("li", {
|
|
53
|
+
children: [/* @__PURE__ */ t(b, {
|
|
54
|
+
prompt: Q,
|
|
55
|
+
variant: o
|
|
56
|
+
}), /* @__PURE__ */ t(W, {
|
|
57
|
+
answer: S,
|
|
58
|
+
citations: T,
|
|
59
|
+
contentType: m.contentType,
|
|
60
|
+
error: N,
|
|
61
|
+
hostAppName: y,
|
|
62
|
+
isCitationsEnabled: s,
|
|
63
|
+
isCompleted: C,
|
|
64
|
+
isFeedbackEnabled: a,
|
|
65
|
+
isLoading: L,
|
|
66
|
+
isMarkdownEnabled: f,
|
|
67
|
+
items: m.items,
|
|
68
|
+
onAnswerCopy: u,
|
|
69
|
+
onCitationClick: p,
|
|
70
|
+
recordAction: n,
|
|
71
|
+
useAnimation: x,
|
|
72
|
+
variant: o
|
|
73
|
+
})]
|
|
74
|
+
}, w))
|
|
75
|
+
})]
|
|
76
|
+
});
|
|
77
|
+
};
|
|
75
78
|
export {
|
|
76
79
|
J as Chat,
|
|
77
80
|
J as default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/box-ai-content-answers",
|
|
3
|
-
"version": "0.89.
|
|
3
|
+
"version": "0.89.3",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@box/blueprint-web": "^7.8.0",
|
|
6
6
|
"@box/blueprint-web-assets": "^4.16.0",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"**/*.css"
|
|
57
57
|
],
|
|
58
58
|
"license": "SEE LICENSE IN LICENSE",
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "0e147384ae2927e849e6aa23e46c37af276828f3"
|
|
60
60
|
}
|
package/styles/answer.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._answer_qd3qe_1{white-space:pre-wrap;border:none}._answer_qd3qe_1 ._alertIcon_qd3qe_5{margin-left:.5rem}._answer_qd3qe_1 ._error_qd3qe_8{display:flex;align-items:center}._answer_qd3qe_1 ._footer_qd3qe_12{display:flex;align-items:center;justify-content:space-between;height:1.5rem}._answer_qd3qe_1 ._footer_qd3qe_12 ._copyButtonContainer_qd3qe_18{opacity:0;transition:opacity .3s}._answer_qd3qe_1 ._footer_qd3qe_12._shouldHaveMarginTop_qd3qe_22{margin-top:.75rem}._answer_qd3qe_1 ._footer_qd3qe_12._shouldUseAnimation_qd3qe_25{max-height:0;overflow-y:hidden}._answer_qd3qe_1 ._footer_qd3qe_12._shouldUseAnimation_qd3qe_25._shouldAnimateHeight_qd3qe_29{max-height:200px;transition:max-height 1s ease-in}._answer_qd3qe_1 ._footer_qd3qe_12 ._footerButtons_qd3qe_33{display:flex;gap:.25rem;margin-inline-start:auto}._answer_qd3qe_1 ._iconAvatar_qd3qe_38{display:flex;align-items:center;justify-content:center;width:var(--size-8);height:var(--size-8);border-radius:50%}@media (max-width: 374px){._answer_qd3qe_1 ._iconAvatar_qd3qe_38{width:var(--size-6);height:var(--size-6)}}._answer_qd3qe_1:hover ._copyButtonContainer_qd3qe_18{opacity:1}
|