@arbor-education/ask-arbor-chat-panel 1.1.0 → 1.1.1
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/index.cjs +18 -18
- package/dist/index.d.ts +8 -0
- package/dist/index.js +582 -570
- package/dist/style.css +1 -1
- package/dist-iife/ask-arbor-slideover.js +59 -59
- package/dist-iife/ask-arbor-widget.js +59 -59
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,10 +2,10 @@ var Sr = Object.defineProperty;
|
|
|
2
2
|
var wr = (e, t, r) => t in e ? Sr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var Ln = (e, t, r) => wr(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
import { jsxs as S, jsx as i, Fragment as we } from "react/jsx-runtime";
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { useRef as x, useMemo as tr, useEffect as V, useState as M, useContext as
|
|
5
|
+
import { Icon as Ot, Tag as Nr, Button as kr, Tabs as nn, Table as Rr, Slideover as Ir } from "@arbor-education/design-system.components";
|
|
6
|
+
import { useRef as x, useMemo as tr, useEffect as V, useState as M, useContext as Cr, createContext as vr, forwardRef as Tn, createElement as pn, useImperativeHandle as Or, useLayoutEffect as nr, useCallback as $t } from "react";
|
|
7
7
|
import { createPortal as rr } from "react-dom";
|
|
8
|
-
function
|
|
8
|
+
function Lr(e) {
|
|
9
9
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
10
10
|
}
|
|
11
11
|
var or = { exports: {} };
|
|
@@ -44,64 +44,64 @@ var or = { exports: {} };
|
|
|
44
44
|
e.exports ? (r.default = r, e.exports = r) : window.classNames = r;
|
|
45
45
|
})();
|
|
46
46
|
})(or);
|
|
47
|
-
var
|
|
48
|
-
const _e = /* @__PURE__ */
|
|
49
|
-
function
|
|
50
|
-
var l = this, s = x(null), u = x(0), m = x(0), h = x(null),
|
|
47
|
+
var Dr = or.exports;
|
|
48
|
+
const _e = /* @__PURE__ */ Lr(Dr);
|
|
49
|
+
function Mr(e, t, r, a) {
|
|
50
|
+
var l = this, s = x(null), u = x(0), m = x(0), h = x(null), f = x([]), T = x(), A = x(), _ = x(e), E = x(!0), k = x(), D = x();
|
|
51
51
|
_.current = e;
|
|
52
|
-
var
|
|
52
|
+
var N = typeof window < "u", w = !t && t !== 0 && N;
|
|
53
53
|
if (typeof e != "function") throw new TypeError("Expected a function");
|
|
54
54
|
t = +t || 0;
|
|
55
55
|
var H = !!(r = r || {}).leading, pe = !("trailing" in r) || !!r.trailing, z = !!r.flushOnExit && pe, K = "maxWait" in r, U = "debounceOnServer" in r && !!r.debounceOnServer, q = K ? Math.max(+r.maxWait || 0, t) : null, me = tr(function() {
|
|
56
|
-
var J = function(
|
|
57
|
-
var W =
|
|
58
|
-
return
|
|
59
|
-
}, G = function(
|
|
60
|
-
|
|
61
|
-
}, de = function(
|
|
56
|
+
var J = function(L) {
|
|
57
|
+
var W = f.current, he = T.current;
|
|
58
|
+
return f.current = T.current = null, u.current = L, m.current = m.current || L, A.current = _.current.apply(he, W);
|
|
59
|
+
}, G = function(L, W) {
|
|
60
|
+
w && cancelAnimationFrame(h.current), h.current = w ? requestAnimationFrame(L) : setTimeout(L, W);
|
|
61
|
+
}, de = function(L) {
|
|
62
62
|
if (!E.current) return !1;
|
|
63
|
-
var W =
|
|
64
|
-
return !s.current || W >= t || W < 0 || K &&
|
|
65
|
-
}, b = function(
|
|
66
|
-
return h.current = null, pe &&
|
|
67
|
-
},
|
|
63
|
+
var W = L - s.current;
|
|
64
|
+
return !s.current || W >= t || W < 0 || K && L - u.current >= q;
|
|
65
|
+
}, b = function(L) {
|
|
66
|
+
return h.current = null, pe && f.current ? J(L) : (f.current = T.current = null, A.current);
|
|
67
|
+
}, O = function L() {
|
|
68
68
|
var W = Date.now();
|
|
69
69
|
if (H && m.current === u.current && B(), de(W)) return b(W);
|
|
70
70
|
if (E.current) {
|
|
71
71
|
var he = t - (W - s.current), Le = K ? Math.min(he, q - (W - u.current)) : he;
|
|
72
|
-
G(
|
|
72
|
+
G(L, Le);
|
|
73
73
|
}
|
|
74
74
|
}, B = function() {
|
|
75
75
|
}, re = function() {
|
|
76
|
-
if (
|
|
77
|
-
var
|
|
78
|
-
if (
|
|
76
|
+
if (N || U) {
|
|
77
|
+
var L, W = Date.now(), he = de(W);
|
|
78
|
+
if (f.current = [].slice.call(arguments), T.current = l, s.current = W, z && !k.current && (k.current = function() {
|
|
79
79
|
var Le;
|
|
80
|
-
((Le = globalThis.document) == null ? void 0 : Le.visibilityState) === "hidden" &&
|
|
81
|
-
}, (
|
|
82
|
-
if (!h.current && E.current) return u.current = s.current, G(
|
|
83
|
-
if (K) return G(
|
|
80
|
+
((Le = globalThis.document) == null ? void 0 : Le.visibilityState) === "hidden" && D.current.flush();
|
|
81
|
+
}, (L = globalThis.document) == null || L.addEventListener == null || L.addEventListener("visibilitychange", k.current)), he) {
|
|
82
|
+
if (!h.current && E.current) return u.current = s.current, G(O, t), H ? J(s.current) : A.current;
|
|
83
|
+
if (K) return G(O, t), J(s.current);
|
|
84
84
|
}
|
|
85
|
-
return h.current || G(
|
|
85
|
+
return h.current || G(O, t), A.current;
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
return re.cancel = function() {
|
|
89
|
-
var
|
|
90
|
-
|
|
89
|
+
var L = h.current;
|
|
90
|
+
L && (w ? cancelAnimationFrame(h.current) : clearTimeout(h.current)), u.current = 0, f.current = s.current = T.current = h.current = null;
|
|
91
91
|
}, re.isPending = function() {
|
|
92
92
|
return !!h.current;
|
|
93
93
|
}, re.flush = function() {
|
|
94
94
|
return h.current ? b(Date.now()) : A.current;
|
|
95
95
|
}, re;
|
|
96
|
-
}, [H, K, t, q, pe, z,
|
|
97
|
-
return
|
|
96
|
+
}, [H, K, t, q, pe, z, w, N, U, a]);
|
|
97
|
+
return D.current = me, V(function() {
|
|
98
98
|
return E.current = !0, function() {
|
|
99
99
|
var J;
|
|
100
|
-
z &&
|
|
100
|
+
z && D.current.flush(), k.current && ((J = globalThis.document) == null || J.removeEventListener == null || J.removeEventListener("visibilitychange", k.current), k.current = null), E.current = !1;
|
|
101
101
|
};
|
|
102
102
|
}, [z]), me;
|
|
103
103
|
}
|
|
104
|
-
const
|
|
104
|
+
const xr = () => /* @__PURE__ */ S(
|
|
105
105
|
"svg",
|
|
106
106
|
{
|
|
107
107
|
width: "32",
|
|
@@ -134,13 +134,13 @@ const Mr = () => /* @__PURE__ */ S(
|
|
|
134
134
|
)
|
|
135
135
|
]
|
|
136
136
|
}
|
|
137
|
-
),
|
|
137
|
+
), Pr = "Enter", Ur = " ", Dn = ({
|
|
138
138
|
category: e,
|
|
139
139
|
isExpanded: t,
|
|
140
140
|
onHeaderClick: r
|
|
141
141
|
}) => {
|
|
142
142
|
const a = `ask-arbor-prompt-library__body-${e.id}`, l = (s) => {
|
|
143
|
-
(s.key ===
|
|
143
|
+
(s.key === Pr || s.key === Ur) && (s.preventDefault(), r(e.id));
|
|
144
144
|
};
|
|
145
145
|
return /* @__PURE__ */ i(
|
|
146
146
|
"div",
|
|
@@ -165,7 +165,7 @@ const Mr = () => /* @__PURE__ */ S(
|
|
|
165
165
|
"aria-label": `${e.title}, ${t ? "collapse" : "expand"} to ${t ? "hide" : "show"} prompts`,
|
|
166
166
|
children: [
|
|
167
167
|
/* @__PURE__ */ i("div", { className: "ask-arbor-prompt-library__icon-circle", children: /* @__PURE__ */ i(
|
|
168
|
-
|
|
168
|
+
Ot,
|
|
169
169
|
{
|
|
170
170
|
name: e.icon,
|
|
171
171
|
size: 12,
|
|
@@ -174,7 +174,7 @@ const Mr = () => /* @__PURE__ */ S(
|
|
|
174
174
|
) }),
|
|
175
175
|
/* @__PURE__ */ i("div", { className: "ask-arbor-prompt-library__header-text", children: /* @__PURE__ */ i("h4", { className: "ask-arbor-prompt-library__title", children: e.title }) }),
|
|
176
176
|
/* @__PURE__ */ i(
|
|
177
|
-
|
|
177
|
+
Ot,
|
|
178
178
|
{
|
|
179
179
|
name: t ? "chevron-up" : "chevron-down",
|
|
180
180
|
size: 16,
|
|
@@ -188,7 +188,7 @@ const Mr = () => /* @__PURE__ */ S(
|
|
|
188
188
|
)
|
|
189
189
|
}
|
|
190
190
|
);
|
|
191
|
-
},
|
|
191
|
+
}, Fr = ({
|
|
192
192
|
onSelectPrompt: e,
|
|
193
193
|
onPromptHover: t,
|
|
194
194
|
categories: r
|
|
@@ -201,7 +201,7 @@ const Mr = () => /* @__PURE__ */ S(
|
|
|
201
201
|
);
|
|
202
202
|
}, u = (_, E) => {
|
|
203
203
|
_.stopPropagation(), e(E);
|
|
204
|
-
}, m = a != null ? r.findIndex((_) => _.id === a) : -1, h = m >= 0 ? r[m] : null,
|
|
204
|
+
}, m = a != null ? r.findIndex((_) => _.id === a) : -1, h = m >= 0 ? r[m] : null, f = (_) => /* @__PURE__ */ i(
|
|
205
205
|
"div",
|
|
206
206
|
{
|
|
207
207
|
className: "ask-arbor-prompt-library__grid-item ask-arbor-prompt-library__grid-item--full-width",
|
|
@@ -227,18 +227,18 @@ const Mr = () => /* @__PURE__ */ S(
|
|
|
227
227
|
className: "ask-arbor-prompt-library__prompt-group",
|
|
228
228
|
children: [
|
|
229
229
|
/* @__PURE__ */ i(Nr, { color: _.theme, children: E.tag }),
|
|
230
|
-
/* @__PURE__ */ i("div", { className: "ask-arbor-prompt-library__prompts", children: E.prompts.map((k,
|
|
230
|
+
/* @__PURE__ */ i("div", { className: "ask-arbor-prompt-library__prompts", children: E.prompts.map((k, D) => /* @__PURE__ */ S(
|
|
231
231
|
"button",
|
|
232
232
|
{
|
|
233
233
|
type: "button",
|
|
234
234
|
className: "ask-arbor-prompt-library__prompt-row",
|
|
235
|
-
onClick: (
|
|
235
|
+
onClick: (N) => u(N, k),
|
|
236
236
|
onMouseEnter: () => t == null ? void 0 : t(k),
|
|
237
237
|
onMouseLeave: () => t == null ? void 0 : t(null),
|
|
238
238
|
children: [
|
|
239
239
|
/* @__PURE__ */ i("span", { className: "ask-arbor-prompt-library__prompt-text", children: k }),
|
|
240
240
|
/* @__PURE__ */ i(
|
|
241
|
-
|
|
241
|
+
Ot,
|
|
242
242
|
{
|
|
243
243
|
name: "chevron-right",
|
|
244
244
|
size: 12,
|
|
@@ -247,7 +247,7 @@ const Mr = () => /* @__PURE__ */ S(
|
|
|
247
247
|
)
|
|
248
248
|
]
|
|
249
249
|
},
|
|
250
|
-
`${E.tag}-${
|
|
250
|
+
`${E.tag}-${D}`
|
|
251
251
|
)) })
|
|
252
252
|
]
|
|
253
253
|
},
|
|
@@ -267,7 +267,7 @@ const Mr = () => /* @__PURE__ */ S(
|
|
|
267
267
|
}
|
|
268
268
|
) }, _.id), A = m >= 0 ? [
|
|
269
269
|
...r.slice(0, m).map(T),
|
|
270
|
-
|
|
270
|
+
f(h),
|
|
271
271
|
...r.slice(m + 1).map(T)
|
|
272
272
|
] : r.map(T);
|
|
273
273
|
return /* @__PURE__ */ i(
|
|
@@ -292,14 +292,14 @@ const ar = (...e) => e.filter((t, r, a) => !!t && t.trim() !== "" && a.indexOf(t
|
|
|
292
292
|
* This source code is licensed under the ISC license.
|
|
293
293
|
* See the LICENSE file in the root directory of this source tree.
|
|
294
294
|
*/
|
|
295
|
-
const
|
|
295
|
+
const Hr = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
296
296
|
/**
|
|
297
297
|
* @license lucide-react v1.21.0 - ISC
|
|
298
298
|
*
|
|
299
299
|
* This source code is licensed under the ISC license.
|
|
300
300
|
* See the LICENSE file in the root directory of this source tree.
|
|
301
301
|
*/
|
|
302
|
-
const
|
|
302
|
+
const zr = (e) => e.replace(
|
|
303
303
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
304
304
|
(t, r, a) => a ? a.toUpperCase() : r.toLowerCase()
|
|
305
305
|
);
|
|
@@ -310,7 +310,7 @@ const Hr = (e) => e.replace(
|
|
|
310
310
|
* See the LICENSE file in the root directory of this source tree.
|
|
311
311
|
*/
|
|
312
312
|
const Mn = (e) => {
|
|
313
|
-
const t =
|
|
313
|
+
const t = zr(e);
|
|
314
314
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
315
315
|
};
|
|
316
316
|
/**
|
|
@@ -336,35 +336,35 @@ var rn = {
|
|
|
336
336
|
* This source code is licensed under the ISC license.
|
|
337
337
|
* See the LICENSE file in the root directory of this source tree.
|
|
338
338
|
*/
|
|
339
|
-
const
|
|
339
|
+
const Gr = (e) => {
|
|
340
340
|
for (const t in e)
|
|
341
341
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
342
342
|
return !0;
|
|
343
343
|
return !1;
|
|
344
|
-
},
|
|
344
|
+
}, Br = vr({}), Wr = () => Cr(Br), $r = Tn(
|
|
345
345
|
({ color: e, size: t, strokeWidth: r, absoluteStrokeWidth: a, className: l = "", children: s, iconNode: u, ...m }, h) => {
|
|
346
346
|
const {
|
|
347
|
-
size:
|
|
347
|
+
size: f = 24,
|
|
348
348
|
strokeWidth: T = 2,
|
|
349
349
|
absoluteStrokeWidth: A = !1,
|
|
350
350
|
color: _ = "currentColor",
|
|
351
351
|
className: E = ""
|
|
352
|
-
} =
|
|
352
|
+
} = Wr() ?? {}, k = a ?? A ? Number(r ?? T) * 24 / Number(t ?? f) : r ?? T;
|
|
353
353
|
return pn(
|
|
354
354
|
"svg",
|
|
355
355
|
{
|
|
356
356
|
ref: h,
|
|
357
357
|
...rn,
|
|
358
|
-
width: t ??
|
|
359
|
-
height: t ??
|
|
358
|
+
width: t ?? f ?? rn.width,
|
|
359
|
+
height: t ?? f ?? rn.height,
|
|
360
360
|
stroke: e ?? _,
|
|
361
361
|
strokeWidth: k,
|
|
362
362
|
className: ar("lucide", E, l),
|
|
363
|
-
...!s && !
|
|
363
|
+
...!s && !Gr(m) && { "aria-hidden": "true" },
|
|
364
364
|
...m
|
|
365
365
|
},
|
|
366
366
|
[
|
|
367
|
-
...u.map(([
|
|
367
|
+
...u.map(([D, N]) => pn(D, N)),
|
|
368
368
|
...Array.isArray(s) ? s : [s]
|
|
369
369
|
]
|
|
370
370
|
);
|
|
@@ -378,11 +378,11 @@ const zr = (e) => {
|
|
|
378
378
|
*/
|
|
379
379
|
const Oe = (e, t) => {
|
|
380
380
|
const r = Tn(
|
|
381
|
-
({ className: a, ...l }, s) => pn(
|
|
381
|
+
({ className: a, ...l }, s) => pn($r, {
|
|
382
382
|
ref: s,
|
|
383
383
|
iconNode: t,
|
|
384
384
|
className: ar(
|
|
385
|
-
`lucide-${
|
|
385
|
+
`lucide-${Hr(Mn(e))}`,
|
|
386
386
|
`lucide-${e}`,
|
|
387
387
|
a
|
|
388
388
|
),
|
|
@@ -397,76 +397,76 @@ const Oe = (e, t) => {
|
|
|
397
397
|
* This source code is licensed under the ISC license.
|
|
398
398
|
* See the LICENSE file in the root directory of this source tree.
|
|
399
399
|
*/
|
|
400
|
-
const
|
|
400
|
+
const Yr = [
|
|
401
401
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
402
402
|
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
403
|
-
],
|
|
403
|
+
], jr = Oe("arrow-right", Yr);
|
|
404
404
|
/**
|
|
405
405
|
* @license lucide-react v1.21.0 - ISC
|
|
406
406
|
*
|
|
407
407
|
* This source code is licensed under the ISC license.
|
|
408
408
|
* See the LICENSE file in the root directory of this source tree.
|
|
409
409
|
*/
|
|
410
|
-
const
|
|
410
|
+
const Kr = [
|
|
411
411
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
412
412
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
413
413
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
414
|
-
],
|
|
414
|
+
], Vr = Oe("circle-alert", Kr);
|
|
415
415
|
/**
|
|
416
416
|
* @license lucide-react v1.21.0 - ISC
|
|
417
417
|
*
|
|
418
418
|
* This source code is licensed under the ISC license.
|
|
419
419
|
* See the LICENSE file in the root directory of this source tree.
|
|
420
420
|
*/
|
|
421
|
-
const
|
|
421
|
+
const qr = [
|
|
422
422
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
423
423
|
["path", { d: "M16 16s-1.5-2-4-2-4 2-4 2", key: "epbg0q" }],
|
|
424
424
|
["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
|
|
425
425
|
["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
|
|
426
|
-
],
|
|
426
|
+
], Xr = Oe("frown", qr);
|
|
427
427
|
/**
|
|
428
428
|
* @license lucide-react v1.21.0 - ISC
|
|
429
429
|
*
|
|
430
430
|
* This source code is licensed under the ISC license.
|
|
431
431
|
* See the LICENSE file in the root directory of this source tree.
|
|
432
432
|
*/
|
|
433
|
-
const
|
|
433
|
+
const Zr = [
|
|
434
434
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
435
435
|
["path", { d: "M12 16v-4", key: "1dtifu" }],
|
|
436
436
|
["path", { d: "M12 8h.01", key: "e9boi3" }]
|
|
437
|
-
],
|
|
437
|
+
], Jr = Oe("info", Zr);
|
|
438
438
|
/**
|
|
439
439
|
* @license lucide-react v1.21.0 - ISC
|
|
440
440
|
*
|
|
441
441
|
* This source code is licensed under the ISC license.
|
|
442
442
|
* See the LICENSE file in the root directory of this source tree.
|
|
443
443
|
*/
|
|
444
|
-
const
|
|
444
|
+
const Qr = [
|
|
445
445
|
["path", { d: "M12 19v3", key: "npa21l" }],
|
|
446
446
|
["path", { d: "M15 9.34V5a3 3 0 0 0-5.68-1.33", key: "1gzdoj" }],
|
|
447
447
|
["path", { d: "M16.95 16.95A7 7 0 0 1 5 12v-2", key: "cqa7eg" }],
|
|
448
448
|
["path", { d: "M18.89 13.23A7 7 0 0 0 19 12v-2", key: "16hl24" }],
|
|
449
449
|
["path", { d: "m2 2 20 20", key: "1ooewy" }],
|
|
450
450
|
["path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12", key: "r2i35w" }]
|
|
451
|
-
],
|
|
451
|
+
], eo = Oe("mic-off", Qr);
|
|
452
452
|
/**
|
|
453
453
|
* @license lucide-react v1.21.0 - ISC
|
|
454
454
|
*
|
|
455
455
|
* This source code is licensed under the ISC license.
|
|
456
456
|
* See the LICENSE file in the root directory of this source tree.
|
|
457
457
|
*/
|
|
458
|
-
const
|
|
458
|
+
const to = [
|
|
459
459
|
["path", { d: "M12 19v3", key: "npa21l" }],
|
|
460
460
|
["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2", key: "1vc78b" }],
|
|
461
461
|
["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3", key: "s6n7sd" }]
|
|
462
|
-
],
|
|
462
|
+
], no = Oe("mic", to);
|
|
463
463
|
/**
|
|
464
464
|
* @license lucide-react v1.21.0 - ISC
|
|
465
465
|
*
|
|
466
466
|
* This source code is licensed under the ISC license.
|
|
467
467
|
* See the LICENSE file in the root directory of this source tree.
|
|
468
468
|
*/
|
|
469
|
-
const
|
|
469
|
+
const ro = [
|
|
470
470
|
[
|
|
471
471
|
"path",
|
|
472
472
|
{
|
|
@@ -475,26 +475,26 @@ const no = [
|
|
|
475
475
|
}
|
|
476
476
|
],
|
|
477
477
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
478
|
-
],
|
|
478
|
+
], oo = Oe("settings", ro);
|
|
479
479
|
/**
|
|
480
480
|
* @license lucide-react v1.21.0 - ISC
|
|
481
481
|
*
|
|
482
482
|
* This source code is licensed under the ISC license.
|
|
483
483
|
* See the LICENSE file in the root directory of this source tree.
|
|
484
484
|
*/
|
|
485
|
-
const
|
|
485
|
+
const ao = [
|
|
486
486
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
487
487
|
["path", { d: "M8 14s1.5 2 4 2 4-2 4-2", key: "1y1vjs" }],
|
|
488
488
|
["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
|
|
489
489
|
["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
|
|
490
|
-
],
|
|
490
|
+
], so = Oe("smile", ao);
|
|
491
491
|
/**
|
|
492
492
|
* @license lucide-react v1.21.0 - ISC
|
|
493
493
|
*
|
|
494
494
|
* This source code is licensed under the ISC license.
|
|
495
495
|
* See the LICENSE file in the root directory of this source tree.
|
|
496
496
|
*/
|
|
497
|
-
const
|
|
497
|
+
const io = [
|
|
498
498
|
[
|
|
499
499
|
"path",
|
|
500
500
|
{
|
|
@@ -504,18 +504,18 @@ const so = [
|
|
|
504
504
|
],
|
|
505
505
|
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
506
506
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
507
|
-
],
|
|
507
|
+
], co = Oe("triangle-alert", io);
|
|
508
508
|
/**
|
|
509
509
|
* @license lucide-react v1.21.0 - ISC
|
|
510
510
|
*
|
|
511
511
|
* This source code is licensed under the ISC license.
|
|
512
512
|
* See the LICENSE file in the root directory of this source tree.
|
|
513
513
|
*/
|
|
514
|
-
const
|
|
514
|
+
const lo = [
|
|
515
515
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
516
516
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
517
|
-
],
|
|
518
|
-
function
|
|
517
|
+
], uo = Oe("x", lo);
|
|
518
|
+
function fo(e, t) {
|
|
519
519
|
if (t) {
|
|
520
520
|
t(e);
|
|
521
521
|
return;
|
|
@@ -533,10 +533,10 @@ const sr = ({
|
|
|
533
533
|
const u = x(null);
|
|
534
534
|
return V(() => {
|
|
535
535
|
if (!e) return;
|
|
536
|
-
const m = (
|
|
537
|
-
u.current && !u.current.contains(
|
|
538
|
-
}, h = (
|
|
539
|
-
|
|
536
|
+
const m = (f) => {
|
|
537
|
+
u.current && !u.current.contains(f.target) && r.current && !r.current.contains(f.target) && t();
|
|
538
|
+
}, h = (f) => {
|
|
539
|
+
f.key === "Escape" && t();
|
|
540
540
|
};
|
|
541
541
|
return document.addEventListener("mousedown", m), document.addEventListener("keydown", h), () => {
|
|
542
542
|
document.removeEventListener("mousedown", m), document.removeEventListener("keydown", h);
|
|
@@ -554,8 +554,8 @@ const sr = ({
|
|
|
554
554
|
href: m.url,
|
|
555
555
|
className: "ask-arbor-settings__item",
|
|
556
556
|
role: "menuitem",
|
|
557
|
-
onClick: (
|
|
558
|
-
|
|
557
|
+
onClick: (f) => {
|
|
558
|
+
f.preventDefault(), t(), fo(m.url, l);
|
|
559
559
|
},
|
|
560
560
|
children: [
|
|
561
561
|
m.icon,
|
|
@@ -568,7 +568,7 @@ const sr = ({
|
|
|
568
568
|
) : null;
|
|
569
569
|
};
|
|
570
570
|
sr.displayName = "AskArborSettings";
|
|
571
|
-
function
|
|
571
|
+
function po(e) {
|
|
572
572
|
const t = Math.floor(e / 60), r = e % 60;
|
|
573
573
|
return `${t}:${r.toString().padStart(2, "0")}`;
|
|
574
574
|
}
|
|
@@ -583,15 +583,15 @@ const ir = Tn(
|
|
|
583
583
|
onMicClick: u,
|
|
584
584
|
onStopClick: m,
|
|
585
585
|
menuContent: h,
|
|
586
|
-
onNavigate:
|
|
586
|
+
onNavigate: f,
|
|
587
587
|
isProcessing: T = !1,
|
|
588
588
|
speechEngaged: A = !1,
|
|
589
589
|
showMicButton: _ = !0,
|
|
590
590
|
ariaLabel: E = "Chat panel input",
|
|
591
591
|
disclaimerText: k = "Ask Arbor can occasionally be wrong. Please check any important information.",
|
|
592
|
-
showDisclaimer:
|
|
593
|
-
},
|
|
594
|
-
const
|
|
592
|
+
showDisclaimer: D = !1
|
|
593
|
+
}, N) => {
|
|
594
|
+
const w = x(null), H = x(null), [pe, z] = M(0), [K, U] = M(!1);
|
|
595
595
|
V(() => {
|
|
596
596
|
if (!A) {
|
|
597
597
|
z(0);
|
|
@@ -602,12 +602,12 @@ const ir = Tn(
|
|
|
602
602
|
z((de) => de + 1);
|
|
603
603
|
}, 1e3);
|
|
604
604
|
return () => clearInterval(G);
|
|
605
|
-
}, [A]),
|
|
605
|
+
}, [A]), Or(N, () => w.current);
|
|
606
606
|
const q = !T && !A && e.trim().length > 0, me = A, J = tr(
|
|
607
607
|
() => (h ?? []).map((G) => ({
|
|
608
608
|
label: G.label,
|
|
609
609
|
icon: /* @__PURE__ */ i(
|
|
610
|
-
|
|
610
|
+
Ot,
|
|
611
611
|
{
|
|
612
612
|
name: G.icon,
|
|
613
613
|
size: 12
|
|
@@ -622,7 +622,7 @@ const ir = Tn(
|
|
|
622
622
|
/* @__PURE__ */ i("div", { className: "ask-arbor-input__input-row", children: /* @__PURE__ */ i(
|
|
623
623
|
"textarea",
|
|
624
624
|
{
|
|
625
|
-
ref:
|
|
625
|
+
ref: w,
|
|
626
626
|
className: "ask-arbor-input__textarea",
|
|
627
627
|
value: e,
|
|
628
628
|
onChange: (G) => t(G.target.value),
|
|
@@ -636,7 +636,7 @@ const ir = Tn(
|
|
|
636
636
|
}
|
|
637
637
|
) }),
|
|
638
638
|
/* @__PURE__ */ i("div", { className: "ask-arbor-input__bottom-actions", children: /* @__PURE__ */ S("div", { className: "ask-arbor-input__actions-right", children: [
|
|
639
|
-
A && /* @__PURE__ */ i("span", { className: "ask-arbor-input__timer", children:
|
|
639
|
+
A && /* @__PURE__ */ i("span", { className: "ask-arbor-input__timer", children: po(pe) }),
|
|
640
640
|
J.length > 0 && /* @__PURE__ */ S("div", { className: "ask-arbor-input__settings-wrap", children: [
|
|
641
641
|
/* @__PURE__ */ i(
|
|
642
642
|
"button",
|
|
@@ -659,7 +659,7 @@ const ir = Tn(
|
|
|
659
659
|
"aria-expanded": K,
|
|
660
660
|
"aria-haspopup": "menu",
|
|
661
661
|
children: /* @__PURE__ */ i(
|
|
662
|
-
|
|
662
|
+
oo,
|
|
663
663
|
{
|
|
664
664
|
size: 12,
|
|
665
665
|
stroke: "#000000"
|
|
@@ -674,7 +674,7 @@ const ir = Tn(
|
|
|
674
674
|
onClose: () => U(!1),
|
|
675
675
|
anchorRef: H,
|
|
676
676
|
items: J,
|
|
677
|
-
onNavigate:
|
|
677
|
+
onNavigate: f
|
|
678
678
|
}
|
|
679
679
|
)
|
|
680
680
|
] }),
|
|
@@ -689,7 +689,7 @@ const ir = Tn(
|
|
|
689
689
|
onClick: u,
|
|
690
690
|
"aria-label": "speak with agent",
|
|
691
691
|
disabled: A || T,
|
|
692
|
-
children: /* @__PURE__ */ i(
|
|
692
|
+
children: /* @__PURE__ */ i(no, { size: 12, stroke: "#3C3735" })
|
|
693
693
|
}
|
|
694
694
|
),
|
|
695
695
|
me && m ? /* @__PURE__ */ S(
|
|
@@ -700,7 +700,7 @@ const ir = Tn(
|
|
|
700
700
|
onClick: m,
|
|
701
701
|
"aria-label": "Stop",
|
|
702
702
|
children: [
|
|
703
|
-
/* @__PURE__ */ i(
|
|
703
|
+
/* @__PURE__ */ i(eo, { size: 12, stroke: "#FFFFFF" }),
|
|
704
704
|
"Stop"
|
|
705
705
|
]
|
|
706
706
|
}
|
|
@@ -713,7 +713,7 @@ const ir = Tn(
|
|
|
713
713
|
disabled: !q,
|
|
714
714
|
"aria-label": "submit message",
|
|
715
715
|
children: /* @__PURE__ */ i(
|
|
716
|
-
|
|
716
|
+
jr,
|
|
717
717
|
{
|
|
718
718
|
size: 12,
|
|
719
719
|
stroke: "#FFFFFF",
|
|
@@ -724,23 +724,23 @@ const ir = Tn(
|
|
|
724
724
|
)
|
|
725
725
|
] }) })
|
|
726
726
|
] }),
|
|
727
|
-
|
|
727
|
+
D && /* @__PURE__ */ i("p", { className: "ask-arbor-input__disclaimer", children: k })
|
|
728
728
|
] });
|
|
729
729
|
}
|
|
730
730
|
);
|
|
731
731
|
ir.displayName = "AskArborInput";
|
|
732
|
-
const
|
|
732
|
+
const Lt = "AGENT", _t = "USER", mn = "INFO", Kt = "WARNING", ve = "ERROR", on = "up", xn = "down", Pn = 10, mo = ({
|
|
733
733
|
message: e,
|
|
734
734
|
onRate: t,
|
|
735
735
|
upRatingPopupUrl: r,
|
|
736
736
|
downRatingPopupUrl: a,
|
|
737
737
|
onRatingPopupOpen: l
|
|
738
738
|
}) => {
|
|
739
|
-
const [s, u] = M(null), m = (
|
|
740
|
-
const T =
|
|
739
|
+
const [s, u] = M(null), m = (f) => {
|
|
740
|
+
const T = f === on ? r : a;
|
|
741
741
|
T != null && T.trim() && (l ? l(T.trim()) : window.open(T.trim(), "_blank", "noopener,noreferrer"));
|
|
742
|
-
}, h = (
|
|
743
|
-
u(
|
|
742
|
+
}, h = (f) => {
|
|
743
|
+
u(f), t(f), m(f);
|
|
744
744
|
};
|
|
745
745
|
return /* @__PURE__ */ S("div", { className: "chat-message__feedback", children: [
|
|
746
746
|
/* @__PURE__ */ i("span", { className: "chat-message__feedback-question", children: "How did Ask Arbor do?" }),
|
|
@@ -761,7 +761,7 @@ const jt = "AGENT", ht = "USER", mn = "INFO", Kt = "WARNING", ve = "ERROR", on =
|
|
|
761
761
|
onClick: () => h(on),
|
|
762
762
|
children: [
|
|
763
763
|
/* @__PURE__ */ i(
|
|
764
|
-
|
|
764
|
+
so,
|
|
765
765
|
{
|
|
766
766
|
size: Pn,
|
|
767
767
|
strokeWidth: 1.5,
|
|
@@ -789,7 +789,7 @@ const jt = "AGENT", ht = "USER", mn = "INFO", Kt = "WARNING", ve = "ERROR", on =
|
|
|
789
789
|
onClick: () => h(xn),
|
|
790
790
|
children: [
|
|
791
791
|
/* @__PURE__ */ i(
|
|
792
|
-
|
|
792
|
+
Xr,
|
|
793
793
|
{
|
|
794
794
|
size: Pn,
|
|
795
795
|
strokeWidth: 1.5,
|
|
@@ -803,7 +803,7 @@ const jt = "AGENT", ht = "USER", mn = "INFO", Kt = "WARNING", ve = "ERROR", on =
|
|
|
803
803
|
)
|
|
804
804
|
] })
|
|
805
805
|
] });
|
|
806
|
-
},
|
|
806
|
+
}, ho = kr, _o = ({ prompt: e, onClick: t }) => /* @__PURE__ */ i(ho, { type: "button", variant: "secondary", size: "S", onClick: () => t(e), children: e }), go = ({
|
|
807
807
|
id: e,
|
|
808
808
|
text: t,
|
|
809
809
|
type: r,
|
|
@@ -813,25 +813,25 @@ const jt = "AGENT", ht = "USER", mn = "INFO", Kt = "WARNING", ve = "ERROR", on =
|
|
|
813
813
|
showRating: u = !1,
|
|
814
814
|
followUpPrompts: m,
|
|
815
815
|
onFollowUpPromptClick: h,
|
|
816
|
-
processCanvasReferences:
|
|
816
|
+
processCanvasReferences: f,
|
|
817
817
|
isFallbackMessage: T,
|
|
818
818
|
onRatingPopupOpen: A,
|
|
819
819
|
children: _
|
|
820
820
|
}) => {
|
|
821
|
-
const E = r ===
|
|
821
|
+
const E = r === Lt, k = /* @__PURE__ */ S(we, { children: [
|
|
822
822
|
/* @__PURE__ */ S(
|
|
823
823
|
"div",
|
|
824
824
|
{
|
|
825
825
|
className: _e("chat-message", {
|
|
826
|
-
"chat-message--user": r ===
|
|
827
|
-
"chat-message--agent": r ===
|
|
826
|
+
"chat-message--user": r === _t,
|
|
827
|
+
"chat-message--agent": r === Lt,
|
|
828
828
|
"chat-message--info": r === mn,
|
|
829
829
|
"chat-message--error": r === ve,
|
|
830
830
|
"chat-message--warning": r === Kt
|
|
831
831
|
}),
|
|
832
832
|
children: [
|
|
833
833
|
r === mn && /* @__PURE__ */ i(
|
|
834
|
-
|
|
834
|
+
Jr,
|
|
835
835
|
{
|
|
836
836
|
className: "chat-message__icon",
|
|
837
837
|
"aria-label": "Information",
|
|
@@ -839,7 +839,7 @@ const jt = "AGENT", ht = "USER", mn = "INFO", Kt = "WARNING", ve = "ERROR", on =
|
|
|
839
839
|
}
|
|
840
840
|
),
|
|
841
841
|
r === Kt && /* @__PURE__ */ i(
|
|
842
|
-
|
|
842
|
+
co,
|
|
843
843
|
{
|
|
844
844
|
className: "chat-message__icon",
|
|
845
845
|
"aria-label": "Warning",
|
|
@@ -847,7 +847,7 @@ const jt = "AGENT", ht = "USER", mn = "INFO", Kt = "WARNING", ve = "ERROR", on =
|
|
|
847
847
|
}
|
|
848
848
|
),
|
|
849
849
|
r === ve && /* @__PURE__ */ i(
|
|
850
|
-
|
|
850
|
+
Vr,
|
|
851
851
|
{
|
|
852
852
|
className: "chat-message__icon",
|
|
853
853
|
"aria-label": "Error",
|
|
@@ -858,7 +858,7 @@ const jt = "AGENT", ht = "USER", mn = "INFO", Kt = "WARNING", ve = "ERROR", on =
|
|
|
858
858
|
"span",
|
|
859
859
|
{
|
|
860
860
|
dangerouslySetInnerHTML: {
|
|
861
|
-
__html:
|
|
861
|
+
__html: f(t)
|
|
862
862
|
}
|
|
863
863
|
}
|
|
864
864
|
)
|
|
@@ -867,32 +867,28 @@ const jt = "AGENT", ht = "USER", mn = "INFO", Kt = "WARNING", ve = "ERROR", on =
|
|
|
867
867
|
),
|
|
868
868
|
E && /* @__PURE__ */ S("div", { className: "chat-message__footer-actions", children: [
|
|
869
869
|
/* @__PURE__ */ i("div", { className: "chat-message__footer-icons", children: u && a && s && /* @__PURE__ */ i(
|
|
870
|
-
|
|
870
|
+
mo,
|
|
871
871
|
{
|
|
872
872
|
upRatingPopupUrl: l.up,
|
|
873
873
|
downRatingPopupUrl: l.down,
|
|
874
874
|
message: { id: e, type: r, text: t },
|
|
875
|
-
onRate: (
|
|
875
|
+
onRate: (D) => a(D, e),
|
|
876
876
|
onRatingPopupOpen: A
|
|
877
877
|
}
|
|
878
878
|
) }),
|
|
879
879
|
/* @__PURE__ */ i("div", { className: "chat-message__follow-up-prompts", children: m && m.length > 0 && !T && /* @__PURE__ */ i("ul", { className: "chat-message__follow-up-prompts-list", children: m.map(
|
|
880
|
-
(
|
|
880
|
+
(D, N) => /* @__PURE__ */ i(
|
|
881
881
|
"li",
|
|
882
882
|
{
|
|
883
883
|
children: /* @__PURE__ */ i(
|
|
884
|
-
|
|
884
|
+
_o,
|
|
885
885
|
{
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
onClick: () => h == null ? void 0 : h(
|
|
889
|
-
O
|
|
890
|
-
),
|
|
891
|
-
children: O
|
|
886
|
+
prompt: D,
|
|
887
|
+
onClick: (w) => h == null ? void 0 : h(w)
|
|
892
888
|
}
|
|
893
889
|
)
|
|
894
890
|
},
|
|
895
|
-
`follow-up-prompt-${
|
|
891
|
+
`follow-up-prompt-${N}`
|
|
896
892
|
)
|
|
897
893
|
) }) })
|
|
898
894
|
] })
|
|
@@ -901,24 +897,24 @@ const jt = "AGENT", ht = "USER", mn = "INFO", Kt = "WARNING", ve = "ERROR", on =
|
|
|
901
897
|
"li",
|
|
902
898
|
{
|
|
903
899
|
className: _e("chat-message-container", {
|
|
904
|
-
"chat-message-container--user": r ===
|
|
900
|
+
"chat-message-container--user": r === _t,
|
|
905
901
|
"chat-message-container--agent": E
|
|
906
902
|
}),
|
|
907
903
|
children: E ? /* @__PURE__ */ i("div", { className: "chat-message-container__content", children: k }) : k
|
|
908
904
|
}
|
|
909
905
|
);
|
|
910
|
-
},
|
|
911
|
-
function
|
|
906
|
+
}, bo = "Not authorised. Your session could have expired or is invalid. Please refresh the page and try again.", yo = "You do not have permission to use this feature. Please contact your administrator if you need access.", To = "The chat service could not be found. Please check your configuration and try again.", Eo = "It looks like this request took too long to complete. Please try again.", Ao = "Whoops! Too many requests. Please wait a moment and try again.", So = "The chat service is temporarily unavailable. Please try again later.", wo = "Unable to reach the chat service. Please check your connection and try again.", cr = "Something went wrong. Please try again later.", No = "Something went wrong while trying to get a new agent message. Please try again later.", Un = "keyboard-shortcut-menu-portal";
|
|
907
|
+
function ko() {
|
|
912
908
|
let e = document.getElementById(Un);
|
|
913
909
|
return e || (e = document.createElement("div"), e.id = Un, e.style.cssText = "position:fixed;left:0;top:0;z-index:19950;pointer-events:none;", document.body.appendChild(e)), e;
|
|
914
910
|
}
|
|
915
911
|
const Vt = 200;
|
|
916
|
-
function
|
|
912
|
+
function Ro(e) {
|
|
917
913
|
const t = window.innerHeight, r = e.top + e.height > t - Vt, a = e.top < Vt;
|
|
918
914
|
return r ? "above" : a ? "below" : "above";
|
|
919
915
|
}
|
|
920
|
-
function
|
|
921
|
-
const t =
|
|
916
|
+
function Io(e) {
|
|
917
|
+
const t = Ro(e), r = 8;
|
|
922
918
|
return t === "below" ? {
|
|
923
919
|
left: e.left,
|
|
924
920
|
width: e.width,
|
|
@@ -938,7 +934,7 @@ function Fn(e, t) {
|
|
|
938
934
|
}
|
|
939
935
|
/^https?:\/\//.test(e) ? window.open(e, "_blank", "noopener,noreferrer") : window.location.href = e;
|
|
940
936
|
}
|
|
941
|
-
const
|
|
937
|
+
const Co = ({
|
|
942
938
|
anchorRef: e,
|
|
943
939
|
...t
|
|
944
940
|
}) => {
|
|
@@ -947,10 +943,10 @@ const ko = ({
|
|
|
947
943
|
);
|
|
948
944
|
if (nr(() => {
|
|
949
945
|
const s = () => {
|
|
950
|
-
const
|
|
951
|
-
if (!
|
|
952
|
-
const T =
|
|
953
|
-
a(
|
|
946
|
+
const f = e.current;
|
|
947
|
+
if (!f) return;
|
|
948
|
+
const T = f.getBoundingClientRect();
|
|
949
|
+
a(Io(T));
|
|
954
950
|
};
|
|
955
951
|
s();
|
|
956
952
|
const u = requestAnimationFrame(() => s()), m = () => s(), h = () => s();
|
|
@@ -966,7 +962,7 @@ const ko = ({
|
|
|
966
962
|
};
|
|
967
963
|
return r.placement === "below" ? l.top = r.top : l.bottom = r.bottom, rr(
|
|
968
964
|
/* @__PURE__ */ i(lr, { ...t, portalStyle: l }),
|
|
969
|
-
|
|
965
|
+
ko()
|
|
970
966
|
);
|
|
971
967
|
}, lr = (e) => {
|
|
972
968
|
const {
|
|
@@ -977,29 +973,29 @@ const ko = ({
|
|
|
977
973
|
anchorRef: s,
|
|
978
974
|
portalStyle: u,
|
|
979
975
|
onNavigate: m
|
|
980
|
-
} = e, [h,
|
|
976
|
+
} = e, [h, f] = M(0), [T, A] = M(""), [_, E] = M(t), k = x(null), D = x(null), N = x(null), [w, H] = M(!1), [pe, z] = M(!1), K = u ? u.top != null : w, U = u ? !0 : pe;
|
|
981
977
|
V(() => {
|
|
982
|
-
|
|
978
|
+
f(0), A("");
|
|
983
979
|
}, []), V(() => {
|
|
984
980
|
u && setTimeout(() => {
|
|
985
981
|
var b;
|
|
986
|
-
return (b =
|
|
982
|
+
return (b = N.current) == null ? void 0 : b.focus();
|
|
987
983
|
}, 0);
|
|
988
984
|
}, [u]), V(() => {
|
|
989
985
|
if (u || s || !k.current) return;
|
|
990
|
-
const b = k.current.getBoundingClientRect(),
|
|
991
|
-
H(re ? !1 : !!
|
|
986
|
+
const b = k.current.getBoundingClientRect(), O = window.innerHeight, B = b.top, re = B + b.height > O - Vt, L = B < Vt;
|
|
987
|
+
H(re ? !1 : !!L), z(!0), setTimeout(() => {
|
|
992
988
|
var W;
|
|
993
|
-
return (W =
|
|
989
|
+
return (W = N.current) == null ? void 0 : W.focus();
|
|
994
990
|
}, 0);
|
|
995
991
|
}, [s]), V(() => {
|
|
996
|
-
if (
|
|
997
|
-
const b =
|
|
992
|
+
if (D.current) {
|
|
993
|
+
const b = D.current.querySelector(
|
|
998
994
|
".keyboard-shortcut-menu__items"
|
|
999
|
-
),
|
|
995
|
+
), O = b == null ? void 0 : b.querySelector(
|
|
1000
996
|
".keyboard-shortcut-menu__item--selected"
|
|
1001
997
|
);
|
|
1002
|
-
|
|
998
|
+
O && O.scrollIntoView({
|
|
1003
999
|
behavior: "smooth",
|
|
1004
1000
|
block: "nearest"
|
|
1005
1001
|
});
|
|
@@ -1012,28 +1008,28 @@ const ko = ({
|
|
|
1012
1008
|
);
|
|
1013
1009
|
}, [T, t]);
|
|
1014
1010
|
const q = (b) => {
|
|
1015
|
-
var
|
|
1016
|
-
r && _[b] && !_[b].link && r(_[b]), a && !((
|
|
1011
|
+
var O;
|
|
1012
|
+
r && _[b] && !_[b].link && r(_[b]), a && !((O = _[b]) != null && O.link) && a();
|
|
1017
1013
|
};
|
|
1018
1014
|
V(() => {
|
|
1019
1015
|
const b = (B) => {
|
|
1020
1016
|
B.key === "Escape" && a && (B.preventDefault(), a());
|
|
1021
|
-
},
|
|
1017
|
+
}, O = (B) => {
|
|
1022
1018
|
k.current && !k.current.contains(B.target) && a && a();
|
|
1023
1019
|
};
|
|
1024
|
-
return document.addEventListener("keydown", b), document.addEventListener("mousedown",
|
|
1025
|
-
document.removeEventListener("keydown", b), document.removeEventListener("mousedown",
|
|
1020
|
+
return document.addEventListener("keydown", b), document.addEventListener("mousedown", O), () => {
|
|
1021
|
+
document.removeEventListener("keydown", b), document.removeEventListener("mousedown", O);
|
|
1026
1022
|
};
|
|
1027
1023
|
}, [a]);
|
|
1028
1024
|
const me = (b) => {
|
|
1029
1025
|
switch (b.key) {
|
|
1030
1026
|
case "ArrowDown":
|
|
1031
|
-
b.preventDefault(),
|
|
1032
|
-
(
|
|
1027
|
+
b.preventDefault(), f(
|
|
1028
|
+
(O) => O < _.length - 1 ? O + 1 : O
|
|
1033
1029
|
);
|
|
1034
1030
|
break;
|
|
1035
1031
|
case "ArrowUp":
|
|
1036
|
-
b.preventDefault(),
|
|
1032
|
+
b.preventDefault(), f((O) => O > 0 ? O - 1 : 0);
|
|
1037
1033
|
break;
|
|
1038
1034
|
case "Enter":
|
|
1039
1035
|
b.preventDefault(), _[h] && (_[h].link ? Fn(
|
|
@@ -1049,10 +1045,10 @@ const ko = ({
|
|
|
1049
1045
|
break;
|
|
1050
1046
|
}
|
|
1051
1047
|
}, J = (b) => {
|
|
1052
|
-
A(b),
|
|
1053
|
-
}, G = (b,
|
|
1054
|
-
const B =
|
|
1055
|
-
/* @__PURE__ */ i(
|
|
1048
|
+
A(b), f(0);
|
|
1049
|
+
}, G = (b, O) => {
|
|
1050
|
+
const B = O === h, re = b.icon ? /* @__PURE__ */ S(we, { children: [
|
|
1051
|
+
/* @__PURE__ */ i(Ot, { name: b.icon, size: 12 }),
|
|
1056
1052
|
/* @__PURE__ */ i("span", { className: "keyboard-shortcut-menu__item-description keyboard-shortcut-menu__item-main", children: b.description })
|
|
1057
1053
|
] }) : /* @__PURE__ */ i(we, { children: l ? /* @__PURE__ */ i(
|
|
1058
1054
|
"span",
|
|
@@ -1066,11 +1062,11 @@ const ko = ({
|
|
|
1066
1062
|
/* @__PURE__ */ i("span", { className: "keyboard-shortcut-menu__item-description keyboard-shortcut-menu__item-secondary", children: b.description })
|
|
1067
1063
|
] }) });
|
|
1068
1064
|
if (b.link) {
|
|
1069
|
-
const
|
|
1065
|
+
const L = b.link.replace(/\/\?/g, "");
|
|
1070
1066
|
return /* @__PURE__ */ i("li", { role: "menuitem", children: /* @__PURE__ */ i(
|
|
1071
1067
|
"a",
|
|
1072
1068
|
{
|
|
1073
|
-
href:
|
|
1069
|
+
href: L,
|
|
1074
1070
|
className: _e(
|
|
1075
1071
|
"keyboard-shortcut-menu__item-main keyboard-shortcut-menu__item",
|
|
1076
1072
|
{
|
|
@@ -1079,7 +1075,7 @@ const ko = ({
|
|
|
1079
1075
|
}
|
|
1080
1076
|
),
|
|
1081
1077
|
onClick: (W) => {
|
|
1082
|
-
W.preventDefault(), Fn(
|
|
1078
|
+
W.preventDefault(), Fn(L, m), a == null || a();
|
|
1083
1079
|
},
|
|
1084
1080
|
children: re
|
|
1085
1081
|
}
|
|
@@ -1113,7 +1109,7 @@ const ko = ({
|
|
|
1113
1109
|
"aria-label": "Keyboard shortcut menu",
|
|
1114
1110
|
"data-testid": "keyboard-shortcut-menu",
|
|
1115
1111
|
ref: k,
|
|
1116
|
-
children: /* @__PURE__ */ S("div", { className: "keyboard-shortcut-menu__content", ref:
|
|
1112
|
+
children: /* @__PURE__ */ S("div", { className: "keyboard-shortcut-menu__content", ref: D, children: [
|
|
1117
1113
|
/* @__PURE__ */ S("div", { className: "keyboard-shortcut-menu__header", children: [
|
|
1118
1114
|
/* @__PURE__ */ i("div", { className: "keyboard-shortcut-menu__search", children: /* @__PURE__ */ i(
|
|
1119
1115
|
"input",
|
|
@@ -1123,7 +1119,7 @@ const ko = ({
|
|
|
1123
1119
|
onChange: (b) => J(b.target.value),
|
|
1124
1120
|
placeholder: "Search...",
|
|
1125
1121
|
autoFocus: !0,
|
|
1126
|
-
ref:
|
|
1122
|
+
ref: N
|
|
1127
1123
|
}
|
|
1128
1124
|
) }),
|
|
1129
1125
|
a && /* @__PURE__ */ i(
|
|
@@ -1134,7 +1130,7 @@ const ko = ({
|
|
|
1134
1130
|
onClick: a,
|
|
1135
1131
|
"aria-label": "Close menu",
|
|
1136
1132
|
children: /* @__PURE__ */ i(
|
|
1137
|
-
|
|
1133
|
+
uo,
|
|
1138
1134
|
{
|
|
1139
1135
|
size: 12,
|
|
1140
1136
|
className: "keyboard-shortcut-menu__close-icon"
|
|
@@ -1157,7 +1153,7 @@ const ko = ({
|
|
|
1157
1153
|
children: "No results found"
|
|
1158
1154
|
}
|
|
1159
1155
|
) : _.map(
|
|
1160
|
-
(b,
|
|
1156
|
+
(b, O) => G(b, O)
|
|
1161
1157
|
)
|
|
1162
1158
|
}
|
|
1163
1159
|
)
|
|
@@ -1165,7 +1161,7 @@ const ko = ({
|
|
|
1165
1161
|
}
|
|
1166
1162
|
);
|
|
1167
1163
|
return s && !u ? /* @__PURE__ */ i(
|
|
1168
|
-
|
|
1164
|
+
Co,
|
|
1169
1165
|
{
|
|
1170
1166
|
anchorRef: s,
|
|
1171
1167
|
menuItems: t,
|
|
@@ -1213,7 +1209,7 @@ const ko = ({
|
|
|
1213
1209
|
)
|
|
1214
1210
|
] })
|
|
1215
1211
|
}
|
|
1216
|
-
),
|
|
1212
|
+
), vo = 4e3, Oo = 500, Lo = 8e3, an = [
|
|
1217
1213
|
"I'm working on it…",
|
|
1218
1214
|
"Generating insights…",
|
|
1219
1215
|
"Piecing things together…",
|
|
@@ -1261,7 +1257,7 @@ const ko = ({
|
|
|
1261
1257
|
"Analysing your query…",
|
|
1262
1258
|
"Analysing results…",
|
|
1263
1259
|
"Working through the details…"
|
|
1264
|
-
],
|
|
1260
|
+
], Do = ({
|
|
1265
1261
|
loadingPhrase: e,
|
|
1266
1262
|
showSpinnerAsIcon: t = !0,
|
|
1267
1263
|
showNotifyLaterButton: r = !1,
|
|
@@ -1270,38 +1266,38 @@ const ko = ({
|
|
|
1270
1266
|
}) => {
|
|
1271
1267
|
const s = () => Math.floor(Math.random() * an.length), u = x(null), [m, h] = M(
|
|
1272
1268
|
e || an[s()]
|
|
1273
|
-
), [
|
|
1269
|
+
), [f, T] = M("fade-in"), [A, _] = M(!1), [E, k] = M(!1);
|
|
1274
1270
|
V(() => {
|
|
1275
1271
|
r || k(!1);
|
|
1276
1272
|
}, [r]), V(() => {
|
|
1277
1273
|
if (!r || !a)
|
|
1278
1274
|
return;
|
|
1279
|
-
const
|
|
1275
|
+
const w = setTimeout(() => {
|
|
1280
1276
|
_(!0);
|
|
1281
|
-
},
|
|
1277
|
+
}, Lo);
|
|
1282
1278
|
return () => {
|
|
1283
|
-
clearTimeout(
|
|
1279
|
+
clearTimeout(w);
|
|
1284
1280
|
};
|
|
1285
1281
|
}, [r, a]);
|
|
1286
|
-
const
|
|
1282
|
+
const D = async () => {
|
|
1287
1283
|
if (!a)
|
|
1288
1284
|
return;
|
|
1289
1285
|
await a() && k(!0);
|
|
1290
|
-
},
|
|
1286
|
+
}, N = () => {
|
|
1291
1287
|
k(!1), l == null || l();
|
|
1292
1288
|
};
|
|
1293
1289
|
return V(() => {
|
|
1294
|
-
let
|
|
1295
|
-
return e ? (h(e), T("fade-in")) :
|
|
1290
|
+
let w = null;
|
|
1291
|
+
return e ? (h(e), T("fade-in")) : w = setInterval(() => {
|
|
1296
1292
|
T("fade-out"), setTimeout(() => {
|
|
1297
1293
|
let H;
|
|
1298
1294
|
do
|
|
1299
1295
|
H = s();
|
|
1300
1296
|
while (H === u.current);
|
|
1301
1297
|
u.current = H, h(an[H]), T("fade-in");
|
|
1302
|
-
},
|
|
1303
|
-
},
|
|
1304
|
-
|
|
1298
|
+
}, Oo);
|
|
1299
|
+
}, vo), () => {
|
|
1300
|
+
w && clearInterval(w);
|
|
1305
1301
|
};
|
|
1306
1302
|
}, [e]), /* @__PURE__ */ S(
|
|
1307
1303
|
"li",
|
|
@@ -1312,7 +1308,7 @@ const ko = ({
|
|
|
1312
1308
|
children: [
|
|
1313
1309
|
/* @__PURE__ */ S("div", { className: "chat-panel__loading-content", children: [
|
|
1314
1310
|
t ? /* @__PURE__ */ i(Hn, { className: "chat-panel__loading-spinner" }) : /* @__PURE__ */ i("span", { className: "chat-panel__loading-spinner-container", children: /* @__PURE__ */ i(Hn, { className: "chat-panel__loading-spinner" }) }),
|
|
1315
|
-
/* @__PURE__ */ i("span", { className: `chat-panel__loading-phrase ${
|
|
1311
|
+
/* @__PURE__ */ i("span", { className: `chat-panel__loading-phrase ${f}`, children: m })
|
|
1316
1312
|
] }),
|
|
1317
1313
|
r && a && A && /* @__PURE__ */ i("div", { className: "chat-panel__notify-later", children: E ? /* @__PURE__ */ S(we, { children: [
|
|
1318
1314
|
/* @__PURE__ */ i("p", { className: "chat-panel__notify-later-message", children: "We'll notify you in the notifications panel on the left of your MIS." }),
|
|
@@ -1321,7 +1317,7 @@ const ko = ({
|
|
|
1321
1317
|
{
|
|
1322
1318
|
type: "button",
|
|
1323
1319
|
className: "chat-panel__notify-later-btn",
|
|
1324
|
-
onClick:
|
|
1320
|
+
onClick: N,
|
|
1325
1321
|
"aria-label": "Got it",
|
|
1326
1322
|
children: "Got it"
|
|
1327
1323
|
}
|
|
@@ -1333,7 +1329,7 @@ const ko = ({
|
|
|
1333
1329
|
{
|
|
1334
1330
|
type: "button",
|
|
1335
1331
|
className: "chat-panel__notify-later-btn",
|
|
1336
|
-
onClick:
|
|
1332
|
+
onClick: D,
|
|
1337
1333
|
"aria-label": "Let me know when it's done",
|
|
1338
1334
|
children: "Let me know when it's done"
|
|
1339
1335
|
}
|
|
@@ -1343,19 +1339,19 @@ const ko = ({
|
|
|
1343
1339
|
}
|
|
1344
1340
|
);
|
|
1345
1341
|
};
|
|
1346
|
-
function
|
|
1342
|
+
function Mo(e) {
|
|
1347
1343
|
V(e, []);
|
|
1348
1344
|
}
|
|
1349
|
-
function
|
|
1345
|
+
function xo() {
|
|
1350
1346
|
const e = x(!1);
|
|
1351
1347
|
return V(() => (e.current = !0, () => {
|
|
1352
1348
|
e.current = !1;
|
|
1353
1349
|
}), []), e;
|
|
1354
1350
|
}
|
|
1355
|
-
function
|
|
1351
|
+
function Po() {
|
|
1356
1352
|
return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).substring(2) + Date.now().toString(36);
|
|
1357
1353
|
}
|
|
1358
|
-
function
|
|
1354
|
+
function Uo(e, t = 0) {
|
|
1359
1355
|
if (typeof e == "number" && e > 0) return e;
|
|
1360
1356
|
if (typeof e == "string") {
|
|
1361
1357
|
const r = parseInt(e, 10);
|
|
@@ -1363,9 +1359,9 @@ function Mo(e, t = 0) {
|
|
|
1363
1359
|
}
|
|
1364
1360
|
return t;
|
|
1365
1361
|
}
|
|
1366
|
-
const
|
|
1367
|
-
function
|
|
1368
|
-
return e.replace(
|
|
1362
|
+
const Fo = /\*\*(.+?)\*\*/g;
|
|
1363
|
+
function Ho(e) {
|
|
1364
|
+
return e.replace(Fo, "<strong>$1</strong>");
|
|
1369
1365
|
}
|
|
1370
1366
|
/*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */
|
|
1371
1367
|
function zn(e, t) {
|
|
@@ -1373,43 +1369,43 @@ function zn(e, t) {
|
|
|
1373
1369
|
for (var r = 0, a = Array(t); r < t; r++) a[r] = e[r];
|
|
1374
1370
|
return a;
|
|
1375
1371
|
}
|
|
1376
|
-
function
|
|
1372
|
+
function zo(e) {
|
|
1377
1373
|
if (Array.isArray(e)) return e;
|
|
1378
1374
|
}
|
|
1379
|
-
function
|
|
1375
|
+
function Go(e, t) {
|
|
1380
1376
|
var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
1381
1377
|
if (r != null) {
|
|
1382
|
-
var a, l, s, u, m = [], h = !0,
|
|
1378
|
+
var a, l, s, u, m = [], h = !0, f = !1;
|
|
1383
1379
|
try {
|
|
1384
1380
|
if (s = (r = r.call(e)).next, t !== 0) for (; !(h = (a = s.call(r)).done) && (m.push(a.value), m.length !== t); h = !0) ;
|
|
1385
1381
|
} catch (T) {
|
|
1386
|
-
|
|
1382
|
+
f = !0, l = T;
|
|
1387
1383
|
} finally {
|
|
1388
1384
|
try {
|
|
1389
1385
|
if (!h && r.return != null && (u = r.return(), Object(u) !== u)) return;
|
|
1390
1386
|
} finally {
|
|
1391
|
-
if (
|
|
1387
|
+
if (f) throw l;
|
|
1392
1388
|
}
|
|
1393
1389
|
}
|
|
1394
1390
|
return m;
|
|
1395
1391
|
}
|
|
1396
1392
|
}
|
|
1397
|
-
function
|
|
1393
|
+
function Bo() {
|
|
1398
1394
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1399
1395
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1400
1396
|
}
|
|
1401
|
-
function
|
|
1402
|
-
return
|
|
1397
|
+
function Wo(e, t) {
|
|
1398
|
+
return zo(e) || Go(e, t) || $o(e, t) || Bo();
|
|
1403
1399
|
}
|
|
1404
|
-
function
|
|
1400
|
+
function $o(e, t) {
|
|
1405
1401
|
if (e) {
|
|
1406
1402
|
if (typeof e == "string") return zn(e, t);
|
|
1407
1403
|
var r = {}.toString.call(e).slice(8, -1);
|
|
1408
1404
|
return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? zn(e, t) : void 0;
|
|
1409
1405
|
}
|
|
1410
1406
|
}
|
|
1411
|
-
const ur = Object.entries, Gn = Object.setPrototypeOf,
|
|
1412
|
-
let se = Object.freeze, ie = Object.seal,
|
|
1407
|
+
const ur = Object.entries, Gn = Object.setPrototypeOf, Yo = Object.isFrozen, jo = Object.getPrototypeOf, Ko = Object.getOwnPropertyDescriptor;
|
|
1408
|
+
let se = Object.freeze, ie = Object.seal, ht = Object.create, dr = typeof Reflect < "u" && Reflect, hn = dr.apply, _n = dr.construct;
|
|
1413
1409
|
se || (se = function(t) {
|
|
1414
1410
|
return t;
|
|
1415
1411
|
});
|
|
@@ -1426,7 +1422,7 @@ _n || (_n = function(t) {
|
|
|
1426
1422
|
a[l - 1] = arguments[l];
|
|
1427
1423
|
return new t(...a);
|
|
1428
1424
|
});
|
|
1429
|
-
const
|
|
1425
|
+
const kt = Z(Array.prototype.forEach), Vo = Z(Array.prototype.lastIndexOf), Bn = Z(Array.prototype.pop), mt = Z(Array.prototype.push), qo = Z(Array.prototype.splice), Be = Array.isArray, vt = Z(String.prototype.toLowerCase), sn = Z(String.prototype.toString), Wn = Z(String.prototype.match), Rt = Z(String.prototype.replace), $n = Z(String.prototype.indexOf), Xo = Z(String.prototype.trim), Zo = Z(Number.prototype.toString), Jo = Z(Boolean.prototype.toString), Yn = typeof BigInt > "u" ? null : Z(BigInt.prototype.toString), jn = typeof Symbol > "u" ? null : Z(Symbol.prototype.toString), ne = Z(Object.prototype.hasOwnProperty), It = Z(Object.prototype.toString), ae = Z(RegExp.prototype.test), Qe = Qo(TypeError);
|
|
1430
1426
|
function Z(e) {
|
|
1431
1427
|
return function(t) {
|
|
1432
1428
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -1435,7 +1431,7 @@ function Z(e) {
|
|
|
1435
1431
|
return hn(e, t, a);
|
|
1436
1432
|
};
|
|
1437
1433
|
}
|
|
1438
|
-
function
|
|
1434
|
+
function Qo(e) {
|
|
1439
1435
|
return function() {
|
|
1440
1436
|
for (var t = arguments.length, r = new Array(t), a = 0; a < t; a++)
|
|
1441
1437
|
r[a] = arguments[a];
|
|
@@ -1443,7 +1439,7 @@ function Xo(e) {
|
|
|
1443
1439
|
};
|
|
1444
1440
|
}
|
|
1445
1441
|
function C(e, t) {
|
|
1446
|
-
let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
1442
|
+
let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : vt;
|
|
1447
1443
|
if (Gn && Gn(e, null), !Be(t))
|
|
1448
1444
|
return e;
|
|
1449
1445
|
let a = t.length;
|
|
@@ -1451,85 +1447,85 @@ function C(e, t) {
|
|
|
1451
1447
|
let l = t[a];
|
|
1452
1448
|
if (typeof l == "string") {
|
|
1453
1449
|
const s = r(l);
|
|
1454
|
-
s !== l && (
|
|
1450
|
+
s !== l && (Yo(t) || (t[a] = s), l = s);
|
|
1455
1451
|
}
|
|
1456
1452
|
e[l] = !0;
|
|
1457
1453
|
}
|
|
1458
1454
|
return e;
|
|
1459
1455
|
}
|
|
1460
|
-
function
|
|
1456
|
+
function ea(e) {
|
|
1461
1457
|
for (let t = 0; t < e.length; t++)
|
|
1462
1458
|
ne(e, t) || (e[t] = null);
|
|
1463
1459
|
return e;
|
|
1464
1460
|
}
|
|
1465
1461
|
function ue(e) {
|
|
1466
|
-
const t =
|
|
1462
|
+
const t = ht(null);
|
|
1467
1463
|
for (const a of ur(e)) {
|
|
1468
|
-
var r =
|
|
1464
|
+
var r = Wo(a, 2);
|
|
1469
1465
|
const l = r[0], s = r[1];
|
|
1470
|
-
ne(e, l) && (Be(s) ? t[l] =
|
|
1466
|
+
ne(e, l) && (Be(s) ? t[l] = ea(s) : s && typeof s == "object" && s.constructor === Object ? t[l] = ue(s) : t[l] = s);
|
|
1471
1467
|
}
|
|
1472
1468
|
return t;
|
|
1473
1469
|
}
|
|
1474
|
-
function
|
|
1470
|
+
function ta(e) {
|
|
1475
1471
|
switch (typeof e) {
|
|
1476
1472
|
case "string":
|
|
1477
1473
|
return e;
|
|
1478
1474
|
case "number":
|
|
1479
|
-
return
|
|
1475
|
+
return Zo(e);
|
|
1480
1476
|
case "boolean":
|
|
1481
|
-
return
|
|
1477
|
+
return Jo(e);
|
|
1482
1478
|
case "bigint":
|
|
1483
1479
|
return Yn ? Yn(e) : "0";
|
|
1484
1480
|
case "symbol":
|
|
1485
1481
|
return jn ? jn(e) : "Symbol()";
|
|
1486
1482
|
case "undefined":
|
|
1487
|
-
return
|
|
1483
|
+
return It(e);
|
|
1488
1484
|
case "function":
|
|
1489
1485
|
case "object": {
|
|
1490
1486
|
if (e === null)
|
|
1491
|
-
return
|
|
1487
|
+
return It(e);
|
|
1492
1488
|
const t = e, r = Ce(t, "toString");
|
|
1493
1489
|
if (typeof r == "function") {
|
|
1494
1490
|
const a = r(t);
|
|
1495
|
-
return typeof a == "string" ? a :
|
|
1491
|
+
return typeof a == "string" ? a : It(a);
|
|
1496
1492
|
}
|
|
1497
|
-
return
|
|
1493
|
+
return It(e);
|
|
1498
1494
|
}
|
|
1499
1495
|
default:
|
|
1500
|
-
return
|
|
1496
|
+
return It(e);
|
|
1501
1497
|
}
|
|
1502
1498
|
}
|
|
1503
1499
|
function Ce(e, t) {
|
|
1504
1500
|
for (; e !== null; ) {
|
|
1505
|
-
const a =
|
|
1501
|
+
const a = Ko(e, t);
|
|
1506
1502
|
if (a) {
|
|
1507
1503
|
if (a.get)
|
|
1508
1504
|
return Z(a.get);
|
|
1509
1505
|
if (typeof a.value == "function")
|
|
1510
1506
|
return Z(a.value);
|
|
1511
1507
|
}
|
|
1512
|
-
e =
|
|
1508
|
+
e = jo(e);
|
|
1513
1509
|
}
|
|
1514
1510
|
function r() {
|
|
1515
1511
|
return null;
|
|
1516
1512
|
}
|
|
1517
1513
|
return r;
|
|
1518
1514
|
}
|
|
1519
|
-
function
|
|
1515
|
+
function na(e) {
|
|
1520
1516
|
try {
|
|
1521
1517
|
return ae(e, ""), !0;
|
|
1522
1518
|
} catch {
|
|
1523
1519
|
return !1;
|
|
1524
1520
|
}
|
|
1525
1521
|
}
|
|
1526
|
-
const Kn = se(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), cn = se(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), ln = se(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]),
|
|
1522
|
+
const Kn = se(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), cn = se(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), ln = se(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), ra = se(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), un = se(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), oa = se(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Vn = se(["#text"]), qn = se(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), dn = se(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Xn = se(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), Yt = se(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), aa = ie(/{{[\w\W]*|^[\w\W]*}}/g), sa = ie(/<%[\w\W]*|^[\w\W]*%>/g), ia = ie(/\${[\w\W]*/g), ca = ie(/^data-[\-\w.\u00B7-\uFFFF]+$/), la = ie(/^aria-[\-\w]+$/), Zn = ie(
|
|
1527
1523
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
1528
1524
|
// eslint-disable-line no-useless-escape
|
|
1529
|
-
),
|
|
1525
|
+
), ua = ie(/^(?:\w+script|data):/i), da = ie(
|
|
1530
1526
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
1531
1527
|
// eslint-disable-line no-control-regex
|
|
1532
|
-
),
|
|
1528
|
+
), fa = ie(/^html$/i), pa = ie(/^[a-z][.\w]*(-[.\w]+)+$/i), Jn = ie(/<[/\w!]/g), ma = ie(/<[/\w]/g), ha = ie(/<\/no(script|embed|frames)/i), _a = ie(/\/>/i), Ie = {
|
|
1533
1529
|
element: 1,
|
|
1534
1530
|
attribute: 2,
|
|
1535
1531
|
text: 3,
|
|
@@ -1545,9 +1541,9 @@ const Kn = se(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
|
|
|
1545
1541
|
documentFragment: 11,
|
|
1546
1542
|
notation: 12
|
|
1547
1543
|
// Deprecated
|
|
1548
|
-
},
|
|
1544
|
+
}, ga = function() {
|
|
1549
1545
|
return typeof window > "u" ? null : window;
|
|
1550
|
-
},
|
|
1546
|
+
}, ba = function(t, r) {
|
|
1551
1547
|
if (typeof t != "object" || typeof t.createPolicy != "function")
|
|
1552
1548
|
return null;
|
|
1553
1549
|
let a = null;
|
|
@@ -1582,19 +1578,19 @@ const Kn = se(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
|
|
|
1582
1578
|
return ne(t, r) && Be(t[r]) ? C(l.base ? ue(l.base) : {}, t[r], l.transform) : a;
|
|
1583
1579
|
};
|
|
1584
1580
|
function fr() {
|
|
1585
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
1586
|
-
const t = (
|
|
1581
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ga();
|
|
1582
|
+
const t = (p) => fr(p);
|
|
1587
1583
|
if (t.version = "3.4.11", t.removed = [], !e || !e.document || e.document.nodeType !== Ie.document || !e.Element)
|
|
1588
1584
|
return t.isSupported = !1, t;
|
|
1589
1585
|
let r = e.document;
|
|
1590
1586
|
const a = r, l = a.currentScript;
|
|
1591
1587
|
e.DocumentFragment;
|
|
1592
|
-
const s = e.HTMLTemplateElement, u = e.Node, m = e.Element, h = e.NodeFilter,
|
|
1593
|
-
|
|
1594
|
-
const T = e.DOMParser, A = e.trustedTypes, _ = m.prototype, E = Ce(_, "cloneNode"), k = Ce(_, "remove"),
|
|
1588
|
+
const s = e.HTMLTemplateElement, u = e.Node, m = e.Element, h = e.NodeFilter, f = e.NamedNodeMap;
|
|
1589
|
+
f === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
|
|
1590
|
+
const T = e.DOMParser, A = e.trustedTypes, _ = m.prototype, E = Ce(_, "cloneNode"), k = Ce(_, "remove"), D = Ce(_, "nextSibling"), N = Ce(_, "childNodes"), w = Ce(_, "parentNode"), H = Ce(_, "shadowRoot"), pe = Ce(_, "attributes"), z = u && u.prototype ? Ce(u.prototype, "nodeType") : null, K = u && u.prototype ? Ce(u.prototype, "nodeName") : null;
|
|
1595
1591
|
if (typeof s == "function") {
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1592
|
+
const p = r.createElement("template");
|
|
1593
|
+
p.content && p.content.ownerDocument && (r = p.content.ownerDocument);
|
|
1598
1594
|
}
|
|
1599
1595
|
let U, q = "", me, J = !1, G = 0;
|
|
1600
1596
|
const de = function() {
|
|
@@ -1607,7 +1603,7 @@ function fr() {
|
|
|
1607
1603
|
} finally {
|
|
1608
1604
|
G--;
|
|
1609
1605
|
}
|
|
1610
|
-
},
|
|
1606
|
+
}, O = function(n) {
|
|
1611
1607
|
de(), G++;
|
|
1612
1608
|
try {
|
|
1613
1609
|
return U.createScriptURL(n);
|
|
@@ -1615,16 +1611,16 @@ function fr() {
|
|
|
1615
1611
|
G--;
|
|
1616
1612
|
}
|
|
1617
1613
|
}, B = function() {
|
|
1618
|
-
return J || (me =
|
|
1619
|
-
}, re = r,
|
|
1614
|
+
return J || (me = ba(A, l), J = !0), me;
|
|
1615
|
+
}, re = r, L = re.implementation, W = re.createNodeIterator, he = re.createDocumentFragment, Le = re.getElementsByTagName, xe = a.importNode;
|
|
1620
1616
|
let F = Qn();
|
|
1621
|
-
t.isSupported = typeof ur == "function" && typeof
|
|
1622
|
-
const oe =
|
|
1617
|
+
t.isSupported = typeof ur == "function" && typeof w == "function" && L && L.createHTMLDocument !== void 0;
|
|
1618
|
+
const oe = aa, gt = sa, Q = ia, bt = ca, qt = la, et = ua, tt = da, We = pa;
|
|
1623
1619
|
let Pe = Zn, P = null;
|
|
1624
|
-
const
|
|
1620
|
+
const nt = C({}, [...Kn, ...cn, ...ln, ...un, ...Vn]);
|
|
1625
1621
|
let Y = null;
|
|
1626
|
-
const
|
|
1627
|
-
let $ = Object.seal(
|
|
1622
|
+
const rt = C({}, [...qn, ...dn, ...Xn, ...Yt]);
|
|
1623
|
+
let $ = Object.seal(ht(null, {
|
|
1628
1624
|
tagNameCheck: {
|
|
1629
1625
|
writable: !0,
|
|
1630
1626
|
configurable: !1,
|
|
@@ -1643,8 +1639,8 @@ function fr() {
|
|
|
1643
1639
|
enumerable: !0,
|
|
1644
1640
|
value: !1
|
|
1645
1641
|
}
|
|
1646
|
-
})), Ne = null,
|
|
1647
|
-
const Ee = Object.seal(
|
|
1642
|
+
})), Ne = null, yt = null;
|
|
1643
|
+
const Ee = Object.seal(ht(null, {
|
|
1648
1644
|
tagCheck: {
|
|
1649
1645
|
writable: !0,
|
|
1650
1646
|
configurable: !1,
|
|
@@ -1658,9 +1654,9 @@ function fr() {
|
|
|
1658
1654
|
value: null
|
|
1659
1655
|
}
|
|
1660
1656
|
}));
|
|
1661
|
-
let
|
|
1662
|
-
const
|
|
1663
|
-
let
|
|
1657
|
+
let Dt = !0, $e = !0, ot = !1, Ue = !0, Ae = !1, Ye = !0, ke = !1, at = !1, je = null, Fe = null, st = !1, De = !1, Ke = !1, it = !1, Tt = !0, Ve = !1;
|
|
1658
|
+
const ct = "user-content-";
|
|
1659
|
+
let Et = !0, lt = !1, He = {}, ge = null;
|
|
1664
1660
|
const qe = C({}, [
|
|
1665
1661
|
"annotation-xml",
|
|
1666
1662
|
"audio",
|
|
@@ -1698,18 +1694,18 @@ function fr() {
|
|
|
1698
1694
|
"video",
|
|
1699
1695
|
"xmp"
|
|
1700
1696
|
]);
|
|
1701
|
-
let
|
|
1697
|
+
let Mt = null;
|
|
1702
1698
|
const Xe = C({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
1703
|
-
let
|
|
1704
|
-
const
|
|
1705
|
-
let be = ee,
|
|
1706
|
-
const Xt = C({}, [Re,
|
|
1707
|
-
let At = C({}, xt);
|
|
1708
|
-
const Pt = se(["annotation-xml"]);
|
|
1699
|
+
let At = null;
|
|
1700
|
+
const xt = C({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Re = "http://www.w3.org/1998/Math/MathML", ut = "http://www.w3.org/2000/svg", ee = "http://www.w3.org/1999/xhtml";
|
|
1701
|
+
let be = ee, dt = !1, ft = null;
|
|
1702
|
+
const Xt = C({}, [Re, ut, ee], sn), Pt = se(["mi", "mo", "mn", "ms", "mtext"]);
|
|
1709
1703
|
let St = C({}, Pt);
|
|
1704
|
+
const Ut = se(["annotation-xml"]);
|
|
1705
|
+
let wt = C({}, Ut);
|
|
1710
1706
|
const Zt = C({}, ["title", "style", "font", "a", "script"]);
|
|
1711
1707
|
let Ze = null;
|
|
1712
|
-
const Jt = ["application/xhtml+xml", "text/html"],
|
|
1708
|
+
const Jt = ["application/xhtml+xml", "text/html"], Ft = "text/html";
|
|
1713
1709
|
let j = null, c = null;
|
|
1714
1710
|
const y = r.createElement("form"), I = function(n) {
|
|
1715
1711
|
return n instanceof RegExp || n instanceof Function;
|
|
@@ -1718,27 +1714,27 @@ function fr() {
|
|
|
1718
1714
|
if (c && c === n)
|
|
1719
1715
|
return;
|
|
1720
1716
|
(!n || typeof n != "object") && (n = {}), n = ue(n), Ze = // eslint-disable-next-line unicorn/prefer-includes
|
|
1721
|
-
Jt.indexOf(n.PARSER_MEDIA_TYPE) === -1 ?
|
|
1717
|
+
Jt.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? Ft : n.PARSER_MEDIA_TYPE, j = Ze === "application/xhtml+xml" ? sn : vt, P = Ge(n, "ALLOWED_TAGS", nt, {
|
|
1722
1718
|
transform: j
|
|
1723
|
-
}), Y = Ge(n, "ALLOWED_ATTR",
|
|
1719
|
+
}), Y = Ge(n, "ALLOWED_ATTR", rt, {
|
|
1724
1720
|
transform: j
|
|
1725
|
-
}),
|
|
1721
|
+
}), ft = Ge(n, "ALLOWED_NAMESPACES", Xt, {
|
|
1726
1722
|
transform: sn
|
|
1727
|
-
}),
|
|
1723
|
+
}), At = Ge(n, "ADD_URI_SAFE_ATTR", xt, {
|
|
1728
1724
|
transform: j,
|
|
1729
|
-
base:
|
|
1730
|
-
}),
|
|
1725
|
+
base: xt
|
|
1726
|
+
}), Mt = Ge(n, "ADD_DATA_URI_TAGS", Xe, {
|
|
1731
1727
|
transform: j,
|
|
1732
1728
|
base: Xe
|
|
1733
1729
|
}), ge = Ge(n, "FORBID_CONTENTS", qe, {
|
|
1734
1730
|
transform: j
|
|
1735
1731
|
}), Ne = Ge(n, "FORBID_TAGS", ue({}), {
|
|
1736
1732
|
transform: j
|
|
1737
|
-
}),
|
|
1733
|
+
}), yt = Ge(n, "FORBID_ATTR", ue({}), {
|
|
1738
1734
|
transform: j
|
|
1739
|
-
}), He = ne(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? ue(n.USE_PROFILES) : n.USE_PROFILES : !1,
|
|
1740
|
-
const o = ne(n, "CUSTOM_ELEMENT_HANDLING") && n.CUSTOM_ELEMENT_HANDLING && typeof n.CUSTOM_ELEMENT_HANDLING == "object" ? ue(n.CUSTOM_ELEMENT_HANDLING) :
|
|
1741
|
-
if ($ =
|
|
1735
|
+
}), He = ne(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? ue(n.USE_PROFILES) : n.USE_PROFILES : !1, Dt = n.ALLOW_ARIA_ATTR !== !1, $e = n.ALLOW_DATA_ATTR !== !1, ot = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Ue = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ae = n.SAFE_FOR_TEMPLATES || !1, Ye = n.SAFE_FOR_XML !== !1, ke = n.WHOLE_DOCUMENT || !1, De = n.RETURN_DOM || !1, Ke = n.RETURN_DOM_FRAGMENT || !1, it = n.RETURN_TRUSTED_TYPE || !1, st = n.FORCE_BODY || !1, Tt = n.SANITIZE_DOM !== !1, Ve = n.SANITIZE_NAMED_PROPS || !1, Et = n.KEEP_CONTENT !== !1, lt = n.IN_PLACE || !1, Pe = na(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : Zn, be = typeof n.NAMESPACE == "string" ? n.NAMESPACE : ee, St = ne(n, "MATHML_TEXT_INTEGRATION_POINTS") && n.MATHML_TEXT_INTEGRATION_POINTS && typeof n.MATHML_TEXT_INTEGRATION_POINTS == "object" ? ue(n.MATHML_TEXT_INTEGRATION_POINTS) : C({}, Pt), wt = ne(n, "HTML_INTEGRATION_POINTS") && n.HTML_INTEGRATION_POINTS && typeof n.HTML_INTEGRATION_POINTS == "object" ? ue(n.HTML_INTEGRATION_POINTS) : C({}, Ut);
|
|
1736
|
+
const o = ne(n, "CUSTOM_ELEMENT_HANDLING") && n.CUSTOM_ELEMENT_HANDLING && typeof n.CUSTOM_ELEMENT_HANDLING == "object" ? ue(n.CUSTOM_ELEMENT_HANDLING) : ht(null);
|
|
1737
|
+
if ($ = ht(null), ne(o, "tagNameCheck") && I(o.tagNameCheck) && ($.tagNameCheck = o.tagNameCheck), ne(o, "attributeNameCheck") && I(o.attributeNameCheck) && ($.attributeNameCheck = o.attributeNameCheck), ne(o, "allowCustomizedBuiltInElements") && typeof o.allowCustomizedBuiltInElements == "boolean" && ($.allowCustomizedBuiltInElements = o.allowCustomizedBuiltInElements), ie($), Ae && ($e = !1), Ke && (De = !0), He && (P = C({}, Vn), Y = ht(null), He.html === !0 && (C(P, Kn), C(Y, qn)), He.svg === !0 && (C(P, cn), C(Y, dn), C(Y, Yt)), He.svgFilters === !0 && (C(P, ln), C(Y, dn), C(Y, Yt)), He.mathMl === !0 && (C(P, un), C(Y, Xn), C(Y, Yt))), Ee.tagCheck = null, Ee.attributeCheck = null, ne(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? Ee.tagCheck = n.ADD_TAGS : Be(n.ADD_TAGS) && (P === nt && (P = ue(P)), C(P, n.ADD_TAGS, j))), ne(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? Ee.attributeCheck = n.ADD_ATTR : Be(n.ADD_ATTR) && (Y === rt && (Y = ue(Y)), C(Y, n.ADD_ATTR, j))), ne(n, "ADD_URI_SAFE_ATTR") && Be(n.ADD_URI_SAFE_ATTR) && C(At, n.ADD_URI_SAFE_ATTR, j), ne(n, "FORBID_CONTENTS") && Be(n.FORBID_CONTENTS) && (ge === qe && (ge = ue(ge)), C(ge, n.FORBID_CONTENTS, j)), ne(n, "ADD_FORBID_CONTENTS") && Be(n.ADD_FORBID_CONTENTS) && (ge === qe && (ge = ue(ge)), C(ge, n.ADD_FORBID_CONTENTS, j)), Et && (P["#text"] = !0), ke && C(P, ["html", "head", "body"]), P.table && (C(P, ["tbody"]), delete Ne.tbody), n.TRUSTED_TYPES_POLICY) {
|
|
1742
1738
|
if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
1743
1739
|
throw Qe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
1744
1740
|
if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
@@ -1752,37 +1748,37 @@ function fr() {
|
|
|
1752
1748
|
}
|
|
1753
1749
|
} else n.TRUSTED_TYPES_POLICY === null ? (U = void 0, q = "") : (U === void 0 && (U = B()), U && typeof q == "string" && (q = b("")));
|
|
1754
1750
|
se && se(n), c = n;
|
|
1755
|
-
}, ye = C({}, [...cn, ...ln, ...
|
|
1756
|
-
return o.namespaceURI === ee ? n === "svg" : o.namespaceURI === Re ? n === "svg" && (d === "annotation-xml" ||
|
|
1751
|
+
}, ye = C({}, [...cn, ...ln, ...ra]), fe = C({}, [...un, ...oa]), Ht = function(n, o, d) {
|
|
1752
|
+
return o.namespaceURI === ee ? n === "svg" : o.namespaceURI === Re ? n === "svg" && (d === "annotation-xml" || St[d]) : !!ye[n];
|
|
1757
1753
|
}, Sn = function(n, o, d) {
|
|
1758
|
-
return o.namespaceURI === ee ? n === "math" : o.namespaceURI ===
|
|
1754
|
+
return o.namespaceURI === ee ? n === "math" : o.namespaceURI === ut ? n === "math" && wt[d] : !!fe[n];
|
|
1759
1755
|
}, wn = function(n, o, d) {
|
|
1760
|
-
return o.namespaceURI ===
|
|
1761
|
-
},
|
|
1762
|
-
let o =
|
|
1756
|
+
return o.namespaceURI === ut && !wt[d] || o.namespaceURI === Re && !St[d] ? !1 : !fe[n] && (Zt[n] || !ye[n]);
|
|
1757
|
+
}, zt = function(n) {
|
|
1758
|
+
let o = w(n);
|
|
1763
1759
|
(!o || !o.tagName) && (o = {
|
|
1764
1760
|
namespaceURI: be,
|
|
1765
1761
|
tagName: "template"
|
|
1766
1762
|
});
|
|
1767
|
-
const d =
|
|
1768
|
-
return
|
|
1763
|
+
const d = vt(n.tagName), g = vt(o.tagName);
|
|
1764
|
+
return ft[n.namespaceURI] ? n.namespaceURI === ut ? Ht(d, o, g) : n.namespaceURI === Re ? Sn(d, o, g) : n.namespaceURI === ee ? wn(d, o, g) : !!(Ze === "application/xhtml+xml" && ft[n.namespaceURI]) : !1;
|
|
1769
1765
|
}, ze = function(n) {
|
|
1770
|
-
|
|
1766
|
+
mt(t.removed, {
|
|
1771
1767
|
element: n
|
|
1772
1768
|
});
|
|
1773
1769
|
try {
|
|
1774
|
-
|
|
1770
|
+
w(n).removeChild(n);
|
|
1775
1771
|
} catch {
|
|
1776
|
-
if (k(n), !
|
|
1772
|
+
if (k(n), !w(n))
|
|
1777
1773
|
throw Qe("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
1778
1774
|
}
|
|
1779
1775
|
}, Nn = function(n) {
|
|
1780
|
-
const o =
|
|
1776
|
+
const o = N(n);
|
|
1781
1777
|
if (o) {
|
|
1782
1778
|
const g = [];
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
}),
|
|
1779
|
+
kt(o, (R) => {
|
|
1780
|
+
mt(g, R);
|
|
1781
|
+
}), kt(g, (R) => {
|
|
1786
1782
|
try {
|
|
1787
1783
|
k(R);
|
|
1788
1784
|
} catch {
|
|
@@ -1801,12 +1797,12 @@ function fr() {
|
|
|
1801
1797
|
}
|
|
1802
1798
|
}, Je = function(n, o) {
|
|
1803
1799
|
try {
|
|
1804
|
-
|
|
1800
|
+
mt(t.removed, {
|
|
1805
1801
|
attribute: o.getAttributeNode(n),
|
|
1806
1802
|
from: o
|
|
1807
1803
|
});
|
|
1808
1804
|
} catch {
|
|
1809
|
-
|
|
1805
|
+
mt(t.removed, {
|
|
1810
1806
|
attribute: null,
|
|
1811
1807
|
from: o
|
|
1812
1808
|
});
|
|
@@ -1838,14 +1834,14 @@ function fr() {
|
|
|
1838
1834
|
for (; o.length > 0; ) {
|
|
1839
1835
|
const d = o.pop();
|
|
1840
1836
|
(z ? z(d) : d.nodeType) === Ie.element && _r(d);
|
|
1841
|
-
const R =
|
|
1837
|
+
const R = N(d);
|
|
1842
1838
|
if (R)
|
|
1843
1839
|
for (let v = R.length - 1; v >= 0; --v)
|
|
1844
1840
|
o.push(R[v]);
|
|
1845
1841
|
}
|
|
1846
1842
|
}, kn = function(n) {
|
|
1847
1843
|
let o = null, d = null;
|
|
1848
|
-
if (
|
|
1844
|
+
if (st)
|
|
1849
1845
|
n = "<remove></remove>" + n;
|
|
1850
1846
|
else {
|
|
1851
1847
|
const v = Wn(n, /^[\r\n\t ]+/);
|
|
@@ -1859,9 +1855,9 @@ function fr() {
|
|
|
1859
1855
|
} catch {
|
|
1860
1856
|
}
|
|
1861
1857
|
if (!o || !o.documentElement) {
|
|
1862
|
-
o =
|
|
1858
|
+
o = L.createDocument(be, "template", null);
|
|
1863
1859
|
try {
|
|
1864
|
-
o.documentElement.innerHTML =
|
|
1860
|
+
o.documentElement.innerHTML = dt ? q : g;
|
|
1865
1861
|
} catch {
|
|
1866
1862
|
}
|
|
1867
1863
|
}
|
|
@@ -1875,8 +1871,8 @@ function fr() {
|
|
|
1875
1871
|
h.SHOW_ELEMENT | h.SHOW_COMMENT | h.SHOW_TEXT | h.SHOW_PROCESSING_INSTRUCTION | h.SHOW_CDATA_SECTION,
|
|
1876
1872
|
null
|
|
1877
1873
|
);
|
|
1878
|
-
},
|
|
1879
|
-
return n =
|
|
1874
|
+
}, Gt = function(n) {
|
|
1875
|
+
return n = Rt(n, oe, " "), n = Rt(n, gt, " "), n = Rt(n, Q, " "), n;
|
|
1880
1876
|
}, Qt = function(n) {
|
|
1881
1877
|
var o;
|
|
1882
1878
|
n.normalize();
|
|
@@ -1889,12 +1885,12 @@ function fr() {
|
|
|
1889
1885
|
);
|
|
1890
1886
|
let g = d.nextNode();
|
|
1891
1887
|
for (; g; )
|
|
1892
|
-
g.data =
|
|
1888
|
+
g.data = Gt(g.data), g = d.nextNode();
|
|
1893
1889
|
const R = (o = n.querySelectorAll) === null || o === void 0 ? void 0 : o.call(n, "template");
|
|
1894
|
-
R &&
|
|
1895
|
-
|
|
1890
|
+
R && kt(R, (v) => {
|
|
1891
|
+
pt(v.content) && Qt(v.content);
|
|
1896
1892
|
});
|
|
1897
|
-
},
|
|
1893
|
+
}, Bt = function(n) {
|
|
1898
1894
|
const o = K ? K(n) : null;
|
|
1899
1895
|
return typeof o != "string" || j(o) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
|
|
1900
1896
|
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
@@ -1919,8 +1915,8 @@ function fr() {
|
|
|
1919
1915
|
// select, etc.) regardless of whether the named child happens to
|
|
1920
1916
|
// carry a numeric .length, which a typeof-based probe would miss
|
|
1921
1917
|
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
1922
|
-
n.childNodes !==
|
|
1923
|
-
},
|
|
1918
|
+
n.childNodes !== N(n);
|
|
1919
|
+
}, pt = function(n) {
|
|
1924
1920
|
if (!z || typeof n != "object" || n === null)
|
|
1925
1921
|
return !1;
|
|
1926
1922
|
try {
|
|
@@ -1928,7 +1924,7 @@ function fr() {
|
|
|
1928
1924
|
} catch {
|
|
1929
1925
|
return !1;
|
|
1930
1926
|
}
|
|
1931
|
-
},
|
|
1927
|
+
}, Nt = function(n) {
|
|
1932
1928
|
if (!z || typeof n != "object" || n === null)
|
|
1933
1929
|
return !1;
|
|
1934
1930
|
try {
|
|
@@ -1937,29 +1933,29 @@ function fr() {
|
|
|
1937
1933
|
return !1;
|
|
1938
1934
|
}
|
|
1939
1935
|
};
|
|
1940
|
-
function Me(
|
|
1941
|
-
|
|
1936
|
+
function Me(p, n, o) {
|
|
1937
|
+
p.length !== 0 && kt(p, (d) => {
|
|
1942
1938
|
d.call(t, n, o, c);
|
|
1943
1939
|
});
|
|
1944
1940
|
}
|
|
1945
1941
|
const br = function(n, o) {
|
|
1946
|
-
return !!(Ye && n.hasChildNodes() && !
|
|
1942
|
+
return !!(Ye && n.hasChildNodes() && !Nt(n.firstElementChild) && ae(Jn, n.textContent) && ae(Jn, n.innerHTML) || Ye && n.namespaceURI === ee && o === "style" && Nt(n.firstElementChild) || n.nodeType === Ie.processingInstruction || Ye && n.nodeType === Ie.comment && ae(ma, n.data));
|
|
1947
1943
|
}, yr = function(n, o) {
|
|
1948
1944
|
if (!Ne[o] && vn(o) && ($.tagNameCheck instanceof RegExp && ae($.tagNameCheck, o) || $.tagNameCheck instanceof Function && $.tagNameCheck(o)))
|
|
1949
1945
|
return !1;
|
|
1950
|
-
if (
|
|
1951
|
-
const d =
|
|
1946
|
+
if (Et && !ge[o]) {
|
|
1947
|
+
const d = w(n), g = N(n);
|
|
1952
1948
|
if (g && d) {
|
|
1953
1949
|
const R = g.length;
|
|
1954
1950
|
for (let v = R - 1; v >= 0; --v) {
|
|
1955
|
-
const te =
|
|
1956
|
-
d.insertBefore(te,
|
|
1951
|
+
const te = lt ? g[v] : E(g[v], !0);
|
|
1952
|
+
d.insertBefore(te, D(n));
|
|
1957
1953
|
}
|
|
1958
1954
|
}
|
|
1959
1955
|
}
|
|
1960
1956
|
return ze(n), !0;
|
|
1961
1957
|
}, In = function(n) {
|
|
1962
|
-
if (Me(F.beforeSanitizeElements, n, null),
|
|
1958
|
+
if (Me(F.beforeSanitizeElements, n, null), Bt(n))
|
|
1963
1959
|
return ze(n), !0;
|
|
1964
1960
|
const o = j(K ? K(n) : n.nodeName);
|
|
1965
1961
|
if (Me(F.uponSanitizeElement, n, {
|
|
@@ -1969,26 +1965,26 @@ function fr() {
|
|
|
1969
1965
|
return ze(n), !0;
|
|
1970
1966
|
if (Ne[o] || !(Ee.tagCheck instanceof Function && Ee.tagCheck(o)) && !P[o])
|
|
1971
1967
|
return yr(n, o);
|
|
1972
|
-
if ((z ? z(n) : n.nodeType) === Ie.element && !
|
|
1968
|
+
if ((z ? z(n) : n.nodeType) === Ie.element && !zt(n) || (o === "noscript" || o === "noembed" || o === "noframes") && ae(ha, n.innerHTML))
|
|
1973
1969
|
return ze(n), !0;
|
|
1974
1970
|
if (Ae && n.nodeType === Ie.text) {
|
|
1975
|
-
const g =
|
|
1976
|
-
n.textContent !== g && (
|
|
1971
|
+
const g = Gt(n.textContent);
|
|
1972
|
+
n.textContent !== g && (mt(t.removed, {
|
|
1977
1973
|
element: n.cloneNode()
|
|
1978
1974
|
}), n.textContent = g);
|
|
1979
1975
|
}
|
|
1980
1976
|
return Me(F.afterSanitizeElements, n, null), !1;
|
|
1981
1977
|
}, Cn = function(n, o, d) {
|
|
1982
|
-
if (
|
|
1978
|
+
if (yt[o] || Tt && (o === "id" || o === "name") && (d in r || d in y))
|
|
1983
1979
|
return !1;
|
|
1984
1980
|
const g = Y[o] || Ee.attributeCheck instanceof Function && Ee.attributeCheck(o, n);
|
|
1985
|
-
if (!($e && ae(
|
|
1986
|
-
if (!(
|
|
1981
|
+
if (!($e && ae(bt, o))) {
|
|
1982
|
+
if (!(Dt && ae(qt, o))) {
|
|
1987
1983
|
if (g) {
|
|
1988
|
-
if (!
|
|
1989
|
-
if (!ae(Pe,
|
|
1990
|
-
if (!((o === "src" || o === "xlink:href" || o === "href") && n !== "script" && $n(d, "data:") === 0 &&
|
|
1991
|
-
if (!(
|
|
1984
|
+
if (!At[o]) {
|
|
1985
|
+
if (!ae(Pe, Rt(d, tt, ""))) {
|
|
1986
|
+
if (!((o === "src" || o === "xlink:href" || o === "href") && n !== "script" && $n(d, "data:") === 0 && Mt[n])) {
|
|
1987
|
+
if (!(ot && !ae(et, Rt(d, tt, "")))) {
|
|
1992
1988
|
if (d)
|
|
1993
1989
|
return !1;
|
|
1994
1990
|
}
|
|
@@ -2007,26 +2003,26 @@ function fr() {
|
|
|
2007
2003
|
}
|
|
2008
2004
|
return !0;
|
|
2009
2005
|
}, Tr = C({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), vn = function(n) {
|
|
2010
|
-
return !Tr[
|
|
2006
|
+
return !Tr[vt(n)] && ae(We, n);
|
|
2011
2007
|
}, Er = function(n, o, d, g) {
|
|
2012
2008
|
if (U && typeof A == "object" && typeof A.getAttributeType == "function" && !d)
|
|
2013
2009
|
switch (A.getAttributeType(n, o)) {
|
|
2014
2010
|
case "TrustedHTML":
|
|
2015
2011
|
return b(g);
|
|
2016
2012
|
case "TrustedScriptURL":
|
|
2017
|
-
return
|
|
2013
|
+
return O(g);
|
|
2018
2014
|
}
|
|
2019
2015
|
return g;
|
|
2020
2016
|
}, Ar = function(n, o, d, g) {
|
|
2021
2017
|
try {
|
|
2022
|
-
d ? n.setAttributeNS(d, o, g) : n.setAttribute(o, g),
|
|
2018
|
+
d ? n.setAttributeNS(d, o, g) : n.setAttribute(o, g), Bt(n) ? ze(n) : Bn(t.removed);
|
|
2023
2019
|
} catch {
|
|
2024
2020
|
Je(o, n);
|
|
2025
2021
|
}
|
|
2026
2022
|
}, On = function(n) {
|
|
2027
2023
|
Me(F.beforeSanitizeAttributes, n, null);
|
|
2028
2024
|
const o = n.attributes;
|
|
2029
|
-
if (!o ||
|
|
2025
|
+
if (!o || Bt(n))
|
|
2030
2026
|
return;
|
|
2031
2027
|
const d = {
|
|
2032
2028
|
attrName: "",
|
|
@@ -2039,8 +2035,8 @@ function fr() {
|
|
|
2039
2035
|
const R = j(n.nodeName);
|
|
2040
2036
|
for (; g--; ) {
|
|
2041
2037
|
const v = o[g], te = v.name, X = v.namespaceURI, Te = v.value, Se = j(te), tn = Te;
|
|
2042
|
-
let le = te === "value" ? tn :
|
|
2043
|
-
if (d.attrName = Se, d.attrValue = le, d.keepAttr = !0, d.forceKeepAttr = void 0, Me(F.uponSanitizeAttribute, n, d), le = d.attrValue, Ve && (Se === "id" || Se === "name") && $n(le,
|
|
2038
|
+
let le = te === "value" ? tn : Xo(tn);
|
|
2039
|
+
if (d.attrName = Se, d.attrValue = le, d.keepAttr = !0, d.forceKeepAttr = void 0, Me(F.uponSanitizeAttribute, n, d), le = d.attrValue, Ve && (Se === "id" || Se === "name") && $n(le, ct) !== 0 && (Je(te, n), le = ct + le), Ye && ae(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, le)) {
|
|
2044
2040
|
Je(te, n);
|
|
2045
2041
|
continue;
|
|
2046
2042
|
}
|
|
@@ -2053,11 +2049,11 @@ function fr() {
|
|
|
2053
2049
|
Je(te, n);
|
|
2054
2050
|
continue;
|
|
2055
2051
|
}
|
|
2056
|
-
if (!Ue && ae(
|
|
2052
|
+
if (!Ue && ae(_a, le)) {
|
|
2057
2053
|
Je(te, n);
|
|
2058
2054
|
continue;
|
|
2059
2055
|
}
|
|
2060
|
-
if (Ae && (le =
|
|
2056
|
+
if (Ae && (le = Gt(le)), !Cn(R, Se, le)) {
|
|
2061
2057
|
Je(te, n);
|
|
2062
2058
|
continue;
|
|
2063
2059
|
}
|
|
@@ -2065,13 +2061,13 @@ function fr() {
|
|
|
2065
2061
|
}
|
|
2066
2062
|
}
|
|
2067
2063
|
Me(F.afterSanitizeAttributes, n, null);
|
|
2068
|
-
},
|
|
2064
|
+
}, Wt = function(n) {
|
|
2069
2065
|
let o = null;
|
|
2070
2066
|
const d = Rn(n);
|
|
2071
2067
|
for (Me(F.beforeSanitizeShadowDOM, n, null); o = d.nextNode(); )
|
|
2072
|
-
if (Me(F.uponSanitizeShadowNode, o, null), In(o), On(o),
|
|
2068
|
+
if (Me(F.uponSanitizeShadowNode, o, null), In(o), On(o), pt(o.content) && Wt(o.content), (z ? z(o) : o.nodeType) === Ie.element) {
|
|
2073
2069
|
const R = H(o);
|
|
2074
|
-
|
|
2070
|
+
pt(R) && (en(R), Wt(R));
|
|
2075
2071
|
}
|
|
2076
2072
|
Me(F.afterSanitizeShadowDOM, n, null);
|
|
2077
2073
|
}, en = function(n) {
|
|
@@ -2082,10 +2078,10 @@ function fr() {
|
|
|
2082
2078
|
for (; o.length > 0; ) {
|
|
2083
2079
|
const d = o.pop();
|
|
2084
2080
|
if (d.shadow) {
|
|
2085
|
-
|
|
2081
|
+
Wt(d.shadow);
|
|
2086
2082
|
continue;
|
|
2087
2083
|
}
|
|
2088
|
-
const g = d.node, v = (z ? z(g) : g.nodeType) === Ie.element, te =
|
|
2084
|
+
const g = d.node, v = (z ? z(g) : g.nodeType) === Ie.element, te = N(g);
|
|
2089
2085
|
if (te)
|
|
2090
2086
|
for (let X = te.length - 1; X >= 0; --X)
|
|
2091
2087
|
o.push({
|
|
@@ -2096,7 +2092,7 @@ function fr() {
|
|
|
2096
2092
|
const X = K ? K(g) : null;
|
|
2097
2093
|
if (typeof X == "string" && j(X) === "template") {
|
|
2098
2094
|
const Te = g.content;
|
|
2099
|
-
|
|
2095
|
+
pt(Te) && o.push({
|
|
2100
2096
|
node: Te,
|
|
2101
2097
|
shadow: null
|
|
2102
2098
|
});
|
|
@@ -2104,7 +2100,7 @@ function fr() {
|
|
|
2104
2100
|
}
|
|
2105
2101
|
if (v) {
|
|
2106
2102
|
const X = H(g);
|
|
2107
|
-
|
|
2103
|
+
pt(X) && o.push({
|
|
2108
2104
|
node: null,
|
|
2109
2105
|
shadow: X
|
|
2110
2106
|
}, {
|
|
@@ -2114,49 +2110,49 @@ function fr() {
|
|
|
2114
2110
|
}
|
|
2115
2111
|
}
|
|
2116
2112
|
};
|
|
2117
|
-
return t.sanitize = function(
|
|
2113
|
+
return t.sanitize = function(p) {
|
|
2118
2114
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = null, d = null, g = null, R = null;
|
|
2119
|
-
if (
|
|
2115
|
+
if (dt = !p, dt && (p = "<!-->"), typeof p != "string" && !Nt(p) && (p = ta(p), typeof p != "string"))
|
|
2120
2116
|
throw Qe("dirty is not a string, aborting");
|
|
2121
2117
|
if (!t.isSupported)
|
|
2122
|
-
return
|
|
2123
|
-
|
|
2124
|
-
const v =
|
|
2118
|
+
return p;
|
|
2119
|
+
at ? (P = je, Y = Fe) : ce(n), (F.uponSanitizeElement.length > 0 || F.uponSanitizeAttribute.length > 0) && (P = ue(P)), F.uponSanitizeAttribute.length > 0 && (Y = ue(Y)), t.removed = [];
|
|
2120
|
+
const v = lt && typeof p != "string" && Nt(p);
|
|
2125
2121
|
if (v) {
|
|
2126
|
-
const Te = K ? K(
|
|
2122
|
+
const Te = K ? K(p) : p.nodeName;
|
|
2127
2123
|
if (typeof Te == "string") {
|
|
2128
2124
|
const Se = j(Te);
|
|
2129
2125
|
if (!P[Se] || Ne[Se])
|
|
2130
2126
|
throw Qe("root node is forbidden and cannot be sanitized in-place");
|
|
2131
2127
|
}
|
|
2132
|
-
if (
|
|
2128
|
+
if (Bt(p))
|
|
2133
2129
|
throw Qe("root node is clobbered and cannot be sanitized in-place");
|
|
2134
2130
|
try {
|
|
2135
|
-
en(
|
|
2131
|
+
en(p);
|
|
2136
2132
|
} catch (Se) {
|
|
2137
|
-
throw Nn(
|
|
2133
|
+
throw Nn(p), Se;
|
|
2138
2134
|
}
|
|
2139
|
-
} else if (
|
|
2140
|
-
o = kn("<!---->"), d = o.ownerDocument.importNode(
|
|
2135
|
+
} else if (Nt(p))
|
|
2136
|
+
o = kn("<!---->"), d = o.ownerDocument.importNode(p, !0), d.nodeType === Ie.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? o = d : o.appendChild(d), en(d);
|
|
2141
2137
|
else {
|
|
2142
2138
|
if (!De && !Ae && !ke && // eslint-disable-next-line unicorn/prefer-includes
|
|
2143
|
-
|
|
2144
|
-
return U &&
|
|
2145
|
-
if (o = kn(
|
|
2146
|
-
return De ? null :
|
|
2139
|
+
p.indexOf("<") === -1)
|
|
2140
|
+
return U && it ? b(p) : p;
|
|
2141
|
+
if (o = kn(p), !o)
|
|
2142
|
+
return De ? null : it ? q : "";
|
|
2147
2143
|
}
|
|
2148
|
-
o &&
|
|
2149
|
-
const te = Rn(v ?
|
|
2144
|
+
o && st && ze(o.firstChild);
|
|
2145
|
+
const te = Rn(v ? p : o);
|
|
2150
2146
|
try {
|
|
2151
2147
|
for (; g = te.nextNode(); )
|
|
2152
|
-
In(g), On(g),
|
|
2148
|
+
In(g), On(g), pt(g.content) && Wt(g.content);
|
|
2153
2149
|
} catch (Te) {
|
|
2154
|
-
throw v && Nn(
|
|
2150
|
+
throw v && Nn(p), Te;
|
|
2155
2151
|
}
|
|
2156
2152
|
if (v)
|
|
2157
|
-
return
|
|
2153
|
+
return kt(t.removed, (Te) => {
|
|
2158
2154
|
Te.element && gr(Te.element);
|
|
2159
|
-
}), Ae && Qt(
|
|
2155
|
+
}), Ae && Qt(p), p;
|
|
2160
2156
|
if (De) {
|
|
2161
2157
|
if (Ae && Qt(o), Ke)
|
|
2162
2158
|
for (R = he.call(o.ownerDocument); o.firstChild; )
|
|
@@ -2166,35 +2162,35 @@ function fr() {
|
|
|
2166
2162
|
return (Y.shadowroot || Y.shadowrootmode) && (R = xe.call(a, R, !0)), R;
|
|
2167
2163
|
}
|
|
2168
2164
|
let X = ke ? o.outerHTML : o.innerHTML;
|
|
2169
|
-
return ke && P["!doctype"] && o.ownerDocument && o.ownerDocument.doctype && o.ownerDocument.doctype.name && ae(
|
|
2170
|
-
` + X), Ae && (X =
|
|
2165
|
+
return ke && P["!doctype"] && o.ownerDocument && o.ownerDocument.doctype && o.ownerDocument.doctype.name && ae(fa, o.ownerDocument.doctype.name) && (X = "<!DOCTYPE " + o.ownerDocument.doctype.name + `>
|
|
2166
|
+
` + X), Ae && (X = Gt(X)), U && it ? b(X) : X;
|
|
2171
2167
|
}, t.setConfig = function() {
|
|
2172
|
-
let
|
|
2173
|
-
ce(
|
|
2168
|
+
let p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2169
|
+
ce(p), at = !0, je = P, Fe = Y;
|
|
2174
2170
|
}, t.clearConfig = function() {
|
|
2175
|
-
c = null,
|
|
2176
|
-
}, t.isValidAttribute = function(
|
|
2171
|
+
c = null, at = !1, je = null, Fe = null, U = me, q = "";
|
|
2172
|
+
}, t.isValidAttribute = function(p, n, o) {
|
|
2177
2173
|
c || ce({});
|
|
2178
|
-
const d = j(
|
|
2174
|
+
const d = j(p), g = j(n);
|
|
2179
2175
|
return Cn(d, g, o);
|
|
2180
|
-
}, t.addHook = function(
|
|
2181
|
-
typeof n == "function" && ne(F,
|
|
2182
|
-
}, t.removeHook = function(
|
|
2183
|
-
if (ne(F,
|
|
2176
|
+
}, t.addHook = function(p, n) {
|
|
2177
|
+
typeof n == "function" && ne(F, p) && mt(F[p], n);
|
|
2178
|
+
}, t.removeHook = function(p, n) {
|
|
2179
|
+
if (ne(F, p)) {
|
|
2184
2180
|
if (n !== void 0) {
|
|
2185
|
-
const o =
|
|
2186
|
-
return o === -1 ? void 0 :
|
|
2181
|
+
const o = Vo(F[p], n);
|
|
2182
|
+
return o === -1 ? void 0 : qo(F[p], o, 1)[0];
|
|
2187
2183
|
}
|
|
2188
|
-
return Bn(F[
|
|
2184
|
+
return Bn(F[p]);
|
|
2189
2185
|
}
|
|
2190
|
-
}, t.removeHooks = function(
|
|
2191
|
-
ne(F,
|
|
2186
|
+
}, t.removeHooks = function(p) {
|
|
2187
|
+
ne(F, p) && (F[p] = []);
|
|
2192
2188
|
}, t.removeAllHooks = function() {
|
|
2193
2189
|
F = Qn();
|
|
2194
2190
|
}, t;
|
|
2195
2191
|
}
|
|
2196
|
-
var
|
|
2197
|
-
const
|
|
2192
|
+
var jt = fr();
|
|
2193
|
+
const ya = [
|
|
2198
2194
|
"a",
|
|
2199
2195
|
"b",
|
|
2200
2196
|
"br",
|
|
@@ -2210,18 +2206,18 @@ const _a = [
|
|
|
2210
2206
|
"u",
|
|
2211
2207
|
"ul"
|
|
2212
2208
|
];
|
|
2213
|
-
function
|
|
2209
|
+
function Ta(e) {
|
|
2214
2210
|
e.hasAttribute("href") && (e.setAttribute("target", "_blank"), e.setAttribute("rel", "noopener noreferrer"));
|
|
2215
2211
|
}
|
|
2216
|
-
function
|
|
2217
|
-
|
|
2218
|
-
const t =
|
|
2219
|
-
ALLOWED_TAGS: [...
|
|
2212
|
+
function Ea(e) {
|
|
2213
|
+
jt.addHook("afterSanitizeAttributes", Ta);
|
|
2214
|
+
const t = jt.sanitize(e, {
|
|
2215
|
+
ALLOWED_TAGS: [...ya]
|
|
2220
2216
|
});
|
|
2221
|
-
return
|
|
2217
|
+
return jt.removeHook("afterSanitizeAttributes"), t;
|
|
2222
2218
|
}
|
|
2223
|
-
function
|
|
2224
|
-
return
|
|
2219
|
+
function Aa(e) {
|
|
2220
|
+
return jt.sanitize(e, { ALLOWED_TAGS: [] });
|
|
2225
2221
|
}
|
|
2226
2222
|
class En extends Error {
|
|
2227
2223
|
constructor(t, r) {
|
|
@@ -2253,13 +2249,13 @@ function gn(e) {
|
|
|
2253
2249
|
return e;
|
|
2254
2250
|
}
|
|
2255
2251
|
}
|
|
2256
|
-
function
|
|
2252
|
+
function Sa(e) {
|
|
2257
2253
|
return e.includes("/chat/agent-completions");
|
|
2258
2254
|
}
|
|
2259
2255
|
function hr(e) {
|
|
2260
2256
|
return /\/conversations(?:\/|$)/.test(e.replace(/\?.*$/, ""));
|
|
2261
2257
|
}
|
|
2262
|
-
const
|
|
2258
|
+
const Ct = {
|
|
2263
2259
|
model: "gpt-4o-mini",
|
|
2264
2260
|
agentName: "Group_Ask_Arbor_Agent",
|
|
2265
2261
|
systemPrompt: "You are a helpful AI assistant for Arbor Education group MIS users.",
|
|
@@ -2271,16 +2267,16 @@ const It = {
|
|
|
2271
2267
|
{ server: "statsapi", tools: ["*"] },
|
|
2272
2268
|
{ server: "arbormis", tools: ["create_pdf", "academic_date_range_finder"] }
|
|
2273
2269
|
]
|
|
2274
|
-
}, bn = "user",
|
|
2275
|
-
function
|
|
2270
|
+
}, bn = "user", wa = "assistant", Na = "system";
|
|
2271
|
+
function ka({
|
|
2276
2272
|
chatId: e,
|
|
2277
2273
|
userMessage: t,
|
|
2278
2274
|
chatHistory: r = [],
|
|
2279
2275
|
config: a = {}
|
|
2280
2276
|
}) {
|
|
2281
|
-
const l = a.model ??
|
|
2282
|
-
messages:
|
|
2283
|
-
{ role:
|
|
2277
|
+
const l = a.model ?? Ct.model, s = a.agentName ?? Ct.agentName, u = a.systemPrompt ?? Ct.systemPrompt, m = a.modelKwargs ?? Ct.modelKwargs, h = a.mcps ?? [...Ct.mcps], f = !e && r.length === 0, A = {
|
|
2278
|
+
messages: f ? [
|
|
2279
|
+
{ role: Na, content: u },
|
|
2284
2280
|
{ role: bn, content: t }
|
|
2285
2281
|
] : [{ role: bn, content: t }],
|
|
2286
2282
|
model: l,
|
|
@@ -2292,9 +2288,9 @@ function Sa({
|
|
|
2292
2288
|
},
|
|
2293
2289
|
moderation_enabled: !0
|
|
2294
2290
|
};
|
|
2295
|
-
return e && (A.chat_id = e),
|
|
2291
|
+
return e && (A.chat_id = e), f && (A.auto_title = !1), A;
|
|
2296
2292
|
}
|
|
2297
|
-
function
|
|
2293
|
+
function Ra(e) {
|
|
2298
2294
|
const t = e.trim();
|
|
2299
2295
|
if (!t.startsWith("data:")) return null;
|
|
2300
2296
|
const r = t.slice(5).trim();
|
|
@@ -2305,10 +2301,10 @@ function wa(e) {
|
|
|
2305
2301
|
return null;
|
|
2306
2302
|
}
|
|
2307
2303
|
}
|
|
2308
|
-
async function
|
|
2309
|
-
var
|
|
2304
|
+
async function Ia(e) {
|
|
2305
|
+
var f, T, A;
|
|
2310
2306
|
if ((e.headers.get("content-type") ?? "").includes("application/json")) {
|
|
2311
|
-
const E = (
|
|
2307
|
+
const E = (f = (await e.json()).items) == null ? void 0 : f[0];
|
|
2312
2308
|
return E ? {
|
|
2313
2309
|
text: E.text ?? E.content ?? "",
|
|
2314
2310
|
chatId: E.chatId,
|
|
@@ -2326,26 +2322,26 @@ async function Na(e) {
|
|
|
2326
2322
|
const k = l.split(`
|
|
2327
2323
|
`);
|
|
2328
2324
|
l = k.pop() ?? "";
|
|
2329
|
-
for (const
|
|
2330
|
-
const
|
|
2331
|
-
if (
|
|
2325
|
+
for (const D of k) {
|
|
2326
|
+
const N = D.trim();
|
|
2327
|
+
if (N === "event: error") {
|
|
2332
2328
|
h = !0;
|
|
2333
2329
|
continue;
|
|
2334
2330
|
}
|
|
2335
|
-
const
|
|
2336
|
-
if (!
|
|
2337
|
-
if (
|
|
2331
|
+
const w = Ra(N);
|
|
2332
|
+
if (!w) continue;
|
|
2333
|
+
if (w.error || h)
|
|
2338
2334
|
throw new Error(
|
|
2339
|
-
|
|
2335
|
+
w.message_text ?? (typeof w.message == "string" ? w.message : "Agent completion stream failed")
|
|
2340
2336
|
);
|
|
2341
|
-
h = !1,
|
|
2342
|
-
const H = (A =
|
|
2343
|
-
H && (s =
|
|
2337
|
+
h = !1, w.chat_id && (u = w.chat_id), w.event_id && (m = w.event_id), w.client_message_id && (m = w.client_message_id);
|
|
2338
|
+
const H = (A = w.message) == null ? void 0 : A.content;
|
|
2339
|
+
H && (s = w.is_final ? H : s + H);
|
|
2344
2340
|
}
|
|
2345
2341
|
}
|
|
2346
2342
|
return s ? { text: s, chatId: u, messageId: m } : null;
|
|
2347
2343
|
}
|
|
2348
|
-
async function
|
|
2344
|
+
async function Ca({
|
|
2349
2345
|
chatUrl: e,
|
|
2350
2346
|
chatId: t,
|
|
2351
2347
|
userMessage: r,
|
|
@@ -2353,7 +2349,7 @@ async function ka({
|
|
|
2353
2349
|
authorizationToken: l,
|
|
2354
2350
|
config: s
|
|
2355
2351
|
}) {
|
|
2356
|
-
const u =
|
|
2352
|
+
const u = ka({
|
|
2357
2353
|
chatId: t,
|
|
2358
2354
|
userMessage: r,
|
|
2359
2355
|
chatHistory: a,
|
|
@@ -2370,39 +2366,39 @@ async function ka({
|
|
|
2370
2366
|
});
|
|
2371
2367
|
if (!m.ok)
|
|
2372
2368
|
throw new En(m.status, m.statusText);
|
|
2373
|
-
return
|
|
2369
|
+
return Ia(m);
|
|
2374
2370
|
}
|
|
2375
|
-
function
|
|
2371
|
+
function va(e) {
|
|
2376
2372
|
switch (e) {
|
|
2377
2373
|
case 401:
|
|
2378
2374
|
return {
|
|
2379
|
-
text:
|
|
2375
|
+
text: bo,
|
|
2380
2376
|
type: ve
|
|
2381
2377
|
};
|
|
2382
2378
|
case 403:
|
|
2383
2379
|
return {
|
|
2384
|
-
text:
|
|
2380
|
+
text: yo,
|
|
2385
2381
|
type: ve
|
|
2386
2382
|
};
|
|
2387
2383
|
case 404:
|
|
2388
2384
|
return {
|
|
2389
|
-
text:
|
|
2385
|
+
text: To,
|
|
2390
2386
|
type: ve
|
|
2391
2387
|
};
|
|
2392
2388
|
case 408:
|
|
2393
2389
|
case 504:
|
|
2394
2390
|
return {
|
|
2395
|
-
text:
|
|
2391
|
+
text: Eo,
|
|
2396
2392
|
type: Kt
|
|
2397
2393
|
};
|
|
2398
2394
|
case 429:
|
|
2399
2395
|
return {
|
|
2400
|
-
text:
|
|
2396
|
+
text: Ao,
|
|
2401
2397
|
type: Kt
|
|
2402
2398
|
};
|
|
2403
2399
|
default:
|
|
2404
2400
|
return e >= 500 ? {
|
|
2405
|
-
text:
|
|
2401
|
+
text: So,
|
|
2406
2402
|
type: ve
|
|
2407
2403
|
} : {
|
|
2408
2404
|
text: cr,
|
|
@@ -2410,16 +2406,16 @@ function Ra(e) {
|
|
|
2410
2406
|
};
|
|
2411
2407
|
}
|
|
2412
2408
|
}
|
|
2413
|
-
function
|
|
2414
|
-
return e instanceof En ?
|
|
2415
|
-
text:
|
|
2409
|
+
function Oa(e) {
|
|
2410
|
+
return e instanceof En ? va(e.status) : e instanceof TypeError ? {
|
|
2411
|
+
text: wo,
|
|
2416
2412
|
type: ve
|
|
2417
2413
|
} : {
|
|
2418
2414
|
text: cr,
|
|
2419
2415
|
type: ve
|
|
2420
2416
|
};
|
|
2421
2417
|
}
|
|
2422
|
-
const
|
|
2418
|
+
const La = 55e3, yn = "fallback", Da = async ({
|
|
2423
2419
|
chatId: e = void 0,
|
|
2424
2420
|
chatUrl: t,
|
|
2425
2421
|
userMessage: r,
|
|
@@ -2431,8 +2427,8 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2431
2427
|
}) => {
|
|
2432
2428
|
let h;
|
|
2433
2429
|
try {
|
|
2434
|
-
if (
|
|
2435
|
-
const
|
|
2430
|
+
if (Sa(t)) {
|
|
2431
|
+
const N = await Ca({
|
|
2436
2432
|
chatUrl: t,
|
|
2437
2433
|
chatId: e,
|
|
2438
2434
|
userMessage: r,
|
|
@@ -2440,11 +2436,11 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2440
2436
|
authorizationToken: u,
|
|
2441
2437
|
config: m
|
|
2442
2438
|
});
|
|
2443
|
-
return
|
|
2444
|
-
text:
|
|
2445
|
-
id:
|
|
2446
|
-
...
|
|
2447
|
-
type:
|
|
2439
|
+
return N ? {
|
|
2440
|
+
text: N.text,
|
|
2441
|
+
id: N.messageId,
|
|
2442
|
+
...N.chatId != null && { chatId: N.chatId },
|
|
2443
|
+
type: Lt
|
|
2448
2444
|
} : null;
|
|
2449
2445
|
}
|
|
2450
2446
|
const _ = {
|
|
@@ -2457,9 +2453,9 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2457
2453
|
t,
|
|
2458
2454
|
_,
|
|
2459
2455
|
{ authorizationToken: u, signal: E.signal }
|
|
2460
|
-
),
|
|
2461
|
-
(
|
|
2462
|
-
E.abort(),
|
|
2456
|
+
), D = new Promise(
|
|
2457
|
+
(N) => setTimeout(() => {
|
|
2458
|
+
E.abort(), N({
|
|
2463
2459
|
items: [
|
|
2464
2460
|
{
|
|
2465
2461
|
id: yn,
|
|
@@ -2468,38 +2464,39 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2468
2464
|
}
|
|
2469
2465
|
]
|
|
2470
2466
|
});
|
|
2471
|
-
},
|
|
2467
|
+
}, La)
|
|
2472
2468
|
);
|
|
2473
|
-
h = await Promise.race([k,
|
|
2469
|
+
h = await Promise.race([k, D]);
|
|
2474
2470
|
} catch (_) {
|
|
2475
2471
|
console.error("Error in getNewAgentMessage", _);
|
|
2476
|
-
const { text: E, type: k } =
|
|
2472
|
+
const { text: E, type: k } = Oa(_);
|
|
2477
2473
|
return {
|
|
2478
2474
|
text: E,
|
|
2479
2475
|
type: k,
|
|
2480
2476
|
id: crypto.randomUUID()
|
|
2481
2477
|
};
|
|
2482
2478
|
}
|
|
2483
|
-
const
|
|
2484
|
-
if (!
|
|
2485
|
-
const T =
|
|
2486
|
-
typeof
|
|
2479
|
+
const f = h.items[0];
|
|
2480
|
+
if (!f) return null;
|
|
2481
|
+
const T = f.text != null && f.text !== "" ? f.text : gn(
|
|
2482
|
+
typeof f.content == "string" ? f.content : ""
|
|
2487
2483
|
);
|
|
2488
2484
|
return {
|
|
2489
2485
|
text: typeof T == "string" ? T : "",
|
|
2490
|
-
id:
|
|
2491
|
-
...
|
|
2492
|
-
...
|
|
2493
|
-
...
|
|
2494
|
-
...
|
|
2495
|
-
type:
|
|
2496
|
-
...
|
|
2486
|
+
id: f.id,
|
|
2487
|
+
...f.chatId != null && { chatId: f.chatId },
|
|
2488
|
+
...f.timedOut != null && { timedOut: f.timedOut },
|
|
2489
|
+
...f.deferred != null && { deferred: f.deferred },
|
|
2490
|
+
...f.hardStopped != null && { hardStopped: f.hardStopped },
|
|
2491
|
+
type: f.type,
|
|
2492
|
+
...f.element != null && { element: f.element },
|
|
2493
|
+
...f.followUpPrompts != null && { followUpPrompts: f.followUpPrompts }
|
|
2497
2494
|
};
|
|
2498
|
-
},
|
|
2495
|
+
}, Ma = (e) => new Date(e).toLocaleDateString("en-GB", {
|
|
2499
2496
|
day: "numeric",
|
|
2500
2497
|
month: "short",
|
|
2501
2498
|
year: "numeric"
|
|
2502
|
-
}),
|
|
2499
|
+
}), xa = [
|
|
2503
2500
|
{
|
|
2504
2501
|
field: "title",
|
|
2505
2502
|
headerName: "Conversation",
|
|
@@ -2509,15 +2506,25 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2509
2506
|
field: "updatedAt",
|
|
2510
2507
|
headerName: "Last Conversation",
|
|
2511
2508
|
width: 140,
|
|
2512
|
-
valueFormatter: ({ value: e }) =>
|
|
2509
|
+
valueFormatter: ({ value: e }) => Ma(e)
|
|
2513
2510
|
}
|
|
2514
|
-
],
|
|
2511
|
+
], Pa = {
|
|
2515
2512
|
sortable: !1,
|
|
2516
2513
|
filter: !1,
|
|
2517
2514
|
resizable: !1,
|
|
2518
2515
|
editable: !1,
|
|
2519
2516
|
suppressHeaderMenuButton: !0
|
|
2520
|
-
},
|
|
2517
|
+
}, Ua = (e) => {
|
|
2518
|
+
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
2519
|
+
const r = e[t];
|
|
2520
|
+
if (r.type === Lt)
|
|
2521
|
+
return r.followUpPrompts ?? null;
|
|
2522
|
+
}
|
|
2523
|
+
return null;
|
|
2524
|
+
}, Fa = (e, t, r) => {
|
|
2525
|
+
if (r)
|
|
2526
|
+
return e !== null && e.length > 0 ? e : e === null ? null : t.followUpPrompts;
|
|
2527
|
+
}, fn = "NONE", Ha = "KEYBOARD", za = "VOICE", Ga = "MIXED", Ba = 2e4, Wa = 15, $a = (e, t) => new Promise((r) => {
|
|
2521
2528
|
if (t != null && t.aborted) {
|
|
2522
2529
|
r(!1);
|
|
2523
2530
|
return;
|
|
@@ -2528,7 +2535,7 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2528
2535
|
clearTimeout(a), r(!1);
|
|
2529
2536
|
};
|
|
2530
2537
|
t == null || t.addEventListener("abort", l);
|
|
2531
|
-
}),
|
|
2538
|
+
}), Ya = ({
|
|
2532
2539
|
title: e,
|
|
2533
2540
|
connector: t,
|
|
2534
2541
|
newChatUrl: r,
|
|
@@ -2538,15 +2545,15 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2538
2545
|
speechEnabled: u = !0,
|
|
2539
2546
|
speechLanguage: m = "en-GB",
|
|
2540
2547
|
speechSubmissionDelay: h = 1e3,
|
|
2541
|
-
chatHistory:
|
|
2548
|
+
chatHistory: f,
|
|
2542
2549
|
canvasHistory: T,
|
|
2543
2550
|
refreshAgentMessages: A,
|
|
2544
2551
|
startQuery: _,
|
|
2545
2552
|
slashMenuItems: E,
|
|
2546
2553
|
menuContent: k,
|
|
2547
|
-
samplePrompts:
|
|
2548
|
-
dailyPrompt:
|
|
2549
|
-
prompts:
|
|
2554
|
+
samplePrompts: D,
|
|
2555
|
+
dailyPrompt: N,
|
|
2556
|
+
prompts: w,
|
|
2550
2557
|
promptLibrary: H,
|
|
2551
2558
|
placeholder: pe = "Explain what you need in your own words...",
|
|
2552
2559
|
introHeading: z = "Get instant answers from your MIS",
|
|
@@ -2558,21 +2565,21 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2558
2565
|
}) => {
|
|
2559
2566
|
const G = (() => {
|
|
2560
2567
|
if (H && H.length > 0) return H;
|
|
2561
|
-
if (!
|
|
2568
|
+
if (!w || w.trim() === "") return [];
|
|
2562
2569
|
try {
|
|
2563
|
-
const c = JSON.parse(
|
|
2570
|
+
const c = JSON.parse(w);
|
|
2564
2571
|
return Array.isArray(c) && c.length > 0 ? c : [];
|
|
2565
2572
|
} catch {
|
|
2566
2573
|
return [];
|
|
2567
2574
|
}
|
|
2568
2575
|
})(), de = x(!1), b = (c) => {
|
|
2569
2576
|
de.current = c;
|
|
2570
|
-
},
|
|
2577
|
+
}, O = xo(), B = x(null), re = x(null), L = x(null), W = x(null), he = x(null), Le = x(null), [xe, F] = M(
|
|
2571
2578
|
() => s ? "" : _ ?? ""
|
|
2572
|
-
), [oe,
|
|
2573
|
-
(!de.current || c.id === "DEEP_THINKING_MESSAGE") &&
|
|
2574
|
-
}, [We, Pe] = M(!1), [P,
|
|
2575
|
-
|
|
2579
|
+
), [oe, gt] = M(s), [Q, bt] = M([]), [qt, et] = M([]), tt = (c) => {
|
|
2580
|
+
(!de.current || c.id === "DEEP_THINKING_MESSAGE") && bt((y) => [...y, c]);
|
|
2581
|
+
}, [We, Pe] = M(!1), [P, nt] = M(!1), [Y, rt] = M(!1), $ = x(!1), Ne = x(null), yt = x(!1), [Ee, Dt] = M(!1), [$e, ot] = M(fn), [Ue, Ae] = M(!1), [Ye, ke] = M(!0), [at, je] = M(!1), [Fe, st] = M("getting-started"), [De, Ke] = M([]), [it, Tt] = M(!1), Ve = Uo(l, 0), ct = Ve > 0 && Q.length >= Ve, Et = We || P;
|
|
2582
|
+
Mo(() => {
|
|
2576
2583
|
if (!!(_ != null && _.trim()) && !s || J == null && !_) return;
|
|
2577
2584
|
const y = setTimeout(() => {
|
|
2578
2585
|
var I;
|
|
@@ -2580,7 +2587,7 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2580
2587
|
}, J ?? 0);
|
|
2581
2588
|
return () => clearTimeout(y);
|
|
2582
2589
|
});
|
|
2583
|
-
const [
|
|
2590
|
+
const [lt, He] = M(!1), ge = !window.webkitSpeechRecognition && !window.SpeechRecognition, qe = typeof navigator < "u" && navigator.userAgent.toLowerCase().includes("firefox"), Mt = async () => {
|
|
2584
2591
|
let c = !1;
|
|
2585
2592
|
if (navigator.permissions)
|
|
2586
2593
|
try {
|
|
@@ -2594,57 +2601,57 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2594
2601
|
};
|
|
2595
2602
|
V(() => {
|
|
2596
2603
|
(async () => {
|
|
2597
|
-
const y = await
|
|
2604
|
+
const y = await Mt();
|
|
2598
2605
|
He(y);
|
|
2599
2606
|
})();
|
|
2600
2607
|
}, [u, Ue]), V(() => {
|
|
2601
|
-
|
|
2602
|
-
}, [
|
|
2608
|
+
f && f.length > 0 && (bt(f), et(Ua(f)));
|
|
2609
|
+
}, [f]);
|
|
2603
2610
|
const Xe = async (c = oe) => {
|
|
2604
2611
|
if (!t.canLoadHistory || !c) return;
|
|
2605
|
-
|
|
2612
|
+
nt(!0);
|
|
2606
2613
|
const y = await t.loadHistory(c);
|
|
2607
|
-
if (
|
|
2614
|
+
if (O.current) {
|
|
2608
2615
|
if (JSON.stringify(y) === JSON.stringify(Q) || !y) {
|
|
2609
|
-
|
|
2616
|
+
nt(!1);
|
|
2610
2617
|
return;
|
|
2611
2618
|
}
|
|
2612
|
-
return y.chatItems.length > 0 &&
|
|
2619
|
+
return y.chatItems.length > 0 && bt(y.chatItems), et(y.followUpPrompts), nt(!1), Dt(!0), y;
|
|
2613
2620
|
}
|
|
2614
2621
|
};
|
|
2615
2622
|
V(() => {
|
|
2616
2623
|
A && !de.current && Xe();
|
|
2617
2624
|
}, [A]), V(() => {
|
|
2618
|
-
|
|
2625
|
+
O.current && t.canLoadHistory && s && (Ee || Xe(s));
|
|
2619
2626
|
}, [s, t.canLoadHistory, Ee]), nr(() => {
|
|
2620
|
-
|
|
2621
|
-
top:
|
|
2627
|
+
L.current && L.current.scrollTo({
|
|
2628
|
+
top: L.current.scrollHeight,
|
|
2622
2629
|
behavior: "smooth"
|
|
2623
2630
|
});
|
|
2624
2631
|
}, [Q]);
|
|
2625
|
-
const
|
|
2626
|
-
const y =
|
|
2632
|
+
const At = (c) => {
|
|
2633
|
+
const y = Ho(c), I = /\['Canvas_Element_ID'\s*:\s*'([^']+)',\s*'Title'\s*:\s*'([^']+)'\]/g;
|
|
2627
2634
|
return y.replace(
|
|
2628
2635
|
I,
|
|
2629
2636
|
(ce, ye, fe) => `<span class="chat-panel__message-tag">@${fe}</span>`
|
|
2630
2637
|
);
|
|
2631
|
-
},
|
|
2638
|
+
}, xt = async ({
|
|
2632
2639
|
maxAttempts: c = 6,
|
|
2633
2640
|
chatIdToFetch: y,
|
|
2634
2641
|
signal: I
|
|
2635
2642
|
} = {}) => {
|
|
2636
|
-
const ce = new Set(Q.map(({ id:
|
|
2643
|
+
const ce = new Set(Q.map(({ id: Ht }) => Ht));
|
|
2637
2644
|
let ye = 0, fe;
|
|
2638
2645
|
for (; ye < c; ) {
|
|
2639
|
-
if (I != null && I.aborted || !await
|
|
2646
|
+
if (I != null && I.aborted || !await $a(Ba, I) || (fe = await Xe(y), I != null && I.aborted)) return;
|
|
2640
2647
|
if (((fe == null ? void 0 : fe.chatItems) || []).some(
|
|
2641
|
-
(
|
|
2648
|
+
(zt) => zt.type !== _t && !ce.has(zt.id)
|
|
2642
2649
|
)) break;
|
|
2643
2650
|
ye++;
|
|
2644
2651
|
}
|
|
2645
2652
|
if (Number.isFinite(c) && ye >= c) {
|
|
2646
|
-
|
|
2647
|
-
text:
|
|
2653
|
+
tt({
|
|
2654
|
+
text: No,
|
|
2648
2655
|
id: yn,
|
|
2649
2656
|
type: ve
|
|
2650
2657
|
});
|
|
@@ -2656,8 +2663,8 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2656
2663
|
var c;
|
|
2657
2664
|
(c = B.current) == null || c.focus();
|
|
2658
2665
|
}, 0);
|
|
2659
|
-
},
|
|
2660
|
-
|
|
2666
|
+
}, ut = async (c) => {
|
|
2667
|
+
et(null), Pe(!0);
|
|
2661
2668
|
const y = await t.sendMessage({
|
|
2662
2669
|
chatId: oe,
|
|
2663
2670
|
userMessage: c,
|
|
@@ -2670,52 +2677,52 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2670
2677
|
return;
|
|
2671
2678
|
}
|
|
2672
2679
|
if (y.deferred === !0) {
|
|
2673
|
-
y.chatId &&
|
|
2680
|
+
y.chatId && gt(y.chatId);
|
|
2674
2681
|
const I = y.chatId || oe;
|
|
2675
2682
|
Ne.current = new AbortController();
|
|
2676
2683
|
try {
|
|
2677
|
-
await
|
|
2678
|
-
maxAttempts:
|
|
2684
|
+
await xt({
|
|
2685
|
+
maxAttempts: Wa,
|
|
2679
2686
|
chatIdToFetch: I,
|
|
2680
2687
|
signal: Ne.current.signal
|
|
2681
2688
|
});
|
|
2682
2689
|
} finally {
|
|
2683
2690
|
Ne.current = null;
|
|
2684
2691
|
}
|
|
2685
|
-
|
|
2692
|
+
O.current && (Pe(!1), Re());
|
|
2686
2693
|
return;
|
|
2687
2694
|
}
|
|
2688
2695
|
if (y.hardStopped === !0) {
|
|
2689
|
-
!$.current && t.canSendNotification && oe && await t.sendNotification({ chatId: oe }) && ($.current = !0),
|
|
2696
|
+
!$.current && t.canSendNotification && oe && await t.sendNotification({ chatId: oe }) && ($.current = !0), O.current && (rt(!0), Pe(!1), Re());
|
|
2690
2697
|
return;
|
|
2691
2698
|
}
|
|
2692
|
-
|
|
2693
|
-
text:
|
|
2699
|
+
tt({
|
|
2700
|
+
text: Ea(y.text),
|
|
2694
2701
|
type: y.type,
|
|
2695
2702
|
id: y.id,
|
|
2696
2703
|
...y.element != null && { element: y.element }
|
|
2697
|
-
}), y.chatId &&
|
|
2704
|
+
}), y.chatId && gt(y.chatId), et(y.followUpPrompts ?? null), Pe(!1), Re();
|
|
2698
2705
|
}, ee = async ({
|
|
2699
2706
|
prompt: c = null,
|
|
2700
2707
|
allowDoubleMessage: y = !1
|
|
2701
2708
|
} = {}) => {
|
|
2702
2709
|
var ye;
|
|
2703
2710
|
let I = null;
|
|
2704
|
-
if (c != null && c.trim() !== "" && (I = c.trim()), I === null && (I =
|
|
2705
|
-
const ce = Q.slice().reverse().find((fe) => fe.type ===
|
|
2711
|
+
if (c != null && c.trim() !== "" && (I = c.trim()), I === null && (I = Aa(xe).trim()), !I || We || P) return;
|
|
2712
|
+
const ce = Q.slice().reverse().find((fe) => fe.type === _t);
|
|
2706
2713
|
if (!y && ce && ce.text === I) {
|
|
2707
2714
|
console.warn("Duplicate message detected, not adding:", I);
|
|
2708
2715
|
return;
|
|
2709
2716
|
}
|
|
2710
|
-
(ye = Le.current) == null || ye.cancel(), be(),
|
|
2711
|
-
type:
|
|
2717
|
+
(ye = Le.current) == null || ye.cancel(), be(), rt(!1), $.current = !1, tt({
|
|
2718
|
+
type: _t,
|
|
2712
2719
|
text: I,
|
|
2713
|
-
id:
|
|
2714
|
-
}), F(""), Re(), b(!1), await
|
|
2720
|
+
id: Po()
|
|
2721
|
+
}), F(""), Re(), b(!1), await ut(I), ot(fn);
|
|
2715
2722
|
};
|
|
2716
2723
|
V(() => {
|
|
2717
|
-
if (
|
|
2718
|
-
|
|
2724
|
+
if (yt.current || !(_ != null && _.trim()) || s) return;
|
|
2725
|
+
yt.current = !0;
|
|
2719
2726
|
const c = setTimeout(() => {
|
|
2720
2727
|
ee({ prompt: _ });
|
|
2721
2728
|
}, J ?? 0);
|
|
@@ -2723,34 +2730,34 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2723
2730
|
}, []);
|
|
2724
2731
|
const be = () => {
|
|
2725
2732
|
he.current && (he.current.stop(), he.current = null), Ae(!1), W.current && (clearTimeout(W.current), W.current = null);
|
|
2726
|
-
},
|
|
2733
|
+
}, dt = Mr((c) => {
|
|
2727
2734
|
be(), c.trim().length > 0 && Ye && ee();
|
|
2728
2735
|
}, h);
|
|
2729
|
-
Le.current =
|
|
2730
|
-
const
|
|
2736
|
+
Le.current = dt;
|
|
2737
|
+
const ft = (c) => {
|
|
2731
2738
|
if ($e === fn) {
|
|
2732
|
-
|
|
2739
|
+
ot(c);
|
|
2733
2740
|
return;
|
|
2734
2741
|
}
|
|
2735
2742
|
if ($e !== c) {
|
|
2736
|
-
|
|
2743
|
+
ot(Ga);
|
|
2737
2744
|
return;
|
|
2738
2745
|
}
|
|
2739
2746
|
}, Xt = () => {
|
|
2740
2747
|
if (We || P) return;
|
|
2741
|
-
|
|
2748
|
+
ft(za), ke(!0);
|
|
2742
2749
|
const c = new window.webkitSpeechRecognition();
|
|
2743
2750
|
he.current = c, c.continuous = !0, c.interimResults = !0, c.lang = m, c.start(), c.onstart = () => {
|
|
2744
2751
|
Ae(!0);
|
|
2745
2752
|
}, c.onresult = (y) => {
|
|
2746
2753
|
const I = Array.from(y.results).map((ce) => ce[0]).map((ce) => ce.transcript).join("");
|
|
2747
|
-
I !== xe && F(I),
|
|
2754
|
+
I !== xe && F(I), dt(I);
|
|
2748
2755
|
}, c.onerror = () => {
|
|
2749
2756
|
be();
|
|
2750
2757
|
};
|
|
2751
|
-
},
|
|
2758
|
+
}, Pt = () => {
|
|
2752
2759
|
Ue ? be() : Xt();
|
|
2753
|
-
},
|
|
2760
|
+
}, St = !P && !We && xe.trim().length > 0;
|
|
2754
2761
|
V(
|
|
2755
2762
|
() => () => {
|
|
2756
2763
|
var c;
|
|
@@ -2760,17 +2767,17 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2760
2767
|
), V(() => {
|
|
2761
2768
|
if (!t.canListInteractions) return;
|
|
2762
2769
|
let c = !1;
|
|
2763
|
-
return
|
|
2770
|
+
return Tt(!0), t.listInteractions().then((y) => {
|
|
2764
2771
|
c || Ke(y ?? []);
|
|
2765
2772
|
}).catch(() => {
|
|
2766
2773
|
c || Ke([]);
|
|
2767
2774
|
}).finally(() => {
|
|
2768
|
-
c ||
|
|
2775
|
+
c || Tt(!1);
|
|
2769
2776
|
}), () => {
|
|
2770
2777
|
c = !0;
|
|
2771
2778
|
};
|
|
2772
2779
|
}, [t]);
|
|
2773
|
-
const
|
|
2780
|
+
const Ut = () => E != null && E.length ? E.map((c) => {
|
|
2774
2781
|
let y = c.url;
|
|
2775
2782
|
return oe && y.includes("/chat-id/") && (y.match(/\/chat-id\/[^/]+$/) || (y = `${y}${oe}`)), {
|
|
2776
2783
|
reference: c.label,
|
|
@@ -2778,20 +2785,20 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2778
2785
|
link: y,
|
|
2779
2786
|
icon: c.icon
|
|
2780
2787
|
};
|
|
2781
|
-
}) : [],
|
|
2782
|
-
c.key !== "Enter" && (
|
|
2788
|
+
}) : [], wt = (c) => {
|
|
2789
|
+
c.key !== "Enter" && (ft(Ha), Ue && ke(!1), c.key === "/" && xe.length === 0 && (E != null && E.length) && (je(!0), c.preventDefault())), c.key === "Enter" && !c.shiftKey && (c.preventDefault(), St && ee({ allowDoubleMessage: !0 })), c.key === "Escape" && at && je(!1);
|
|
2783
2790
|
}, Zt = () => {
|
|
2784
2791
|
je(!1), setTimeout(() => {
|
|
2785
2792
|
var c;
|
|
2786
2793
|
(c = B.current) == null || c.focus();
|
|
2787
2794
|
}, 0);
|
|
2788
|
-
}, Ze =
|
|
2795
|
+
}, Ze = $t((c) => {
|
|
2789
2796
|
F(c), setTimeout(() => {
|
|
2790
2797
|
B.current && (B.current.focus(), B.current.selectionStart = B.current.value.length, B.current.selectionEnd = B.current.value.length);
|
|
2791
2798
|
}, 0);
|
|
2792
|
-
}, []), Jt =
|
|
2793
|
-
|
|
2794
|
-
}, [U]), j =
|
|
2799
|
+
}, []), Jt = $t(async () => !t.canSendNotification || !oe ? !1 : t.sendNotification({ chatId: oe }), [oe, t]), Ft = $t(() => {
|
|
2800
|
+
rt(!1), U == null || U();
|
|
2801
|
+
}, [U]), j = $t(
|
|
2795
2802
|
(c, y) => {
|
|
2796
2803
|
oe && t.rateMessage({ rating: c, messageId: y, chatId: oe });
|
|
2797
2804
|
},
|
|
@@ -2809,7 +2816,7 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2809
2816
|
children: "New"
|
|
2810
2817
|
}
|
|
2811
2818
|
) }),
|
|
2812
|
-
(Q.length > 0 || !a && !
|
|
2819
|
+
(Q.length > 0 || !a && !ct) && /* @__PURE__ */ S(
|
|
2813
2820
|
"div",
|
|
2814
2821
|
{
|
|
2815
2822
|
className: _e("chat-panel__body", {
|
|
@@ -2817,11 +2824,15 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2817
2824
|
}),
|
|
2818
2825
|
children: [
|
|
2819
2826
|
Q.length > 0 && /* @__PURE__ */ S("div", { className: "chat-panel__message-list-wrapper", children: [
|
|
2820
|
-
/* @__PURE__ */ S("ul", { className: "chat-panel-message-list", ref:
|
|
2827
|
+
/* @__PURE__ */ S("ul", { className: "chat-panel-message-list", ref: L, children: [
|
|
2821
2828
|
Q.map((c, y) => {
|
|
2822
|
-
const I = y === Q.length - 1, ce =
|
|
2829
|
+
const I = y === Q.length - 1, ce = Fa(
|
|
2830
|
+
qt,
|
|
2831
|
+
c,
|
|
2832
|
+
I
|
|
2833
|
+
), ye = c.id === yn, fe = I;
|
|
2823
2834
|
return /* @__PURE__ */ i(
|
|
2824
|
-
|
|
2835
|
+
go,
|
|
2825
2836
|
{
|
|
2826
2837
|
id: c.id,
|
|
2827
2838
|
type: c.type,
|
|
@@ -2832,19 +2843,19 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2832
2843
|
showRating: fe,
|
|
2833
2844
|
followUpPrompts: ce,
|
|
2834
2845
|
onFollowUpPromptClick: Ze,
|
|
2835
|
-
processCanvasReferences:
|
|
2846
|
+
processCanvasReferences: At,
|
|
2836
2847
|
isFallbackMessage: ye,
|
|
2837
2848
|
onRatingPopupOpen: me
|
|
2838
2849
|
},
|
|
2839
2850
|
`${c.id}_${y}`
|
|
2840
2851
|
);
|
|
2841
2852
|
}),
|
|
2842
|
-
|
|
2843
|
-
|
|
2853
|
+
Et && /* @__PURE__ */ i(
|
|
2854
|
+
Do,
|
|
2844
2855
|
{
|
|
2845
2856
|
showNotifyLaterButton: t.canSendNotification && !!oe,
|
|
2846
2857
|
onNotifyLater: Jt,
|
|
2847
|
-
onNotificationRegisteredGotIt:
|
|
2858
|
+
onNotificationRegisteredGotIt: Ft
|
|
2848
2859
|
}
|
|
2849
2860
|
),
|
|
2850
2861
|
Y && /* @__PURE__ */ i(
|
|
@@ -2859,7 +2870,7 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2859
2870
|
{
|
|
2860
2871
|
type: "button",
|
|
2861
2872
|
className: "chat-panel__notify-later-btn",
|
|
2862
|
-
onClick:
|
|
2873
|
+
onClick: Ft,
|
|
2863
2874
|
"aria-label": "Got it",
|
|
2864
2875
|
children: "Got it"
|
|
2865
2876
|
}
|
|
@@ -2875,20 +2886,20 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2875
2886
|
Ve
|
|
2876
2887
|
] })
|
|
2877
2888
|
] }),
|
|
2878
|
-
!a && !
|
|
2889
|
+
!a && !ct && /* @__PURE__ */ S(we, { children: [
|
|
2879
2890
|
Q.length === 0 && !P && /* @__PURE__ */ S("div", { className: "chat-panel__chat-intro", children: [
|
|
2880
2891
|
/* @__PURE__ */ S("div", { className: "chat-panel__chat-intro-frame", children: [
|
|
2881
|
-
/* @__PURE__ */ i("span", { className: "chat-panel__chat-intro-icon", children: /* @__PURE__ */ i(
|
|
2892
|
+
/* @__PURE__ */ i("span", { className: "chat-panel__chat-intro-icon", children: /* @__PURE__ */ i(xr, {}) }),
|
|
2882
2893
|
/* @__PURE__ */ i("h3", { className: "chat-panel__chat-intro-heading", children: z })
|
|
2883
2894
|
] }),
|
|
2884
2895
|
/* @__PURE__ */ i("p", { className: "chat-panel__chat-intro-body", children: K })
|
|
2885
2896
|
] }),
|
|
2886
2897
|
/* @__PURE__ */ i("div", { className: "chat-panel__input-container", children: /* @__PURE__ */ S("div", { className: "chat-panel__input-wrapper", ref: re, children: [
|
|
2887
|
-
|
|
2898
|
+
at && /* @__PURE__ */ i(
|
|
2888
2899
|
lr,
|
|
2889
2900
|
{
|
|
2890
2901
|
anchorRef: re,
|
|
2891
|
-
menuItems:
|
|
2902
|
+
menuItems: Ut(),
|
|
2892
2903
|
onClose: Zt,
|
|
2893
2904
|
onNavigate: q
|
|
2894
2905
|
}
|
|
@@ -2899,20 +2910,20 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2899
2910
|
ref: B,
|
|
2900
2911
|
value: xe,
|
|
2901
2912
|
onChange: F,
|
|
2902
|
-
onKeyDown:
|
|
2913
|
+
onKeyDown: wt,
|
|
2903
2914
|
placeholder: pe,
|
|
2904
2915
|
onSubmit: () => {
|
|
2905
2916
|
xe.trim() && ee({
|
|
2906
2917
|
allowDoubleMessage: !0
|
|
2907
2918
|
});
|
|
2908
2919
|
},
|
|
2909
|
-
onMicClick:
|
|
2920
|
+
onMicClick: Pt,
|
|
2910
2921
|
onStopClick: () => {
|
|
2911
2922
|
Ue && be();
|
|
2912
2923
|
},
|
|
2913
2924
|
isProcessing: We,
|
|
2914
2925
|
speechEngaged: Ue,
|
|
2915
|
-
showMicButton: !
|
|
2926
|
+
showMicButton: !lt && u && !qe,
|
|
2916
2927
|
ariaLabel: "Chat panel input",
|
|
2917
2928
|
menuContent: k,
|
|
2918
2929
|
onNavigate: q,
|
|
@@ -2925,7 +2936,7 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2925
2936
|
}
|
|
2926
2937
|
),
|
|
2927
2938
|
Q.length === 0 && /* @__PURE__ */ S(we, { children: [
|
|
2928
|
-
|
|
2939
|
+
lt && /* @__PURE__ */ i("div", { className: "chat-panel__speech-disabled-wrapper", children: qe ? /* @__PURE__ */ S(we, { children: [
|
|
2929
2940
|
" ",
|
|
2930
2941
|
"Speech isn't supported in Firefox. To enable speech, please use Google Chrome."
|
|
2931
2942
|
] }) : /* @__PURE__ */ i(we, { children: " To use speech, please allow Arbor to use your microphone." }) }),
|
|
@@ -2935,7 +2946,7 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2935
2946
|
{
|
|
2936
2947
|
active: Fe === "getting-started",
|
|
2937
2948
|
tabElementProps: {
|
|
2938
|
-
onClick: () =>
|
|
2949
|
+
onClick: () => st("getting-started")
|
|
2939
2950
|
},
|
|
2940
2951
|
children: "Getting started"
|
|
2941
2952
|
}
|
|
@@ -2945,7 +2956,7 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2945
2956
|
{
|
|
2946
2957
|
active: Fe === "recent",
|
|
2947
2958
|
tabElementProps: {
|
|
2948
|
-
onClick: () =>
|
|
2959
|
+
onClick: () => st("recent")
|
|
2949
2960
|
},
|
|
2950
2961
|
children: "Recent"
|
|
2951
2962
|
}
|
|
@@ -2954,7 +2965,7 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2954
2965
|
/* @__PURE__ */ S("div", { className: "chat-panel__tab-content", children: [
|
|
2955
2966
|
Fe === "getting-started" && /* @__PURE__ */ S(we, { children: [
|
|
2956
2967
|
G.length > 0 && /* @__PURE__ */ i("div", { className: "chat-panel__sample-prompt-container", children: /* @__PURE__ */ i(
|
|
2957
|
-
|
|
2968
|
+
Fr,
|
|
2958
2969
|
{
|
|
2959
2970
|
onSelectPrompt: (c) => {
|
|
2960
2971
|
ee({
|
|
@@ -2968,8 +2979,8 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2968
2979
|
categories: G
|
|
2969
2980
|
}
|
|
2970
2981
|
) }),
|
|
2971
|
-
(
|
|
2972
|
-
|
|
2982
|
+
(D && D.length > 0 && G.length === 0 || !!(N != null && N.trim())) && /* @__PURE__ */ S("div", { className: "chat-panel__sample-prompt-container", children: [
|
|
2983
|
+
D == null ? void 0 : D.map((c, y) => /* @__PURE__ */ i(
|
|
2973
2984
|
"button",
|
|
2974
2985
|
{
|
|
2975
2986
|
type: "button",
|
|
@@ -2982,13 +2993,13 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2982
2993
|
},
|
|
2983
2994
|
`sample-${y}`
|
|
2984
2995
|
)),
|
|
2985
|
-
|
|
2996
|
+
N && /* @__PURE__ */ i(
|
|
2986
2997
|
"button",
|
|
2987
2998
|
{
|
|
2988
2999
|
type: "button",
|
|
2989
3000
|
className: "chat-panel__daily-prompt",
|
|
2990
3001
|
onClick: () => ee({
|
|
2991
|
-
prompt:
|
|
3002
|
+
prompt: N,
|
|
2992
3003
|
allowDoubleMessage: !0
|
|
2993
3004
|
}),
|
|
2994
3005
|
children: /* @__PURE__ */ S("span", { children: [
|
|
@@ -2996,35 +3007,35 @@ const Ca = 55e3, yn = "fallback", va = async ({
|
|
|
2996
3007
|
" ",
|
|
2997
3008
|
/* @__PURE__ */ i("strong", { children: "Daily Prompt:" }),
|
|
2998
3009
|
/* @__PURE__ */ i("br", {}),
|
|
2999
|
-
|
|
3010
|
+
N
|
|
3000
3011
|
] })
|
|
3001
3012
|
},
|
|
3002
3013
|
"daily-prompt"
|
|
3003
3014
|
)
|
|
3004
3015
|
] })
|
|
3005
3016
|
] }),
|
|
3006
|
-
Fe === "recent" && /* @__PURE__ */ i("div", { className: "chat-panel__tab-panel--recent", children:
|
|
3007
|
-
|
|
3017
|
+
Fe === "recent" && /* @__PURE__ */ i("div", { className: "chat-panel__tab-panel--recent", children: it ? /* @__PURE__ */ i("div", { className: "chat-panel__ai-interactions-loading", children: "Loading..." }) : De.length === 0 ? /* @__PURE__ */ i("div", { className: "chat-panel__ai-interactions-empty", children: "No previous chats found." }) : /* @__PURE__ */ i(
|
|
3018
|
+
Rr,
|
|
3008
3019
|
{
|
|
3009
3020
|
wrapperClassName: "chat-panel__ai-interactions-table",
|
|
3010
3021
|
hasSearch: !1,
|
|
3011
3022
|
tableTheme: "tidy",
|
|
3012
3023
|
domLayout: "autoHeight",
|
|
3013
3024
|
rowData: De,
|
|
3014
|
-
columnDefs:
|
|
3015
|
-
defaultColDef:
|
|
3025
|
+
columnDefs: xa,
|
|
3026
|
+
defaultColDef: Pa,
|
|
3016
3027
|
getRowId: ({ data: c }) => c.id,
|
|
3017
3028
|
onRowClicked: ({ data: c }) => {
|
|
3018
|
-
!c || !t.canLoadHistory || (
|
|
3029
|
+
!c || !t.canLoadHistory || (gt(c.chatId), Xe(c.chatId));
|
|
3019
3030
|
}
|
|
3020
3031
|
}
|
|
3021
3032
|
) })
|
|
3022
3033
|
] })
|
|
3023
3034
|
] }),
|
|
3024
|
-
|
|
3035
|
+
ct && /* @__PURE__ */ i("div", { className: "chat-panel-footer", children: "You've reached the maximum number of messages for this conversation" })
|
|
3025
3036
|
] });
|
|
3026
3037
|
};
|
|
3027
|
-
class
|
|
3038
|
+
class ja {
|
|
3028
3039
|
constructor() {
|
|
3029
3040
|
Ln(this, "events");
|
|
3030
3041
|
this.events = {};
|
|
@@ -3043,31 +3054,31 @@ class Ga {
|
|
|
3043
3054
|
});
|
|
3044
3055
|
}
|
|
3045
3056
|
}
|
|
3046
|
-
const er = new
|
|
3047
|
-
function
|
|
3057
|
+
const er = new ja();
|
|
3058
|
+
function as({ isOpen: e, ...t }) {
|
|
3048
3059
|
const { onClose: r } = t;
|
|
3049
3060
|
return V(() => {
|
|
3050
3061
|
const a = er.subscribe("ds-remove-slideover", () => r == null ? void 0 : r());
|
|
3051
3062
|
return () => er.unsubscribe("ds-remove-slideover", a);
|
|
3052
3063
|
}, [r]), e ? rr(
|
|
3053
|
-
/* @__PURE__ */ i(
|
|
3064
|
+
/* @__PURE__ */ i(Ir, { children: /* @__PURE__ */ i("div", { className: "ask-arbor-widget__panel", children: /* @__PURE__ */ i(Ya, { ...t, focusDelay: 200 }) }) }),
|
|
3054
3065
|
document.body
|
|
3055
3066
|
) : null;
|
|
3056
3067
|
}
|
|
3057
|
-
function
|
|
3068
|
+
function Ka(e) {
|
|
3058
3069
|
switch (e.toLowerCase()) {
|
|
3059
3070
|
case bn:
|
|
3060
|
-
return
|
|
3061
|
-
case
|
|
3062
|
-
return
|
|
3071
|
+
return _t;
|
|
3072
|
+
case wa:
|
|
3073
|
+
return Lt;
|
|
3063
3074
|
default:
|
|
3064
3075
|
return null;
|
|
3065
3076
|
}
|
|
3066
3077
|
}
|
|
3067
|
-
function
|
|
3078
|
+
function Va(e) {
|
|
3068
3079
|
const t = [];
|
|
3069
3080
|
for (const r of e.messages ?? []) {
|
|
3070
|
-
const a =
|
|
3081
|
+
const a = Ka(r.role);
|
|
3071
3082
|
!a || !r.content || t.push({
|
|
3072
3083
|
id: r.message_id,
|
|
3073
3084
|
type: a,
|
|
@@ -3076,20 +3087,20 @@ function Wa(e) {
|
|
|
3076
3087
|
}
|
|
3077
3088
|
return { chatItems: t, followUpPrompts: [] };
|
|
3078
3089
|
}
|
|
3079
|
-
const
|
|
3090
|
+
const qa = async (e, t) => {
|
|
3080
3091
|
try {
|
|
3081
3092
|
const r = await mr(e, void 0, void 0, t);
|
|
3082
3093
|
if (hr(e) && Array.isArray(r == null ? void 0 : r.messages))
|
|
3083
|
-
return
|
|
3094
|
+
return Va(r);
|
|
3084
3095
|
if (!(r != null && r.items))
|
|
3085
3096
|
return console.error("Invalid response in getHistoricMessages", e, r), { chatItems: [], followUpPrompts: [] };
|
|
3086
3097
|
let a = [], l = [];
|
|
3087
3098
|
return r.items.forEach((s) => {
|
|
3088
3099
|
if ("chatItems" in s)
|
|
3089
3100
|
a = s.chatItems.map(
|
|
3090
|
-
({ id: u, type: m, text: h, content:
|
|
3101
|
+
({ id: u, type: m, text: h, content: f, ...T }) => {
|
|
3091
3102
|
const A = h != null && h !== "" ? h : gn(
|
|
3092
|
-
typeof
|
|
3103
|
+
typeof f == "string" ? f : ""
|
|
3093
3104
|
);
|
|
3094
3105
|
return {
|
|
3095
3106
|
id: u,
|
|
@@ -3115,7 +3126,7 @@ const $a = async (e, t) => {
|
|
|
3115
3126
|
} catch (r) {
|
|
3116
3127
|
return console.error("Error in getHistoricMessages", r, e), { chatItems: [], followUpPrompts: [] };
|
|
3117
3128
|
}
|
|
3118
|
-
},
|
|
3129
|
+
}, Xa = async ({
|
|
3119
3130
|
rating: e,
|
|
3120
3131
|
messageId: t,
|
|
3121
3132
|
chatId: r,
|
|
@@ -3127,7 +3138,7 @@ const $a = async (e, t) => {
|
|
|
3127
3138
|
} catch (s) {
|
|
3128
3139
|
console.error("Error rating message", s);
|
|
3129
3140
|
}
|
|
3130
|
-
},
|
|
3141
|
+
}, Za = async ({
|
|
3131
3142
|
chatId: e,
|
|
3132
3143
|
notificationCallbackUrl: t,
|
|
3133
3144
|
authorizationToken: r
|
|
@@ -3138,7 +3149,7 @@ const $a = async (e, t) => {
|
|
|
3138
3149
|
return console.error("Error sending notification", a), !1;
|
|
3139
3150
|
}
|
|
3140
3151
|
};
|
|
3141
|
-
function
|
|
3152
|
+
function Ja(e) {
|
|
3142
3153
|
return (e.conversations ?? []).map((t) => {
|
|
3143
3154
|
var r, a;
|
|
3144
3155
|
return {
|
|
@@ -3149,7 +3160,7 @@ function Ka(e) {
|
|
|
3149
3160
|
};
|
|
3150
3161
|
});
|
|
3151
3162
|
}
|
|
3152
|
-
class
|
|
3163
|
+
class Qa {
|
|
3153
3164
|
constructor(t) {
|
|
3154
3165
|
this.config = t;
|
|
3155
3166
|
}
|
|
@@ -3172,7 +3183,7 @@ class Va {
|
|
|
3172
3183
|
};
|
|
3173
3184
|
}
|
|
3174
3185
|
async sendMessage(t) {
|
|
3175
|
-
return
|
|
3186
|
+
return Da({
|
|
3176
3187
|
chatUrl: this.config.chatUrl,
|
|
3177
3188
|
authorizationToken: this.config.authorizationToken,
|
|
3178
3189
|
agentCompletionsConfig: this.config.agentCompletionsConfig,
|
|
@@ -3180,7 +3191,7 @@ class Va {
|
|
|
3180
3191
|
});
|
|
3181
3192
|
}
|
|
3182
3193
|
async loadHistory(t) {
|
|
3183
|
-
return this.config.historicChatUrl ?
|
|
3194
|
+
return this.config.historicChatUrl ? qa(
|
|
3184
3195
|
`${this.config.historicChatUrl}/${t}`,
|
|
3185
3196
|
this.config.authorizationToken
|
|
3186
3197
|
) : null;
|
|
@@ -3194,7 +3205,7 @@ class Va {
|
|
|
3194
3205
|
void 0,
|
|
3195
3206
|
this.config.authorizationToken
|
|
3196
3207
|
);
|
|
3197
|
-
return hr(this.config.aiInteractionsUrl) && Array.isArray(t.conversations) ?
|
|
3208
|
+
return hr(this.config.aiInteractionsUrl) && Array.isArray(t.conversations) ? Ja(
|
|
3198
3209
|
t
|
|
3199
3210
|
) : Array.isArray(t) ? t : Array.isArray(t.items) ? t.items : [];
|
|
3200
3211
|
} catch {
|
|
@@ -3202,21 +3213,21 @@ class Va {
|
|
|
3202
3213
|
}
|
|
3203
3214
|
}
|
|
3204
3215
|
async rateMessage(t) {
|
|
3205
|
-
this.config.ratingUrl && await
|
|
3216
|
+
this.config.ratingUrl && await Xa({
|
|
3206
3217
|
ratingUrl: this.config.ratingUrl,
|
|
3207
3218
|
authorizationToken: this.config.authorizationToken,
|
|
3208
3219
|
...t
|
|
3209
3220
|
});
|
|
3210
3221
|
}
|
|
3211
3222
|
async sendNotification(t) {
|
|
3212
|
-
return this.config.notificationCallbackUrl ?
|
|
3223
|
+
return this.config.notificationCallbackUrl ? Za({
|
|
3213
3224
|
notificationCallbackUrl: this.config.notificationCallbackUrl,
|
|
3214
3225
|
authorizationToken: this.config.authorizationToken,
|
|
3215
3226
|
...t
|
|
3216
3227
|
}) : !1;
|
|
3217
3228
|
}
|
|
3218
3229
|
}
|
|
3219
|
-
const
|
|
3230
|
+
const ss = {
|
|
3220
3231
|
create(e) {
|
|
3221
3232
|
const t = e.model || e.agentName || e.systemPrompt || e.mcps ? {
|
|
3222
3233
|
...e.model && { model: e.model },
|
|
@@ -3224,7 +3235,7 @@ const ts = {
|
|
|
3224
3235
|
...e.systemPrompt && { systemPrompt: e.systemPrompt },
|
|
3225
3236
|
...e.mcps && { mcps: e.mcps }
|
|
3226
3237
|
} : void 0;
|
|
3227
|
-
return new
|
|
3238
|
+
return new Qa({
|
|
3228
3239
|
chatUrl: e.chatUrl,
|
|
3229
3240
|
authorizationToken: e.authorizationToken ?? void 0,
|
|
3230
3241
|
historicChatUrl: e.historicChatUrl ?? void 0,
|
|
@@ -3238,14 +3249,15 @@ const ts = {
|
|
|
3238
3249
|
}
|
|
3239
3250
|
};
|
|
3240
3251
|
export {
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3252
|
+
ss as AIServiceConnectorFactory,
|
|
3253
|
+
as as AskArborSlideover,
|
|
3254
|
+
Ya as AskArborWidget,
|
|
3255
|
+
Lt as CHAT_RESPONSE_TYPE_AGENT,
|
|
3245
3256
|
ve as CHAT_RESPONSE_TYPE_ERROR,
|
|
3246
3257
|
mn as CHAT_RESPONSE_TYPE_INFO,
|
|
3247
|
-
|
|
3258
|
+
_t as CHAT_RESPONSE_TYPE_USER,
|
|
3248
3259
|
Kt as CHAT_RESPONSE_TYPE_WARNING,
|
|
3249
|
-
|
|
3250
|
-
|
|
3260
|
+
Ya as ChatPanel,
|
|
3261
|
+
_o as FollowUpPromptButton,
|
|
3262
|
+
Qa as HttpAIServiceConnector
|
|
3251
3263
|
};
|