@progress/kendo-react-conversational-ui 16.1.0-develop.1 → 16.1.0-develop.11
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/ai-prompt/AIPrompt.js +1 -1
- package/ai-prompt/AIPrompt.mjs +30 -28
- package/ai-prompt/AIPromptContext.d.ts +1 -0
- package/ai-prompt/views/AIPromptView.js +2 -2
- package/ai-prompt/views/AIPromptView.mjs +60 -57
- package/dist/cdn/js/kendo-react-conversational-ui.js +1 -1
- package/messages/index.d.ts +5 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +70 -68
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -13
package/ai-prompt/AIPrompt.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),R=require("./AIPromptHeader.js"),m=require("./views/constants.js"),V=require("./AIPromptContext.js"),c=require("@progress/kendo-react-common"),u=require("../package-metadata.js");function
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),R=require("./AIPromptHeader.js"),m=require("./views/constants.js"),V=require("./AIPromptContext.js"),c=require("@progress/kendo-react-common"),u=require("../package-metadata.js");function j(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const a=j(O),E=e=>{const o=a.useRef(null);c.useWebMcpRegister("aiprompt",o,e,e.webMcp);const t=!c.validatePackage(u.packageMetadata,{component:"AIPrompt"}),n=c.getLicenseMessage(u.packageMetadata),{activeView:s,toolbarItems:p,children:d,onActiveViewChange:i,onPromptRequest:g,onCommandExecute:f,style:P,dir:b,className:v,streaming:w,loading:S,onCancel:k,promptPlaceholder:M,suggestionsView:r,...A}=e,I=p||[m.promptViewDefaults,m.outputViewDefaults],[h,q]=a.useState({activeView:s}),l={...h,activeView:s,streaming:w,loading:S,suggestionsView:r!=null?r:"classic",promptPlaceholder:M,onCancel:k,onActiveViewChange:i,onPromptRequest:g,onCommandExecute:f},y=C=>{q(C)};return a.createElement(V.AIPromptContext.Provider,{value:[l,y]},a.createElement("div",{className:c.classNames("k-prompt",v),style:P,dir:b,...A},a.createElement(R.PromptHeader,{activeView:l.activeView,toolbarItems:I,activeViewChange:i}),d,t&&a.createElement(c.WatermarkOverlay,{message:n})))};exports.AIPrompt=E;
|
package/ai-prompt/AIPrompt.mjs
CHANGED
|
@@ -6,51 +6,53 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import { PromptHeader as
|
|
10
|
-
import { promptViewDefaults as
|
|
11
|
-
import { AIPromptContext as
|
|
12
|
-
import { useWebMcpRegister as
|
|
13
|
-
import { packageMetadata as
|
|
14
|
-
const
|
|
9
|
+
import { PromptHeader as M } from "./AIPromptHeader.mjs";
|
|
10
|
+
import { promptViewDefaults as R, outputViewDefaults as b } from "./views/constants.mjs";
|
|
11
|
+
import { AIPromptContext as x } from "./AIPromptContext.mjs";
|
|
12
|
+
import { useWebMcpRegister as L, validatePackage as N, getLicenseMessage as W, classNames as y, WatermarkOverlay as D } from "@progress/kendo-react-common";
|
|
13
|
+
import { packageMetadata as s } from "../package-metadata.mjs";
|
|
14
|
+
const z = (t) => {
|
|
15
15
|
const m = e.useRef(null);
|
|
16
|
-
|
|
17
|
-
const n = !
|
|
16
|
+
L("aiprompt", m, t, t.webMcp);
|
|
17
|
+
const n = !N(s, { component: "AIPrompt" }), i = W(s), {
|
|
18
18
|
activeView: o,
|
|
19
19
|
toolbarItems: l,
|
|
20
20
|
children: p,
|
|
21
|
-
onActiveViewChange:
|
|
21
|
+
onActiveViewChange: r,
|
|
22
22
|
onPromptRequest: u,
|
|
23
23
|
onCommandExecute: g,
|
|
24
|
-
style:
|
|
25
|
-
dir:
|
|
26
|
-
className:
|
|
27
|
-
streaming:
|
|
24
|
+
style: d,
|
|
25
|
+
dir: f,
|
|
26
|
+
className: v,
|
|
27
|
+
streaming: w,
|
|
28
28
|
loading: P,
|
|
29
|
-
onCancel:
|
|
29
|
+
onCancel: h,
|
|
30
|
+
promptPlaceholder: V,
|
|
30
31
|
suggestionsView: a,
|
|
31
|
-
...
|
|
32
|
-
} = t,
|
|
33
|
-
...
|
|
32
|
+
...S
|
|
33
|
+
} = t, k = l || [R, b], [A, C] = e.useState({ activeView: o }), c = {
|
|
34
|
+
...A,
|
|
34
35
|
activeView: o,
|
|
35
|
-
streaming:
|
|
36
|
+
streaming: w,
|
|
36
37
|
loading: P,
|
|
37
38
|
suggestionsView: a != null ? a : "classic",
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
promptPlaceholder: V,
|
|
40
|
+
onCancel: h,
|
|
41
|
+
onActiveViewChange: r,
|
|
40
42
|
onPromptRequest: u,
|
|
41
43
|
onCommandExecute: g
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
+
}, E = (I) => {
|
|
45
|
+
C(I);
|
|
44
46
|
};
|
|
45
|
-
return /* @__PURE__ */ e.createElement(
|
|
46
|
-
|
|
47
|
+
return /* @__PURE__ */ e.createElement(x.Provider, { value: [c, E] }, /* @__PURE__ */ e.createElement("div", { className: y("k-prompt", v), style: d, dir: f, ...S }, /* @__PURE__ */ e.createElement(
|
|
48
|
+
M,
|
|
47
49
|
{
|
|
48
50
|
activeView: c.activeView,
|
|
49
|
-
toolbarItems:
|
|
50
|
-
activeViewChange:
|
|
51
|
+
toolbarItems: k,
|
|
52
|
+
activeViewChange: r
|
|
51
53
|
}
|
|
52
|
-
), p, n && /* @__PURE__ */ e.createElement(
|
|
54
|
+
), p, n && /* @__PURE__ */ e.createElement(D, { message: i })));
|
|
53
55
|
};
|
|
54
56
|
export {
|
|
55
|
-
|
|
57
|
+
z as AIPrompt
|
|
56
58
|
};
|
|
@@ -16,6 +16,7 @@ interface AIPromptContextInterface {
|
|
|
16
16
|
activeView?: string;
|
|
17
17
|
streaming?: boolean;
|
|
18
18
|
loading?: boolean;
|
|
19
|
+
promptPlaceholder?: string;
|
|
19
20
|
suggestionsView?: SuggestionsView;
|
|
20
21
|
onCancel?: () => void;
|
|
21
22
|
onPromptRequest?: (prompt?: string, outputItem?: AIPromptOutputInterface) => void;
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
-
`);return d+(
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react"),G=require("../AIPromptContent.js"),M=require("../AIPromptFooter.js"),R=require("@progress/kendo-react-buttons"),h=require("@progress/kendo-react-inputs"),D=require("@progress/kendo-svg-icons"),b=require("@progress/kendo-react-common"),_=require("@progress/kendo-react-intl"),x=require("../../messages/index.js"),H=require("./AIPromptViewRender.js"),L=require("../AIPromptExpander.js"),W=require("../AIPromptContext.js"),N=require("../../chat/components/SuggestionsGroup.js"),$=require("./constants.js");function J(o){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const r in o)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(c,r,n.get?n:{enumerable:!0,get:()=>o[r]})}}return c.default=o,Object.freeze(c)}const e=J(F),K=o=>{var C;const{promptInput:c=h.TextArea,generateButton:r=R.Button,enableSpeechToText:n=!1,promptValue:E,promptSuggestions:f}=o,[l,p]=e.useState(E||""),[s]=W.useAIPromptContext(),T=_.useLocalization(),[y,I]=b.useCustomComponent(r),[k,S]=b.useCustomComponent(c),w=()=>{s.onPromptRequest&&s.onPromptRequest.call(null,l),p("")},m=e.useRef(null),V=t=>{p(t)};e.useEffect(()=>{var t,a;(a=(t=m.current)==null?void 0:t.element)!=null&&a.current&&requestAnimationFrame(()=>{var u,g;if((g=(u=m.current)==null?void 0:u.element)!=null&&g.current){const i=m.current.element.current;i.style.height="auto",i.style.height=`${i.scrollHeight}px`}})},[l]);const v=t=>{p(t.target.value)},O={title:"Generate",children:"Generate",svgIcon:D.sparklesIcon},j={placeholder:(C=s.promptPlaceholder)!=null?C:T.toLanguageString(x.aIPromptInputPlaceholder,x.messages[x.aIPromptInputPlaceholder]),rows:2},A=Object.keys(I).length>0?I:O,z=Object.keys(S).length>0?S:j,q=t=>{const{isFinal:a,alternatives:u}=t;if(a&&u.length>0){const g=u[0].transcript,i=(()=>{const d=l,B=d&&!d.endsWith(" ")&&!d.endsWith(`
|
|
9
|
+
`);return d+(B?" ":"")+g})();p(i)}};let P;return n&&(typeof n=="object"?P={...n,onResult:n.onResult||q}:P={onResult:q}),e.createElement(H.AIPromptViewRender,{name:$.promptViewDefaults.name},e.createElement(G.AIPromptContent,{streaming:s.streaming,onCancel:s.onCancel},e.createElement(k,{ref:m,value:l,flow:"vertical",textareaStyle:{maxHeight:"110px"},autoSize:!0,suffix:n?e.createElement(e.Fragment,null,e.createElement(h.InputSeparator,{orientation:"horizontal"}),e.createElement(h.InputSuffix,{orientation:"horizontal"},e.createElement(R.SpeechToTextButton,{fillMode:"flat",...P}))):void 0,onChange:v,...z}),f&&f.length>0&&e.createElement(L.AIPromptExpander,{title:"Prompt Suggestions"},e.createElement(N.SuggestionGroup,{suggestionsView:s.suggestionsView,suggestions:f.map((t,a)=>({id:a,text:t,description:t})),onSuggestionClick:t=>{V(t.text)}}))),e.createElement(M.AIPromptFooter,null,e.createElement(y,{themeColor:"primary",fillMode:"solid",rounded:"full",size:"medium",onClick:w,disabled:!l.trim(),...A},A.children)))};exports.AIPromptView=K;
|
|
@@ -6,104 +6,107 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import { AIPromptContent as
|
|
10
|
-
import { AIPromptFooter as
|
|
11
|
-
import { Button as
|
|
12
|
-
import { TextArea as
|
|
13
|
-
import { sparklesIcon as
|
|
14
|
-
import { useCustomComponent as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
9
|
+
import { AIPromptContent as F } from "../AIPromptContent.mjs";
|
|
10
|
+
import { AIPromptFooter as j } from "../AIPromptFooter.mjs";
|
|
11
|
+
import { Button as G, SpeechToTextButton as O } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { TextArea as $, InputSeparator as H, InputSuffix as L } from "@progress/kendo-react-inputs";
|
|
13
|
+
import { sparklesIcon as M } from "@progress/kendo-svg-icons";
|
|
14
|
+
import { useCustomComponent as S } from "@progress/kendo-react-common";
|
|
15
|
+
import { useLocalization as W } from "@progress/kendo-react-intl";
|
|
16
|
+
import { aIPromptInputPlaceholder as A, messages as D } from "../../messages/index.mjs";
|
|
17
|
+
import { AIPromptViewRender as J } from "./AIPromptViewRender.mjs";
|
|
18
|
+
import { AIPromptExpander as K } from "../AIPromptExpander.mjs";
|
|
19
|
+
import { useAIPromptContext as N } from "../AIPromptContext.mjs";
|
|
20
|
+
import { SuggestionGroup as Q } from "../../chat/components/SuggestionsGroup.mjs";
|
|
21
|
+
import { promptViewDefaults as U } from "./constants.mjs";
|
|
22
|
+
const me = (E) => {
|
|
23
|
+
var P;
|
|
21
24
|
const {
|
|
22
|
-
promptInput:
|
|
23
|
-
generateButton:
|
|
24
|
-
enableSpeechToText:
|
|
25
|
-
promptValue:
|
|
25
|
+
promptInput: I = $,
|
|
26
|
+
generateButton: T = G,
|
|
27
|
+
enableSpeechToText: r = !1,
|
|
28
|
+
promptValue: C,
|
|
26
29
|
promptSuggestions: p
|
|
27
|
-
} =
|
|
28
|
-
|
|
29
|
-
}, m = e.useRef(null),
|
|
30
|
+
} = E, [s, i] = e.useState(C || ""), [o] = N(), R = W(), [V, g] = S(T), [w, h] = S(I), b = () => {
|
|
31
|
+
o.onPromptRequest && o.onPromptRequest.call(null, s), i("");
|
|
32
|
+
}, m = e.useRef(null), y = (t) => {
|
|
30
33
|
i(t);
|
|
31
34
|
};
|
|
32
35
|
e.useEffect(() => {
|
|
33
|
-
var t,
|
|
34
|
-
(
|
|
35
|
-
var
|
|
36
|
-
if ((c = (
|
|
37
|
-
const
|
|
38
|
-
|
|
36
|
+
var t, n;
|
|
37
|
+
(n = (t = m.current) == null ? void 0 : t.element) != null && n.current && requestAnimationFrame(() => {
|
|
38
|
+
var a, c;
|
|
39
|
+
if ((c = (a = m.current) == null ? void 0 : a.element) != null && c.current) {
|
|
40
|
+
const l = m.current.element.current;
|
|
41
|
+
l.style.height = "auto", l.style.height = `${l.scrollHeight}px`;
|
|
39
42
|
}
|
|
40
43
|
});
|
|
41
|
-
}, [
|
|
42
|
-
const
|
|
44
|
+
}, [s]);
|
|
45
|
+
const v = (t) => {
|
|
43
46
|
i(t.target.value);
|
|
44
|
-
},
|
|
47
|
+
}, z = {
|
|
45
48
|
title: "Generate",
|
|
46
49
|
children: "Generate",
|
|
47
|
-
svgIcon:
|
|
48
|
-
},
|
|
49
|
-
placeholder:
|
|
50
|
+
svgIcon: M
|
|
51
|
+
}, B = {
|
|
52
|
+
placeholder: (P = o.promptPlaceholder) != null ? P : R.toLanguageString(A, D[A]),
|
|
50
53
|
rows: 2
|
|
51
|
-
}, d = Object.keys(g).length > 0 ? g :
|
|
52
|
-
const { isFinal:
|
|
53
|
-
if (
|
|
54
|
-
const c =
|
|
55
|
-
const u =
|
|
54
|
+
}, d = Object.keys(g).length > 0 ? g : z, k = Object.keys(h).length > 0 ? h : B, x = (t) => {
|
|
55
|
+
const { isFinal: n, alternatives: a } = t;
|
|
56
|
+
if (n && a.length > 0) {
|
|
57
|
+
const c = a[0].transcript, l = (() => {
|
|
58
|
+
const u = s, q = u && !u.endsWith(" ") && !u.endsWith(`
|
|
56
59
|
`);
|
|
57
|
-
return u + (
|
|
60
|
+
return u + (q ? " " : "") + c;
|
|
58
61
|
})();
|
|
59
|
-
i(
|
|
62
|
+
i(l);
|
|
60
63
|
}
|
|
61
64
|
};
|
|
62
65
|
let f;
|
|
63
|
-
return
|
|
64
|
-
...
|
|
65
|
-
onResult:
|
|
66
|
+
return r && (typeof r == "object" ? f = {
|
|
67
|
+
...r,
|
|
68
|
+
onResult: r.onResult || x
|
|
66
69
|
} : f = {
|
|
67
70
|
onResult: x
|
|
68
|
-
}), /* @__PURE__ */ e.createElement(
|
|
69
|
-
|
|
71
|
+
}), /* @__PURE__ */ e.createElement(J, { name: U.name }, /* @__PURE__ */ e.createElement(F, { streaming: o.streaming, onCancel: o.onCancel }, /* @__PURE__ */ e.createElement(
|
|
72
|
+
w,
|
|
70
73
|
{
|
|
71
74
|
ref: m,
|
|
72
|
-
value:
|
|
75
|
+
value: s,
|
|
73
76
|
flow: "vertical",
|
|
74
77
|
textareaStyle: { maxHeight: "110px" },
|
|
75
78
|
autoSize: !0,
|
|
76
|
-
suffix:
|
|
77
|
-
onChange:
|
|
79
|
+
suffix: r ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(H, { orientation: "horizontal" }), /* @__PURE__ */ e.createElement(L, { orientation: "horizontal" }, /* @__PURE__ */ e.createElement(O, { fillMode: "flat", ...f }))) : void 0,
|
|
80
|
+
onChange: v,
|
|
78
81
|
...k
|
|
79
82
|
}
|
|
80
|
-
), p && p.length > 0 && /* @__PURE__ */ e.createElement(
|
|
81
|
-
|
|
83
|
+
), p && p.length > 0 && /* @__PURE__ */ e.createElement(K, { title: "Prompt Suggestions" }, /* @__PURE__ */ e.createElement(
|
|
84
|
+
Q,
|
|
82
85
|
{
|
|
83
|
-
suggestionsView:
|
|
84
|
-
suggestions: p.map((t,
|
|
85
|
-
id:
|
|
86
|
+
suggestionsView: o.suggestionsView,
|
|
87
|
+
suggestions: p.map((t, n) => ({
|
|
88
|
+
id: n,
|
|
86
89
|
text: t,
|
|
87
90
|
description: t
|
|
88
91
|
})),
|
|
89
92
|
onSuggestionClick: (t) => {
|
|
90
|
-
|
|
93
|
+
y(t.text);
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
|
-
))), /* @__PURE__ */ e.createElement(
|
|
94
|
-
|
|
96
|
+
))), /* @__PURE__ */ e.createElement(j, null, /* @__PURE__ */ e.createElement(
|
|
97
|
+
V,
|
|
95
98
|
{
|
|
96
99
|
themeColor: "primary",
|
|
97
100
|
fillMode: "solid",
|
|
98
101
|
rounded: "full",
|
|
99
102
|
size: "medium",
|
|
100
|
-
onClick:
|
|
101
|
-
disabled: !
|
|
103
|
+
onClick: b,
|
|
104
|
+
disabled: !s.trim(),
|
|
102
105
|
...d
|
|
103
106
|
},
|
|
104
107
|
d.children
|
|
105
108
|
)));
|
|
106
109
|
};
|
|
107
110
|
export {
|
|
108
|
-
|
|
111
|
+
me as AIPromptView
|
|
109
112
|
};
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common"),require("@progress/kendo-react-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-intl"),require("prop-types"),require("@progress/kendo-react-upload"),require("@progress/kendo-react-animation"),require("@progress/kendo-react-notification"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-indicators"),require("@progress/kendo-react-tooltip")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-layout","@progress/kendo-react-intl","prop-types","@progress/kendo-react-upload","@progress/kendo-react-animation","@progress/kendo-react-notification","@progress/kendo-react-inputs","@progress/kendo-react-popup","@progress/kendo-react-indicators","@progress/kendo-react-tooltip"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactConversationalUi={},e.React,e.KendoReactCommon,e.KendoReactButtons,e.KendoSvgIcons,e.KendoReactLayout,e.KendoReactIntl,e.PropTypes,e.KendoReactUpload,e.KendoReactAnimation,e.KendoReactNotification,e.KendoReactInputs,e.KendoReactPopup,e.KendoReactIndicators,e.KendoReactTooltip)}(this,function(e,t,n,a,l,s,o,r,i,c,u,m,d,g,p){"use strict";function f(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var h=f(t);const v="newMessage.sendButton",k="newMessage.optionsButton",E="newMessage.messageInput",b="avatar.alt",y="messageList.ariaLabel",C="aIPrompt.noOutputs",x="aIPrompt.cancel",I="chat.senderDeletedMessage",T="chat.receiverDeletedMessage",N="chat.copyNotification",w="chat.downloadAllFiles",F="chat.closeReply",S="chat.collapseMessage",A="chat.expandMessage",R="chat.removeFile",M="chat.fileActions",L="chat.attachFile",B="chat.downloadAll",D="chat.scrollLeft",P="chat.scrollRight",z="chat.scrollToBottom",O="chat.messageFailed",q="chat.retryMessage",K="chat.stopGenerating",H="promptBox.input",U="promptBox.sendButton",$="promptBox.attachFile",V="promptBox.removeFile",j="promptBox.stopGenerating",W="promptBox.ariaLabel",G="promptBox.attachedFiles",_="chat.messageToolbar",Y="chat.unpinMessage",J="chat.messageAttachedFiles",X="toolCall.state.active",Q="toolCall.state.completed",Z="toolCall.state.awaitingApproval",ee="toolCall.state.error",te="checkpoint.startOver",ne="checkpoint.restore",ae="checkpoint.restored",le="checkpoint.redo",se="toolCall.approve",oe="toolCall.reject",re="citation.previous",ie="citation.next",ce={[v]:"Send",[k]:"Options",[E]:"Message",[b]:"Avatar",[y]:"Message list",[x]:"Cancel",[C]:"No output from AI available",[I]:"You removed this message",[T]:"The message was removed by its sender",[N]:"Text copied to clipboard",[w]:"Download all files",[F]:"Close reply",[S]:"Collapse message",[A]:"Expand message",[R]:"Remove file",[M]:"File actions for",[O]:"Failed to send",[q]:"Retry",[K]:"Stop generating",[L]:"Attach file",[B]:"Download all",[D]:"Scroll left",[P]:"Scroll right",[z]:"Scroll to bottom",[H]:"Prompt",[U]:"Send",[$]:"Attach file",[V]:"Remove file",[j]:"Stop generating",[W]:"Prompt box",[G]:"Attached files",[_]:"Toolbar",[Y]:"Unpin message",[J]:"Attached files",[X]:"Active",[Q]:"Completed",[Z]:"Awaiting Approval",[ee]:"Error",[te]:"Start Over",[ne]:"Restore Checkpoint",[ae]:"Checkpoint Restored",[le]:"Redo",[se]:"Approve",[oe]:"Reject",[re]:"Previous",[ie]:"Next"},ue=(e,t)=>e&&t.author&&e.id===t.author.id,me=(e,t)=>{const n=t.toLanguageString("chatSender.deletedMessage",ce[I]),a=t.toLanguageString("chatReceiver.deletedMessage",ce[T]);return e?n:a},de=(e,t)=>e.find(e=>e.id===t),ge=/(https?:\/\/[^\s]+)/g,pe=e=>{if(!e)return[""];const t=e.split(ge),n=[];return t.forEach(e=>{e&&ge.test(e)?(ge.lastIndex=0,n.push(h.createElement("a",{key:e,href:e,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"}},e))):e&&n.push(e)}),n},fe=h.createContext(void 0),he=()=>{const e=t.useContext(fe);if(void 0===e)throw new Error("useChatContext must be used within a ChatContext.Provider");return e},ve=e=>{const{files:t,onFileAction:s,onDownload:r,fileActions:i}=e,{messageFilesLayout:c="vertical"}=he(),u=o.useLocalization(),m=i||[{id:"download",label:"Download",svgIcon:l.downloadIcon}],d=e=>{if(null==e)return"";if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,t)).toFixed(2))} ${["B","KB","MB","GB","TB"][t]}`},g=e=>"."+e.split(".").pop()||"",p=e=>m.length>0&&h.createElement(a.DropDownButton,{fillMode:"flat",size:"xs",svgIcon:l.moreVerticalIcon,onClick:e=>{e.syntheticEvent.stopPropagation()},onItemClick:t=>((e,t)=>{var n,a;null==(a=null==(n=e.syntheticEvent)?void 0:n.stopPropagation)||a.call(n),"download"===e.item.id&&(null==r||r([t])),null==s||s(e.item,e,t)})(t,e),items:m.map(e=>({id:e.id,icon:e.icon,text:e.label,svgIcon:e.svgIcon})),"aria-label":`${u.toLanguageString(M,ce[M])} ${e.name}`,title:`${u.toLanguageString(M,ce[M])} ${e.name}`}),f=h.useCallback(()=>n.classNames({"k-files-wrap":"wrap"===c,"k-files-vertical":"vertical"===c},"k-file-box-wrapper"),[c]);return h.createElement("ul",{role:"list","aria-label":u.toLanguageString(J,ce[J]),className:f()},"horizontal"===c?h.createElement("div",{className:"k-files-scroll",role:"presentation"},t.map(e=>h.createElement("li",{key:e.name,className:"k-file-box",role:"listitem","aria-label":[e.name,d(e.size)].filter(Boolean).join(" ")||void 0},h.createElement(n.IconWrap,{size:"xlarge",...n.getFileExtensionIcon(g(e.name))}),h.createElement("div",{className:"k-file-info"},h.createElement("span",{className:"k-file-name"},e.name),h.createElement("span",{className:"k-file-size"},d(e.size))),p(e)))):t.map(e=>h.createElement("li",{key:e.name,className:"k-file-box",role:"listitem","aria-label":[e.name,d(e.size)].filter(Boolean).join(" ")||void 0},h.createElement(n.IconWrap,{size:"xlarge",...n.getFileExtensionIcon(g(e.name))}),h.createElement("div",{className:"k-file-info"},h.createElement("span",{className:"k-file-name"},e.name),h.createElement("span",{className:"k-file-size"},d(e.size))),p(e))))},ke=h.forwardRef((e,t)=>{const{item:r,template:i,contentTemplate:c,onRequestSelection:u,tabIndex:m=-1,dateFormat:d="g",selected:g,allowMessageCollapse:p,messageToolbarActions:f,messageContextMenuActions:v,fileActions:k,isSender:E}=e,{setReplyToMessage:b,messages:y,repliedToMessages:C,user:x,onToolbarAction:I,onContextMenuAction:T,onFileAction:N,onDownload:F,onResendMessage:R,setShowCopyNotification:M,statusTemplate:L,timestampVisibility:D="onFocus",onReferencedMessageClick:P}=he(),[z,K]=h.useState(!1),[H,U]=h.useState(!1),[$,V]=h.useState(!0),[j,W]=h.useState(!1),G=o.useLocalization(),Y=o.useInternationalization(),J=h.useRef({left:0,top:0}),X=h.useCallback(()=>{null!=r&&r.text&&(e=>{navigator.clipboard.writeText(e)})(r.text),M&&(M(!0),setTimeout(()=>{M(!1)},3e3))},[r,M]),Q=h.useCallback(e=>{e.stopPropagation(),V(e=>!e)},[]),Z=h.useCallback(()=>{W(!1)},[]),ee=h.useCallback(e=>{("Tab"===e.key||"Enter"===e.key||" "===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key)&&W(!0)},[]),te=h.useRef(null);h.useEffect(()=>{g&&te.current&&te.current.focus()},[g]);const ne=h.useCallback(e=>{J.current={left:e.pageX,top:e.pageY},e.preventDefault(),U(!0),K(!0)},[]),ae=h.useCallback(()=>{U(!1),K(!1)},[]),le=h.useCallback((e,t)=>e.isDeleted?me(t,G):e.text?e.text:"",[G]),se=h.useCallback(e=>{var t;null!=(t=e.item)&&t.text&&("copy"!==e.item.data.id||r.isDeleted?"reply"===e.item.data.id&&b(r):X(),T&&T(e.item.data,e,r)),U(!1),K(!1)},[r,T,b,X]),oe=h.useCallback(()=>{if(r.replyToId){const e=de(y,r.replyToId)||(C?de(C,r.replyToId):void 0);if(e){const t=t=>{t.preventDefault(),t.stopPropagation(),null==P||P(e.id)};return h.createElement("div",{className:n.classNames("k-message-reference",ue(x,e)?"k-message-reference-sender":"k-message-reference-receiver"),onClick:t},h.createElement("div",{className:"k-message-reference-content"},pe(le(e,ue(x,e)))))}}return null},[r.replyToId,y,C,x,le,P]),re=h.useCallback(()=>{const e=[{id:"reply",label:"Reply",svgIcon:l.undoIcon},{id:"copy",label:"Copy",svgIcon:l.copyIcon}],t=v?[...e.map(e=>v.find(t=>t.id===e.id)||e),...v.filter(t=>!e.some(e=>e.id===t.id))]:e;return h.createElement(s.ContextMenu,{onSelect:se,onClose:ae,vertical:!0,show:z,offset:J.current},t.map(e=>"delete"!==e.id||E?h.createElement(s.MenuItem,{key:e.id,text:e.label,icon:e.icon,svgIcon:e.svgIcon,data:e}):null))},[v,se,ae,z,E]),ie=h.useCallback(()=>r.files&&r.files.length>1?h.createElement("div",{className:"k-chat-download-button-wrapper"},h.createElement(a.Button,{className:"k-chat-download-button",fillMode:"flat",svgIcon:l.downloadIcon,size:"small",onClick:e=>{e.stopPropagation(),F&&F(r.files,r)},"aria-label":G.toLanguageString(w,ce[w])},h.createElement("span",{className:"k-button-text"},G.toLanguageString(B,ce[B])))):null,[r,F,G]),ge=h.useCallback(()=>{if(r.typing)return h.createElement("div",{className:"k-chat-bubble k-bubble"},h.createElement("div",{className:"k-bubble-content"},h.createElement("div",{className:"k-typing-indicator"},h.createElement("span",null),h.createElement("span",null),h.createElement("span",null))));if(i){const e=i;return h.createElement(h.Fragment,null,h.createElement(e,{item:r}),re())}return r.text||r.files&&r.files.length>0?h.createElement(h.Fragment,null,h.createElement("div",{className:n.classNames("k-chat-bubble","k-bubble",{"k-bubble-expandable":p,"k-expanded":p&&$,"k-selected":g,"k-active":H}),onClick:()=>u(g?void 0:r.selectionIndex),onContextMenu:ne},h.createElement("div",{className:"k-bubble-content"},c?h.createElement(c,{item:r}):h.createElement(h.Fragment,null,(r.text||r.isDeleted||r.replyToId)&&h.createElement("span",{className:"k-chat-bubble-text"},!r.isDeleted&&oe(),pe(le(r,ue(x,r)))),r.files&&r.files.length>0&&h.createElement(ve,{files:r.files,message:r,onFileAction:N,onDownload:e=>null==F?void 0:F(e,r),renderInTextarea:!1,fileActions:k}),ie())),p&&h.createElement("span",{className:"k-bubble-expandable-indicator",onClick:Q,role:"button","aria-label":$?G.toLanguageString(S,ce[S]):G.toLanguageString(A,ce[A]),tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),Q(e))}},h.createElement(n.IconWrap,{icon:$?l.chevronUpIcon:l.chevronDownIcon}))),re()):null},[r,i,c,p,$,g,H,u,ne,oe,le,x,N,k,ie,Q,G,re,F]),fe=h.useCallback(()=>{let e=null;return r.timestamp&&("hidden"===D||(e=h.createElement("time",{className:"k-message-time"},Y.formatDate(r.timestamp,d)))),e},[r.timestamp,d,D,Y]),ke=h.useCallback(()=>{if(!r.status)return null;let e;if(L)e=h.createElement(L,{item:r});else{let t,a,l;if("object"==typeof r.status&&null!==r.status){const e=r.status;t=e.text,a=e.icon,l=e.svgIcon}else t=r.status;let s=null;a?s=h.createElement(n.Icon,{name:a,size:"xsmall"}):l&&(s=h.createElement(n.IconWrap,{icon:l,size:"xsmall"})),e=h.createElement(h.Fragment,null,s,t)}return h.createElement("span",{className:"k-message-status"},e)},[r,L]),Ee=h.useCallback(()=>{let e=null;if(r.isFailed){const t=G.toLanguageString(O,ce[O]);e=h.createElement("span",{className:"k-message-failed-content"},h.createElement(n.IconWrap,{icon:l.warningTriangleIcon,size:"xsmall"}),h.createElement("span",{className:"k-message-failed-text"},t))}return e},[r,G]),be=h.useCallback(()=>{let e=null;if(r.isFailed){const t=G.toLanguageString(q,ce[q]);e=h.createElement(a.Button,{fillMode:"clear",size:"xs",className:"k-resend-button",svgIcon:l.arrowRotateCwIcon,"aria-label":t,title:t,onClick:e=>{e.stopPropagation(),R&&R({message:r,syntheticEvent:e,nativeEvent:e.nativeEvent,target:e.target})}})}return e},[r,G,R]),ye=h.useCallback(()=>n.classNames({"k-focus":g,"k-message-removed":r.isDeleted,"k-message-failed":r.isFailed},"k-message"),[g,r.isDeleted,r.isFailed]),Ce=h.useCallback(()=>f&&f.length>0&&h.createElement(a.Toolbar,{className:"k-chat-message-toolbar",fillMode:"flat",ariaLabel:G.toLanguageString(_,ce[_])},f.map(e=>"delete"!==e.id||E?h.createElement(a.Button,{key:e.id,fillMode:"flat",className:"k-toolbar-button",icon:e.icon,svgIcon:e.svgIcon,"aria-label":e.label,onClick:t=>{t.stopPropagation(),"copy"!==e.id||r.isDeleted?"reply"===e.id&&b(r):X(),I&&I(e,t,r)},onMouseDown:e=>e.preventDefault()}):null)),[X,E,r,G,f,I,b]);return h.createElement("div",{key:r.id,"data-message-id":r.id,className:ye(),tabIndex:m,onMouseDown:Z,onKeyDown:ee,onFocus:e=>{j&&u(r.selectionIndex)},ref:e=>{te.current=e,"function"==typeof t?t(e):t&&(t.current=e)},onContextMenu:i?ne:void 0},be(),ge(),(r.status||r.timestamp&&"hidden"!==D||r.isFailed)&&h.createElement("div",{className:"k-message-info"},ke(),fe(),Ee()),Ce())});ke.displayName="ChatMessage";const Ee=e=>e[e.length-1],be=e=>(t,n,a)=>{const l=a===e-1;return((e,t)=>{const n=t.timestamp,a=Ee(e);if(n&&(!a||((e,t)=>e&&t&&(t.getDate()!==e.getDate()||t.getMonth()!==e.getMonth()||t.getFullYear()!==e.getFullYear()))(n,a.timestamp))){const t={type:"date-marker",timestamp:n,trackBy:n.getTime()};e.push(t)}})(t,n),((e,t,n)=>{const a=Ee(e);let l;t.typing&&!n||(a&&"message-group"===a.type&&(l=a.messages),l&&ue(t.author,Ee(l))?l.push(t):e.push({type:"message-group",messages:[t],author:t.author,timestamp:t.timestamp,trackBy:t}))})(t,n,l),n.attachments&&n.attachments.length>1&&t.push({type:"attachment-group",attachments:n.attachments,attachmentLayout:n.attachmentLayout,timestamp:n.timestamp,trackBy:n}),n.suggestedActions&&l&&t.push({type:"action-group",actions:n.suggestedActions,timestamp:n.timestamp,trackBy:n}),t};const ye=e=>{const{item:t,onActionExecute:a,selected:l}=e,s=h.useRef(null);h.useEffect(()=>{l&&s.current&&s.current.focus()},[l]);const o=h.useCallback(e=>{(e.keyCode===n.Keys.enter||" "===e.key)&&(e.preventDefault(),a(t,e))},[a,t]),r=h.useCallback(()=>n.classNames("k-suggestion k-suggestion-primary",{"k-selected":l},{"k-focus":l}),[l]);return h.createElement("span",{role:"button",className:r(),onClick:e=>a(t,e),ref:s,onKeyDown:o,tabIndex:0,"aria-label":t.title||t.value},t.title||t.value)},Ce=({visible:e,dir:t,canScrollLeft:n,canScrollRight:s,onScrollLeft:r,onScrollRight:i,children:c})=>{const u=o.useLocalization();if(!e)return c;const m=u.toLanguageString(D,ce[D]),d=u.toLanguageString(P,ce[P]),g="rtl"!==t?m:d,p="rtl"!==t?d:m;return h.createElement("div",{className:"k-suggestion-scrollwrap"},h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:"rtl"===t?l.chevronRightIcon:l.chevronLeftIcon,onClick:r,disabled:!n,"aria-label":g,title:g}),c,h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:"rtl"===t?l.chevronLeftIcon:l.chevronRightIcon,onClick:i,disabled:!s,"aria-label":p,title:p}))},xe=100,Ie=(e,t)=>{const{enabled:n,dir:a,mode:l,itemsDependency:s=[],scrollSpeed:o=xe}=t,[r,i]=h.useState(!1),[c,u]=h.useState(!1),m=h.useCallback(()=>{if(e.current&&n){const{scrollLeft:t,scrollWidth:n,clientWidth:l}=e.current,s="rtl"!==a?t+l>=n-1:l-t>=n-1;i(!(0===t)),u(!s)}},[n,a]),d=h.useCallback(()=>{e.current&&n&&e.current.scrollBy({left:"rtl"!==a?-o:o,behavior:"smooth"})},[n,a,o]),g=h.useCallback(()=>{e.current&&n&&e.current.scrollBy({left:"rtl"!==a?o:-o,behavior:"smooth"})},[n,a,o]);return h.useEffect(()=>{const t=e.current;if(!t||!n)return;m();const a=()=>m();t.addEventListener("scroll",a,{passive:!0});const l=new ResizeObserver(m);return l.observe(t),()=>{t.removeEventListener("scroll",a),l.disconnect()}},[n,m,s.length,l]),h.useLayoutEffect(()=>{n&&m()},[n,a,s]),{canScrollLeft:r,canScrollRight:c,scrollLeft:d,scrollRight:g}},Te=e=>{var t,a;const{group:l,onActionExecute:s,selected:o,onRequestSelection:r,quickActionsLayout:i="scroll",dir:c}=e,[u,m]=h.useState(null),d=h.useRef(null),{canScrollLeft:g,canScrollRight:p,scrollLeft:f,scrollRight:v}=Ie(d,{enabled:"scrollbuttons"===i||"scroll"===i,dir:c,mode:i,itemsDependency:l.actions});h.useEffect(()=>{o||null===u?o&&null===u&&m(0):m(null)},[o,u]);const k=h.useCallback(()=>l.actions?l.actions.length-1:-1,[l.actions]),E=h.useCallback((e,t=0)=>{let n=null;return e?null===u?n=t:u<k()&&(n=u+1):null===u?n=0:u>0&&(n=u-1),null!==n&&m(n),n},[u,k]),b=h.useCallback(()=>{r(l.selectionIndex)},[r,l.selectionIndex]),y=h.useCallback(e=>{let t=null;const a=n.Keys.left,l=n.Keys.right;e.keyCode===a?t=E(!1):e.keyCode===l&&(t=E(!0)),null!==t&&(e.preventDefault(),e.stopPropagation())},[E]),C=h.useCallback(()=>n.classNames("k-suggestion-group",{"k-suggestion-group-scrollable":"scroll"===i,"k-suggestion-group-scrollable-start":p&&("scroll"===i||"scrollbuttons"===i),"k-suggestion-group-scrollable-end":g&&("scroll"===i||"scrollbuttons"===i)}),[i,p,g]),x="scroll"===i||"scrollbuttons"===i,I=h.createElement("div",{className:C(),onClick:b,onKeyDown:y,role:"toolbar",tabIndex:0,"aria-label":"Action group"},x?h.createElement("div",{className:"k-suggestions-scroll",ref:d},null==(t=l.actions)?void 0:t.map((e,t)=>h.createElement(ye,{item:e,onActionExecute:s,selected:t===u,key:e.value}))):null==(a=l.actions)?void 0:a.map((e,t)=>h.createElement(ye,{item:e,onActionExecute:s,selected:t===u,key:e.value})));return h.createElement(Ce,{visible:"scrollbuttons"===i,dir:c,canScrollLeft:g,canScrollRight:p,onScrollLeft:f,onScrollRight:v},I)},Ne=e=>{const{item:t,template:a,tabbable:l,onClick:s,selected:o}=e,r=h.useRef(null);h.useEffect(()=>{o&&r.current&&r.current.focus()},[o]);const i=h.useCallback(()=>{if(void 0!==l)return l?0:-1},[l]),c=h.useCallback(()=>n.classNames({"k-selected":o},{"k-focus":o}),[o]),u=h.useCallback(()=>t.title?h.createElement("h5",{className:"k-card-title"},t.title):null,[t.title]),m=h.useCallback(()=>t.subtitle?h.createElement("h6",{className:"k-card-subtitle"},t.subtitle):null,[t.subtitle]),d=h.useCallback(()=>0===t.contentType.indexOf("image/")?h.createElement("img",{src:t.content,alt:t.title||"Attachment",style:{maxHeight:"200px",height:"auto",maxWidth:"200px",width:"auto"}}):t.content,[t.contentType,t.content,t.title]),g=a;return h.createElement("div",{className:c(),tabIndex:i(),onClick:s,ref:r},a?h.createElement(g,{item:t}):h.createElement("div",{className:"k-card"},h.createElement("div",{className:"k-card-body"},u(),m(),d())))},we=e=>{const{group:t,itemTemplate:s,selected:o,isLastGroup:r,onRequestSelection:i}=e,[c,u]=h.useState(null);h.useEffect(()=>{o||null===c?o&&null===c&&u(0):u(null)},[o,c]);const m=h.useCallback(e=>"list"!==e.attachmentLayout,[]),d=h.useCallback(()=>t.attachments?t.attachments.length-1:-1,[t.attachments]),g=h.useCallback(()=>t.attachments.length-1,[t.attachments]),p=h.useCallback((e,t=0)=>{let n=null;return e?null===c?n=t:c<d()&&(n=c+1):null===c?n=0:c>0&&(n=c-1),null!==n&&u(n),n},[c,d]),f=h.useCallback(()=>{i(t.selectionIndex)},[i,t.selectionIndex]),v=h.useCallback(e=>{let a,l,s=null;m(t)?(a=n.Keys.left,l=n.Keys.right):(a=n.Keys.up,l=n.Keys.down),e.keyCode===a?s=p(!1):e.keyCode===l&&(s=p(!0)),null!==s&&(e.preventDefault(),e.stopPropagation())},[p,m,t]),k=h.useCallback(e=>{f(),u(e)},[f]),E=h.useCallback(e=>{f(),p(e,1)},[f,p]),b=h.useCallback(()=>{let e=null;return m(t)&&c&&(e=h.createElement(a.Button,{icon:"chevron-left",onClick:()=>E(!1),svgIcon:l.chevronLeftIcon})),e},[m,t,c,E]),y=h.useCallback(()=>{let e=null;return m(t)&&c!==g()&&(e=h.createElement(a.Button,{icon:"chevron-right",onClick:()=>E(!0),svgIcon:l.chevronRightIcon})),e},[m,t,c,g,E]),C=h.useCallback(()=>n.classNames({"k-card-list":t.attachmentLayout,"k-card-deck":m(t)}),[t.attachmentLayout,t,m]),x=m(t),I=h.createElement("div",{className:C(),onKeyDown:x?void 0:v},t.attachments.map((e,t)=>h.createElement(Ne,{item:e,template:s,selected:t===c,tabbable:r&&t===c,onClick:()=>k(t),key:e.content})));return x?h.createElement("div",{className:"k-card-deck-scrollwrap",onKeyDown:v},b(),I,y()):I},Fe=({item:e,timestampTemplate:t})=>{const n=o.useInternationalization(),a=t;return h.createElement("div",{className:"k-timestamp"},a?h.createElement(a,{item:e}):n.formatDate(e.timestamp,"D"))},Se=e=>{const{group:t,user:a,itemTemplate:l,contentTemplate:r,attachmentTemplate:i,onRequestSelection:c,selectedItemIndex:u,isLastGroup:m,message:d,allowMessageCollapse:g,messageToolbarActions:p,messageContextMenuActions:f,fileActions:v,messageWidthMode:k="standard",showAvatar:E=!0,showUsername:y=!0}=e,{userStatusTemplate:C}=he(),x=o.useLocalization(),I=t.messages.length>0&&ue(a,t.messages[0]),{avatarUrl:T,avatarAltText:N,name:w}=t.author,F=h.useMemo(()=>n.classNames("k-message-group",{"k-message-group-sender":I,"k-message-group-receiver":!I,"k-message-group-full-width":"full"===k,"k-no-avatar":!E||!T}),[I,k,E,T]),S=h.useMemo(()=>{const e=t.messages.length-1;return t.messages.map((t,n)=>{const s=[h.createElement(d,{item:t,template:l,contentTemplate:r,selected:t.selectionIndex===u,onRequestSelection:c,tabIndex:n===e&&m?0:-1,key:t.id,allowMessageCollapse:g,messageToolbarActions:p,messageContextMenuActions:f,fileActions:v,isSender:ue(a,t)})];return t.attachments&&1===t.attachments.length&&s.push(h.createElement(Ne,{item:t.attachments[0],template:i,selected:!1,key:`att-${t.attachments[0].content}`})),s})},[t.messages,d,l,r,u,c,m,g,p,f,v,a,i]),A=void 0!==N?N:x.toLanguageString(b,ce[b]);return h.createElement("div",{className:F},(()=>{if(!E||!T)return;const e=h.createElement(s.Avatar,{type:"image"},h.createElement("img",{src:T,alt:A}));if(C){const n=t.messages[t.messages.length-1];return h.createElement("div",{className:"k-chat-user-status-wrapper"},e,h.createElement("div",{className:"k-chat-user-status"},h.createElement(C,{message:"dataItem"in n?n.dataItem:n})))}return e})(),h.createElement("div",{className:"k-message-group-content"},y&&h.createElement("span",{className:"k-message-author"},w),S))},Ae=e=>{const{suggestions:t,onSuggestionClick:a,suggestionsView:l,suggestionTemplate:s,suggestionsLayout:o,dir:r}=e,i=h.useRef(null),{canScrollLeft:c,canScrollRight:u,scrollLeft:m,scrollRight:d}=Ie(i,{enabled:"scrollbuttons"===o||"scroll"===o,dir:r,mode:o,itemsDependency:t}),g=h.useCallback((e,t)=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),null==a||a(t))},[a]),p=h.useCallback(()=>t.map(e=>s?h.createElement(s,{key:e.id,suggestion:e,onClick:()=>{null==a||a(e)}}):h.createElement("span",{role:"button",tabIndex:e.disabled?-1:0,"aria-label":e.description,"aria-disabled":e.disabled,onClick:()=>!e.disabled&&(null==a?void 0:a(e)),onKeyDown:t=>!e.disabled&&g(t,e),key:e.id,title:e.description,className:n.classNames("classic"===l?"k-prompt-suggestion":"k-suggestion",{"k-disabled":e.disabled})},e.text)),[t,s,a,l,g]);if(!t||0===t.length)return null;if("classic"===l)return p();const f="scroll"===o||"scrollbuttons"===o,v=h.createElement("div",{role:"group",className:n.classNames("k-suggestion-group",{"k-suggestion-group-scrollable":"scroll"===o,"k-suggestion-group-scrollable-start":u&&("scroll"===o||"scrollbuttons"===o),"k-suggestion-group-scrollable-end":c&&("scroll"===o||"scrollbuttons"===o)})},f?h.createElement("div",{className:"k-suggestions-scroll",ref:i},p()):p());return h.createElement(Ce,{visible:"scrollbuttons"===o,dir:r,canScrollLeft:c,canScrollRight:u,onScrollLeft:m,onScrollRight:d},v)},Re=h.forwardRef(({onFilesAdd:e,files:t=[],restrictions:n,multiple:l=!0,accept:s,uploadRef:o,onSelectAttachments:r,onRemoveAttachment:c,_registerRemoveCallback:u,...m},d)=>{h.useEffect(()=>(u&&c&&u(c),()=>{u&&c&&u(void 0)}),[c,u]);const g=h.useCallback(t=>{e&&e(t),r&&r({selectedFiles:t.affectedFiles,allFiles:t.newState})},[e,r]);return h.createElement(h.Fragment,null,h.createElement(a.Button,{ref:d,...m}),h.createElement(i.Upload,{ref:o,files:t,onAdd:g,autoUpload:!1,restrictions:n,multiple:l,accept:s,className:"k-hidden"}))});Re.displayName="PromptBoxUploadButton";const Me=h.forwardRef((e,t)=>h.createElement(a.Button,{ref:t,...e}));Me.displayName="PromptBoxActionButton";const Le=h.forwardRef((e,t)=>h.createElement(a.SpeechToTextButton,{ref:t,...e}));Le.displayName="PromptBoxSpeechToTextButton";const Be=e=>"."+e.split(".").pop()||"",De=e=>{if(null==e)return"";if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,t)).toFixed(2))} ${["B","KB","MB","GB","TB"][t]}`},Pe=({files:e,onRemoveFile:t,header:s})=>{const r=o.useLocalization(),i=h.useRef(null),[c,u]=h.useState(!1),[m,d]=h.useState(!1),g=h.useCallback(()=>{const e=i.current;if(!e)return;const{scrollLeft:t,scrollWidth:n,clientWidth:a}=e,l=t+a>=n-1;d(!(0===t)),u(!l)},[]);if(h.useLayoutEffect(()=>{g()},[e,g]),h.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>g(),n=new ResizeObserver(g);return n.observe(e),e.addEventListener("scroll",t,{passive:!0}),()=>{e.removeEventListener("scroll",t),n.disconnect()}},[g,e.length]),0===e.length&&!s)return null;const p=(e=>e?"function"==typeof e?e():e:null)(s),f=e.length>0&&h.createElement("ul",{role:"list","aria-label":r.toLanguageString(G,ce[G]),className:n.classNames("k-file-box-wrapper",{"k-file-box-wrapper-scrollable-start":c,"k-file-box-wrapper-scrollable-end":m})},h.createElement("div",{className:"k-files-scroll",role:"presentation",ref:i},e.map((e,s)=>h.createElement("li",{key:e.name,className:"k-file-box",role:"listitem",tabIndex:0===s?0:-1,"aria-label":[e.name,De(e.size)].filter(Boolean).join(" ")||void 0},h.createElement(n.IconWrap,{size:"xlarge",...n.getFileExtensionIcon(Be(e.name))}),h.createElement("div",{className:"k-file-info"},h.createElement("span",{className:"k-file-name"},e.name),h.createElement("span",{className:"k-file-size"},De(e.size))),h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:l.xCircleIcon,onClick:n=>{n.stopPropagation(),t(e.name)},"aria-label":`${r.toLanguageString(V,ce[V])} ${e.name}`,title:`${r.toLanguageString(V,ce[V])} ${e.name}`})))));return h.createElement("div",{className:"k-prompt-box-header"},p,f)},ze=Object.freeze({name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"16.1.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"}),Oe="k-prompt-box",qe={mode:"auto",rows:1,defaultValue:"",disabled:!1,readOnly:!1,loading:!1,uploadButtonConfig:!1,speechToTextButtonConfig:!0,actionButtonConfig:!0},Ke=h.forwardRef((e,t)=>{const a=!n.validatePackage(ze,{component:"PromptBox"}),s=n.getLicenseMessage(ze),r=o.useLocalization(),i={...qe,...e},{mode:c=qe.mode,fillMode:u,rows:m=qe.rows,maxTextAreaHeight:d,value:g,defaultValue:p=qe.defaultValue,disabled:f=qe.disabled,readOnly:v=qe.readOnly,placeholder:k,title:E,maxLength:b,inputAttributes:y,topAffix:C,startAffix:x,endAffix:I,header:T,onChange:N,onFocus:w,onBlur:F,onPromptAction:S,attachments:A,loading:R=qe.loading,uploadButtonConfig:M=qe.uploadButtonConfig,speechToTextButtonConfig:L=qe.speechToTextButtonConfig,actionButtonConfig:B=qe.actionButtonConfig,className:D,style:P,...z}=i,O=h.useRef(null),[q,K]=h.useState(p),[V,W]=h.useState([]),[G,_]=h.useState(!1),Y=h.useRef(null),J=h.useRef(null),X=h.useRef(0),Q=h.useRef(0),Z=h.useRef(!1),ee=h.useRef(0),te=h.useRef(0),ne=h.useCallback((e,t)=>e?"function"==typeof e?e(t):e:null,[]),ae=void 0!==g,le=ae?g:q,se=void 0!==A,oe=se?A:V,re=h.useMemo(()=>!!(null!=le&&le.trim()||oe.length>0),[le,oe.length]),ie=h.useCallback(()=>{if(!O.current||"single"===c)return;const e=O.current,t=globalThis.getComputedStyle(e),n=Number.parseFloat(t.lineHeight)||20,a=Number.parseFloat(t.paddingTop)||0,l=Number.parseFloat(t.paddingBottom)||0;X.current=e.offsetHeight||n+a+l,Q.current=n*m+a+l,"auto"===c&&!G&&(te.current=e.offsetWidth)},[c,m,G]),ue=h.useCallback(()=>"auto"===c?1:m,[c,m]),me=h.useCallback(e=>{if(d){const t=Number.parseInt(d,10);if(e>t)return t}return Math.max(Q.current,e)},[d]),de=h.useCallback(e=>{e.style.overflow="hidden",e.style.height=`${X.current}px`;const t=e.scrollHeight,n=me(t);e.style.height=`${n}px`,d&&t>Number.parseInt(d,10)&&(e.style.overflow="")},[me,d]),ge=h.useCallback(e=>{e.style.overflow="hidden",e.style.height=`${X.current}px`;const t=e.scrollHeight,n=d?Math.min(t,Number.parseInt(d,10)):t;e.style.height=`${n}px`,d&&t>Number.parseInt(d,10)&&(e.style.overflow="")},[d]),pe=h.useCallback(e=>{if(te.current<=0)return!1;const t=e.style.height,n=e.style.width;e.style.overflow="hidden",e.style.width=`${te.current}px`,e.style.height=`${X.current}px`;const a=e.scrollWidth<=te.current&&e.scrollHeight<=X.current;return e.style.overflow="",e.style.width=n||"",e.style.height=t||"",a},[]),fe=h.useCallback((e,t)=>{if(!Z.current){if((e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&!G)return Z.current=!0,void _(!0);if(G){ge(e);t<ee.current&&pe(e)&&(e.style.height="",Z.current=!0,_(!1))}}},[G,ge,pe]),he=h.useCallback(()=>{var e;if("single"===c||!O.current)return;const t=O.current,n=(null==(e=t.value)?void 0:e.length)||0;"multi"===c?de(t):"auto"===c&&fe(t,n)},[c,de,fe]);h.useEffect(()=>{"single"!==c&&O.current&&ie()},[c,ie]),h.useEffect(()=>{"single"!==c&&O.current&&(ie(),he())},[m,c,ie,he]),h.useEffect(()=>{if("single"!==c&&O.current){const e=(null==le?void 0:le.length)||0;requestAnimationFrame(()=>{if(O.current){const t=O.current;"multi"===c?de(t):"auto"===c&&fe(t,e),ee.current=e}})}},[le,c,de,fe]),h.useEffect(()=>{"auto"===c&&G&&O.current&&requestAnimationFrame(()=>{if(O.current){const e=O.current;ge(e),Z.current=!1}})},[G,c,ge]),h.useEffect(()=>{if("auto"===c&&O.current){const e=O.current;G||(e.style.height="",e.style.overflow="",Z.current=!1)}},[c,G]),h.useEffect(()=>{if("single"===c||!O.current)return;const e=O.current;let t;const n=new ResizeObserver(()=>{clearTimeout(t),t=setTimeout(()=>{O.current&&("auto"===c&&!G&&ie(),he())},50)});return n.observe(e),()=>{n.disconnect(),clearTimeout(t)}},[c,G,ie,he]);const ve=h.useCallback(()=>({focus:()=>{var e;return null==(e=O.current)?void 0:e.focus()},blur:()=>{var e;return null==(e=O.current)?void 0:e.blur()},element:O.current,get value(){return le}}),[le]);h.useImperativeHandle(t,ve);const ke=h.useCallback(e=>{const t=e.target.value;!ae&&!f&&K(t),N&&!f&&n.dispatchEvent(N,e,{...ve(),value:t},{value:t}),"single"!==c&&he()},[K,N,f,ae,ve,c,he]),Ee=h.useCallback(e=>{w&&!f&&n.dispatchEvent(w,e,ve(),void 0)},[w,f,ve]),be=h.useCallback(e=>{F&&!f&&n.dispatchEvent(F,e,ve(),void 0)},[F,f,ve]),ye=h.useCallback(e=>{e.preventDefault()},[]),Ce=h.useCallback(e=>{S&&n.dispatchEvent(S,e,ve(),{value:le,attachments:oe}),ae||K(""),se||W([])},[S,ve,le,oe,ae,se]),xe=h.useCallback(e=>{if("Enter"!==e.key||!e.shiftKey){if("ArrowUp"===e.key||"ArrowDown"===e.key)return void e.stopPropagation();if("Enter"===e.key){if(e.preventDefault(),R)return;re&&Ce(e)}}},[Ce,R,re]),Ie={disabled:f,readOnly:v,placeholder:k,title:E,maxLength:b,"aria-label":r.toLanguageString(H,ce[H]),value:le,onKeyDown:xe,...y,onChange:ke,onFocus:Ee,onBlur:be,ref:O},Te=h.useCallback(e=>{var t,a;const{isFinal:l,alternatives:s}=e;if(s.length>0){const e=s[0];if(l){const a=(null==(t=O.current)?void 0:t.value)||"",l=(a?`${a} `:"")+e.transcript;if(ae||K(l),N&&!f){const e={target:O.current,currentTarget:O.current};n.dispatchEvent(N,e,{...ve(),value:l},{value:l})}}}null==(a=O.current)||a.focus()},[ae,N,f,ve]),Ne=h.useCallback(()=>{var e,t;null==(t=null==(e=Y.current)?void 0:e.actionElement)||t.click()},[]),we=h.useCallback(e=>{var t;const n=Array.from(e.affectedFiles),a="object"==typeof M&&M.onSelectAttachments;se||W(e=>[...e,...n]),a&&a({selectedFiles:e.affectedFiles,allFiles:e.newState}),null==(t=O.current)||t.focus()},[M,se]),Fe=h.useMemo(()=>({uploadButtonProps:{fillMode:"flat",svgIcon:l.paperclipIcon,size:"small",rounded:"full",onClick:Ne,onFilesAdd:we,files:oe,uploadRef:Y,"aria-label":r.toLanguageString($,ce[$]),title:r.toLanguageString($,ce[$]),_registerRemoveCallback:e=>{J.current=e}},speechToTextButtonProps:{fillMode:"flat",size:"small",rounded:"full",onResult:Te},actionButtonProps:{rounded:"full",size:"small",svgIcon:R?l.stopIcon:l.arrowUpIcon,className:R?"k-generating k-active":"",onClick:Ce,onMouseDown:ye,disabled:!R&&!re,"aria-label":R?r.toLanguageString(j,ce[j]):r.toLanguageString(U,ce[U]),title:R?r.toLanguageString(j,ce[j]):r.toLanguageString(U,ce[U]),"aria-live":"polite"}}),[Te,we,oe,Ce,ye,R,Ne,r,re]),Se=h.useCallback(e=>{se||W(t=>t.filter(t=>t.name!==e));const t="object"==typeof M&&M.onRemoveAttachment;t&&(J.current=t),J.current&&J.current(e)},[M,se]),Ae=()=>{const e=!1!==L,t=!1!==B,n=!1!==M,a="object"==typeof L?L:void 0,l="object"==typeof M?M:{},{restrictions:s,multiple:o=!0,accept:r,onSelectAttachments:i,onRemoveAttachment:c,...u}=l,m={restrictions:s,multiple:o,accept:r},d="object"==typeof B?B:void 0;return h.createElement(h.Fragment,null,n&&h.createElement(Re,{...Fe.uploadButtonProps,restrictions:m.restrictions,multiple:m.multiple,accept:m.accept,...u}),e&&h.createElement(Le,{...Fe.speechToTextButtonProps,...a}),t&&h.createElement(Me,{...Fe.actionButtonProps,...d}))},Be="multi"===c||"auto"===c&&G,De=!1!==M||!1!==L||!1!==B,Ke=I||De,He=x||I||De;return h.createElement("div",{...z,className:n.classNames(D,"k-input",Oe,{[`k-input-${u}`]:u,"k-disabled":f,"k-prompt-box-singleline":"single"===c,"k-prompt-box-multiline":Be}),style:P},h.createElement(Pe,{files:oe,onRemoveFile:Se,header:T}),"single"===c?h.createElement("div",{className:`${Oe}-content`},x&&h.createElement("div",{className:`${Oe}-affix`},ne(x,Fe)),h.createElement("input",{...Ie,className:n.classNames("k-input-inner",`${Oe}-input`)}),Ke?h.createElement("div",{className:`${Oe}-affix`},I&&ne(I,Fe),Ae()):null):h.createElement("div",{className:`${Oe}-content`},"multi"===c&&C&&h.createElement("div",{className:`${Oe}-affix`},ne(C,Fe)),"auto"===c&&!G&&x&&h.createElement("div",{className:`${Oe}-affix`},ne(x,Fe)),h.createElement("textarea",{...Ie,className:n.classNames("k-input-inner",`${Oe}-textarea`),rows:ue(),style:d?{maxHeight:d}:{},"aria-multiline":"true"}),"auto"===c&&!G&&Ke?h.createElement("div",{className:`${Oe}-affix`},I&&ne(I,Fe),Ae()):null,Be&&He?h.createElement("div",{className:`${Oe}-affix`},x&&ne(x,Fe),(x||I)&&h.createElement("div",{className:"k-spacer"}),I&&ne(I,Fe),Ae()):null),a&&h.createElement(n.WatermarkOverlay,{message:s}))});Ke.propTypes={value:r.string,defaultValue:r.string,mode:r.oneOf(["single","multi","auto"]),rows:r.number,maxTextAreaHeight:r.string,title:r.string,disabled:r.bool,readOnly:r.bool,placeholder:r.string,maxLength:r.number,inputAttributes:r.object,fillMode:r.oneOf(["solid","flat","outline"]),topAffix:r.oneOfType([r.func,r.element,r.string]),startAffix:r.oneOfType([r.func,r.element,r.string]),endAffix:r.oneOfType([r.func,r.element,r.string]),header:r.oneOfType([r.func,r.element,r.string]),onChange:r.func,onFocus:r.func,onBlur:r.func,loading:r.bool,uploadButtonConfig:r.oneOfType([r.bool,r.object]),speechToTextButtonConfig:r.oneOfType([r.bool,r.object]),actionButtonConfig:r.oneOfType([r.bool,r.object]),attachments:r.array,onPromptAction:r.func,className:r.string,style:r.object},Ke.displayName="KendoPromptBox";const He=h.memo(({affixProps:e,uploadConfig:t,localizationService:n,onFilesSelect:a,onFileRemove:l})=>{const s="object"==typeof t?t:{};return!1!==t?h.createElement(Re,{...e.uploadButtonProps,fillMode:"clear","aria-label":n.toLanguageString(L,ce[L]),title:n.toLanguageString(L,ce[L]),...s,onSelectAttachments:a,onRemoveAttachment:l}):null});He.displayName="UploadButtonAffix";const Ue=h.forwardRef((e,t)=>{const{onSendMessage:s,isDirectionRightToLeft:r,placeholder:i,MessageBox:c,suggestions:u,onSuggestionClick:m,inputValue:d,onInputValueChange:g,suggestionTemplate:p,sendButtonConfig:f,onInputClick:k,suggestionsLayout:b,dir:y,messageBoxSettings:C,loading:x}=e,{replyToMessage:I,setReplyToMessage:T,user:N,speechToTextConfig:w,uploadConfig:S}=he(),[A,R]=h.useState(""),[M,L]=h.useState([]),B=h.useRef(null),D=o.useLocalization(),P=void 0!==d,z=P?d:A,O=h.useCallback(()=>{null!==B.current&&B.current.focus()},[]);h.useEffect(()=>{I&&O()},[I,O]);const q=h.useCallback(e=>{if(e.preventDefault(),s){const t={id:"",author:N,text:z||"",timestamp:new Date,replyToId:I?I.id:void 0,files:M.map(e=>({name:e.name,size:e.size,type:e.extension,rawFile:e.getRawFile?e.getRawFile():e}))};T(null),s(t,e),L([]),P||R(""),g&&g(""),O()}},[s,z,N,I,M,T,g,O,P]);h.useImperativeHandle(t,()=>({focusInput:O}),[O]);const H=h.useCallback(e=>{L(t=>t.filter(t=>t.name!==e))},[]),U=h.useCallback((e,t)=>e.isDeleted?me(t,D):e.text,[D]),$=h.useCallback(()=>{if(I){const e=ue(N,I);return h.createElement("div",{className:n.classNames("k-message-reference",e?"k-message-reference-sender":"k-message-reference-receiver")},h.createElement("div",{className:"k-message-reference-content"},U(I,e)),h.createElement("span",{className:"k-spacer"}),h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:l.xCircleIcon,onClick:()=>T(null),"aria-label":D.toLanguageString(F,ce[F]),title:D.toLanguageString(F,ce[F])}))}return null},[I,N,U,T,D]),V=h.useCallback(e=>{try{const t=Array.from(e.allFiles);L(t)}catch{}},[]),j=h.useCallback(e=>{const t=e.value;P||R(t),g&&g(t||"")},[P,g]),W=h.useCallback(e=>{q(e.syntheticEvent)},[q]),G=h.useCallback(e=>e?"function"==typeof e?e():e:null,[]),_=h.useCallback(e=>h.createElement(h.Fragment,null,h.createElement(He,{affixProps:e,uploadConfig:S,localizationService:D,onFilesSelect:V,onFileRemove:H}),G(null==C?void 0:C.startAffix)),[S,D,V,H,null==C?void 0:C.startAffix,G]),Y=h.useCallback(()=>G(null==C?void 0:C.endAffix),[null==C?void 0:C.endAffix,G]),J=h.useCallback(()=>G(null==C?void 0:C.topAffix),[null==C?void 0:C.topAffix,G]),X=h.useMemo(()=>{const e="object"==typeof f?f:{},t=!1!==f&&{"aria-label":x?D.toLanguageString(K,ce[K]):D.toLanguageString(v,ce[v]),title:x?D.toLanguageString(K,ce[K]):D.toLanguageString(v,ce[v]),dir:r?"rtl":void 0,...e};return h.createElement(Ke,{header:$(),ref:B,placeholder:i,value:z,onChange:j,onPromptAction:W,mode:(null==C?void 0:C.mode)||"multi",rows:(null==C?void 0:C.rows)||2,maxTextAreaHeight:(null==C?void 0:C.maxTextAreaHeight)||"110",loading:x,speechToTextButtonConfig:w,actionButtonConfig:t,attachments:M,startAffix:_,endAffix:null!=C&&C.endAffix?Y:void 0,topAffix:null!=C&&C.topAffix?J:void 0,inputAttributes:{onClick:k,"aria-label":D.toLanguageString(E,ce[E])}})},[i,z,j,W,C,x,w,f,M,$,_,Y,J,D,r,k]);return h.createElement("div",{className:"k-message-box-wrapper"},u&&u.length>0&&h.createElement(Ae,{onSuggestionClick:m,suggestions:u,suggestionTemplate:p,suggestionsLayout:b,dir:y}),c?h.createElement(c,{messageInput:X}):X)});Ue.displayName="NewMessage";const $e=e=>h.createElement(a.Toolbar,{className:"k-chat-header",size:"small"},e.children),Ve=e=>{const{message:t,onUnpin:s,user:r,onReferencedMessageClick:i}=e,c=o.useLocalization(),u=h.useRef(null),m=r&&ue(r,t),d=h.useCallback(e=>{e.preventDefault(),e.stopPropagation(),null==i||i(t.id)},[t.id,i]);return h.createElement("div",{ref:u,className:`k-message-reference ${m?"k-message-reference-sender":"k-message-reference-receiver"} k-message-pinned`,onClick:d},h.createElement(n.IconWrap,{icon:l.pinIcon}),h.createElement("div",{className:"k-message-reference-content"},t.isDeleted?r&&me(ue(r,t),c):t.text),h.createElement("span",{className:"k-spacer"}),h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:l.xCircleIcon,onClick:e=>{e.stopPropagation(),null==s||s(t)},"aria-label":c.toLanguageString("chat.unpinMessage",ce["chat.unpinMessage"])}))},je=e=>{const{show:t,text:n}=e;return h.createElement("div",{style:{position:"absolute",top:"90%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e3,pointerEvents:t?"auto":"none"}},h.createElement(c.Fade,null,t&&h.createElement(u.Notification,{type:{style:"inverse"},closable:!1},h.createElement("span",null,n))))},We={textField:"text",statusField:"status",authorIdField:"authorId",authorNameField:"authorName",authorImageUrlField:"authorImageUrl",authorImageAltTextField:"authorImageAltText",idField:"id",timestampField:"timestamp",filesField:"files",attachmentsField:"attachments",replyToIdField:"replyToId",isDeletedField:"isDeleted",isPinnedField:"isPinned",typingField:"typing",suggestedActionsField:"suggestedActions",isFailedField:"isFailed"},Ge=(e,t={})=>{const n={...We,...t};let a,l;a=e.author&&"object"==typeof e.author?{id:e.author.id||e.author[n.authorIdField]||e[n.authorIdField]||"",name:e.author.name||e.author[n.authorNameField]||e[n.authorNameField],avatarUrl:e.author.avatarUrl||e.author[n.authorImageUrlField]||e[n.authorImageUrlField],avatarAltText:e.author.avatarAltText||e.author[n.authorImageAltTextField]||e[n.authorImageAltTextField]}:{id:e[n.authorIdField]||e.authorId||"",name:e[n.authorNameField]||e.authorName,avatarUrl:e[n.authorImageUrlField]||e.authorImageUrl,avatarAltText:e[n.authorImageAltTextField]||e.authorImageAltText},l=e.timestamp?new Date(e.timestamp):e[n.timestampField]?new Date(e[n.timestampField]):new Date;const s={id:void 0!==e.id?e.id:e[n.idField],text:void 0!==e.text?e.text:e[n.textField]||"",author:a,timestamp:l,status:void 0!==e.status?e.status:e[n.statusField],attachments:void 0!==e.attachments?e.attachments:e[n.attachmentsField],attachmentLayout:e.attachmentLayout||"list",suggestedActions:void 0!==e.suggestedActions?e.suggestedActions:e[n.suggestedActionsField],isPinned:void 0!==e.isPinned?e.isPinned:e[n.isPinnedField]||!1,typing:void 0!==e.typing?e.typing:e[n.typingField],files:void 0!==e.files?e.files:e[n.filesField]||[],isFailed:void 0!==e.isFailed?e.isFailed:e[n.isFailedField]||!1};return e.pinnedAt&&(s.pinnedAt=new Date(e.pinnedAt)),e.pinnedBy&&(s.pinnedBy=e.pinnedBy),void 0!==e.replyToId?s.replyToId=e.replyToId:void 0!==e[n.replyToIdField]&&(s.replyToId=e[n.replyToIdField]),void 0!==e.isDeleted?s.isDeleted=e.isDeleted:void 0!==e[n.isDeletedField]&&(s.isDeleted=e[n.isDeletedField]),{...s,dataItem:e}},_e=(e,t={})=>Array.isArray(e)?e.map(e=>Ge(e,t)):[],Ye=e=>e&&void 0!==e.id&&"string"==typeof e.text&&e.author&&"object"==typeof e.author&&void 0!==e.author.id&&(e.timestamp instanceof Date||"string"==typeof e.timestamp||"number"==typeof e.timestamp),Je=e=>{e.scrollTop=e.scrollHeight-e.clientHeight},Xe=({viewItemsWrapperRef:e,isKeyboardNavigationActiveRef:t,processedMessages:n,authorId:a,autoScrollThreshold:l,isEndless:s=!1,isOnLastBatch:o=!0,skipAutoScrollRef:r})=>{var i;const c=h.useRef(a),u=h.useRef(l),m=h.useRef(s),d=h.useRef(o);h.useEffect(()=>{c.current=a,u.current=l,m.current=s,d.current=o});const g=h.useRef(!1);h.useEffect(()=>{s||!e.current||0===n.length||g.current||(Je(e.current),g.current=!0)},[e,s,n.length]);const p=h.useRef(void 0),f=h.useRef(0),v=h.useRef(!0),k=h.useRef(!0),E=h.useRef(!1),b=h.useRef(null),y=(n.length>0?null==(i=n.at(-1))?void 0:i.id:void 0)!==p.current,C=n.length>f.current;if(y||C){const t=e.current;k.current=!t||(e=>{const{scrollHeight:t,scrollTop:n,clientHeight:a}=e;return!(t>a)||t-n-a<=100})(t)}h.useEffect(()=>{var a,l;const s=n.length,o=s>0?null==(a=n[s-1])?void 0:a.id:void 0,i=p.current,g=f.current,h=v.current;if(p.current=o,f.current=s,v.current=!1,0===s)return;const y=e.current;if(!y||t.current)return;if(h||o===i)return void(!m.current&&(h||s>g)&&(Je(y),E.current=!1,b.current=null));if(m.current&&!d.current)return;if(null!=r&&r.current)return void(r.current=!1);const C=n[s-1];if(void 0!==c.current&&void 0!==(null==(l=null==C?void 0:C.author)?void 0:l.id)&&String(C.author.id)===String(c.current))return y.scrollTo({top:y.scrollHeight-y.clientHeight,behavior:"smooth"}),E.current=!1,void(b.current=null);if(!k.current)return E.current=!1,void(b.current=null);const x=(e=>{const t=e.querySelectorAll(".k-message");return t.length>0?t[t.length-1]:null})(y);if(!x)return;const I=(e=>{const t=e.querySelector(".k-message-pinned");return t?t.offsetHeight:0})(y),T=Math.max(0,y.clientHeight-I),N=((e,t)=>{const n=null!=e?e:"20%";let a;if("number"==typeof n)a=n;else{const e=/^(-?\d+(?:\.\d+)?)%$/.exec(String(n));if(e)a=Number.parseFloat(e[1])/100*t;else{const e=Number.parseFloat(String(n));a=Number.isNaN(e)?.2*t:e}}return Math.min(a,t)})(u.current,T),w=x.getBoundingClientRect().top-y.getBoundingClientRect().top+y.scrollTop,F=Math.max(0,w-N-I),S=Math.max(0,y.scrollHeight-y.clientHeight),A=Math.min(F,S);A>y.scrollTop&&y.scrollTo({top:A,behavior:"smooth"}),b.current=F,E.current=!0},[n,e,t]),h.useEffect(()=>{const n=e.current;if(!n)return;let a=n.querySelectorAll(".k-message").length,l=n.scrollHeight,s=n.scrollTop;const o=()=>{const e=n.scrollTop;E.current&&e<s&&(E.current=!1,b.current=null),s=e},r=new MutationObserver(()=>{if(t.current)return;const e=n.querySelectorAll(".k-message").length,o=n.scrollHeight;if(e===a&&o>l&&E.current){const e=o-n.clientHeight,t=b.current,a=null===t?e:Math.min(e,t);a>n.scrollTop&&(n.scrollTop=a),s=n.scrollTop}a=e,l=o});return r.observe(n,{childList:!0,subtree:!0,characterData:!0}),n.addEventListener("scroll",o,{passive:!0}),()=>{r.disconnect(),n.removeEventListener("scroll",o)}},[e,t])},Qe=["allowMessageCollapse","messageWidthMode","showAvatar","showUsername","messageTemplate","messageContentTemplate","messageToolbarActions","messageContextMenuActions","fileActions"];function Ze(e,t,n,a,l){const s=((e,t)=>{var n,a;return(null==(n=null==e?void 0:e.author)?void 0:n.id)===t||(null==(a=null==e?void 0:e.author)?void 0:a.id)===String(t)})(e,t)?a:l,o={};return Qe.forEach(e=>{var t;o[e]=null!=(t=null==s?void 0:s[e])?t:null==n?void 0:n[e]}),o}const et=({scrollMode:e,processedMessages:t,total:n,pageSize:a=50,startIndex:l,endIndex:s,onLoadMoreMessages:o,onReferencedMessageClick:r,viewItemsWrapperRef:i,authorId:c})=>{const u=h.useRef(!1),m="endless"===e,d=null!=n?n:t.length,g=m&&t.length===d&&!u.current,p=m&&(t.length<d||u.current);p&&(u.current=!0);const[f,v]=h.useState(-1),[k,E]=h.useState(-1),b=h.useRef(f),y=h.useRef(k);b.current=f,y.current=k;const C=h.useRef(!1),x=h.useRef(0),I=h.useRef(0),T=h.useRef(0),N=h.useRef(!1),w=h.useRef(d),F=h.useRef(c);F.current=c;const S=h.useRef(!1),A=h.useRef(null),R=h.useRef(!1),M=h.useRef(!1),L=h.useRef(!0),B=h.useRef(d);h.useEffect(()=>{if(g){if(u.current)return void((-1===f||-1===k)&&(v(0),E(t.length)));if(-1===f||-1===k){const e=Math.max(0,t.length-a),n=t.length;v(e),E(n)}else if(k<t.length){const e=w.current;if(y.current>=e)E(t.length);else if(t.length>e&&t.slice(e).some(e=>{var t;return void 0!==(null==(t=e.author)?void 0:t.id)&&String(e.author.id)===String(F.current)})){const e=Math.max(0,t.length-a);v(e),E(t.length),R.current=!0}}w.current=d}},[g,t.length,a,f,k,d]);const D=null!=l?l:0,P=null!=s?s:t.length,z=h.useCallback(()=>{const e=i.current;e&&(x.current=e.scrollHeight,I.current=e.scrollTop,T.current=e.querySelectorAll("[data-message-id]").length)},[i]),O=h.useCallback(e=>{var t,n,a;((e,t,n=0)=>{if(!t)return;const a=t.querySelector(`[data-message-id="${e}"]`);if(!a)return;const l=t.querySelector(".k-message-list");if(l){const e=l.getBoundingClientRect().top,t=a.getBoundingClientRect().top,s=l.scrollTop+(t-e)-n;l.scrollTo({top:s,behavior:"smooth"})}else a.scrollIntoView({behavior:"smooth",block:"start"})})(e,null==(t=i.current)?void 0:t.closest(".k-chat"),(null==(a=null==(n=i.current)?void 0:n.querySelector(".k-message-pinned"))?void 0:a.offsetHeight)||0)},[i]);h.useLayoutEffect(()=>{if(!N.current)return;const e=i.current;if(!e)return void(N.current=!1);if(e.querySelectorAll("[data-message-id]").length<=T.current)return;const t=e.scrollHeight-x.current;t>0&&(e.scrollTop=I.current+t),N.current=!1,C.current=!1}),h.useLayoutEffect(()=>{if(!R.current)return;const e=i.current;e?k>=t.length&&k>0&&(R.current=!1,e.scrollTop=e.scrollHeight-e.clientHeight):R.current=!1});const q=h.useRef(!1);h.useLayoutEffect(()=>{if(!m||q.current)return;const e=i.current;e&&e.querySelector("[data-message-id]")&&(e.scrollTop=e.scrollHeight-e.clientHeight,q.current=!0)}),h.useEffect(()=>{if(!m)return;const e=i.current;if(!e)return;let n=e.scrollTop;const l=()=>{const{scrollTop:l,scrollHeight:s,clientHeight:r}=e,i=l<n,c=l>n;if(n=l,!C.current){if(i&&l<=100)if(g){const e=b.current;if(e>0){const t=Math.max(0,e-a);N.current=!0,z(),v(t),null==o||o({startIndex:t,endIndex:y.current})}}else if(p&&D>0){C.current=!0;const e=Math.max(0,D-a);N.current=!0,z(),null==o||o({startIndex:e,endIndex:P})}if(c&&s-l-r<=100)if(g){const e=y.current;if(e<t.length){const n=Math.min(t.length,e+a);M.current=!0,E(n),null==o||o({startIndex:b.current,endIndex:n})}}else if(p&&P<d){C.current=!0,M.current=!0;const e=Math.min(d,P+a);null==o||o({startIndex:D,endIndex:e})}}};return e.addEventListener("scroll",l,{passive:!0}),()=>e.removeEventListener("scroll",l)},[m,g,p,i,a,t.length,D,P,d,o]),h.useEffect(()=>{var e;const n=P>=d;if(!p)return B.current=d,void(L.current=n);const a=B.current,l=L.current;if(B.current=d,L.current=n,d>a&&!l&&n){const n=t[t.length-1];void 0!==F.current&&void 0!==(null==(e=null==n?void 0:n.author)?void 0:e.id)&&String(n.author.id)===String(F.current)&&(S.current=!0,M.current=!0)}},[p,d,P,t]),h.useEffect(()=>{!p||!S.current||(S.current=!1,C.current=!1,requestAnimationFrame(()=>{const e=i.current;e&&(e.scrollTop=e.scrollHeight-e.clientHeight)}))},[p,t,i]),h.useEffect(()=>{if(!p||null===A.current)return;const e=A.current,t=i.current;t&&t.querySelector(`[data-message-id="${e}"]`)&&(A.current=null,C.current=!1,requestAnimationFrame(()=>{O(e)}))},[p,t,i,O]),h.useEffect(()=>{p&&C.current&&!N.current&&(C.current=!1)},[p,D,P]);const K=h.useMemo(()=>{if(g){const e=Math.max(0,f),n=Math.min(t.length,k);if(e>=n){const e=Math.max(0,t.length-a);return t.slice(e)}return t.slice(e,n)}return t},[g,t,f,k,a]),H=h.useMemo(()=>!m||(g?k>=t.length:P>=d),[m,g,k,t.length,P,d]),U=h.useCallback(()=>{if(!m||H){const e=i.current;return void(e&&e.scrollTo({top:e.scrollHeight-e.clientHeight,behavior:"smooth"}))}if(!C.current)if(g){const e=Math.max(0,t.length-a);v(e),E(t.length),null==o||o({startIndex:e,endIndex:t.length}),requestAnimationFrame(()=>{const e=i.current;e&&(e.scrollTop=e.scrollHeight-e.clientHeight)})}else if(p){S.current=!0,N.current=!1,C.current=!0;const e=Math.max(0,d-a);null==o||o({startIndex:e,endIndex:d})}},[m,g,p,H,t.length,a,d,o,i]),$=h.useCallback(e=>{if(m){if(g){const n=i.current;if(null==n?void 0:n.querySelector(`[data-message-id="${e}"]`))O(e);else{if(C.current)return;const n=t.findIndex(t=>t.id===e||String(t.id)===String(e));if(n>=0){const l=Math.floor(a/2),s=Math.max(0,n-l),o=Math.min(t.length,s+a);C.current=!0,v(s),E(o),requestAnimationFrame(()=>{requestAnimationFrame(()=>{O(e),C.current=!1})})}}}else if(p){const t=i.current;if(null==t?void 0:t.querySelector(`[data-message-id="${e}"]`))O(e);else{if(C.current)return;A.current=e,N.current=!1,C.current=!0}}}else O(e);null==r||r({id:e})},[m,g,p,i,t,a,r,O]);return{renderedMessages:K,handleScrollToBottom:U,handleReferencedMessageClick:$,isEndless:m,isOnLastBatch:H,skipAutoScrollRef:M}},tt=h.forwardRef((e,t)=>{const{messages:s=[],messageTemplate:r,messageContentTemplate:i,attachmentTemplate:c,width:u,height:m,onSendMessage:d,onSuggestionClick:g,onInputValueChange:p,onActionExecute:f,dir:v,messageBox:k,placeholder:E,className:b,style:C,message:x=ke,authorId:I,suggestions:T,suggestionTemplate:w,suggestionsLayout:F="scroll",quickActionsLayout:S="scroll",inputValue:A,headerTemplate:R,noDataTemplate:M,timestampTemplate:L,statusTemplate:B,userStatusTemplate:D,allowMessageCollapse:P,messageToolbarActions:O,messageContextMenuActions:q,fileActions:K,onUnpin:H,messageWidthMode:U,showAvatar:$,showUsername:V,timestampVisibility:j,authorMessageSettings:W,receiverMessageSettings:G,onToolbarAction:_,onContextMenuAction:Y,onFileAction:J,onDownload:X,speechToTextConfig:Q,uploadConfig:Z,sendButtonConfig:ee,messageFilesLayout:te,scrollToBottomButton:ne=!0,autoScrollThreshold:ae,textField:le,statusField:se,authorIdField:oe,authorNameField:re,authorImageUrlField:ie,authorImageAltTextField:ue,idField:me,timestampField:de,filesField:ge,attachmentsField:pe,replyToIdField:he,isDeletedField:ve,isPinnedField:Ee,typingField:ye,suggestedActionsField:Ce,isFailedField:xe,onResendMessage:Ie,messageBoxSettings:Ne,loading:Ae,scrollMode:Re,total:Me,pageSize:Le,startIndex:Be,endIndex:De,onLoadMoreMessages:Pe,pinnedMessages:Oe,repliedToMessages:qe,onReferencedMessageClick:Ke,...He}=e,We=h.useRef(null);n.useWebMcpRegister("chat",We,e,e.webMcp);const[Ge,Je]=h.useState(null),[Qe,tt]=h.useState(!1),[nt,at]=h.useState(!1),[lt,st]=h.useState(null),[ot,rt]=h.useState(null),[it,ct]=h.useState(!1),ut=h.useRef(null),mt=h.useRef(null),dt=h.useRef(null),gt=h.useRef(null),pt=h.useRef(void 0),ft=h.useRef(!1),ht=h.useRef(null),vt=h.useRef(""),kt=h.useMemo(()=>{if(!s||0===s.length)return[];const e={textField:le,statusField:se,authorIdField:oe,authorNameField:re,authorImageUrlField:ie,authorImageAltTextField:ue,idField:me,timestampField:de,filesField:ge,attachmentsField:pe,replyToIdField:he,isDeletedField:ve,isPinnedField:Ee,typingField:ye,suggestedActionsField:Ce,isFailedField:xe};return!Object.values(e).some(e=>void 0!==e)&&Ye(s[0])?s.map(e=>({...e,timestamp:e.timestamp?new Date(e.timestamp):e.timestamp})):_e(s,e)},[s,le,se,oe,re,ie,ue,me,de,ge,pe,he,ve,Ee,ye,Ce,xe]);h.useEffect(()=>{if(I===vt.current&&ht.current)rt(ht.current);else if(I&&kt.length>0){const e=kt.find(e=>e.author&&(e.author.id===I||e.author.id===String(I))),t=(null==e?void 0:e.author)||{id:I};ht.current=t,vt.current=I,rt(t)}},[I,kt]);const{renderedMessages:Et,handleScrollToBottom:bt,handleReferencedMessageClick:yt,isEndless:Ct,isOnLastBatch:xt,skipAutoScrollRef:It}=et({scrollMode:Re,processedMessages:kt,total:Me,pageSize:Le,startIndex:Be,endIndex:De,onLoadMoreMessages:Pe,onReferencedMessageClick:Ke,viewItemsWrapperRef:dt,authorId:I}),Tt=h.useMemo(()=>Et.length>0?(e=>{const t=e.slice().reduce(be(e.length),[]);return function(e){let t=0;e.forEach(e=>{"message-group"===e.type?e.messages.forEach(e=>{e.selectionIndex=t++}):("attachment-group"===e.type||"action-group"===e.type)&&(e.selectionIndex=t++)}),e.lastSelectionIndex=t-1}(t),t})(Et):[],[Et]),Nt=h.useMemo(()=>!n.validatePackage(ze,{component:"Chat"}),[]),wt=n.getLicenseMessage(ze),Ft=h.useMemo(()=>{if(Oe)return Oe.find(e=>e.isPinned);const e=kt.find(e=>e.isPinned);return e||void 0},[kt,Oe]),St=o.useLocalization();Xe({viewItemsWrapperRef:dt,isKeyboardNavigationActiveRef:ft,processedMessages:Et,authorId:I,autoScrollThreshold:ae,isEndless:Ct,isOnLastBatch:xt,skipAutoScrollRef:It});const At=(({elementRef:e})=>{const[t,n]=h.useState(!1);return h.useEffect(()=>{const t=e.current;if(!t)return;const a=()=>{n(t.scrollHeight>t.clientHeight)};a();const l=new ResizeObserver(a);l.observe(t);const s=new MutationObserver(()=>{requestAnimationFrame(a)});return s.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),s.disconnect()}},[e]),t})({elementRef:dt}),Rt=h.useCallback(()=>{clearTimeout(pt.current)},[]),Mt=h.useCallback(()=>{pt.current=window.setTimeout(()=>{Je(null)},0)},[]),Lt=h.useCallback(e=>{Je(e)},[]),Bt=h.useCallback(e=>{let t=null;const a=null!==Ge?Ge:Tt.lastSelectionIndex;e.keyCode===n.Keys.up?null===a?t=0:a>0&&(t=a-1):e.keyCode===n.Keys.down?null===a?t=0:a<Tt.lastSelectionIndex&&(t=a+1):e.keyCode===n.Keys.home?t=0:e.keyCode===n.Keys.end&&(t=Tt.lastSelectionIndex),null!==t&&(Je(t),ft.current=!0,e.preventDefault())},[Ge,Tt]),Dt=h.useCallback((e,t,n)=>{var a;if(f&&f({action:{value:e.value,title:e.title,type:e.type},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget}),!t.isDefaultPrevented()){switch(e.type){case"reply":d&&d({message:{id:"",author:ot,text:e.value,timestamp:new Date},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget});break;case"call":window.open("tel:"+e.value);break;case"openUrl":window.open(e.value)}null==(a=gt.current)||a.focusInput()}},[f,d,ot]),Pt=h.useCallback(()=>n.classNames("k-chat",b,{"k-rtl":Qe}),[b,Qe]),zt=h.useCallback(()=>{const e=Tt.length-1;return Tt.map((t,n)=>{var a,l,s,o,u,m;if("date-marker"===t.type)return h.createElement(Fe,{item:t,key:t.trackBy,timestampTemplate:L});if("message-group"===t.type){const s={allowMessageCollapse:P,messageWidthMode:U,showAvatar:$,showUsername:V,messageTemplate:r,messageContentTemplate:i,messageToolbarActions:O,messageContextMenuActions:q,fileActions:K},o=Ze(null==(a=t.messages)?void 0:a[0],I,s,W,G);return h.createElement(Se,{group:t,itemTemplate:o.messageTemplate,contentTemplate:o.messageContentTemplate,attachmentTemplate:c,user:ot,selectedItemIndex:Ge,onRequestSelection:Lt,isLastGroup:n===e,key:null!=(l=t.messages[0].id)?l:t.messages[0].selectionIndex,message:x,allowMessageCollapse:o.allowMessageCollapse,messageToolbarActions:o.messageToolbarActions,messageContextMenuActions:o.messageContextMenuActions,fileActions:o.fileActions,messageWidthMode:o.messageWidthMode,showAvatar:o.showAvatar,showUsername:o.showUsername})}return"attachment-group"===t.type?h.createElement(we,{group:t,itemTemplate:c,onRequestSelection:Lt,selected:t.selectionIndex===Ge,isLastGroup:n===e,key:`att-${null!=(o=null==(s=t.trackBy)?void 0:s.id)?o:t.selectionIndex}`}):"action-group"===t.type?h.createElement(Te,{group:t,onActionExecute:Dt,onRequestSelection:Lt,selected:t.selectionIndex===Ge,key:`act-${null!=(m=null==(u=t.trackBy)?void 0:u.id)?m:t.selectionIndex}`,quickActionsLayout:S,dir:v}):null})},[Tt,L,r,i,c,ot,Ge,Lt,x,P,O,q,K,U,$,V,I,W,G,Dt,S,v]),Ot=h.useCallback(()=>R?"function"==typeof R?R():R:null,[R]),qt=h.useCallback(()=>M?"function"==typeof M?M():M:null,[M]);h.useEffect(()=>{const e=void 0!==v?"rtl"===v:ut.current&&"rtl"===getComputedStyle(ut.current).direction;tt(!!e)},[v]),h.useEffect(()=>()=>{clearTimeout(pt.current)},[]),h.useEffect(()=>{if(!ne||!dt.current)return;let e,t;const n=()=>{e=void 0;const n=dt.current;if(!n)return;const{scrollHeight:a,scrollTop:l,clientHeight:s}=n;!(a>s)||a-l-s<=100?(void 0!==t&&(clearTimeout(t),t=void 0),ct(!1)):null!=t||(t=setTimeout(()=>{t=void 0,ct(!0)},300))},a=()=>{void 0===e&&(e=requestAnimationFrame(n))},l=dt.current;l.addEventListener("scroll",a,{passive:!0});const s=new MutationObserver(a);return s.observe(l,{childList:!0,subtree:!0,characterData:!0}),()=>{l.removeEventListener("scroll",a),s.disconnect(),void 0!==e&&cancelAnimationFrame(e),void 0!==t&&clearTimeout(t)}},[ne]);const Kt=h.useMemo(()=>({replyToMessage:lt,setReplyToMessage:st,messages:kt,repliedToMessages:qe,user:ot,internalScrollContainerRef:mt,messageListScrollContainerRef:dt,onToolbarAction:_,onContextMenuAction:Y,onFileAction:J,setShowCopyNotification:at,onDownload:X,onResendMessage:Ie,fileActions:K,speechToTextConfig:Q,uploadConfig:Z,statusTemplate:B,userStatusTemplate:D,messageFilesLayout:te,timestampVisibility:j,onReferencedMessageClick:yt}),[lt,st,kt,qe,ot,_,Y,J,at,X,Ie,K,Q,Z,B,D,te,j,yt]);return h.createElement(fe.Provider,{value:Kt},h.createElement("div",{style:{width:u,height:m,position:"relative",overflow:"hidden",...C},onKeyDown:Bt,className:Pt(),ref:e=>{ut.current=e,mt.current=e,"function"==typeof t?t(e):t&&(t.current=e)},...He},void 0!==R&&h.createElement($e,null,Ot()),h.createElement("div",{className:"k-message-list",onBlur:Mt,onFocus:Rt,role:"log","aria-label":St.toLanguageString(y,ce[y]),"aria-live":"polite",ref:dt,style:{scrollBehavior:"auto"}},Ft&&h.createElement(Ve,{message:Ft,onUnpin:H,user:ot,onReferencedMessageClick:yt}),h.createElement("div",{className:n.classNames("k-message-list-content",{"k-message-list-content-empty":0===Et.length})},0===Et.length&&void 0!==M&&qt(),Et.length>0&&zt()),ne&&(it||!xt)&&h.createElement("div",{className:"k-chat-scroll-to-bottom-container"},h.createElement(a.FloatingActionButton,{svgIcon:l.arrowDownIcon,size:"small",themeColor:"base",rounded:"full",onClick:bt,"aria-label":St.toLanguageString(z,ce[z]),title:St.toLanguageString(z,ce[z])}))),At&&h.createElement("div",{className:"k-separator"}),h.createElement(Ue,{onSendMessage:(e,t)=>{d&&d({message:e,syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget})},onSuggestionClick:e=>{g&&g(e)},isDirectionRightToLeft:Qe,ref:gt,placeholder:E,MessageBox:k,suggestions:T,suggestionTemplate:w,inputValue:A,onInputValueChange:e=>{p&&p(e)},onInputClick:()=>{ft.current=!1},sendButtonConfig:ee,suggestionsLayout:F,dir:v,messageBoxSettings:Ne,loading:Ae}),h.createElement(je,{show:nt,text:St.toLanguageString(N,ce[N])}),Nt&&h.createElement(n.WatermarkOverlay,{message:wt})))});tt.displayName="Chat",tt.propTypes={messages:r.arrayOf(r.object),user:r.object,messageTemplate:r.any,messageContentTemplate:r.any,attachmentTemplate:r.any,width:r.oneOfType([r.string,r.number]),style:r.object,onSendMessage:r.func,onActionExecute:r.func,dir:r.string,messageBox:r.any,noDataTemplate:r.oneOfType([r.element,r.func]),suggestionsLayout:r.oneOf(["scroll","wrap","scrollbuttons"]),quickActionsLayout:r.oneOf(["scroll","wrap","scrollbuttons"]),userStatusTemplate:r.elementType,messageFilesLayout:r.oneOf(["vertical","wrap","horizontal"]),showAvatar:r.bool,showUsername:r.bool,authorMessageSettings:r.object,receiverMessageSettings:r.object,scrollMode:r.oneOf(["scrollable","endless"]),total:r.number,pageSize:r.number,startIndex:r.number,endIndex:r.number,onLoadMoreMessages:r.func,pinnedMessages:r.arrayOf(r.object),repliedToMessages:r.arrayOf(r.object),onReferencedMessageClick:r.func};const nt=e=>{const{activeView:t,toolbarItems:n,activeViewChange:l}=e;return h.createElement("div",{className:"k-prompt-header"},h.createElement(a.Toolbar,{keyboardNavigation:!1,role:"toolbar",className:"k-toolbar-flat"},n.map(e=>h.isValidElement(e)?e:h.createElement(a.Button,{key:e.name,className:t===e.name?"k-selected":"",size:"medium",themeColor:"primary",fillMode:"flat",rounded:"full",title:e.buttonText,svgIcon:e.buttonIcon,onClick:()=>(e=>{null==l||l.call(null,e)})(e.name)},e.buttonText))))},at={name:"Output view",buttonText:"Output",buttonIcon:l.commentIcon},lt={name:"Commands view",buttonIcon:l.moreHorizontalIcon},st={name:"Prompt view",buttonText:"Ask AI",buttonIcon:l.sparklesIcon},ot=h.createContext([{},()=>{}]),rt=()=>h.useContext(ot),it=e=>{const{children:t}=e;return h.createElement("div",{className:"k-prompt-footer"},h.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal k-prompt-actions"},t))},ct=h.forwardRef((e,t)=>{const{children:n,streaming:s,onCancel:r}=e,i=o.useLocalization().toLanguageString(x,ce[x]),[c]=rt(),u=c.activeView===at.name,m=s&&!u,d=h.useCallback(e=>{"Escape"===e.key&&s&&r&&(e.preventDefault(),r())},[s,r]);return h.createElement("div",{className:"k-prompt-content",ref:t,onKeyDown:d},m&&h.createElement(a.FloatingActionButton,{onClick:r,svgIcon:l.stopIcon,icon:"stop",size:"medium",positionMode:"absolute",className:"k-prompt-stop-fab k-generating","aria-label":i,title:i}),h.createElement("div",{className:"k-prompt-view"},n))});ct.displayName="KendoReactAIPromptContent";const ut=e=>{const[t]=rt();return t.activeView===e.name?e.children:null},mt=e=>{const[t,n]=h.useState(!0),{children:s,title:o}=e;return h.createElement("div",{className:"k-prompt-expander"},h.createElement(a.Button,{"aria-controls":e.id,fillMode:"flat",svgIcon:t?l.chevronUpIcon:l.chevronDownIcon,title:o,onClick:()=>n(!t),"aria-expanded":t},o),t&&h.createElement("div",{id:e.id,className:"k-prompt-expander-content"},s))},dt=e=>null==e?void 0:e.map(e=>h.createElement(s.PanelBarItem,{title:e.text,key:e.id,svgIcon:e.svgIcon,data:e},e.children&&dt(e.children))),gt=({show:e=!1,anchor:t,onOpen:n,onClose:a,animate:l=!0,appendTo:s,popupOptions:o={},children:r,style:i})=>h.createElement(d.Popup,{show:e,anchor:t,style:i,animate:l,appendTo:s,onOpen:n,onClose:a,...o},r),pt=({placeholder:e="Ask or generate content with AI...",promptValue:t,onMenuClick:s,promptInput:o=m.TextArea,generateButton:r,enableSpeechToText:i=!1,streaming:c=!1,commands:u,onPromptRequest:d,onPromptCancel:g})=>{const[p,f]=h.useState(t||""),[v,k]=n.useCustomComponent(r),[E,b]=n.useCustomComponent(o),y=o===m.TextArea||E===m.TextArea,C={svgIcon:c?l.stopIcon:l.paperPlaneIcon,active:(!!c).toString(),title:"Send Button","aria-label":"Send Button",disabled:!p.trim()&&!c,"aria-disabled":!p.trim()&&!c},x={placeholder:e,className:"!k-flex-row",...y?{autoSize:!0}:{},rows:1},I=u&&u.length>0,T=Object.keys(k).length>0?k:C,N=Object.keys(b).length>0?b:x,w=e=>{const{isFinal:t,alternatives:n}=e;if(t&&n.length>0){const e=n[0].transcript,t=(()=>{const t=p,n=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(n?" ":"")+e})();f(t)}},F=()=>{p.trim()&&d&&d(p.trim())};return h.createElement(E,{value:p,onChange:e=>{const t=e.target.value;f(t)},onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),F())},prefix:I||i?h.createElement(h.Fragment,null,h.createElement(m.InputPrefix,{className:"!k-align-items-start"},I&&h.createElement(a.Button,{"aria-label":"Commands Button",title:"Commands Button",fillMode:"flat",svgIcon:l.menuIcon,onClick:s}),i&&h.createElement(a.SpeechToTextButton,{fillMode:"flat",..."object"==typeof i?{...i,onResult:i.onResult||w}:{onResult:w}})),h.createElement(m.InputSeparator,null)):void 0,suffix:h.createElement(m.InputSuffix,{className:"!k-align-items-start"},h.createElement(v,{className:n.classNames("k-prompt-send",{"k-generating":c,"k-active":c}),fillMode:"flat",onClick:c?g:F,...T})),...N})},ft=h.forwardRef((e,t)=>{const{svgIcon:a,label:s,labelClassName:o,secondaryLabel:r,linesAdded:i,linesRemoved:c,expandable:u,expanded:m,defaultExpanded:d,completed:g,onExpandedChange:p,headerTemplate:f,bodyTemplate:v,headerExtra:k,className:E,children:b,...y}=e,C=void 0!==m,[x,I]=h.useState(null!=d&&d),T=null!=m?m:x,N=h.useRef(null),w=h.useCallback(e=>{var t;if(!u)return;const n=!T;if(C||I(n),p){const a={expanded:n,syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(t=N.current)?t:e.currentTarget};p(a)}},[u,T,C,p]),F=h.createElement(h.Fragment,null,a&&h.createElement(n.SvgIcon,{icon:a,size:"small",className:"k-agent-step-icon"}),h.createElement("span",{className:"k-agent-step-content"},s&&h.createElement("span",{className:n.classNames("k-agent-step-label",!1===g&&"k-text-shimmer",o)},s),r&&h.createElement(h.Fragment,null,h.createElement("span",{className:"k-agent-step-sep"},"·"),h.createElement("span",{className:"k-agent-step-secondary"},r)),null!=i&&i>0&&h.createElement("span",{className:"k-agent-step-added k-text-success"},"+",i),null!=c&&c>0&&h.createElement("span",{className:"k-agent-step-removed k-text-error"},"-",c),k,u&&h.createElement(n.SvgIcon,{icon:T?l.chevronUpIcon:l.chevronRightIcon,size:"small",className:"k-agent-step-expand"})));let S;return S=f?h.createElement(f,{svgIcon:a,label:s,secondaryLabel:r,headerExtra:k,linesAdded:i,linesRemoved:c,completed:g,expanded:T,expandable:u}):u?h.createElement("button",{ref:N,type:"button",className:"k-agent-step-head","aria-expanded":T,onClick:w},F):h.createElement("div",{className:"k-agent-step-head"},F),h.createElement("div",{ref:t,className:n.classNames("k-agent-step",{"k-agent-completed":g},E),...y},S,T&&b&&(v?h.createElement(v,{expanded:T,completed:g},b):h.createElement("div",{className:"k-agent-step-body"},b)))});ft.displayName="KendoReactAgentStep";const ht=h.forwardRef((e,t)=>{const{svgIcon:a,label:l,labelClassName:s,secondaryLabel:o,linesAdded:r,linesRemoved:i,status:c,statusThemeColor:u,statusSvgIcon:m,completed:d,description:p,contentNode:f,className:v,children:k,...E}=e,b=!0===d,y=!b;return h.createElement("div",{className:n.classNames("k-thought",{"k-thought-completed":b},{"k-thought-active":y},v),ref:t,...E},h.createElement("span",{className:"k-agent-step-icon-col"},a&&h.createElement(n.SvgIcon,{icon:a,size:"small",className:"k-agent-step-icon"})),h.createElement("span",{className:"k-agent-step-content"},null!=f?f:h.createElement(h.Fragment,null,l&&h.createElement("span",{className:n.classNames("k-agent-step-label",y&&"k-text-shimmer",s)},l),p&&h.createElement("span",{className:"k-agent-step-description"},p),o&&h.createElement(h.Fragment,null,h.createElement("span",{className:"k-agent-step-sep"},"·"),h.createElement("span",{className:"k-agent-step-secondary"},o)),null!=r&&r>0&&h.createElement("span",{className:"k-agent-step-added k-text-success"},"+",r),null!=i&&i>0&&h.createElement("span",{className:"k-agent-step-removed k-text-error"},"-",i),c&&h.createElement(g.Badge,{size:"small",themeColor:null!=u?u:"success",rounded:"full"},m&&h.createElement(n.SvgIcon,{icon:m,size:"small"}),c),k&&h.createElement("div",{className:"k-agent-step-body"},k))))});ht.displayName="KendoReactThought";const vt=h.forwardRef((e,t)=>{const{label:a,secondaryLabel:s,svgIcon:o=l.sparklesIcon,completed:r,expanded:i,defaultExpanded:c,expandable:u,thoughts:m=[],linesAdded:d,linesRemoved:g,thoughtTemplate:p,onExpandedChange:f,className:v,...k}=e,E=m.map((e,t)=>h.createElement(ht,{key:t,label:e.label,secondaryLabel:e.secondaryLabel,svgIcon:e.svgIcon,completed:e.completed,linesAdded:e.linesAdded,linesRemoved:e.linesRemoved,contentNode:p?h.createElement(p,{thought:e,index:t}):void 0},e.content));return h.createElement(ft,{ref:t,svgIcon:o,label:a,secondaryLabel:s,completed:r,expanded:i,defaultExpanded:c,expandable:u&&m.length>0,linesAdded:d,linesRemoved:g,onExpandedChange:f,className:n.classNames("k-chain-of-thought",v),...k},E)});vt.displayName="KendoReactChainOfThought";const kt=h.forwardRef((e,t)=>{const{visible:l,state:s,template:r,onAction:i,className:c,...u}=e,m=o.useLocalization(),d=h.useRef(null),g=h.useCallback(e=>{var t,n;if(i&&s){const a={action:s,syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(n=null==(t=d.current)?void 0:t.element)?n:e.currentTarget};i(a)}},[i,s]),p=m.toLanguageString(te,ce[te]),f=m.toLanguageString(ne,ce[ne]),v=m.toLanguageString(ae,ce[ae]),k=m.toLanguageString(le,ce[le]);let E=null;return"startOver"===s||"restore"===s?E=h.createElement(a.Button,{ref:d,size:"small",fillMode:"flat",onClick:g},"startOver"===s?p:f):"redo"===s&&(E=h.createElement(h.Fragment,null,h.createElement("span",{className:"k-checkpoint-stamp"},v),h.createElement("span",null,"·"),h.createElement(a.Button,{ref:d,size:"small",fillMode:"flat",onClick:g},k))),h.createElement("div",{ref:t,className:n.classNames("k-checkpoint",{"k-checkpoint-visible":!0===l},c),...u},h.createElement("span",{className:"k-checkpoint-line","aria-hidden":"true"}),r?h.createElement(r,{state:s}):E,h.createElement("span",{className:"k-checkpoint-line","aria-hidden":"true"}))});kt.displayName="KendoReactCheckpoint";const Et=e=>{const{sources:t}=e;return h.createElement(h.Fragment,null,t.map((e,t)=>h.createElement("div",{className:"k-citation-popover-view",key:t},(null==e?void 0:e.title)&&h.createElement("div",{className:"k-citation-popover-view-title"},e.title),(null==e?void 0:e.url)&&h.createElement("a",{className:"k-citation-popover-view-source",href:e.url,target:"_blank",rel:"noopener noreferrer"},h.createElement(n.IconWrap,{name:l.globeIcon.name,icon:l.globeIcon}),e.url),(null==e?void 0:e.description)&&h.createElement("span",{className:"k-citation-popover-view-body"},e.description))))},bt={horizontal:"fit",vertical:"flip"},yt=[],Ct=(e,t)=>{if(void 0!==e)return e;const n=t[0];return(e=>{if(!e)return"";try{return new URL(e).hostname}catch{return""}})(null==n?void 0:n.url)||(null==n?void 0:n.title)||""},xt=h.forwardRef((e,t)=>{const{sources:s=yt,label:r,svgIcon:i=l.globeIcon,additionalCount:c,bodyTemplate:u,onOpen:m,showOn:d="hover",className:g,...f}=e,v=o.useLocalization(),[k,E]=h.useState(null),[b,y]=h.useState(!1),[C,x]=h.useState(0),I=h.useRef(s),T=h.useRef(null);s!==I.current&&(I.current=s,x(0));const N=h.useCallback(e=>{var n;const a=null!=(n=null==e?void 0:e.element)?n:null;E(a),"function"==typeof t?t(a):t&&(t.current=a)},[t]),w=h.useCallback(()=>{null!==T.current&&(clearTimeout(T.current),T.current=null)},[]),F=h.useCallback(()=>{w(),T.current=setTimeout(()=>y(!1),150)},[w]);h.useEffect(()=>w,[w]),h.useEffect(()=>{if(!k||0===s.length||"hover"!==d)return;const e=()=>{w(),y(!0)},t=()=>F();return k.addEventListener("mouseenter",e),k.addEventListener("mouseleave",t),()=>{k.removeEventListener("mouseenter",e),k.removeEventListener("mouseleave",t)}},[k,s.length,w,F,d]);const S=h.useCallback((e,t)=>{if(0!==s.length&&(w(),y(!0),m)){const n={sources:s,syntheticEvent:e,nativeEvent:e.nativeEvent,target:t};m(n)}},[s,m,w]),A=h.useCallback(e=>{var t;S(e.syntheticEvent,null!=(t=e.target.element)?t:e.syntheticEvent.currentTarget)},[S]),R=h.useCallback(e=>{var t;"Enter"!==e.syntheticEvent.key&&" "!==e.syntheticEvent.key||(e.syntheticEvent.preventDefault(),S(e.syntheticEvent,null!=(t=e.target.element)?t:e.syntheticEvent.currentTarget))},[S]),M=`k-citation-popover-${n.useId()}`;h.useEffect(()=>{if(!b||"hover"!==d)return;const e=document.getElementById(M);return e?(e.addEventListener("mouseenter",w),e.addEventListener("mouseleave",F),()=>{e.removeEventListener("mouseenter",w),e.removeEventListener("mouseleave",F)}):void 0},[b,M,w,F,d]),h.useEffect(()=>{if(!b||"click"!==d)return;const e=e=>{const t=document.getElementById(M);k&&!k.contains(e.target)&&(!t||!t.contains(e.target))&&y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[b,d,k,M]);const L=s.length,B=h.useCallback(()=>x(e=>Math.min(e+1,L-1)),[L]),D=h.useCallback(()=>x(e=>Math.max(e-1,0)),[]),P=[Ct(r,s),c&&s.length>1?"+"+(s.length-1):void 0].filter(Boolean).join(" "),z=null!=u?u:Et,O=h.createElement(h.Fragment,null,h.createElement("span",{className:"k-citation-pages"},C+1,"/",L),h.createElement(a.ButtonGroup,null,h.createElement(a.Button,{svgIcon:l.arrowLeftIcon,fillMode:"flat",size:"small","aria-label":v.toLanguageString(re,ce[re]),disabled:C<=0,onClick:D}),h.createElement(a.Button,{svgIcon:l.arrowRightIcon,fillMode:"flat",size:"small","aria-label":v.toLanguageString(ie,ce[ie]),disabled:C>=L-1,onClick:B})));return h.createElement(h.Fragment,null,h.createElement(a.Chip,{ref:N,text:P,svgIcon:i,size:"small",fillMode:"outline",rounded:"full",selected:b,onClick:A,onKeyDown:R,className:n.classNames("k-citation",g),...f}),L>0&&h.createElement(p.Popover,{show:b,anchor:k,title:O,collision:bt,callout:!1,margin:{vertical:8,horizontal:0},position:"top",id:M,popoverClass:"k-citation-popover",style:{width:"320px","--kendo-citation-popover-view-current":C+1}},h.createElement(z,{sources:s})))});xt.displayName="KendoReactCitation";const It=h.forwardRef((e,t)=>{const{label:a="Reasoning",secondaryLabel:s,svgIcon:o=l.sparklesIcon,completed:r,expanded:i,defaultExpanded:c,expandable:u,contentTemplate:m,onExpandedChange:d,className:g,children:p,...f}=e,v=m?h.createElement(m,null,p):p;return h.createElement(ft,{ref:t,svgIcon:o,label:a,secondaryLabel:s,completed:r,expanded:i,defaultExpanded:c,expandable:u,onExpandedChange:d,className:n.classNames("k-reasoning",g),...f},v)});It.displayName="KendoReactReasoning";const Tt=e=>"string"==typeof e?e:JSON.stringify(e,null,2),Nt=e=>h.createElement(h.Fragment,null,h.createElement("div",{className:"k-tool-call-label"},"Parameters"),h.createElement("pre",{className:"k-pre"},h.createElement("code",{className:"k-code"},Tt(e.parameters)))),wt=e=>h.createElement(h.Fragment,null,h.createElement("div",{className:"k-tool-call-label"},"Result"),h.createElement("pre",{className:"k-pre"},h.createElement("code",{className:"k-code"},Tt(e.result)))),Ft=e=>e.errorText?h.createElement("div",{className:"k-messagebox k-messagebox-error"},e.errorText):null,St={active:"base",completed:"success",awaitingApproval:"warning",error:"error"},At={completed:l.checkCircleIcon,awaitingApproval:l.clockIcon,error:l.xCircleIcon},Rt={active:X,completed:Q,awaitingApproval:Z,error:ee},Mt=h.forwardRef((e,t)=>{const{svgIcon:r=l.wrenchIcon,state:i,parameters:c,result:u,errorText:m,approvalText:d,paramsTemplate:p,resultTemplate:f,errorTemplate:v,approvalTemplate:k,onExpandedChange:E,onAction:b,className:y,children:C,...x}=e,I=o.useLocalization(),T=h.useRef(null),N=h.useRef(null),w=null!=i&&"active"!==i,F=null!=i&&"active"!==i&&"awaitingApproval"!==i,S=w?I.toLanguageString(Rt[i],ce[Rt[i]]):void 0,A=w?St[i]:void 0,R=w?At[i]:void 0,M=w&&h.createElement(g.Badge,{size:"small",themeColor:A,rounded:"full",position:null},R&&h.createElement(n.SvgIcon,{icon:R,size:"small"}),S),L="awaitingApproval"===i,B=h.useCallback(e=>{var t,n;if(b){const a={action:"approve",syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(n=null==(t=T.current)?void 0:t.element)?n:e.currentTarget};b(a)}},[b]),D=h.useCallback(e=>{var t,n;if(b){const a={action:"reject",syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(n=null==(t=N.current)?void 0:t.element)?n:e.currentTarget};b(a)}},[b]),P=L&&(k?h.createElement(k,{state:i,approvalText:d}):h.createElement(s.Card,null,d&&h.createElement(s.CardBody,null,d),h.createElement(s.CardActions,{layout:"end"},h.createElement(a.Button,{ref:N,fillMode:"outline",onClick:D},I.toLanguageString(oe,ce[oe])),h.createElement(a.Button,{ref:T,themeColor:"primary",onClick:B},I.toLanguageString(se,ce[se]))))),z=null!=p?p:Nt,O=null!=f?f:wt,q=null!=v?v:Ft,K=h.createElement(h.Fragment,null,null!=c&&h.createElement(z,{parameters:c}),null!=u&&h.createElement(O,{result:u}),null!=m&&h.createElement(q,{errorText:m}),L?P:C);return h.createElement(ft,{ref:t,svgIcon:r,headerExtra:M,completed:F,onExpandedChange:E,className:n.classNames("k-tool-call",y),...x},K)});Mt.displayName="KendoReactToolCall",e.AIPrompt=e=>{const t=h.useRef(null);n.useWebMcpRegister("aiprompt",t,e,e.webMcp);const a=!n.validatePackage(ze,{component:"AIPrompt"}),l=n.getLicenseMessage(ze),{activeView:s,toolbarItems:o,children:r,onActiveViewChange:i,onPromptRequest:c,onCommandExecute:u,style:m,dir:d,className:g,streaming:p,loading:f,onCancel:v,suggestionsView:k,...E}=e,b=o||[st,at],[y,C]=h.useState({activeView:s}),x={...y,activeView:s,streaming:p,loading:f,suggestionsView:null!=k?k:"classic",onCancel:v,onActiveViewChange:i,onPromptRequest:c,onCommandExecute:u};return h.createElement(ot.Provider,{value:[x,e=>{C(e)}]},h.createElement("div",{className:n.classNames("k-prompt",g),style:m,dir:d,...E},h.createElement(nt,{activeView:x.activeView,toolbarItems:b,activeViewChange:i}),r,a&&h.createElement(n.WatermarkOverlay,{message:l})))},e.AIPromptCommandsView=e=>{const{commands:t}=e,[n]=rt();return h.createElement(ut,{name:lt.name},h.createElement(ct,{streaming:n.streaming,onCancel:n.onCancel},h.createElement("div",{className:"k-prompt-view"},h.createElement(s.PanelBar,{onSelect:e=>{var t,a,l;const s=null==(a=null==(t=e.target)?void 0:t.props)?void 0:a.data;null!=(l=null==s?void 0:s.children)&&l.length||n.onCommandExecute&&n.onCommandExecute.call(null,s)},selected:""},dt(null!=t?t:[])))))},e.AIPromptContent=ct,e.AIPromptFooter=it,e.AIPromptOutputView=e=>{const[t,n]=h.useState(""),r=h.useRef(null),[i]=rt(),{outputs:c,showOutputRating:u,outputCard:m}=e,{header:d,body:g,actions:p}=m||{},f=o.useLocalization(),v=f.toLanguageString(x,ce[x]),k=(e,t)=>{i.onPromptRequest&&i.onPromptRequest.call(null,e.prompt,{...e,ratingType:t,isRetry:!1}),E()},E=()=>{r&&r.current&&r.current.scrollTo({top:0,behavior:"smooth"})},b=h.createElement(s.Card,null,h.createElement(s.CardHeader,null,h.createElement(s.CardTitle,null,h.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"200px"}})),h.createElement(s.CardSubtitle,null,h.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),h.createElement(s.CardBody,null,h.createElement("span",{className:"k-skeleton k-skeleton-rect k-skeleton-pulse",style:{height:"80px"}})),h.createElement(s.CardActions,null,i.streaming&&i.onCancel?h.createElement(a.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",svgIcon:l.stopIcon,title:v,onClick:i.onCancel},v):h.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),y=(e,s)=>p?p(e):s&&i.onCancel?h.createElement(a.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",svgIcon:l.stopIcon,title:v,onClick:i.onCancel},v):h.createElement(h.Fragment,null,h.createElement(a.Button,{size:"medium",themeColor:"primary",fillMode:"flat",rounded:"medium",title:"Copy",svgIcon:t===e.id?l.checkIcon:l.copyIcon,onClick:()=>(e=>{e.responseContent&&navigator.clipboard.writeText(e.responseContent),n(e.id),setTimeout(()=>{n("")},1e3)})(e)},"Copy"),h.createElement(a.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",title:"Retry",svgIcon:l.arrowRotateCwIcon,onClick:()=>(e=>{i.onPromptRequest&&i.onPromptRequest.call(null,e.prompt,{...e,isRetry:!0}),E()})(e)},"Retry"),u&&h.createElement(h.Fragment,null,h.createElement("span",{className:"k-spacer"}),h.createElement(a.Button,{size:"medium",themeColor:"positive"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate up",svgIcon:l.thumbUpIcon,onClick:()=>k(e,"positive")}),h.createElement(a.Button,{size:"medium",themeColor:"negative"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate down",svgIcon:l.thumbDownIcon,onClick:()=>k(e,"negative")}))),I=null==c?void 0:c.map((e,t)=>{const n=!(!i.streaming||i.loading||0!==t);return h.createElement(s.Card,{key:`${e.id}_${t}`},h.createElement(s.CardHeader,null,d?d(e):h.createElement(h.Fragment,null,e.title&&h.createElement(s.CardTitle,null,e.title),e.subTitle&&h.createElement(s.CardSubtitle,null,e.subTitle))),h.createElement(s.CardBody,null,g?g(e):e.responseContent),h.createElement(s.CardActions,null,y(e,n)))}),T=h.createElement(s.Card,null,h.createElement(s.CardBody,null,f.toLanguageString(C,ce[C])));return h.createElement(ut,{name:at.name},h.createElement(ct,{ref:r,streaming:i.streaming,onCancel:i.onCancel},h.createElement("div",{className:"k-card-list"},i.loading&&b,I,(!I||0===I.length)&&!i.loading&&T)))},e.AIPromptView=e=>{const{promptInput:t=m.TextArea,generateButton:s=a.Button,enableSpeechToText:o=!1,promptValue:r,promptSuggestions:i}=e,[c,u]=h.useState(r||""),[d]=rt(),[g,p]=n.useCustomComponent(s),[f,v]=n.useCustomComponent(t),k=h.useRef(null);h.useEffect(()=>{var e,t;null!=(t=null==(e=k.current)?void 0:e.element)&&t.current&&requestAnimationFrame(()=>{var e,t;if(null!=(t=null==(e=k.current)?void 0:e.element)&&t.current){const e=k.current.element.current;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}})},[c]);const E={title:"Generate",children:"Generate",svgIcon:l.sparklesIcon},b=Object.keys(p).length>0?p:E,y=Object.keys(v).length>0?v:{placeholder:"Ask or generate content with AI ...",rows:2},C=e=>{const{isFinal:t,alternatives:n}=e;if(t&&n.length>0){const e=n[0].transcript,t=(()=>{const t=c,n=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(n?" ":"")+e})();u(t)}};let x;return o&&(x="object"==typeof o?{...o,onResult:o.onResult||C}:{onResult:C}),h.createElement(ut,{name:st.name},h.createElement(ct,{streaming:d.streaming,onCancel:d.onCancel},h.createElement(f,{ref:k,value:c,flow:"vertical",textareaStyle:{maxHeight:"110px"},autoSize:!0,suffix:o?h.createElement(h.Fragment,null,h.createElement(m.InputSeparator,{orientation:"horizontal"}),h.createElement(m.InputSuffix,{orientation:"horizontal"},h.createElement(a.SpeechToTextButton,{fillMode:"flat",...x}))):void 0,onChange:e=>{u(e.target.value)},...y}),i&&i.length>0&&h.createElement(mt,{title:"Prompt Suggestions"},h.createElement(Ae,{suggestionsView:d.suggestionsView,suggestions:i.map((e,t)=>({id:t,text:e,description:e})),onSuggestionClick:e=>{(e=>{u(e)})(e.text)}}))),h.createElement(it,null,h.createElement(g,{themeColor:"primary",fillMode:"solid",rounded:"full",size:"medium",onClick:()=>{d.onPromptRequest&&d.onPromptRequest.call(null,c),u("")},disabled:!c.trim(),...b},b.children)))},e.AIPromptViewRender=ut,e.ChainOfThought=vt,e.Chat=tt,e.ChatMessage=ke,e.Checkpoint=kt,e.Citation=xt,e.DEFAULT_FIELD_MAPPING=We,e.HeroCard=e=>{const{imageUrl:t,imageMaxWidth:n,title:l,subtitle:s,actions:o,onActionExecute:r,altText:i}=e,c=h.useCallback((e,t)=>{null==r||r({action:e,syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget})},[r]),u=i||l||"";return h.createElement("div",{className:"k-card"},h.createElement("img",{className:"k-card-image",src:t,style:{maxWidth:n},alt:u}),h.createElement("div",{className:"k-card-body"},l&&h.createElement("h5",{className:"k-card-title"},l),s&&h.createElement("h6",{className:"k-card-subtitle"},s)),h.createElement("div",{className:"k-card-actions k-card-actions-vertical"},o.map((e,t)=>h.createElement("span",{className:"k-card-action",key:`action-${t}-${e.title||e.value||t}`},h.createElement(a.Button,{fillMode:"flat",onClick:t=>c(e,t)},e.title)))))},e.InlineAIPrompt=e=>{const t=!n.validatePackage(ze,{component:"InlineAIPrompt"}),o=n.getLicenseMessage(ze),{outputs:r=[],outputCard:i,promptInput:c=m.TextArea,generateButton:u=a.Button,promptPlaceholder:d="Ask or generate content with AI...",promptValue:g,onPromptRequest:p,onCopy:f,onDiscard:v,outputActions:k,onOutputAction:E,enableSpeechToText:b=!1,streaming:y,onPromptCancel:C,show:x=!1,anchor:I,width:T,height:N,onOpen:w,onClose:F,animate:S=!0,appendTo:A,commands:R,onCommandExecute:M,style:L,className:B,popupOptions:D={},...P}=e,[z,O]=h.useState(""),[q,K]=h.useState(!1),[H,U]=h.useState({left:0,top:0}),$=h.useRef(null),{body:V,actions:j}=i||{},W=k||[{id:"copy",text:"Copy",svgIcon:l.copyIcon,themeColor:"primary",title:"Copy"},{id:"discard",text:"Discard",svgIcon:l.cancelIcon,themeColor:"base",title:"Discard"}],G=(e,t)=>{switch(e.id){case"copy":(e=>{e.responseContent&&(navigator.clipboard.writeText(e.responseContent),O(e.id),setTimeout(()=>O(""),1e3)),null==f||f(e)})(t);break;case"discard":(e=>{null==v||v(e)})(t);break;default:null==E||E(e,t)}},_=h.useCallback(e=>{"Escape"===e.key&&(y&&C?C():!y&&F&&F({target:null}))},[y,C,F]),Y={...L,...T&&{width:T},...N&&{height:N}},J={...T&&{width:T},...N&&{height:N}},X=h.createElement(h.Fragment,null,h.createElement("div",{className:n.classNames("k-prompt",B),style:Y,onKeyDown:_,...P},h.createElement(ct,{ref:$},r&&r.length>0&&h.createElement("div",{className:"k-card-list"},r.map((e,t)=>h.createElement(s.Card,{key:`${e.id}_${t}`},h.createElement(s.CardBody,null,V?V(e):e.responseContent),h.createElement(s.CardActions,null,j?j(e):h.createElement(h.Fragment,null,W.map(t=>{var n;return t.spacer?h.createElement("span",{key:t.id,className:"k-spacer"}):h.createElement(a.Button,{key:t.id,size:"medium",themeColor:t.themeColor||"primary",fillMode:"flat",rounded:"medium",title:null!=(n=t.title)?n:t.text,svgIcon:"copy"===t.id&&z===e.id?l.checkIcon:t.svgIcon,onClick:()=>G(t,e)},t.text)})))))),h.createElement(pt,{promptValue:g,placeholder:d,onPromptRequest:p,onMenuClick:e=>{if(!$.current)return;const t=$.current.getBoundingClientRect();U({left:t.left,top:t.bottom}),K(!0)},onPromptCancel:C,promptInput:c,generateButton:u,enableSpeechToText:b,streaming:y,commands:R}))),t&&h.createElement(n.WatermarkOverlay,{message:o}));return h.createElement(h.Fragment,null,h.createElement(gt,{show:x,anchor:I,onOpen:w,onClose:F,animate:S,appendTo:A,popupOptions:D,style:J},X),h.createElement(s.ContextMenu,{show:q,offset:H,onClose:()=>{K(!1)},items:(e=>null==e?void 0:e.map(e=>({text:e.text,svgIcon:e.svgIcon,data:e,items:e.children?e.children.map(e=>({text:e.text,data:e})):void 0})))(R),onSelect:e=>{var t,n;const a=null==(t=e.item)?void 0:t.data;a&&(null==(n=a.children)||!n.length)&&(e=>{K(!1),M&&M(e)})(a)}}))},e.PromptBox=Ke,e.PromptBoxActionButton=Me,e.PromptBoxSpeechToTextButton=Le,e.PromptBoxUploadButton=Re,e.PromptHeader=nt,e.Reasoning=It,e.SuggestionGroup=Ae,e.ToolCall=Mt,e.commandsViewDefaults=lt,e.extractFieldMappingFromProps=e=>({textField:e.textField,statusField:e.statusField,authorIdField:e.authorIdField,authorNameField:e.authorNameField,authorImageUrlField:e.authorImageUrlField,authorImageAltTextField:e.authorImageAltTextField,idField:e.idField,timestampField:e.timestampField,filesField:e.filesField,attachmentsField:e.attachmentsField,replyToIdField:e.replyToIdField,isDeletedField:e.isDeletedField,isPinnedField:e.isPinnedField,typingField:e.typingField,suggestedActionsField:e.suggestedActionsField,isFailedField:e.isFailedField}),e.isStandardMessageFormat=Ye,e.mapDataArrayToMessages=_e,e.mapDataToMessage=Ge,e.mapMessageToCustomFormat=(e,t={})=>{const n={...We,...t},a={};return void 0!==e.id&&(a[n.idField]=e.id),void 0!==e.text&&(a[n.textField]=e.text),void 0!==e.status&&(a[n.statusField]=e.status),void 0!==e.isFailed&&(a[n.isFailedField]=e.isFailed),void 0!==e.timestamp&&(a[n.timestampField]=e.timestamp),void 0!==e.attachments&&(a[n.attachmentsField]=e.attachments),void 0!==e.files&&(a[n.filesField]=e.files),void 0!==e.suggestedActions&&(a[n.suggestedActionsField]=e.suggestedActions),void 0!==e.replyToId&&(a[n.replyToIdField]=e.replyToId),void 0!==e.isDeleted&&(a[n.isDeletedField]=e.isDeleted),void 0!==e.isPinned&&(a[n.isPinnedField]=e.isPinned),void 0!==e.typing&&(a[n.typingField]=e.typing),e.author&&(void 0!==e.author.id&&(a[n.authorIdField]=e.author.id),void 0!==e.author.name&&(a[n.authorNameField]=e.author.name),void 0!==e.author.avatarUrl&&(a[n.authorImageUrlField]=e.author.avatarUrl),void 0!==e.author.avatarAltText&&(a[n.authorImageAltTextField]=e.author.avatarAltText)),void 0!==e.pinnedAt&&(a.pinnedAt=e.pinnedAt),void 0!==e.pinnedBy&&(a.pinnedBy=e.pinnedBy),void 0!==e.attachmentLayout&&(a.attachmentLayout=e.attachmentLayout),a},e.outputViewDefaults=at,e.promptViewDefaults=st});
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common"),require("@progress/kendo-react-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-intl"),require("prop-types"),require("@progress/kendo-react-upload"),require("@progress/kendo-react-animation"),require("@progress/kendo-react-notification"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-indicators"),require("@progress/kendo-react-tooltip")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-layout","@progress/kendo-react-intl","prop-types","@progress/kendo-react-upload","@progress/kendo-react-animation","@progress/kendo-react-notification","@progress/kendo-react-inputs","@progress/kendo-react-popup","@progress/kendo-react-indicators","@progress/kendo-react-tooltip"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactConversationalUi={},e.React,e.KendoReactCommon,e.KendoReactButtons,e.KendoSvgIcons,e.KendoReactLayout,e.KendoReactIntl,e.PropTypes,e.KendoReactUpload,e.KendoReactAnimation,e.KendoReactNotification,e.KendoReactInputs,e.KendoReactPopup,e.KendoReactIndicators,e.KendoReactTooltip)}(this,function(e,t,n,a,l,o,s,r,i,c,u,m,d,p,g){"use strict";function f(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var h=f(t);const v="newMessage.sendButton",k="newMessage.optionsButton",E="newMessage.messageInput",b="avatar.alt",y="messageList.ariaLabel",C="aIPrompt.noOutputs",x="aIPrompt.cancel",I="aIPrompt.inputPlaceholder",T="chat.senderDeletedMessage",N="chat.receiverDeletedMessage",w="chat.copyNotification",F="chat.downloadAllFiles",S="chat.closeReply",A="chat.collapseMessage",R="chat.expandMessage",M="chat.removeFile",L="chat.fileActions",B="chat.attachFile",D="chat.downloadAll",P="chat.scrollLeft",z="chat.scrollRight",O="chat.scrollToBottom",q="chat.messageFailed",K="chat.retryMessage",H="chat.stopGenerating",U="promptBox.input",$="promptBox.sendButton",V="promptBox.attachFile",j="promptBox.removeFile",W="promptBox.stopGenerating",G="promptBox.ariaLabel",_="promptBox.attachedFiles",Y="chat.messageToolbar",J="chat.unpinMessage",X="chat.messageAttachedFiles",Q="toolCall.state.active",Z="toolCall.state.completed",ee="toolCall.state.awaitingApproval",te="toolCall.state.error",ne="checkpoint.startOver",ae="checkpoint.restore",le="checkpoint.restored",oe="checkpoint.redo",se="toolCall.approve",re="toolCall.reject",ie="citation.previous",ce="citation.next",ue={[v]:"Send",[k]:"Options",[E]:"Message",[b]:"Avatar",[y]:"Message list",[x]:"Cancel",[C]:"No output from AI available",[I]:"Ask or generate content with AI ...",[T]:"You removed this message",[N]:"The message was removed by its sender",[w]:"Text copied to clipboard",[F]:"Download all files",[S]:"Close reply",[A]:"Collapse message",[R]:"Expand message",[M]:"Remove file",[L]:"File actions for",[q]:"Failed to send",[K]:"Retry",[H]:"Stop generating",[B]:"Attach file",[D]:"Download all",[P]:"Scroll left",[z]:"Scroll right",[O]:"Scroll to bottom",[U]:"Prompt",[$]:"Send",[V]:"Attach file",[j]:"Remove file",[W]:"Stop generating",[G]:"Prompt box",[_]:"Attached files",[Y]:"Toolbar",[J]:"Unpin message",[X]:"Attached files",[Q]:"Active",[Z]:"Completed",[ee]:"Awaiting Approval",[te]:"Error",[ne]:"Start Over",[ae]:"Restore Checkpoint",[le]:"Checkpoint Restored",[oe]:"Redo",[se]:"Approve",[re]:"Reject",[ie]:"Previous",[ce]:"Next"},me=(e,t)=>e&&t.author&&e.id===t.author.id,de=(e,t)=>{const n=t.toLanguageString("chatSender.deletedMessage",ue[T]),a=t.toLanguageString("chatReceiver.deletedMessage",ue[N]);return e?n:a},pe=(e,t)=>e.find(e=>e.id===t),ge=/(https?:\/\/[^\s]+)/g,fe=e=>{if(!e)return[""];const t=e.split(ge),n=[];return t.forEach(e=>{e&&ge.test(e)?(ge.lastIndex=0,n.push(h.createElement("a",{key:e,href:e,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"}},e))):e&&n.push(e)}),n},he=h.createContext(void 0),ve=()=>{const e=t.useContext(he);if(void 0===e)throw new Error("useChatContext must be used within a ChatContext.Provider");return e},ke=e=>{const{files:t,onFileAction:o,onDownload:r,fileActions:i}=e,{messageFilesLayout:c="vertical"}=ve(),u=s.useLocalization(),m=i||[{id:"download",label:"Download",svgIcon:l.downloadIcon}],d=e=>{if(null==e)return"";if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,t)).toFixed(2))} ${["B","KB","MB","GB","TB"][t]}`},p=e=>"."+e.split(".").pop()||"",g=e=>m.length>0&&h.createElement(a.DropDownButton,{fillMode:"flat",size:"xs",svgIcon:l.moreVerticalIcon,onClick:e=>{e.syntheticEvent.stopPropagation()},onItemClick:t=>((e,t)=>{var n,a;null==(a=null==(n=e.syntheticEvent)?void 0:n.stopPropagation)||a.call(n),"download"===e.item.id&&(null==r||r([t])),null==o||o(e.item,e,t)})(t,e),items:m.map(e=>({id:e.id,icon:e.icon,text:e.label,svgIcon:e.svgIcon})),"aria-label":`${u.toLanguageString(L,ue[L])} ${e.name}`,title:`${u.toLanguageString(L,ue[L])} ${e.name}`}),f=h.useCallback(()=>n.classNames({"k-files-wrap":"wrap"===c,"k-files-vertical":"vertical"===c},"k-file-box-wrapper"),[c]);return h.createElement("ul",{role:"list","aria-label":u.toLanguageString(X,ue[X]),className:f()},"horizontal"===c?h.createElement("div",{className:"k-files-scroll",role:"presentation"},t.map(e=>h.createElement("li",{key:e.name,className:"k-file-box",role:"listitem","aria-label":[e.name,d(e.size)].filter(Boolean).join(" ")||void 0},h.createElement(n.IconWrap,{size:"xlarge",...n.getFileExtensionIcon(p(e.name))}),h.createElement("div",{className:"k-file-info"},h.createElement("span",{className:"k-file-name"},e.name),h.createElement("span",{className:"k-file-size"},d(e.size))),g(e)))):t.map(e=>h.createElement("li",{key:e.name,className:"k-file-box",role:"listitem","aria-label":[e.name,d(e.size)].filter(Boolean).join(" ")||void 0},h.createElement(n.IconWrap,{size:"xlarge",...n.getFileExtensionIcon(p(e.name))}),h.createElement("div",{className:"k-file-info"},h.createElement("span",{className:"k-file-name"},e.name),h.createElement("span",{className:"k-file-size"},d(e.size))),g(e))))},Ee=h.forwardRef((e,t)=>{const{item:r,template:i,contentTemplate:c,onRequestSelection:u,tabIndex:m=-1,dateFormat:d="g",selected:p,allowMessageCollapse:g,messageToolbarActions:f,messageContextMenuActions:v,fileActions:k,isSender:E}=e,{setReplyToMessage:b,messages:y,repliedToMessages:C,user:x,onToolbarAction:I,onContextMenuAction:T,onFileAction:N,onDownload:w,onResendMessage:S,setShowCopyNotification:M,statusTemplate:L,timestampVisibility:B="onFocus",onReferencedMessageClick:P}=ve(),[z,O]=h.useState(!1),[H,U]=h.useState(!1),[$,V]=h.useState(!0),[j,W]=h.useState(!1),G=s.useLocalization(),_=s.useInternationalization(),J=h.useRef({left:0,top:0}),X=h.useCallback(()=>{null!=r&&r.text&&(e=>{navigator.clipboard.writeText(e)})(r.text),M&&(M(!0),setTimeout(()=>{M(!1)},3e3))},[r,M]),Q=h.useCallback(e=>{e.stopPropagation(),V(e=>!e)},[]),Z=h.useCallback(()=>{W(!1)},[]),ee=h.useCallback(e=>{("Tab"===e.key||"Enter"===e.key||" "===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key)&&W(!0)},[]),te=h.useRef(null);h.useEffect(()=>{p&&te.current&&te.current.focus()},[p]);const ne=h.useCallback(e=>{J.current={left:e.pageX,top:e.pageY},e.preventDefault(),U(!0),O(!0)},[]),ae=h.useCallback(()=>{U(!1),O(!1)},[]),le=h.useCallback((e,t)=>e.isDeleted?de(t,G):e.text?e.text:"",[G]),oe=h.useCallback(e=>{var t;null!=(t=e.item)&&t.text&&("copy"!==e.item.data.id||r.isDeleted?"reply"===e.item.data.id&&b(r):X(),T&&T(e.item.data,e,r)),U(!1),O(!1)},[r,T,b,X]),se=h.useCallback(()=>{if(r.replyToId){const e=pe(y,r.replyToId)||(C?pe(C,r.replyToId):void 0);if(e){const t=t=>{t.preventDefault(),t.stopPropagation(),null==P||P(e.id)};return h.createElement("div",{className:n.classNames("k-message-reference",me(x,e)?"k-message-reference-sender":"k-message-reference-receiver"),onClick:t},h.createElement("div",{className:"k-message-reference-content"},fe(le(e,me(x,e)))))}}return null},[r.replyToId,y,C,x,le,P]),re=h.useCallback(()=>{const e=[{id:"reply",label:"Reply",svgIcon:l.undoIcon},{id:"copy",label:"Copy",svgIcon:l.copyIcon}],t=v?[...e.map(e=>v.find(t=>t.id===e.id)||e),...v.filter(t=>!e.some(e=>e.id===t.id))]:e;return h.createElement(o.ContextMenu,{onSelect:oe,onClose:ae,vertical:!0,show:z,offset:J.current},t.map(e=>"delete"!==e.id||E?h.createElement(o.MenuItem,{key:e.id,text:e.label,icon:e.icon,svgIcon:e.svgIcon,data:e}):null))},[v,oe,ae,z,E]),ie=h.useCallback(()=>r.files&&r.files.length>1?h.createElement("div",{className:"k-chat-download-button-wrapper"},h.createElement(a.Button,{className:"k-chat-download-button",fillMode:"flat",svgIcon:l.downloadIcon,size:"small",onClick:e=>{e.stopPropagation(),w&&w(r.files,r)},"aria-label":G.toLanguageString(F,ue[F])},h.createElement("span",{className:"k-button-text"},G.toLanguageString(D,ue[D])))):null,[r,w,G]),ce=h.useCallback(()=>{if(r.typing)return h.createElement("div",{className:"k-chat-bubble k-bubble"},h.createElement("div",{className:"k-bubble-content"},h.createElement("div",{className:"k-typing-indicator"},h.createElement("span",null),h.createElement("span",null),h.createElement("span",null))));if(i){const e=i;return h.createElement(h.Fragment,null,h.createElement(e,{item:r}),re())}return r.text||r.files&&r.files.length>0?h.createElement(h.Fragment,null,h.createElement("div",{className:n.classNames("k-chat-bubble","k-bubble",{"k-bubble-expandable":g,"k-expanded":g&&$,"k-selected":p,"k-active":H}),onClick:()=>u(p?void 0:r.selectionIndex),onContextMenu:ne},h.createElement("div",{className:"k-bubble-content"},c?h.createElement(c,{item:r}):h.createElement(h.Fragment,null,(r.text||r.isDeleted||r.replyToId)&&h.createElement("span",{className:"k-chat-bubble-text"},!r.isDeleted&&se(),fe(le(r,me(x,r)))),r.files&&r.files.length>0&&h.createElement(ke,{files:r.files,message:r,onFileAction:N,onDownload:e=>null==w?void 0:w(e,r),renderInTextarea:!1,fileActions:k}),ie())),g&&h.createElement("span",{className:"k-bubble-expandable-indicator",onClick:Q,role:"button","aria-label":$?G.toLanguageString(A,ue[A]):G.toLanguageString(R,ue[R]),tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),Q(e))}},h.createElement(n.IconWrap,{icon:$?l.chevronUpIcon:l.chevronDownIcon}))),re()):null},[r,i,c,g,$,p,H,u,ne,se,le,x,N,k,ie,Q,G,re,w]),ge=h.useCallback(()=>{let e=null;return r.timestamp&&("hidden"===B||(e=h.createElement("time",{className:"k-message-time"},_.formatDate(r.timestamp,d)))),e},[r.timestamp,d,B,_]),he=h.useCallback(()=>{if(!r.status)return null;let e;if(L)e=h.createElement(L,{item:r});else{let t,a,l;if("object"==typeof r.status&&null!==r.status){const e=r.status;t=e.text,a=e.icon,l=e.svgIcon}else t=r.status;let o=null;a?o=h.createElement(n.Icon,{name:a,size:"xsmall"}):l&&(o=h.createElement(n.IconWrap,{icon:l,size:"xsmall"})),e=h.createElement(h.Fragment,null,o,t)}return h.createElement("span",{className:"k-message-status"},e)},[r,L]),Ee=h.useCallback(()=>{let e=null;if(r.isFailed){const t=G.toLanguageString(q,ue[q]);e=h.createElement("span",{className:"k-message-failed-content"},h.createElement(n.IconWrap,{icon:l.warningTriangleIcon,size:"xsmall"}),h.createElement("span",{className:"k-message-failed-text"},t))}return e},[r,G]),be=h.useCallback(()=>{let e=null;if(r.isFailed){const t=G.toLanguageString(K,ue[K]);e=h.createElement(a.Button,{fillMode:"clear",size:"xs",className:"k-resend-button",svgIcon:l.arrowRotateCwIcon,"aria-label":t,title:t,onClick:e=>{e.stopPropagation(),S&&S({message:r,syntheticEvent:e,nativeEvent:e.nativeEvent,target:e.target})}})}return e},[r,G,S]),ye=h.useCallback(()=>n.classNames({"k-focus":p,"k-message-removed":r.isDeleted,"k-message-failed":r.isFailed},"k-message"),[p,r.isDeleted,r.isFailed]),Ce=h.useCallback(()=>f&&f.length>0&&h.createElement(a.Toolbar,{className:"k-chat-message-toolbar",fillMode:"flat",ariaLabel:G.toLanguageString(Y,ue[Y])},f.map(e=>"delete"!==e.id||E?h.createElement(a.Button,{key:e.id,fillMode:"flat",className:"k-toolbar-button",icon:e.icon,svgIcon:e.svgIcon,"aria-label":e.label,onClick:t=>{t.stopPropagation(),"copy"!==e.id||r.isDeleted?"reply"===e.id&&b(r):X(),I&&I(e,t,r)},onMouseDown:e=>e.preventDefault()}):null)),[X,E,r,G,f,I,b]);return h.createElement("div",{key:r.id,"data-message-id":r.id,className:ye(),tabIndex:m,onMouseDown:Z,onKeyDown:ee,onFocus:e=>{j&&u(r.selectionIndex)},ref:e=>{te.current=e,"function"==typeof t?t(e):t&&(t.current=e)},onContextMenu:i?ne:void 0},be(),ce(),(r.status||r.timestamp&&"hidden"!==B||r.isFailed)&&h.createElement("div",{className:"k-message-info"},he(),ge(),Ee()),Ce())});Ee.displayName="ChatMessage";const be=e=>e[e.length-1],ye=e=>(t,n,a)=>{const l=a===e-1;return((e,t)=>{const n=t.timestamp,a=be(e);if(n&&(!a||((e,t)=>e&&t&&(t.getDate()!==e.getDate()||t.getMonth()!==e.getMonth()||t.getFullYear()!==e.getFullYear()))(n,a.timestamp))){const t={type:"date-marker",timestamp:n,trackBy:n.getTime()};e.push(t)}})(t,n),((e,t,n)=>{const a=be(e);let l;t.typing&&!n||(a&&"message-group"===a.type&&(l=a.messages),l&&me(t.author,be(l))?l.push(t):e.push({type:"message-group",messages:[t],author:t.author,timestamp:t.timestamp,trackBy:t}))})(t,n,l),n.attachments&&n.attachments.length>1&&t.push({type:"attachment-group",attachments:n.attachments,attachmentLayout:n.attachmentLayout,timestamp:n.timestamp,trackBy:n}),n.suggestedActions&&l&&t.push({type:"action-group",actions:n.suggestedActions,timestamp:n.timestamp,trackBy:n}),t};const Ce=e=>{const{item:t,onActionExecute:a,selected:l}=e,o=h.useRef(null);h.useEffect(()=>{l&&o.current&&o.current.focus()},[l]);const s=h.useCallback(e=>{(e.keyCode===n.Keys.enter||" "===e.key)&&(e.preventDefault(),a(t,e))},[a,t]),r=h.useCallback(()=>n.classNames("k-suggestion k-suggestion-primary",{"k-selected":l},{"k-focus":l}),[l]);return h.createElement("span",{role:"button",className:r(),onClick:e=>a(t,e),ref:o,onKeyDown:s,tabIndex:0,"aria-label":t.title||t.value},t.title||t.value)},xe=({visible:e,dir:t,canScrollLeft:n,canScrollRight:o,onScrollLeft:r,onScrollRight:i,children:c})=>{const u=s.useLocalization();if(!e)return c;const m=u.toLanguageString(P,ue[P]),d=u.toLanguageString(z,ue[z]),p="rtl"!==t?m:d,g="rtl"!==t?d:m;return h.createElement("div",{className:"k-suggestion-scrollwrap"},h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:"rtl"===t?l.chevronRightIcon:l.chevronLeftIcon,onClick:r,disabled:!n,"aria-label":p,title:p}),c,h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:"rtl"===t?l.chevronLeftIcon:l.chevronRightIcon,onClick:i,disabled:!o,"aria-label":g,title:g}))},Ie=100,Te=(e,t)=>{const{enabled:n,dir:a,mode:l,itemsDependency:o=[],scrollSpeed:s=Ie}=t,[r,i]=h.useState(!1),[c,u]=h.useState(!1),m=h.useCallback(()=>{if(e.current&&n){const{scrollLeft:t,scrollWidth:n,clientWidth:l}=e.current,o="rtl"!==a?t+l>=n-1:l-t>=n-1;i(!(0===t)),u(!o)}},[n,a]),d=h.useCallback(()=>{e.current&&n&&e.current.scrollBy({left:"rtl"!==a?-s:s,behavior:"smooth"})},[n,a,s]),p=h.useCallback(()=>{e.current&&n&&e.current.scrollBy({left:"rtl"!==a?s:-s,behavior:"smooth"})},[n,a,s]);return h.useEffect(()=>{const t=e.current;if(!t||!n)return;m();const a=()=>m();t.addEventListener("scroll",a,{passive:!0});const l=new ResizeObserver(m);return l.observe(t),()=>{t.removeEventListener("scroll",a),l.disconnect()}},[n,m,o.length,l]),h.useLayoutEffect(()=>{n&&m()},[n,a,o]),{canScrollLeft:r,canScrollRight:c,scrollLeft:d,scrollRight:p}},Ne=e=>{var t,a;const{group:l,onActionExecute:o,selected:s,onRequestSelection:r,quickActionsLayout:i="scroll",dir:c}=e,[u,m]=h.useState(null),d=h.useRef(null),{canScrollLeft:p,canScrollRight:g,scrollLeft:f,scrollRight:v}=Te(d,{enabled:"scrollbuttons"===i||"scroll"===i,dir:c,mode:i,itemsDependency:l.actions});h.useEffect(()=>{s||null===u?s&&null===u&&m(0):m(null)},[s,u]);const k=h.useCallback(()=>l.actions?l.actions.length-1:-1,[l.actions]),E=h.useCallback((e,t=0)=>{let n=null;return e?null===u?n=t:u<k()&&(n=u+1):null===u?n=0:u>0&&(n=u-1),null!==n&&m(n),n},[u,k]),b=h.useCallback(()=>{r(l.selectionIndex)},[r,l.selectionIndex]),y=h.useCallback(e=>{let t=null;const a=n.Keys.left,l=n.Keys.right;e.keyCode===a?t=E(!1):e.keyCode===l&&(t=E(!0)),null!==t&&(e.preventDefault(),e.stopPropagation())},[E]),C=h.useCallback(()=>n.classNames("k-suggestion-group",{"k-suggestion-group-scrollable":"scroll"===i,"k-suggestion-group-scrollable-start":g&&("scroll"===i||"scrollbuttons"===i),"k-suggestion-group-scrollable-end":p&&("scroll"===i||"scrollbuttons"===i)}),[i,g,p]),x="scroll"===i||"scrollbuttons"===i,I=h.createElement("div",{className:C(),onClick:b,onKeyDown:y,role:"toolbar",tabIndex:0,"aria-label":"Action group"},x?h.createElement("div",{className:"k-suggestions-scroll",ref:d},null==(t=l.actions)?void 0:t.map((e,t)=>h.createElement(Ce,{item:e,onActionExecute:o,selected:t===u,key:e.value}))):null==(a=l.actions)?void 0:a.map((e,t)=>h.createElement(Ce,{item:e,onActionExecute:o,selected:t===u,key:e.value})));return h.createElement(xe,{visible:"scrollbuttons"===i,dir:c,canScrollLeft:p,canScrollRight:g,onScrollLeft:f,onScrollRight:v},I)},we=e=>{const{item:t,template:a,tabbable:l,onClick:o,selected:s}=e,r=h.useRef(null);h.useEffect(()=>{s&&r.current&&r.current.focus()},[s]);const i=h.useCallback(()=>{if(void 0!==l)return l?0:-1},[l]),c=h.useCallback(()=>n.classNames({"k-selected":s},{"k-focus":s}),[s]),u=h.useCallback(()=>t.title?h.createElement("h5",{className:"k-card-title"},t.title):null,[t.title]),m=h.useCallback(()=>t.subtitle?h.createElement("h6",{className:"k-card-subtitle"},t.subtitle):null,[t.subtitle]),d=h.useCallback(()=>0===t.contentType.indexOf("image/")?h.createElement("img",{src:t.content,alt:t.title||"Attachment",style:{maxHeight:"200px",height:"auto",maxWidth:"200px",width:"auto"}}):t.content,[t.contentType,t.content,t.title]),p=a;return h.createElement("div",{className:c(),tabIndex:i(),onClick:o,ref:r},a?h.createElement(p,{item:t}):h.createElement("div",{className:"k-card"},h.createElement("div",{className:"k-card-body"},u(),m(),d())))},Fe=e=>{const{group:t,itemTemplate:o,selected:s,isLastGroup:r,onRequestSelection:i}=e,[c,u]=h.useState(null);h.useEffect(()=>{s||null===c?s&&null===c&&u(0):u(null)},[s,c]);const m=h.useCallback(e=>"list"!==e.attachmentLayout,[]),d=h.useCallback(()=>t.attachments?t.attachments.length-1:-1,[t.attachments]),p=h.useCallback(()=>t.attachments.length-1,[t.attachments]),g=h.useCallback((e,t=0)=>{let n=null;return e?null===c?n=t:c<d()&&(n=c+1):null===c?n=0:c>0&&(n=c-1),null!==n&&u(n),n},[c,d]),f=h.useCallback(()=>{i(t.selectionIndex)},[i,t.selectionIndex]),v=h.useCallback(e=>{let a,l,o=null;m(t)?(a=n.Keys.left,l=n.Keys.right):(a=n.Keys.up,l=n.Keys.down),e.keyCode===a?o=g(!1):e.keyCode===l&&(o=g(!0)),null!==o&&(e.preventDefault(),e.stopPropagation())},[g,m,t]),k=h.useCallback(e=>{f(),u(e)},[f]),E=h.useCallback(e=>{f(),g(e,1)},[f,g]),b=h.useCallback(()=>{let e=null;return m(t)&&c&&(e=h.createElement(a.Button,{icon:"chevron-left",onClick:()=>E(!1),svgIcon:l.chevronLeftIcon})),e},[m,t,c,E]),y=h.useCallback(()=>{let e=null;return m(t)&&c!==p()&&(e=h.createElement(a.Button,{icon:"chevron-right",onClick:()=>E(!0),svgIcon:l.chevronRightIcon})),e},[m,t,c,p,E]),C=h.useCallback(()=>n.classNames({"k-card-list":t.attachmentLayout,"k-card-deck":m(t)}),[t.attachmentLayout,t,m]),x=m(t),I=h.createElement("div",{className:C(),onKeyDown:x?void 0:v},t.attachments.map((e,t)=>h.createElement(we,{item:e,template:o,selected:t===c,tabbable:r&&t===c,onClick:()=>k(t),key:e.content})));return x?h.createElement("div",{className:"k-card-deck-scrollwrap",onKeyDown:v},b(),I,y()):I},Se=({item:e,timestampTemplate:t})=>{const n=s.useInternationalization(),a=t;return h.createElement("div",{className:"k-timestamp"},a?h.createElement(a,{item:e}):n.formatDate(e.timestamp,"D"))},Ae=e=>{const{group:t,user:a,itemTemplate:l,contentTemplate:r,attachmentTemplate:i,onRequestSelection:c,selectedItemIndex:u,isLastGroup:m,message:d,allowMessageCollapse:p,messageToolbarActions:g,messageContextMenuActions:f,fileActions:v,messageWidthMode:k="standard",showAvatar:E=!0,showUsername:y=!0}=e,{userStatusTemplate:C}=ve(),x=s.useLocalization(),I=t.messages.length>0&&me(a,t.messages[0]),{avatarUrl:T,avatarAltText:N,name:w}=t.author,F=h.useMemo(()=>n.classNames("k-message-group",{"k-message-group-sender":I,"k-message-group-receiver":!I,"k-message-group-full-width":"full"===k,"k-no-avatar":!E||!T}),[I,k,E,T]),S=h.useMemo(()=>{const e=t.messages.length-1;return t.messages.map((t,n)=>{const o=[h.createElement(d,{item:t,template:l,contentTemplate:r,selected:t.selectionIndex===u,onRequestSelection:c,tabIndex:n===e&&m?0:-1,key:t.id,allowMessageCollapse:p,messageToolbarActions:g,messageContextMenuActions:f,fileActions:v,isSender:me(a,t)})];return t.attachments&&1===t.attachments.length&&o.push(h.createElement(we,{item:t.attachments[0],template:i,selected:!1,key:`att-${t.attachments[0].content}`})),o})},[t.messages,d,l,r,u,c,m,p,g,f,v,a,i]),A=void 0!==N?N:x.toLanguageString(b,ue[b]);return h.createElement("div",{className:F},(()=>{if(!E||!T)return;const e=h.createElement(o.Avatar,{type:"image"},h.createElement("img",{src:T,alt:A}));if(C){const n=t.messages[t.messages.length-1];return h.createElement("div",{className:"k-chat-user-status-wrapper"},e,h.createElement("div",{className:"k-chat-user-status"},h.createElement(C,{message:"dataItem"in n?n.dataItem:n})))}return e})(),h.createElement("div",{className:"k-message-group-content"},y&&h.createElement("span",{className:"k-message-author"},w),S))},Re=e=>{const{suggestions:t,onSuggestionClick:a,suggestionsView:l,suggestionTemplate:o,suggestionsLayout:s,dir:r}=e,i=h.useRef(null),{canScrollLeft:c,canScrollRight:u,scrollLeft:m,scrollRight:d}=Te(i,{enabled:"scrollbuttons"===s||"scroll"===s,dir:r,mode:s,itemsDependency:t}),p=h.useCallback((e,t)=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),null==a||a(t))},[a]),g=h.useCallback(()=>t.map(e=>o?h.createElement(o,{key:e.id,suggestion:e,onClick:()=>{null==a||a(e)}}):h.createElement("span",{role:"button",tabIndex:e.disabled?-1:0,"aria-label":e.description,"aria-disabled":e.disabled,onClick:()=>!e.disabled&&(null==a?void 0:a(e)),onKeyDown:t=>!e.disabled&&p(t,e),key:e.id,title:e.description,className:n.classNames("classic"===l?"k-prompt-suggestion":"k-suggestion",{"k-disabled":e.disabled})},e.text)),[t,o,a,l,p]);if(!t||0===t.length)return null;if("classic"===l)return g();const f="scroll"===s||"scrollbuttons"===s,v=h.createElement("div",{role:"group",className:n.classNames("k-suggestion-group",{"k-suggestion-group-scrollable":"scroll"===s,"k-suggestion-group-scrollable-start":u&&("scroll"===s||"scrollbuttons"===s),"k-suggestion-group-scrollable-end":c&&("scroll"===s||"scrollbuttons"===s)})},f?h.createElement("div",{className:"k-suggestions-scroll",ref:i},g()):g());return h.createElement(xe,{visible:"scrollbuttons"===s,dir:r,canScrollLeft:c,canScrollRight:u,onScrollLeft:m,onScrollRight:d},v)},Me=h.forwardRef(({onFilesAdd:e,files:t=[],restrictions:n,multiple:l=!0,accept:o,uploadRef:s,onSelectAttachments:r,onRemoveAttachment:c,_registerRemoveCallback:u,...m},d)=>{h.useEffect(()=>(u&&c&&u(c),()=>{u&&c&&u(void 0)}),[c,u]);const p=h.useCallback(t=>{e&&e(t),r&&r({selectedFiles:t.affectedFiles,allFiles:t.newState})},[e,r]);return h.createElement(h.Fragment,null,h.createElement(a.Button,{ref:d,...m}),h.createElement(i.Upload,{ref:s,files:t,onAdd:p,autoUpload:!1,restrictions:n,multiple:l,accept:o,className:"k-hidden"}))});Me.displayName="PromptBoxUploadButton";const Le=h.forwardRef((e,t)=>h.createElement(a.Button,{ref:t,...e}));Le.displayName="PromptBoxActionButton";const Be=h.forwardRef((e,t)=>h.createElement(a.SpeechToTextButton,{ref:t,...e}));Be.displayName="PromptBoxSpeechToTextButton";const De=e=>"."+e.split(".").pop()||"",Pe=e=>{if(null==e)return"";if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,t)).toFixed(2))} ${["B","KB","MB","GB","TB"][t]}`},ze=({files:e,onRemoveFile:t,header:o})=>{const r=s.useLocalization(),i=h.useRef(null),[c,u]=h.useState(!1),[m,d]=h.useState(!1),p=h.useCallback(()=>{const e=i.current;if(!e)return;const{scrollLeft:t,scrollWidth:n,clientWidth:a}=e,l=t+a>=n-1;d(!(0===t)),u(!l)},[]);if(h.useLayoutEffect(()=>{p()},[e,p]),h.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>p(),n=new ResizeObserver(p);return n.observe(e),e.addEventListener("scroll",t,{passive:!0}),()=>{e.removeEventListener("scroll",t),n.disconnect()}},[p,e.length]),0===e.length&&!o)return null;const g=(e=>e?"function"==typeof e?e():e:null)(o),f=e.length>0&&h.createElement("ul",{role:"list","aria-label":r.toLanguageString(_,ue[_]),className:n.classNames("k-file-box-wrapper",{"k-file-box-wrapper-scrollable-start":c,"k-file-box-wrapper-scrollable-end":m})},h.createElement("div",{className:"k-files-scroll",role:"presentation",ref:i},e.map((e,o)=>h.createElement("li",{key:e.name,className:"k-file-box",role:"listitem",tabIndex:0===o?0:-1,"aria-label":[e.name,Pe(e.size)].filter(Boolean).join(" ")||void 0},h.createElement(n.IconWrap,{size:"xlarge",...n.getFileExtensionIcon(De(e.name))}),h.createElement("div",{className:"k-file-info"},h.createElement("span",{className:"k-file-name"},e.name),h.createElement("span",{className:"k-file-size"},Pe(e.size))),h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:l.xCircleIcon,onClick:n=>{n.stopPropagation(),t(e.name)},"aria-label":`${r.toLanguageString(j,ue[j])} ${e.name}`,title:`${r.toLanguageString(j,ue[j])} ${e.name}`})))));return h.createElement("div",{className:"k-prompt-box-header"},g,f)},Oe=Object.freeze({name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"16.1.0-develop.11",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"}),qe="k-prompt-box",Ke={mode:"auto",rows:1,defaultValue:"",disabled:!1,readOnly:!1,loading:!1,uploadButtonConfig:!1,speechToTextButtonConfig:!0,actionButtonConfig:!0},He=h.forwardRef((e,t)=>{const a=!n.validatePackage(Oe,{component:"PromptBox"}),o=n.getLicenseMessage(Oe),r=s.useLocalization(),i={...Ke,...e},{mode:c=Ke.mode,fillMode:u,rows:m=Ke.rows,maxTextAreaHeight:d,value:p,defaultValue:g=Ke.defaultValue,disabled:f=Ke.disabled,readOnly:v=Ke.readOnly,placeholder:k,title:E,maxLength:b,inputAttributes:y,topAffix:C,startAffix:x,endAffix:I,header:T,onChange:N,onFocus:w,onBlur:F,onPromptAction:S,attachments:A,loading:R=Ke.loading,uploadButtonConfig:M=Ke.uploadButtonConfig,speechToTextButtonConfig:L=Ke.speechToTextButtonConfig,actionButtonConfig:B=Ke.actionButtonConfig,className:D,style:P,...z}=i,O=h.useRef(null),[q,K]=h.useState(g),[H,j]=h.useState([]),[G,_]=h.useState(!1),Y=h.useRef(null),J=h.useRef(null),X=h.useRef(0),Q=h.useRef(0),Z=h.useRef(!1),ee=h.useRef(0),te=h.useRef(0),ne=h.useCallback((e,t)=>e?"function"==typeof e?e(t):e:null,[]),ae=void 0!==p,le=ae?p:q,oe=void 0!==A,se=oe?A:H,re=h.useMemo(()=>!!(null!=le&&le.trim()||se.length>0),[le,se.length]),ie=h.useCallback(()=>{if(!O.current||"single"===c)return;const e=O.current,t=globalThis.getComputedStyle(e),n=Number.parseFloat(t.lineHeight)||20,a=Number.parseFloat(t.paddingTop)||0,l=Number.parseFloat(t.paddingBottom)||0;X.current=e.offsetHeight||n+a+l,Q.current=n*m+a+l,"auto"===c&&!G&&(te.current=e.offsetWidth)},[c,m,G]),ce=h.useCallback(()=>"auto"===c?1:m,[c,m]),me=h.useCallback(e=>{if(d){const t=Number.parseInt(d,10);if(e>t)return t}return Math.max(Q.current,e)},[d]),de=h.useCallback(e=>{e.style.overflow="hidden",e.style.height=`${X.current}px`;const t=e.scrollHeight,n=me(t);e.style.height=`${n}px`,d&&t>Number.parseInt(d,10)&&(e.style.overflow="")},[me,d]),pe=h.useCallback(e=>{e.style.overflow="hidden",e.style.height=`${X.current}px`;const t=e.scrollHeight,n=d?Math.min(t,Number.parseInt(d,10)):t;e.style.height=`${n}px`,d&&t>Number.parseInt(d,10)&&(e.style.overflow="")},[d]),ge=h.useCallback(e=>{if(te.current<=0)return!1;const t=e.style.height,n=e.style.width;e.style.overflow="hidden",e.style.width=`${te.current}px`,e.style.height=`${X.current}px`;const a=e.scrollWidth<=te.current&&e.scrollHeight<=X.current;return e.style.overflow="",e.style.width=n||"",e.style.height=t||"",a},[]),fe=h.useCallback((e,t)=>{if(!Z.current){if((e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&!G)return Z.current=!0,void _(!0);if(G){pe(e);t<ee.current&&ge(e)&&(e.style.height="",Z.current=!0,_(!1))}}},[G,pe,ge]),he=h.useCallback(()=>{var e;if("single"===c||!O.current)return;const t=O.current,n=(null==(e=t.value)?void 0:e.length)||0;"multi"===c?de(t):"auto"===c&&fe(t,n)},[c,de,fe]);h.useEffect(()=>{"single"!==c&&O.current&&ie()},[c,ie]),h.useEffect(()=>{"single"!==c&&O.current&&(ie(),he())},[m,c,ie,he]),h.useEffect(()=>{if("single"!==c&&O.current){const e=(null==le?void 0:le.length)||0;requestAnimationFrame(()=>{if(O.current){const t=O.current;"multi"===c?de(t):"auto"===c&&fe(t,e),ee.current=e}})}},[le,c,de,fe]),h.useEffect(()=>{"auto"===c&&G&&O.current&&requestAnimationFrame(()=>{if(O.current){const e=O.current;pe(e),Z.current=!1}})},[G,c,pe]),h.useEffect(()=>{if("auto"===c&&O.current){const e=O.current;G||(e.style.height="",e.style.overflow="",Z.current=!1)}},[c,G]),h.useEffect(()=>{if("single"===c||!O.current)return;const e=O.current;let t;const n=new ResizeObserver(()=>{clearTimeout(t),t=setTimeout(()=>{O.current&&("auto"===c&&!G&&ie(),he())},50)});return n.observe(e),()=>{n.disconnect(),clearTimeout(t)}},[c,G,ie,he]);const ve=h.useCallback(()=>({focus:()=>{var e;return null==(e=O.current)?void 0:e.focus()},blur:()=>{var e;return null==(e=O.current)?void 0:e.blur()},element:O.current,get value(){return le}}),[le]);h.useImperativeHandle(t,ve);const ke=h.useCallback(e=>{const t=e.target.value;!ae&&!f&&K(t),N&&!f&&n.dispatchEvent(N,e,{...ve(),value:t},{value:t}),"single"!==c&&he()},[K,N,f,ae,ve,c,he]),Ee=h.useCallback(e=>{w&&!f&&n.dispatchEvent(w,e,ve(),void 0)},[w,f,ve]),be=h.useCallback(e=>{F&&!f&&n.dispatchEvent(F,e,ve(),void 0)},[F,f,ve]),ye=h.useCallback(e=>{e.preventDefault()},[]),Ce=h.useCallback(e=>{S&&n.dispatchEvent(S,e,ve(),{value:le,attachments:se}),ae||K(""),oe||j([])},[S,ve,le,se,ae,oe]),xe=h.useCallback(e=>{if("Enter"!==e.key||!e.shiftKey){if("ArrowUp"===e.key||"ArrowDown"===e.key)return void e.stopPropagation();if("Enter"===e.key){if(e.preventDefault(),R)return;re&&Ce(e)}}},[Ce,R,re]),Ie={disabled:f,readOnly:v,placeholder:k,title:E,maxLength:b,"aria-label":r.toLanguageString(U,ue[U]),value:le,onKeyDown:xe,...y,onChange:ke,onFocus:Ee,onBlur:be,ref:O},Te=h.useCallback(e=>{var t,a;const{isFinal:l,alternatives:o}=e;if(o.length>0){const e=o[0];if(l){const a=(null==(t=O.current)?void 0:t.value)||"",l=(a?`${a} `:"")+e.transcript;if(ae||K(l),N&&!f){const e={target:O.current,currentTarget:O.current};n.dispatchEvent(N,e,{...ve(),value:l},{value:l})}}}null==(a=O.current)||a.focus()},[ae,N,f,ve]),Ne=h.useCallback(()=>{var e,t;null==(t=null==(e=Y.current)?void 0:e.actionElement)||t.click()},[]),we=h.useCallback(e=>{var t;const n=Array.from(e.affectedFiles),a="object"==typeof M&&M.onSelectAttachments;oe||j(e=>[...e,...n]),a&&a({selectedFiles:e.affectedFiles,allFiles:e.newState}),null==(t=O.current)||t.focus()},[M,oe]),Fe=h.useMemo(()=>({uploadButtonProps:{fillMode:"flat",svgIcon:l.paperclipIcon,size:"small",rounded:"full",onClick:Ne,onFilesAdd:we,files:se,uploadRef:Y,"aria-label":r.toLanguageString(V,ue[V]),title:r.toLanguageString(V,ue[V]),_registerRemoveCallback:e=>{J.current=e}},speechToTextButtonProps:{fillMode:"flat",size:"small",rounded:"full",onResult:Te},actionButtonProps:{rounded:"full",size:"small",svgIcon:R?l.stopIcon:l.arrowUpIcon,className:R?"k-generating k-active":"",onClick:Ce,onMouseDown:ye,disabled:!R&&!re,"aria-label":R?r.toLanguageString(W,ue[W]):r.toLanguageString($,ue[$]),title:R?r.toLanguageString(W,ue[W]):r.toLanguageString($,ue[$]),"aria-live":"polite"}}),[Te,we,se,Ce,ye,R,Ne,r,re]),Se=h.useCallback(e=>{oe||j(t=>t.filter(t=>t.name!==e));const t="object"==typeof M&&M.onRemoveAttachment;t&&(J.current=t),J.current&&J.current(e)},[M,oe]),Ae=()=>{const e=!1!==L,t=!1!==B,n=!1!==M,a="object"==typeof L?L:void 0,l="object"==typeof M?M:{},{restrictions:o,multiple:s=!0,accept:r,onSelectAttachments:i,onRemoveAttachment:c,...u}=l,m={restrictions:o,multiple:s,accept:r},d="object"==typeof B?B:void 0;return h.createElement(h.Fragment,null,n&&h.createElement(Me,{...Fe.uploadButtonProps,restrictions:m.restrictions,multiple:m.multiple,accept:m.accept,...u}),e&&h.createElement(Be,{...Fe.speechToTextButtonProps,...a}),t&&h.createElement(Le,{...Fe.actionButtonProps,...d}))},Re="multi"===c||"auto"===c&&G,De=!1!==M||!1!==L||!1!==B,Pe=I||De,He=x||I||De;return h.createElement("div",{...z,className:n.classNames(D,"k-input",qe,{[`k-input-${u}`]:u,"k-disabled":f,"k-prompt-box-singleline":"single"===c,"k-prompt-box-multiline":Re}),style:P},h.createElement(ze,{files:se,onRemoveFile:Se,header:T}),"single"===c?h.createElement("div",{className:`${qe}-content`},x&&h.createElement("div",{className:`${qe}-affix`},ne(x,Fe)),h.createElement("input",{...Ie,className:n.classNames("k-input-inner",`${qe}-input`)}),Pe?h.createElement("div",{className:`${qe}-affix`},I&&ne(I,Fe),Ae()):null):h.createElement("div",{className:`${qe}-content`},"multi"===c&&C&&h.createElement("div",{className:`${qe}-affix`},ne(C,Fe)),"auto"===c&&!G&&x&&h.createElement("div",{className:`${qe}-affix`},ne(x,Fe)),h.createElement("textarea",{...Ie,className:n.classNames("k-input-inner",`${qe}-textarea`),rows:ce(),style:d?{maxHeight:d}:{},"aria-multiline":"true"}),"auto"===c&&!G&&Pe?h.createElement("div",{className:`${qe}-affix`},I&&ne(I,Fe),Ae()):null,Re&&He?h.createElement("div",{className:`${qe}-affix`},x&&ne(x,Fe),(x||I)&&h.createElement("div",{className:"k-spacer"}),I&&ne(I,Fe),Ae()):null),a&&h.createElement(n.WatermarkOverlay,{message:o}))});He.propTypes={value:r.string,defaultValue:r.string,mode:r.oneOf(["single","multi","auto"]),rows:r.number,maxTextAreaHeight:r.string,title:r.string,disabled:r.bool,readOnly:r.bool,placeholder:r.string,maxLength:r.number,inputAttributes:r.object,fillMode:r.oneOf(["solid","flat","outline"]),topAffix:r.oneOfType([r.func,r.element,r.string]),startAffix:r.oneOfType([r.func,r.element,r.string]),endAffix:r.oneOfType([r.func,r.element,r.string]),header:r.oneOfType([r.func,r.element,r.string]),onChange:r.func,onFocus:r.func,onBlur:r.func,loading:r.bool,uploadButtonConfig:r.oneOfType([r.bool,r.object]),speechToTextButtonConfig:r.oneOfType([r.bool,r.object]),actionButtonConfig:r.oneOfType([r.bool,r.object]),attachments:r.array,onPromptAction:r.func,className:r.string,style:r.object},He.displayName="KendoPromptBox";const Ue=h.memo(({affixProps:e,uploadConfig:t,localizationService:n,onFilesSelect:a,onFileRemove:l})=>{const o="object"==typeof t?t:{};return!1!==t?h.createElement(Me,{...e.uploadButtonProps,fillMode:"clear","aria-label":n.toLanguageString(B,ue[B]),title:n.toLanguageString(B,ue[B]),...o,onSelectAttachments:a,onRemoveAttachment:l}):null});Ue.displayName="UploadButtonAffix";const $e=h.forwardRef((e,t)=>{const{onSendMessage:o,isDirectionRightToLeft:r,placeholder:i,MessageBox:c,suggestions:u,onSuggestionClick:m,inputValue:d,onInputValueChange:p,suggestionTemplate:g,sendButtonConfig:f,onInputClick:k,suggestionsLayout:b,dir:y,messageBoxSettings:C,loading:x}=e,{replyToMessage:I,setReplyToMessage:T,user:N,speechToTextConfig:w,uploadConfig:F}=ve(),[A,R]=h.useState(""),[M,L]=h.useState([]),B=h.useRef(null),D=s.useLocalization(),P=void 0!==d,z=P?d:A,O=h.useCallback(()=>{null!==B.current&&B.current.focus()},[]);h.useEffect(()=>{I&&O()},[I,O]);const q=h.useCallback(e=>{if(e.preventDefault(),o){const t={id:"",author:N,text:z||"",timestamp:new Date,replyToId:I?I.id:void 0,files:M.map(e=>({name:e.name,size:e.size,type:e.extension,rawFile:e.getRawFile?e.getRawFile():e}))};T(null),o(t,e),L([]),P||R(""),p&&p(""),O()}},[o,z,N,I,M,T,p,O,P]);h.useImperativeHandle(t,()=>({focusInput:O}),[O]);const K=h.useCallback(e=>{L(t=>t.filter(t=>t.name!==e))},[]),U=h.useCallback((e,t)=>e.isDeleted?de(t,D):e.text,[D]),$=h.useCallback(()=>{if(I){const e=me(N,I);return h.createElement("div",{className:n.classNames("k-message-reference",e?"k-message-reference-sender":"k-message-reference-receiver")},h.createElement("div",{className:"k-message-reference-content"},U(I,e)),h.createElement("span",{className:"k-spacer"}),h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:l.xCircleIcon,onClick:()=>T(null),"aria-label":D.toLanguageString(S,ue[S]),title:D.toLanguageString(S,ue[S])}))}return null},[I,N,U,T,D]),V=h.useCallback(e=>{try{const t=Array.from(e.allFiles);L(t)}catch{}},[]),j=h.useCallback(e=>{const t=e.value;P||R(t),p&&p(t||"")},[P,p]),W=h.useCallback(e=>{q(e.syntheticEvent)},[q]),G=h.useCallback(e=>e?"function"==typeof e?e():e:null,[]),_=h.useCallback(e=>h.createElement(h.Fragment,null,h.createElement(Ue,{affixProps:e,uploadConfig:F,localizationService:D,onFilesSelect:V,onFileRemove:K}),G(null==C?void 0:C.startAffix)),[F,D,V,K,null==C?void 0:C.startAffix,G]),Y=h.useCallback(()=>G(null==C?void 0:C.endAffix),[null==C?void 0:C.endAffix,G]),J=h.useCallback(()=>G(null==C?void 0:C.topAffix),[null==C?void 0:C.topAffix,G]),X=h.useMemo(()=>{const e="object"==typeof f?f:{},t=!1!==f&&{"aria-label":x?D.toLanguageString(H,ue[H]):D.toLanguageString(v,ue[v]),title:x?D.toLanguageString(H,ue[H]):D.toLanguageString(v,ue[v]),dir:r?"rtl":void 0,...e};return h.createElement(He,{header:$(),ref:B,placeholder:i,value:z,onChange:j,onPromptAction:W,mode:(null==C?void 0:C.mode)||"multi",rows:(null==C?void 0:C.rows)||2,maxTextAreaHeight:(null==C?void 0:C.maxTextAreaHeight)||"110",loading:x,speechToTextButtonConfig:w,actionButtonConfig:t,attachments:M,startAffix:_,endAffix:null!=C&&C.endAffix?Y:void 0,topAffix:null!=C&&C.topAffix?J:void 0,inputAttributes:{onClick:k,"aria-label":D.toLanguageString(E,ue[E])}})},[i,z,j,W,C,x,w,f,M,$,_,Y,J,D,r,k]);return h.createElement("div",{className:"k-message-box-wrapper"},u&&u.length>0&&h.createElement(Re,{onSuggestionClick:m,suggestions:u,suggestionTemplate:g,suggestionsLayout:b,dir:y}),c?h.createElement(c,{messageInput:X}):X)});$e.displayName="NewMessage";const Ve=e=>h.createElement(a.Toolbar,{className:"k-chat-header",size:"small"},e.children),je=e=>{const{message:t,onUnpin:o,user:r,onReferencedMessageClick:i}=e,c=s.useLocalization(),u=h.useRef(null),m=r&&me(r,t),d=h.useCallback(e=>{e.preventDefault(),e.stopPropagation(),null==i||i(t.id)},[t.id,i]);return h.createElement("div",{ref:u,className:`k-message-reference ${m?"k-message-reference-sender":"k-message-reference-receiver"} k-message-pinned`,onClick:d},h.createElement(n.IconWrap,{icon:l.pinIcon}),h.createElement("div",{className:"k-message-reference-content"},t.isDeleted?r&&de(me(r,t),c):t.text),h.createElement("span",{className:"k-spacer"}),h.createElement(a.Button,{fillMode:"flat",size:"xs",svgIcon:l.xCircleIcon,onClick:e=>{e.stopPropagation(),null==o||o(t)},"aria-label":c.toLanguageString("chat.unpinMessage",ue["chat.unpinMessage"])}))},We=e=>{const{show:t,text:n}=e;return h.createElement("div",{style:{position:"absolute",top:"90%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e3,pointerEvents:t?"auto":"none"}},h.createElement(c.Fade,null,t&&h.createElement(u.Notification,{type:{style:"inverse"},closable:!1},h.createElement("span",null,n))))},Ge={textField:"text",statusField:"status",authorIdField:"authorId",authorNameField:"authorName",authorImageUrlField:"authorImageUrl",authorImageAltTextField:"authorImageAltText",idField:"id",timestampField:"timestamp",filesField:"files",attachmentsField:"attachments",replyToIdField:"replyToId",isDeletedField:"isDeleted",isPinnedField:"isPinned",typingField:"typing",suggestedActionsField:"suggestedActions",isFailedField:"isFailed"},_e=(e,t={})=>{const n={...Ge,...t};let a,l;a=e.author&&"object"==typeof e.author?{id:e.author.id||e.author[n.authorIdField]||e[n.authorIdField]||"",name:e.author.name||e.author[n.authorNameField]||e[n.authorNameField],avatarUrl:e.author.avatarUrl||e.author[n.authorImageUrlField]||e[n.authorImageUrlField],avatarAltText:e.author.avatarAltText||e.author[n.authorImageAltTextField]||e[n.authorImageAltTextField]}:{id:e[n.authorIdField]||e.authorId||"",name:e[n.authorNameField]||e.authorName,avatarUrl:e[n.authorImageUrlField]||e.authorImageUrl,avatarAltText:e[n.authorImageAltTextField]||e.authorImageAltText},l=e.timestamp?new Date(e.timestamp):e[n.timestampField]?new Date(e[n.timestampField]):new Date;const o={id:void 0!==e.id?e.id:e[n.idField],text:void 0!==e.text?e.text:e[n.textField]||"",author:a,timestamp:l,status:void 0!==e.status?e.status:e[n.statusField],attachments:void 0!==e.attachments?e.attachments:e[n.attachmentsField],attachmentLayout:e.attachmentLayout||"list",suggestedActions:void 0!==e.suggestedActions?e.suggestedActions:e[n.suggestedActionsField],isPinned:void 0!==e.isPinned?e.isPinned:e[n.isPinnedField]||!1,typing:void 0!==e.typing?e.typing:e[n.typingField],files:void 0!==e.files?e.files:e[n.filesField]||[],isFailed:void 0!==e.isFailed?e.isFailed:e[n.isFailedField]||!1};return e.pinnedAt&&(o.pinnedAt=new Date(e.pinnedAt)),e.pinnedBy&&(o.pinnedBy=e.pinnedBy),void 0!==e.replyToId?o.replyToId=e.replyToId:void 0!==e[n.replyToIdField]&&(o.replyToId=e[n.replyToIdField]),void 0!==e.isDeleted?o.isDeleted=e.isDeleted:void 0!==e[n.isDeletedField]&&(o.isDeleted=e[n.isDeletedField]),{...o,dataItem:e}},Ye=(e,t={})=>Array.isArray(e)?e.map(e=>_e(e,t)):[],Je=e=>e&&void 0!==e.id&&"string"==typeof e.text&&e.author&&"object"==typeof e.author&&void 0!==e.author.id&&(e.timestamp instanceof Date||"string"==typeof e.timestamp||"number"==typeof e.timestamp),Xe=e=>{e.scrollTop=e.scrollHeight-e.clientHeight},Qe=({viewItemsWrapperRef:e,isKeyboardNavigationActiveRef:t,processedMessages:n,authorId:a,autoScrollThreshold:l,isEndless:o=!1,isOnLastBatch:s=!0,skipAutoScrollRef:r})=>{var i;const c=h.useRef(a),u=h.useRef(l),m=h.useRef(o),d=h.useRef(s);h.useEffect(()=>{c.current=a,u.current=l,m.current=o,d.current=s});const p=h.useRef(!1);h.useEffect(()=>{o||!e.current||0===n.length||p.current||(Xe(e.current),p.current=!0)},[e,o,n.length]);const g=h.useRef(void 0),f=h.useRef(0),v=h.useRef(!0),k=h.useRef(!0),E=h.useRef(!1),b=h.useRef(null),y=(n.length>0?null==(i=n.at(-1))?void 0:i.id:void 0)!==g.current,C=n.length>f.current;if(y||C){const t=e.current;k.current=!t||(e=>{const{scrollHeight:t,scrollTop:n,clientHeight:a}=e;return!(t>a)||t-n-a<=100})(t)}h.useEffect(()=>{var a,l;const o=n.length,s=o>0?null==(a=n[o-1])?void 0:a.id:void 0,i=g.current,p=f.current,h=v.current;if(g.current=s,f.current=o,v.current=!1,0===o)return;const y=e.current;if(!y||t.current)return;if(h||s===i)return void(!m.current&&(h||o>p)&&(Xe(y),E.current=!1,b.current=null));if(m.current&&!d.current)return;if(null!=r&&r.current)return void(r.current=!1);const C=n[o-1];if(void 0!==c.current&&void 0!==(null==(l=null==C?void 0:C.author)?void 0:l.id)&&String(C.author.id)===String(c.current))return y.scrollTo({top:y.scrollHeight-y.clientHeight,behavior:"smooth"}),E.current=!1,void(b.current=null);if(!k.current)return E.current=!1,void(b.current=null);const x=(e=>{const t=e.querySelectorAll(".k-message");return t.length>0?t[t.length-1]:null})(y);if(!x)return;const I=(e=>{const t=e.querySelector(".k-message-pinned");return t?t.offsetHeight:0})(y),T=Math.max(0,y.clientHeight-I),N=((e,t)=>{const n=null!=e?e:"20%";let a;if("number"==typeof n)a=n;else{const e=/^(-?\d+(?:\.\d+)?)%$/.exec(String(n));if(e)a=Number.parseFloat(e[1])/100*t;else{const e=Number.parseFloat(String(n));a=Number.isNaN(e)?.2*t:e}}return Math.min(a,t)})(u.current,T),w=x.getBoundingClientRect().top-y.getBoundingClientRect().top+y.scrollTop,F=Math.max(0,w-N-I),S=Math.max(0,y.scrollHeight-y.clientHeight),A=Math.min(F,S);A>y.scrollTop&&y.scrollTo({top:A,behavior:"smooth"}),b.current=F,E.current=!0},[n,e,t]),h.useEffect(()=>{const n=e.current;if(!n)return;let a=n.querySelectorAll(".k-message").length,l=n.scrollHeight,o=n.scrollTop;const s=()=>{const e=n.scrollTop;E.current&&e<o&&(E.current=!1,b.current=null),o=e},r=new MutationObserver(()=>{if(t.current)return;const e=n.querySelectorAll(".k-message").length,s=n.scrollHeight;if(e===a&&s>l&&E.current){const e=s-n.clientHeight,t=b.current,a=null===t?e:Math.min(e,t);a>n.scrollTop&&(n.scrollTop=a),o=n.scrollTop}a=e,l=s});return r.observe(n,{childList:!0,subtree:!0,characterData:!0}),n.addEventListener("scroll",s,{passive:!0}),()=>{r.disconnect(),n.removeEventListener("scroll",s)}},[e,t])},Ze=["allowMessageCollapse","messageWidthMode","showAvatar","showUsername","messageTemplate","messageContentTemplate","messageToolbarActions","messageContextMenuActions","fileActions"];function et(e,t,n,a,l){const o=((e,t)=>{var n,a;return(null==(n=null==e?void 0:e.author)?void 0:n.id)===t||(null==(a=null==e?void 0:e.author)?void 0:a.id)===String(t)})(e,t)?a:l,s={};return Ze.forEach(e=>{var t;s[e]=null!=(t=null==o?void 0:o[e])?t:null==n?void 0:n[e]}),s}const tt=({scrollMode:e,processedMessages:t,total:n,pageSize:a=50,startIndex:l,endIndex:o,onLoadMoreMessages:s,onReferencedMessageClick:r,viewItemsWrapperRef:i,authorId:c})=>{const u=h.useRef(!1),m="endless"===e,d=null!=n?n:t.length,p=m&&t.length===d&&!u.current,g=m&&(t.length<d||u.current);g&&(u.current=!0);const[f,v]=h.useState(-1),[k,E]=h.useState(-1),b=h.useRef(f),y=h.useRef(k);b.current=f,y.current=k;const C=h.useRef(!1),x=h.useRef(0),I=h.useRef(0),T=h.useRef(0),N=h.useRef(!1),w=h.useRef(d),F=h.useRef(c);F.current=c;const S=h.useRef(!1),A=h.useRef(null),R=h.useRef(!1),M=h.useRef(!1),L=h.useRef(!0),B=h.useRef(d);h.useEffect(()=>{if(p){if(u.current)return void((-1===f||-1===k)&&(v(0),E(t.length)));if(-1===f||-1===k){const e=Math.max(0,t.length-a),n=t.length;v(e),E(n)}else if(k<t.length){const e=w.current;if(y.current>=e)E(t.length);else if(t.length>e&&t.slice(e).some(e=>{var t;return void 0!==(null==(t=e.author)?void 0:t.id)&&String(e.author.id)===String(F.current)})){const e=Math.max(0,t.length-a);v(e),E(t.length),R.current=!0}}w.current=d}},[p,t.length,a,f,k,d]);const D=null!=l?l:0,P=null!=o?o:t.length,z=h.useCallback(()=>{const e=i.current;e&&(x.current=e.scrollHeight,I.current=e.scrollTop,T.current=e.querySelectorAll("[data-message-id]").length)},[i]),O=h.useCallback(e=>{var t,n,a;((e,t,n=0)=>{if(!t)return;const a=t.querySelector(`[data-message-id="${e}"]`);if(!a)return;const l=t.querySelector(".k-message-list");if(l){const e=l.getBoundingClientRect().top,t=a.getBoundingClientRect().top,o=l.scrollTop+(t-e)-n;l.scrollTo({top:o,behavior:"smooth"})}else a.scrollIntoView({behavior:"smooth",block:"start"})})(e,null==(t=i.current)?void 0:t.closest(".k-chat"),(null==(a=null==(n=i.current)?void 0:n.querySelector(".k-message-pinned"))?void 0:a.offsetHeight)||0)},[i]);h.useLayoutEffect(()=>{if(!N.current)return;const e=i.current;if(!e)return void(N.current=!1);if(e.querySelectorAll("[data-message-id]").length<=T.current)return;const t=e.scrollHeight-x.current;t>0&&(e.scrollTop=I.current+t),N.current=!1,C.current=!1}),h.useLayoutEffect(()=>{if(!R.current)return;const e=i.current;e?k>=t.length&&k>0&&(R.current=!1,e.scrollTop=e.scrollHeight-e.clientHeight):R.current=!1});const q=h.useRef(!1);h.useLayoutEffect(()=>{if(!m||q.current)return;const e=i.current;e&&e.querySelector("[data-message-id]")&&(e.scrollTop=e.scrollHeight-e.clientHeight,q.current=!0)}),h.useEffect(()=>{if(!m)return;const e=i.current;if(!e)return;let n=e.scrollTop;const l=()=>{const{scrollTop:l,scrollHeight:o,clientHeight:r}=e,i=l<n,c=l>n;if(n=l,!C.current){if(i&&l<=100)if(p){const e=b.current;if(e>0){const t=Math.max(0,e-a);N.current=!0,z(),v(t),null==s||s({startIndex:t,endIndex:y.current})}}else if(g&&D>0){C.current=!0;const e=Math.max(0,D-a);N.current=!0,z(),null==s||s({startIndex:e,endIndex:P})}if(c&&o-l-r<=100)if(p){const e=y.current;if(e<t.length){const n=Math.min(t.length,e+a);M.current=!0,E(n),null==s||s({startIndex:b.current,endIndex:n})}}else if(g&&P<d){C.current=!0,M.current=!0;const e=Math.min(d,P+a);null==s||s({startIndex:D,endIndex:e})}}};return e.addEventListener("scroll",l,{passive:!0}),()=>e.removeEventListener("scroll",l)},[m,p,g,i,a,t.length,D,P,d,s]),h.useEffect(()=>{var e;const n=P>=d;if(!g)return B.current=d,void(L.current=n);const a=B.current,l=L.current;if(B.current=d,L.current=n,d>a&&!l&&n){const n=t[t.length-1];void 0!==F.current&&void 0!==(null==(e=null==n?void 0:n.author)?void 0:e.id)&&String(n.author.id)===String(F.current)&&(S.current=!0,M.current=!0)}},[g,d,P,t]),h.useEffect(()=>{!g||!S.current||(S.current=!1,C.current=!1,requestAnimationFrame(()=>{const e=i.current;e&&(e.scrollTop=e.scrollHeight-e.clientHeight)}))},[g,t,i]),h.useEffect(()=>{if(!g||null===A.current)return;const e=A.current,t=i.current;t&&t.querySelector(`[data-message-id="${e}"]`)&&(A.current=null,C.current=!1,requestAnimationFrame(()=>{O(e)}))},[g,t,i,O]),h.useEffect(()=>{g&&C.current&&!N.current&&(C.current=!1)},[g,D,P]);const K=h.useMemo(()=>{if(p){const e=Math.max(0,f),n=Math.min(t.length,k);if(e>=n){const e=Math.max(0,t.length-a);return t.slice(e)}return t.slice(e,n)}return t},[p,t,f,k,a]),H=h.useMemo(()=>!m||(p?k>=t.length:P>=d),[m,p,k,t.length,P,d]),U=h.useCallback(()=>{if(!m||H){const e=i.current;return void(e&&e.scrollTo({top:e.scrollHeight-e.clientHeight,behavior:"smooth"}))}if(!C.current)if(p){const e=Math.max(0,t.length-a);v(e),E(t.length),null==s||s({startIndex:e,endIndex:t.length}),requestAnimationFrame(()=>{const e=i.current;e&&(e.scrollTop=e.scrollHeight-e.clientHeight)})}else if(g){S.current=!0,N.current=!1,C.current=!0;const e=Math.max(0,d-a);null==s||s({startIndex:e,endIndex:d})}},[m,p,g,H,t.length,a,d,s,i]),$=h.useCallback(e=>{if(m){if(p){const n=i.current;if(null==n?void 0:n.querySelector(`[data-message-id="${e}"]`))O(e);else{if(C.current)return;const n=t.findIndex(t=>t.id===e||String(t.id)===String(e));if(n>=0){const l=Math.floor(a/2),o=Math.max(0,n-l),s=Math.min(t.length,o+a);C.current=!0,v(o),E(s),requestAnimationFrame(()=>{requestAnimationFrame(()=>{O(e),C.current=!1})})}}}else if(g){const t=i.current;if(null==t?void 0:t.querySelector(`[data-message-id="${e}"]`))O(e);else{if(C.current)return;A.current=e,N.current=!1,C.current=!0}}}else O(e);null==r||r({id:e})},[m,p,g,i,t,a,r,O]);return{renderedMessages:K,handleScrollToBottom:U,handleReferencedMessageClick:$,isEndless:m,isOnLastBatch:H,skipAutoScrollRef:M}},nt=h.forwardRef((e,t)=>{const{messages:o=[],messageTemplate:r,messageContentTemplate:i,attachmentTemplate:c,width:u,height:m,onSendMessage:d,onSuggestionClick:p,onInputValueChange:g,onActionExecute:f,dir:v,messageBox:k,placeholder:E,className:b,style:C,message:x=Ee,authorId:I,suggestions:T,suggestionTemplate:N,suggestionsLayout:F="scroll",quickActionsLayout:S="scroll",inputValue:A,headerTemplate:R,noDataTemplate:M,timestampTemplate:L,statusTemplate:B,userStatusTemplate:D,allowMessageCollapse:P,messageToolbarActions:z,messageContextMenuActions:q,fileActions:K,onUnpin:H,messageWidthMode:U,showAvatar:$,showUsername:V,timestampVisibility:j,authorMessageSettings:W,receiverMessageSettings:G,onToolbarAction:_,onContextMenuAction:Y,onFileAction:J,onDownload:X,speechToTextConfig:Q,uploadConfig:Z,sendButtonConfig:ee,messageFilesLayout:te,scrollToBottomButton:ne=!0,autoScrollThreshold:ae,textField:le,statusField:oe,authorIdField:se,authorNameField:re,authorImageUrlField:ie,authorImageAltTextField:ce,idField:me,timestampField:de,filesField:pe,attachmentsField:ge,replyToIdField:fe,isDeletedField:ve,isPinnedField:ke,typingField:be,suggestedActionsField:Ce,isFailedField:xe,onResendMessage:Ie,messageBoxSettings:Te,loading:we,scrollMode:Re,total:Me,pageSize:Le,startIndex:Be,endIndex:De,onLoadMoreMessages:Pe,pinnedMessages:ze,repliedToMessages:qe,onReferencedMessageClick:Ke,...He}=e,Ue=h.useRef(null);n.useWebMcpRegister("chat",Ue,e,e.webMcp);const[Ge,_e]=h.useState(null),[Xe,Ze]=h.useState(!1),[nt,at]=h.useState(!1),[lt,ot]=h.useState(null),[st,rt]=h.useState(null),[it,ct]=h.useState(!1),ut=h.useRef(null),mt=h.useRef(null),dt=h.useRef(null),pt=h.useRef(null),gt=h.useRef(void 0),ft=h.useRef(!1),ht=h.useRef(null),vt=h.useRef(""),kt=h.useMemo(()=>{if(!o||0===o.length)return[];const e={textField:le,statusField:oe,authorIdField:se,authorNameField:re,authorImageUrlField:ie,authorImageAltTextField:ce,idField:me,timestampField:de,filesField:pe,attachmentsField:ge,replyToIdField:fe,isDeletedField:ve,isPinnedField:ke,typingField:be,suggestedActionsField:Ce,isFailedField:xe};return!Object.values(e).some(e=>void 0!==e)&&Je(o[0])?o.map(e=>({...e,timestamp:e.timestamp?new Date(e.timestamp):e.timestamp})):Ye(o,e)},[o,le,oe,se,re,ie,ce,me,de,pe,ge,fe,ve,ke,be,Ce,xe]);h.useEffect(()=>{if(I===vt.current&&ht.current)rt(ht.current);else if(I&&kt.length>0){const e=kt.find(e=>e.author&&(e.author.id===I||e.author.id===String(I))),t=(null==e?void 0:e.author)||{id:I};ht.current=t,vt.current=I,rt(t)}},[I,kt]);const{renderedMessages:Et,handleScrollToBottom:bt,handleReferencedMessageClick:yt,isEndless:Ct,isOnLastBatch:xt,skipAutoScrollRef:It}=tt({scrollMode:Re,processedMessages:kt,total:Me,pageSize:Le,startIndex:Be,endIndex:De,onLoadMoreMessages:Pe,onReferencedMessageClick:Ke,viewItemsWrapperRef:dt,authorId:I}),Tt=h.useMemo(()=>Et.length>0?(e=>{const t=e.slice().reduce(ye(e.length),[]);return function(e){let t=0;e.forEach(e=>{"message-group"===e.type?e.messages.forEach(e=>{e.selectionIndex=t++}):("attachment-group"===e.type||"action-group"===e.type)&&(e.selectionIndex=t++)}),e.lastSelectionIndex=t-1}(t),t})(Et):[],[Et]),Nt=h.useMemo(()=>!n.validatePackage(Oe,{component:"Chat"}),[]),wt=n.getLicenseMessage(Oe),Ft=h.useMemo(()=>{if(ze)return ze.find(e=>e.isPinned);const e=kt.find(e=>e.isPinned);return e||void 0},[kt,ze]),St=s.useLocalization();Qe({viewItemsWrapperRef:dt,isKeyboardNavigationActiveRef:ft,processedMessages:Et,authorId:I,autoScrollThreshold:ae,isEndless:Ct,isOnLastBatch:xt,skipAutoScrollRef:It});const At=(({elementRef:e})=>{const[t,n]=h.useState(!1);return h.useEffect(()=>{const t=e.current;if(!t)return;const a=()=>{n(t.scrollHeight>t.clientHeight)};a();const l=new ResizeObserver(a);l.observe(t);const o=new MutationObserver(()=>{requestAnimationFrame(a)});return o.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),o.disconnect()}},[e]),t})({elementRef:dt}),Rt=h.useCallback(()=>{clearTimeout(gt.current)},[]),Mt=h.useCallback(()=>{gt.current=window.setTimeout(()=>{_e(null)},0)},[]),Lt=h.useCallback(e=>{_e(e)},[]),Bt=h.useCallback(e=>{let t=null;const a=null!==Ge?Ge:Tt.lastSelectionIndex;e.keyCode===n.Keys.up?null===a?t=0:a>0&&(t=a-1):e.keyCode===n.Keys.down?null===a?t=0:a<Tt.lastSelectionIndex&&(t=a+1):e.keyCode===n.Keys.home?t=0:e.keyCode===n.Keys.end&&(t=Tt.lastSelectionIndex),null!==t&&(_e(t),ft.current=!0,e.preventDefault())},[Ge,Tt]),Dt=h.useCallback((e,t,n)=>{var a;if(f&&f({action:{value:e.value,title:e.title,type:e.type},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget}),!t.isDefaultPrevented()){switch(e.type){case"reply":d&&d({message:{id:"",author:st,text:e.value,timestamp:new Date},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget});break;case"call":window.open("tel:"+e.value);break;case"openUrl":window.open(e.value)}null==(a=pt.current)||a.focusInput()}},[f,d,st]),Pt=h.useCallback(()=>n.classNames("k-chat",b,{"k-rtl":Xe}),[b,Xe]),zt=h.useCallback(()=>{const e=Tt.length-1;return Tt.map((t,n)=>{var a,l,o,s,u,m;if("date-marker"===t.type)return h.createElement(Se,{item:t,key:t.trackBy,timestampTemplate:L});if("message-group"===t.type){const o={allowMessageCollapse:P,messageWidthMode:U,showAvatar:$,showUsername:V,messageTemplate:r,messageContentTemplate:i,messageToolbarActions:z,messageContextMenuActions:q,fileActions:K},s=et(null==(a=t.messages)?void 0:a[0],I,o,W,G);return h.createElement(Ae,{group:t,itemTemplate:s.messageTemplate,contentTemplate:s.messageContentTemplate,attachmentTemplate:c,user:st,selectedItemIndex:Ge,onRequestSelection:Lt,isLastGroup:n===e,key:null!=(l=t.messages[0].id)?l:t.messages[0].selectionIndex,message:x,allowMessageCollapse:s.allowMessageCollapse,messageToolbarActions:s.messageToolbarActions,messageContextMenuActions:s.messageContextMenuActions,fileActions:s.fileActions,messageWidthMode:s.messageWidthMode,showAvatar:s.showAvatar,showUsername:s.showUsername})}return"attachment-group"===t.type?h.createElement(Fe,{group:t,itemTemplate:c,onRequestSelection:Lt,selected:t.selectionIndex===Ge,isLastGroup:n===e,key:`att-${null!=(s=null==(o=t.trackBy)?void 0:o.id)?s:t.selectionIndex}`}):"action-group"===t.type?h.createElement(Ne,{group:t,onActionExecute:Dt,onRequestSelection:Lt,selected:t.selectionIndex===Ge,key:`act-${null!=(m=null==(u=t.trackBy)?void 0:u.id)?m:t.selectionIndex}`,quickActionsLayout:S,dir:v}):null})},[Tt,L,r,i,c,st,Ge,Lt,x,P,z,q,K,U,$,V,I,W,G,Dt,S,v]),Ot=h.useCallback(()=>R?"function"==typeof R?R():R:null,[R]),qt=h.useCallback(()=>M?"function"==typeof M?M():M:null,[M]);h.useEffect(()=>{const e=void 0!==v?"rtl"===v:ut.current&&"rtl"===getComputedStyle(ut.current).direction;Ze(!!e)},[v]),h.useEffect(()=>()=>{clearTimeout(gt.current)},[]),h.useEffect(()=>{if(!ne||!dt.current)return;let e,t;const n=()=>{e=void 0;const n=dt.current;if(!n)return;const{scrollHeight:a,scrollTop:l,clientHeight:o}=n;!(a>o)||a-l-o<=100?(void 0!==t&&(clearTimeout(t),t=void 0),ct(!1)):null!=t||(t=setTimeout(()=>{t=void 0,ct(!0)},300))},a=()=>{void 0===e&&(e=requestAnimationFrame(n))},l=dt.current;l.addEventListener("scroll",a,{passive:!0});const o=new MutationObserver(a);return o.observe(l,{childList:!0,subtree:!0,characterData:!0}),()=>{l.removeEventListener("scroll",a),o.disconnect(),void 0!==e&&cancelAnimationFrame(e),void 0!==t&&clearTimeout(t)}},[ne]);const Kt=h.useMemo(()=>({replyToMessage:lt,setReplyToMessage:ot,messages:kt,repliedToMessages:qe,user:st,internalScrollContainerRef:mt,messageListScrollContainerRef:dt,onToolbarAction:_,onContextMenuAction:Y,onFileAction:J,setShowCopyNotification:at,onDownload:X,onResendMessage:Ie,fileActions:K,speechToTextConfig:Q,uploadConfig:Z,statusTemplate:B,userStatusTemplate:D,messageFilesLayout:te,timestampVisibility:j,onReferencedMessageClick:yt}),[lt,ot,kt,qe,st,_,Y,J,at,X,Ie,K,Q,Z,B,D,te,j,yt]);return h.createElement(he.Provider,{value:Kt},h.createElement("div",{style:{width:u,height:m,position:"relative",overflow:"hidden",...C},onKeyDown:Bt,className:Pt(),ref:e=>{ut.current=e,mt.current=e,"function"==typeof t?t(e):t&&(t.current=e)},...He},void 0!==R&&h.createElement(Ve,null,Ot()),h.createElement("div",{className:"k-message-list",onBlur:Mt,onFocus:Rt,role:"log","aria-label":St.toLanguageString(y,ue[y]),"aria-live":"polite",ref:dt,style:{scrollBehavior:"auto"}},Ft&&h.createElement(je,{message:Ft,onUnpin:H,user:st,onReferencedMessageClick:yt}),h.createElement("div",{className:n.classNames("k-message-list-content",{"k-message-list-content-empty":0===Et.length})},0===Et.length&&void 0!==M&&qt(),Et.length>0&&zt()),ne&&(it||!xt)&&h.createElement("div",{className:"k-chat-scroll-to-bottom-container"},h.createElement(a.FloatingActionButton,{svgIcon:l.arrowDownIcon,size:"small",themeColor:"base",rounded:"full",onClick:bt,"aria-label":St.toLanguageString(O,ue[O]),title:St.toLanguageString(O,ue[O])}))),At&&h.createElement("div",{className:"k-separator"}),h.createElement($e,{onSendMessage:(e,t)=>{d&&d({message:e,syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget})},onSuggestionClick:e=>{p&&p(e)},isDirectionRightToLeft:Xe,ref:pt,placeholder:E,MessageBox:k,suggestions:T,suggestionTemplate:N,inputValue:A,onInputValueChange:e=>{g&&g(e)},onInputClick:()=>{ft.current=!1},sendButtonConfig:ee,suggestionsLayout:F,dir:v,messageBoxSettings:Te,loading:we}),h.createElement(We,{show:nt,text:St.toLanguageString(w,ue[w])}),Nt&&h.createElement(n.WatermarkOverlay,{message:wt})))});nt.displayName="Chat",nt.propTypes={messages:r.arrayOf(r.object),user:r.object,messageTemplate:r.any,messageContentTemplate:r.any,attachmentTemplate:r.any,width:r.oneOfType([r.string,r.number]),style:r.object,onSendMessage:r.func,onActionExecute:r.func,dir:r.string,messageBox:r.any,noDataTemplate:r.oneOfType([r.element,r.func]),suggestionsLayout:r.oneOf(["scroll","wrap","scrollbuttons"]),quickActionsLayout:r.oneOf(["scroll","wrap","scrollbuttons"]),userStatusTemplate:r.elementType,messageFilesLayout:r.oneOf(["vertical","wrap","horizontal"]),showAvatar:r.bool,showUsername:r.bool,authorMessageSettings:r.object,receiverMessageSettings:r.object,scrollMode:r.oneOf(["scrollable","endless"]),total:r.number,pageSize:r.number,startIndex:r.number,endIndex:r.number,onLoadMoreMessages:r.func,pinnedMessages:r.arrayOf(r.object),repliedToMessages:r.arrayOf(r.object),onReferencedMessageClick:r.func};const at=e=>{const{activeView:t,toolbarItems:n,activeViewChange:l}=e;return h.createElement("div",{className:"k-prompt-header"},h.createElement(a.Toolbar,{keyboardNavigation:!1,role:"toolbar",className:"k-toolbar-flat"},n.map(e=>h.isValidElement(e)?e:h.createElement(a.Button,{key:e.name,className:t===e.name?"k-selected":"",size:"medium",themeColor:"primary",fillMode:"flat",rounded:"full",title:e.buttonText,svgIcon:e.buttonIcon,onClick:()=>(e=>{null==l||l.call(null,e)})(e.name)},e.buttonText))))},lt={name:"Output view",buttonText:"Output",buttonIcon:l.commentIcon},ot={name:"Commands view",buttonIcon:l.moreHorizontalIcon},st={name:"Prompt view",buttonText:"Ask AI",buttonIcon:l.sparklesIcon},rt=h.createContext([{},()=>{}]),it=()=>h.useContext(rt),ct=e=>{const{children:t}=e;return h.createElement("div",{className:"k-prompt-footer"},h.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal k-prompt-actions"},t))},ut=h.forwardRef((e,t)=>{const{children:n,streaming:o,onCancel:r}=e,i=s.useLocalization().toLanguageString(x,ue[x]),[c]=it(),u=c.activeView===lt.name,m=o&&!u,d=h.useCallback(e=>{"Escape"===e.key&&o&&r&&(e.preventDefault(),r())},[o,r]);return h.createElement("div",{className:"k-prompt-content",ref:t,onKeyDown:d},m&&h.createElement(a.FloatingActionButton,{onClick:r,svgIcon:l.stopIcon,icon:"stop",size:"medium",positionMode:"absolute",className:"k-prompt-stop-fab k-generating","aria-label":i,title:i}),h.createElement("div",{className:"k-prompt-view"},n))});ut.displayName="KendoReactAIPromptContent";const mt=e=>{const[t]=it();return t.activeView===e.name?e.children:null},dt=e=>{const[t,n]=h.useState(!0),{children:o,title:s}=e;return h.createElement("div",{className:"k-prompt-expander"},h.createElement(a.Button,{"aria-controls":e.id,fillMode:"flat",svgIcon:t?l.chevronUpIcon:l.chevronDownIcon,title:s,onClick:()=>n(!t),"aria-expanded":t},s),t&&h.createElement("div",{id:e.id,className:"k-prompt-expander-content"},o))},pt=e=>null==e?void 0:e.map(e=>h.createElement(o.PanelBarItem,{title:e.text,key:e.id,svgIcon:e.svgIcon,data:e},e.children&&pt(e.children))),gt=({show:e=!1,anchor:t,onOpen:n,onClose:a,animate:l=!0,appendTo:o,popupOptions:s={},children:r,style:i})=>h.createElement(d.Popup,{show:e,anchor:t,style:i,animate:l,appendTo:o,onOpen:n,onClose:a,...s},r),ft=({placeholder:e="Ask or generate content with AI...",promptValue:t,onMenuClick:o,promptInput:s=m.TextArea,generateButton:r,enableSpeechToText:i=!1,streaming:c=!1,commands:u,onPromptRequest:d,onPromptCancel:p})=>{const[g,f]=h.useState(t||""),[v,k]=n.useCustomComponent(r),[E,b]=n.useCustomComponent(s),y=s===m.TextArea||E===m.TextArea,C={svgIcon:c?l.stopIcon:l.paperPlaneIcon,active:(!!c).toString(),title:"Send Button","aria-label":"Send Button",disabled:!g.trim()&&!c,"aria-disabled":!g.trim()&&!c},x={placeholder:e,className:"!k-flex-row",...y?{autoSize:!0}:{},rows:1},I=u&&u.length>0,T=Object.keys(k).length>0?k:C,N=Object.keys(b).length>0?b:x,w=e=>{const{isFinal:t,alternatives:n}=e;if(t&&n.length>0){const e=n[0].transcript,t=(()=>{const t=g,n=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(n?" ":"")+e})();f(t)}},F=()=>{g.trim()&&d&&d(g.trim())};return h.createElement(E,{value:g,onChange:e=>{const t=e.target.value;f(t)},onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),F())},prefix:I||i?h.createElement(h.Fragment,null,h.createElement(m.InputPrefix,{className:"!k-align-items-start"},I&&h.createElement(a.Button,{"aria-label":"Commands Button",title:"Commands Button",fillMode:"flat",svgIcon:l.menuIcon,onClick:o}),i&&h.createElement(a.SpeechToTextButton,{fillMode:"flat",..."object"==typeof i?{...i,onResult:i.onResult||w}:{onResult:w}})),h.createElement(m.InputSeparator,null)):void 0,suffix:h.createElement(m.InputSuffix,{className:"!k-align-items-start"},h.createElement(v,{className:n.classNames("k-prompt-send",{"k-generating":c,"k-active":c}),fillMode:"flat",onClick:c?p:F,...T})),...N})},ht=h.forwardRef((e,t)=>{const{svgIcon:a,label:o,labelClassName:s,secondaryLabel:r,linesAdded:i,linesRemoved:c,expandable:u,expanded:m,defaultExpanded:d,completed:p,onExpandedChange:g,headerTemplate:f,bodyTemplate:v,headerExtra:k,className:E,children:b,...y}=e,C=void 0!==m,[x,I]=h.useState(null!=d&&d),T=null!=m?m:x,N=h.useRef(null),w=h.useCallback(e=>{var t;if(!u)return;const n=!T;if(C||I(n),g){const a={expanded:n,syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(t=N.current)?t:e.currentTarget};g(a)}},[u,T,C,g]),F=h.createElement(h.Fragment,null,a&&h.createElement(n.SvgIcon,{icon:a,size:"small",className:"k-agent-step-icon"}),h.createElement("span",{className:"k-agent-step-content"},o&&h.createElement("span",{className:n.classNames("k-agent-step-label",!1===p&&"k-text-shimmer",s)},o),r&&h.createElement(h.Fragment,null,h.createElement("span",{className:"k-agent-step-sep"},"·"),h.createElement("span",{className:"k-agent-step-secondary"},r)),null!=i&&i>0&&h.createElement("span",{className:"k-agent-step-added k-text-success"},"+",i),null!=c&&c>0&&h.createElement("span",{className:"k-agent-step-removed k-text-error"},"-",c),k,u&&h.createElement(n.SvgIcon,{icon:T?l.chevronUpIcon:l.chevronRightIcon,size:"small",className:"k-agent-step-expand"})));let S;return S=f?h.createElement(f,{svgIcon:a,label:o,secondaryLabel:r,headerExtra:k,linesAdded:i,linesRemoved:c,completed:p,expanded:T,expandable:u}):u?h.createElement("button",{ref:N,type:"button",className:"k-agent-step-head","aria-expanded":T,onClick:w},F):h.createElement("div",{className:"k-agent-step-head"},F),h.createElement("div",{ref:t,className:n.classNames("k-agent-step",{"k-agent-completed":p},E),...y},S,T&&b&&(v?h.createElement(v,{expanded:T,completed:p},b):h.createElement("div",{className:"k-agent-step-body"},b)))});ht.displayName="KendoReactAgentStep";const vt=h.forwardRef((e,t)=>{const{svgIcon:a,label:l,labelClassName:o,secondaryLabel:s,linesAdded:r,linesRemoved:i,status:c,statusThemeColor:u,statusSvgIcon:m,completed:d,description:g,contentNode:f,className:v,children:k,...E}=e,b=!0===d,y=!b;return h.createElement("div",{className:n.classNames("k-thought",{"k-thought-completed":b},{"k-thought-active":y},v),ref:t,...E},h.createElement("span",{className:"k-agent-step-icon-col"},a&&h.createElement(n.SvgIcon,{icon:a,size:"small",className:"k-agent-step-icon"})),h.createElement("span",{className:"k-agent-step-content"},null!=f?f:h.createElement(h.Fragment,null,l&&h.createElement("span",{className:n.classNames("k-agent-step-label",y&&"k-text-shimmer",o)},l),g&&h.createElement("span",{className:"k-agent-step-description"},g),s&&h.createElement(h.Fragment,null,h.createElement("span",{className:"k-agent-step-sep"},"·"),h.createElement("span",{className:"k-agent-step-secondary"},s)),null!=r&&r>0&&h.createElement("span",{className:"k-agent-step-added k-text-success"},"+",r),null!=i&&i>0&&h.createElement("span",{className:"k-agent-step-removed k-text-error"},"-",i),c&&h.createElement(p.Badge,{size:"small",themeColor:null!=u?u:"success",rounded:"full"},m&&h.createElement(n.SvgIcon,{icon:m,size:"small"}),c),k&&h.createElement("div",{className:"k-agent-step-body"},k))))});vt.displayName="KendoReactThought";const kt=h.forwardRef((e,t)=>{const{label:a,secondaryLabel:o,svgIcon:s=l.sparklesIcon,completed:r,expanded:i,defaultExpanded:c,expandable:u,thoughts:m=[],linesAdded:d,linesRemoved:p,thoughtTemplate:g,onExpandedChange:f,className:v,...k}=e,E=m.map((e,t)=>h.createElement(vt,{key:t,label:e.label,secondaryLabel:e.secondaryLabel,svgIcon:e.svgIcon,completed:e.completed,linesAdded:e.linesAdded,linesRemoved:e.linesRemoved,contentNode:g?h.createElement(g,{thought:e,index:t}):void 0},e.content));return h.createElement(ht,{ref:t,svgIcon:s,label:a,secondaryLabel:o,completed:r,expanded:i,defaultExpanded:c,expandable:u&&m.length>0,linesAdded:d,linesRemoved:p,onExpandedChange:f,className:n.classNames("k-chain-of-thought",v),...k},E)});kt.displayName="KendoReactChainOfThought";const Et=h.forwardRef((e,t)=>{const{visible:l,state:o,template:r,onAction:i,className:c,...u}=e,m=s.useLocalization(),d=h.useRef(null),p=h.useCallback(e=>{var t,n;if(i&&o){const a={action:o,syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(n=null==(t=d.current)?void 0:t.element)?n:e.currentTarget};i(a)}},[i,o]),g=m.toLanguageString(ne,ue[ne]),f=m.toLanguageString(ae,ue[ae]),v=m.toLanguageString(le,ue[le]),k=m.toLanguageString(oe,ue[oe]);let E=null;return"startOver"===o||"restore"===o?E=h.createElement(a.Button,{ref:d,size:"small",fillMode:"flat",onClick:p},"startOver"===o?g:f):"redo"===o&&(E=h.createElement(h.Fragment,null,h.createElement("span",{className:"k-checkpoint-stamp"},v),h.createElement("span",null,"·"),h.createElement(a.Button,{ref:d,size:"small",fillMode:"flat",onClick:p},k))),h.createElement("div",{ref:t,className:n.classNames("k-checkpoint",{"k-checkpoint-visible":!0===l},c),...u},h.createElement("span",{className:"k-checkpoint-line","aria-hidden":"true"}),r?h.createElement(r,{state:o}):E,h.createElement("span",{className:"k-checkpoint-line","aria-hidden":"true"}))});Et.displayName="KendoReactCheckpoint";const bt=e=>{const{sources:t}=e;return h.createElement(h.Fragment,null,t.map((e,t)=>h.createElement("div",{className:"k-citation-popover-view",key:t},(null==e?void 0:e.title)&&h.createElement("div",{className:"k-citation-popover-view-title"},e.title),(null==e?void 0:e.url)&&h.createElement("a",{className:"k-citation-popover-view-source",href:e.url,target:"_blank",rel:"noopener noreferrer"},h.createElement(n.IconWrap,{name:l.globeIcon.name,icon:l.globeIcon}),e.url),(null==e?void 0:e.description)&&h.createElement("span",{className:"k-citation-popover-view-body"},e.description))))},yt={horizontal:"fit",vertical:"flip"},Ct=[],xt=(e,t)=>{if(void 0!==e)return e;const n=t[0];return(e=>{if(!e)return"";try{return new URL(e).hostname}catch{return""}})(null==n?void 0:n.url)||(null==n?void 0:n.title)||""},It=h.forwardRef((e,t)=>{const{sources:o=Ct,label:r,svgIcon:i=l.globeIcon,additionalCount:c,bodyTemplate:u,onOpen:m,showOn:d="hover",className:p,...f}=e,v=s.useLocalization(),[k,E]=h.useState(null),[b,y]=h.useState(!1),[C,x]=h.useState(0),I=h.useRef(o),T=h.useRef(null);o!==I.current&&(I.current=o,x(0));const N=h.useCallback(e=>{var n;const a=null!=(n=null==e?void 0:e.element)?n:null;E(a),"function"==typeof t?t(a):t&&(t.current=a)},[t]),w=h.useCallback(()=>{null!==T.current&&(clearTimeout(T.current),T.current=null)},[]),F=h.useCallback(()=>{w(),T.current=setTimeout(()=>y(!1),150)},[w]);h.useEffect(()=>w,[w]),h.useEffect(()=>{if(!k||0===o.length||"hover"!==d)return;const e=()=>{w(),y(!0)},t=()=>F();return k.addEventListener("mouseenter",e),k.addEventListener("mouseleave",t),()=>{k.removeEventListener("mouseenter",e),k.removeEventListener("mouseleave",t)}},[k,o.length,w,F,d]);const S=h.useCallback((e,t)=>{if(0!==o.length&&(w(),y(!0),m)){const n={sources:o,syntheticEvent:e,nativeEvent:e.nativeEvent,target:t};m(n)}},[o,m,w]),A=h.useCallback(e=>{var t;S(e.syntheticEvent,null!=(t=e.target.element)?t:e.syntheticEvent.currentTarget)},[S]),R=h.useCallback(e=>{var t;"Enter"!==e.syntheticEvent.key&&" "!==e.syntheticEvent.key||(e.syntheticEvent.preventDefault(),S(e.syntheticEvent,null!=(t=e.target.element)?t:e.syntheticEvent.currentTarget))},[S]),M=`k-citation-popover-${n.useId()}`;h.useEffect(()=>{if(!b||"hover"!==d)return;const e=document.getElementById(M);return e?(e.addEventListener("mouseenter",w),e.addEventListener("mouseleave",F),()=>{e.removeEventListener("mouseenter",w),e.removeEventListener("mouseleave",F)}):void 0},[b,M,w,F,d]),h.useEffect(()=>{if(!b||"click"!==d)return;const e=e=>{const t=document.getElementById(M);k&&!k.contains(e.target)&&(!t||!t.contains(e.target))&&y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[b,d,k,M]);const L=o.length,B=h.useCallback(()=>x(e=>Math.min(e+1,L-1)),[L]),D=h.useCallback(()=>x(e=>Math.max(e-1,0)),[]),P=[xt(r,o),c&&o.length>1?"+"+(o.length-1):void 0].filter(Boolean).join(" "),z=null!=u?u:bt,O=h.createElement(h.Fragment,null,h.createElement("span",{className:"k-citation-pages"},C+1,"/",L),h.createElement(a.ButtonGroup,null,h.createElement(a.Button,{svgIcon:l.arrowLeftIcon,fillMode:"flat",size:"small","aria-label":v.toLanguageString(ie,ue[ie]),disabled:C<=0,onClick:D}),h.createElement(a.Button,{svgIcon:l.arrowRightIcon,fillMode:"flat",size:"small","aria-label":v.toLanguageString(ce,ue[ce]),disabled:C>=L-1,onClick:B})));return h.createElement(h.Fragment,null,h.createElement(a.Chip,{ref:N,text:P,svgIcon:i,size:"small",fillMode:"outline",rounded:"full",selected:b,onClick:A,onKeyDown:R,className:n.classNames("k-citation",p),...f}),L>0&&h.createElement(g.Popover,{show:b,anchor:k,title:O,collision:yt,callout:!1,margin:{vertical:8,horizontal:0},position:"top",id:M,popoverClass:"k-citation-popover",style:{width:"320px","--kendo-citation-popover-view-current":C+1}},h.createElement(z,{sources:o})))});It.displayName="KendoReactCitation";const Tt=h.forwardRef((e,t)=>{const{label:a="Reasoning",secondaryLabel:o,svgIcon:s=l.sparklesIcon,completed:r,expanded:i,defaultExpanded:c,expandable:u,contentTemplate:m,onExpandedChange:d,className:p,children:g,...f}=e,v=m?h.createElement(m,null,g):g;return h.createElement(ht,{ref:t,svgIcon:s,label:a,secondaryLabel:o,completed:r,expanded:i,defaultExpanded:c,expandable:u,onExpandedChange:d,className:n.classNames("k-reasoning",p),...f},v)});Tt.displayName="KendoReactReasoning";const Nt=e=>"string"==typeof e?e:JSON.stringify(e,null,2),wt=e=>h.createElement(h.Fragment,null,h.createElement("div",{className:"k-tool-call-label"},"Parameters"),h.createElement("pre",{className:"k-pre"},h.createElement("code",{className:"k-code"},Nt(e.parameters)))),Ft=e=>h.createElement(h.Fragment,null,h.createElement("div",{className:"k-tool-call-label"},"Result"),h.createElement("pre",{className:"k-pre"},h.createElement("code",{className:"k-code"},Nt(e.result)))),St=e=>e.errorText?h.createElement("div",{className:"k-messagebox k-messagebox-error"},e.errorText):null,At={active:"base",completed:"success",awaitingApproval:"warning",error:"error"},Rt={completed:l.checkCircleIcon,awaitingApproval:l.clockIcon,error:l.xCircleIcon},Mt={active:Q,completed:Z,awaitingApproval:ee,error:te},Lt=h.forwardRef((e,t)=>{const{svgIcon:r=l.wrenchIcon,state:i,parameters:c,result:u,errorText:m,approvalText:d,paramsTemplate:g,resultTemplate:f,errorTemplate:v,approvalTemplate:k,onExpandedChange:E,onAction:b,className:y,children:C,...x}=e,I=s.useLocalization(),T=h.useRef(null),N=h.useRef(null),w=null!=i&&"active"!==i,F=null!=i&&"active"!==i&&"awaitingApproval"!==i,S=w?I.toLanguageString(Mt[i],ue[Mt[i]]):void 0,A=w?At[i]:void 0,R=w?Rt[i]:void 0,M=w&&h.createElement(p.Badge,{size:"small",themeColor:A,rounded:"full",position:null},R&&h.createElement(n.SvgIcon,{icon:R,size:"small"}),S),L="awaitingApproval"===i,B=h.useCallback(e=>{var t,n;if(b){const a={action:"approve",syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(n=null==(t=T.current)?void 0:t.element)?n:e.currentTarget};b(a)}},[b]),D=h.useCallback(e=>{var t,n;if(b){const a={action:"reject",syntheticEvent:e,nativeEvent:e.nativeEvent,target:null!=(n=null==(t=N.current)?void 0:t.element)?n:e.currentTarget};b(a)}},[b]),P=L&&(k?h.createElement(k,{state:i,approvalText:d}):h.createElement(o.Card,null,d&&h.createElement(o.CardBody,null,d),h.createElement(o.CardActions,{layout:"end"},h.createElement(a.Button,{ref:N,fillMode:"outline",onClick:D},I.toLanguageString(re,ue[re])),h.createElement(a.Button,{ref:T,themeColor:"primary",onClick:B},I.toLanguageString(se,ue[se]))))),z=null!=g?g:wt,O=null!=f?f:Ft,q=null!=v?v:St,K=h.createElement(h.Fragment,null,null!=c&&h.createElement(z,{parameters:c}),null!=u&&h.createElement(O,{result:u}),null!=m&&h.createElement(q,{errorText:m}),L?P:C);return h.createElement(ht,{ref:t,svgIcon:r,headerExtra:M,completed:F,onExpandedChange:E,className:n.classNames("k-tool-call",y),...x},K)});Lt.displayName="KendoReactToolCall",e.AIPrompt=e=>{const t=h.useRef(null);n.useWebMcpRegister("aiprompt",t,e,e.webMcp);const a=!n.validatePackage(Oe,{component:"AIPrompt"}),l=n.getLicenseMessage(Oe),{activeView:o,toolbarItems:s,children:r,onActiveViewChange:i,onPromptRequest:c,onCommandExecute:u,style:m,dir:d,className:p,streaming:g,loading:f,onCancel:v,promptPlaceholder:k,suggestionsView:E,...b}=e,y=s||[st,lt],[C,x]=h.useState({activeView:o}),I={...C,activeView:o,streaming:g,loading:f,suggestionsView:null!=E?E:"classic",promptPlaceholder:k,onCancel:v,onActiveViewChange:i,onPromptRequest:c,onCommandExecute:u};return h.createElement(rt.Provider,{value:[I,e=>{x(e)}]},h.createElement("div",{className:n.classNames("k-prompt",p),style:m,dir:d,...b},h.createElement(at,{activeView:I.activeView,toolbarItems:y,activeViewChange:i}),r,a&&h.createElement(n.WatermarkOverlay,{message:l})))},e.AIPromptCommandsView=e=>{const{commands:t}=e,[n]=it();return h.createElement(mt,{name:ot.name},h.createElement(ut,{streaming:n.streaming,onCancel:n.onCancel},h.createElement("div",{className:"k-prompt-view"},h.createElement(o.PanelBar,{onSelect:e=>{var t,a,l;const o=null==(a=null==(t=e.target)?void 0:t.props)?void 0:a.data;null!=(l=null==o?void 0:o.children)&&l.length||n.onCommandExecute&&n.onCommandExecute.call(null,o)},selected:""},pt(null!=t?t:[])))))},e.AIPromptContent=ut,e.AIPromptFooter=ct,e.AIPromptOutputView=e=>{const[t,n]=h.useState(""),r=h.useRef(null),[i]=it(),{outputs:c,showOutputRating:u,outputCard:m}=e,{header:d,body:p,actions:g}=m||{},f=s.useLocalization(),v=f.toLanguageString(x,ue[x]),k=(e,t)=>{i.onPromptRequest&&i.onPromptRequest.call(null,e.prompt,{...e,ratingType:t,isRetry:!1}),E()},E=()=>{r&&r.current&&r.current.scrollTo({top:0,behavior:"smooth"})},b=h.createElement(o.Card,null,h.createElement(o.CardHeader,null,h.createElement(o.CardTitle,null,h.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"200px"}})),h.createElement(o.CardSubtitle,null,h.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),h.createElement(o.CardBody,null,h.createElement("span",{className:"k-skeleton k-skeleton-rect k-skeleton-pulse",style:{height:"80px"}})),h.createElement(o.CardActions,null,i.streaming&&i.onCancel?h.createElement(a.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",svgIcon:l.stopIcon,title:v,onClick:i.onCancel},v):h.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),y=(e,o)=>g?g(e):o&&i.onCancel?h.createElement(a.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",svgIcon:l.stopIcon,title:v,onClick:i.onCancel},v):h.createElement(h.Fragment,null,h.createElement(a.Button,{size:"medium",themeColor:"primary",fillMode:"flat",rounded:"medium",title:"Copy",svgIcon:t===e.id?l.checkIcon:l.copyIcon,onClick:()=>(e=>{e.responseContent&&navigator.clipboard.writeText(e.responseContent),n(e.id),setTimeout(()=>{n("")},1e3)})(e)},"Copy"),h.createElement(a.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",title:"Retry",svgIcon:l.arrowRotateCwIcon,onClick:()=>(e=>{i.onPromptRequest&&i.onPromptRequest.call(null,e.prompt,{...e,isRetry:!0}),E()})(e)},"Retry"),u&&h.createElement(h.Fragment,null,h.createElement("span",{className:"k-spacer"}),h.createElement(a.Button,{size:"medium",themeColor:"positive"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate up",svgIcon:l.thumbUpIcon,onClick:()=>k(e,"positive")}),h.createElement(a.Button,{size:"medium",themeColor:"negative"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate down",svgIcon:l.thumbDownIcon,onClick:()=>k(e,"negative")}))),I=null==c?void 0:c.map((e,t)=>{const n=!(!i.streaming||i.loading||0!==t);return h.createElement(o.Card,{key:`${e.id}_${t}`},h.createElement(o.CardHeader,null,d?d(e):h.createElement(h.Fragment,null,e.title&&h.createElement(o.CardTitle,null,e.title),e.subTitle&&h.createElement(o.CardSubtitle,null,e.subTitle))),h.createElement(o.CardBody,null,p?p(e):e.responseContent),h.createElement(o.CardActions,null,y(e,n)))}),T=h.createElement(o.Card,null,h.createElement(o.CardBody,null,f.toLanguageString(C,ue[C])));return h.createElement(mt,{name:lt.name},h.createElement(ut,{ref:r,streaming:i.streaming,onCancel:i.onCancel},h.createElement("div",{className:"k-card-list"},i.loading&&b,I,(!I||0===I.length)&&!i.loading&&T)))},e.AIPromptView=e=>{var t;const{promptInput:o=m.TextArea,generateButton:r=a.Button,enableSpeechToText:i=!1,promptValue:c,promptSuggestions:u}=e,[d,p]=h.useState(c||""),[g]=it(),f=s.useLocalization(),[v,k]=n.useCustomComponent(r),[E,b]=n.useCustomComponent(o),y=h.useRef(null);h.useEffect(()=>{var e,t;null!=(t=null==(e=y.current)?void 0:e.element)&&t.current&&requestAnimationFrame(()=>{var e,t;if(null!=(t=null==(e=y.current)?void 0:e.element)&&t.current){const e=y.current.element.current;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}})},[d]);const C={title:"Generate",children:"Generate",svgIcon:l.sparklesIcon},x={placeholder:null!=(t=g.promptPlaceholder)?t:f.toLanguageString(I,ue[I]),rows:2},T=Object.keys(k).length>0?k:C,N=Object.keys(b).length>0?b:x,w=e=>{const{isFinal:t,alternatives:n}=e;if(t&&n.length>0){const e=n[0].transcript,t=(()=>{const t=d,n=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(n?" ":"")+e})();p(t)}};let F;return i&&(F="object"==typeof i?{...i,onResult:i.onResult||w}:{onResult:w}),h.createElement(mt,{name:st.name},h.createElement(ut,{streaming:g.streaming,onCancel:g.onCancel},h.createElement(E,{ref:y,value:d,flow:"vertical",textareaStyle:{maxHeight:"110px"},autoSize:!0,suffix:i?h.createElement(h.Fragment,null,h.createElement(m.InputSeparator,{orientation:"horizontal"}),h.createElement(m.InputSuffix,{orientation:"horizontal"},h.createElement(a.SpeechToTextButton,{fillMode:"flat",...F}))):void 0,onChange:e=>{p(e.target.value)},...N}),u&&u.length>0&&h.createElement(dt,{title:"Prompt Suggestions"},h.createElement(Re,{suggestionsView:g.suggestionsView,suggestions:u.map((e,t)=>({id:t,text:e,description:e})),onSuggestionClick:e=>{(e=>{p(e)})(e.text)}}))),h.createElement(ct,null,h.createElement(v,{themeColor:"primary",fillMode:"solid",rounded:"full",size:"medium",onClick:()=>{g.onPromptRequest&&g.onPromptRequest.call(null,d),p("")},disabled:!d.trim(),...T},T.children)))},e.AIPromptViewRender=mt,e.ChainOfThought=kt,e.Chat=nt,e.ChatMessage=Ee,e.Checkpoint=Et,e.Citation=It,e.DEFAULT_FIELD_MAPPING=Ge,e.HeroCard=e=>{const{imageUrl:t,imageMaxWidth:n,title:l,subtitle:o,actions:s,onActionExecute:r,altText:i}=e,c=h.useCallback((e,t)=>{null==r||r({action:e,syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget})},[r]),u=i||l||"";return h.createElement("div",{className:"k-card"},h.createElement("img",{className:"k-card-image",src:t,style:{maxWidth:n},alt:u}),h.createElement("div",{className:"k-card-body"},l&&h.createElement("h5",{className:"k-card-title"},l),o&&h.createElement("h6",{className:"k-card-subtitle"},o)),h.createElement("div",{className:"k-card-actions k-card-actions-vertical"},s.map((e,t)=>h.createElement("span",{className:"k-card-action",key:`action-${t}-${e.title||e.value||t}`},h.createElement(a.Button,{fillMode:"flat",onClick:t=>c(e,t)},e.title)))))},e.InlineAIPrompt=e=>{const t=!n.validatePackage(Oe,{component:"InlineAIPrompt"}),s=n.getLicenseMessage(Oe),{outputs:r=[],outputCard:i,promptInput:c=m.TextArea,generateButton:u=a.Button,promptPlaceholder:d="Ask or generate content with AI...",promptValue:p,onPromptRequest:g,onCopy:f,onDiscard:v,outputActions:k,onOutputAction:E,enableSpeechToText:b=!1,streaming:y,onPromptCancel:C,show:x=!1,anchor:I,width:T,height:N,onOpen:w,onClose:F,animate:S=!0,appendTo:A,commands:R,onCommandExecute:M,style:L,className:B,popupOptions:D={},...P}=e,[z,O]=h.useState(""),[q,K]=h.useState(!1),[H,U]=h.useState({left:0,top:0}),$=h.useRef(null),{body:V,actions:j}=i||{},W=k||[{id:"copy",text:"Copy",svgIcon:l.copyIcon,themeColor:"primary",title:"Copy"},{id:"discard",text:"Discard",svgIcon:l.cancelIcon,themeColor:"base",title:"Discard"}],G=(e,t)=>{switch(e.id){case"copy":(e=>{e.responseContent&&(navigator.clipboard.writeText(e.responseContent),O(e.id),setTimeout(()=>O(""),1e3)),null==f||f(e)})(t);break;case"discard":(e=>{null==v||v(e)})(t);break;default:null==E||E(e,t)}},_=h.useCallback(e=>{"Escape"===e.key&&(y&&C?C():!y&&F&&F({target:null}))},[y,C,F]),Y={...L,...T&&{width:T},...N&&{height:N}},J={...T&&{width:T},...N&&{height:N}},X=h.createElement(h.Fragment,null,h.createElement("div",{className:n.classNames("k-prompt",B),style:Y,onKeyDown:_,...P},h.createElement(ut,{ref:$},r&&r.length>0&&h.createElement("div",{className:"k-card-list"},r.map((e,t)=>h.createElement(o.Card,{key:`${e.id}_${t}`},h.createElement(o.CardBody,null,V?V(e):e.responseContent),h.createElement(o.CardActions,null,j?j(e):h.createElement(h.Fragment,null,W.map(t=>{var n;return t.spacer?h.createElement("span",{key:t.id,className:"k-spacer"}):h.createElement(a.Button,{key:t.id,size:"medium",themeColor:t.themeColor||"primary",fillMode:"flat",rounded:"medium",title:null!=(n=t.title)?n:t.text,svgIcon:"copy"===t.id&&z===e.id?l.checkIcon:t.svgIcon,onClick:()=>G(t,e)},t.text)})))))),h.createElement(ft,{promptValue:p,placeholder:d,onPromptRequest:g,onMenuClick:e=>{if(!$.current)return;const t=$.current.getBoundingClientRect();U({left:t.left,top:t.bottom}),K(!0)},onPromptCancel:C,promptInput:c,generateButton:u,enableSpeechToText:b,streaming:y,commands:R}))),t&&h.createElement(n.WatermarkOverlay,{message:s}));return h.createElement(h.Fragment,null,h.createElement(gt,{show:x,anchor:I,onOpen:w,onClose:F,animate:S,appendTo:A,popupOptions:D,style:J},X),h.createElement(o.ContextMenu,{show:q,offset:H,onClose:()=>{K(!1)},items:(e=>null==e?void 0:e.map(e=>({text:e.text,svgIcon:e.svgIcon,data:e,items:e.children?e.children.map(e=>({text:e.text,data:e})):void 0})))(R),onSelect:e=>{var t,n;const a=null==(t=e.item)?void 0:t.data;a&&(null==(n=a.children)||!n.length)&&(e=>{K(!1),M&&M(e)})(a)}}))},e.PromptBox=He,e.PromptBoxActionButton=Le,e.PromptBoxSpeechToTextButton=Be,e.PromptBoxUploadButton=Me,e.PromptHeader=at,e.Reasoning=Tt,e.SuggestionGroup=Re,e.ToolCall=Lt,e.commandsViewDefaults=ot,e.extractFieldMappingFromProps=e=>({textField:e.textField,statusField:e.statusField,authorIdField:e.authorIdField,authorNameField:e.authorNameField,authorImageUrlField:e.authorImageUrlField,authorImageAltTextField:e.authorImageAltTextField,idField:e.idField,timestampField:e.timestampField,filesField:e.filesField,attachmentsField:e.attachmentsField,replyToIdField:e.replyToIdField,isDeletedField:e.isDeletedField,isPinnedField:e.isPinnedField,typingField:e.typingField,suggestedActionsField:e.suggestedActionsField,isFailedField:e.isFailedField}),e.isStandardMessageFormat=Je,e.mapDataArrayToMessages=Ye,e.mapDataToMessage=_e,e.mapMessageToCustomFormat=(e,t={})=>{const n={...Ge,...t},a={};return void 0!==e.id&&(a[n.idField]=e.id),void 0!==e.text&&(a[n.textField]=e.text),void 0!==e.status&&(a[n.statusField]=e.status),void 0!==e.isFailed&&(a[n.isFailedField]=e.isFailed),void 0!==e.timestamp&&(a[n.timestampField]=e.timestamp),void 0!==e.attachments&&(a[n.attachmentsField]=e.attachments),void 0!==e.files&&(a[n.filesField]=e.files),void 0!==e.suggestedActions&&(a[n.suggestedActionsField]=e.suggestedActions),void 0!==e.replyToId&&(a[n.replyToIdField]=e.replyToId),void 0!==e.isDeleted&&(a[n.isDeletedField]=e.isDeleted),void 0!==e.isPinned&&(a[n.isPinnedField]=e.isPinned),void 0!==e.typing&&(a[n.typingField]=e.typing),e.author&&(void 0!==e.author.id&&(a[n.authorIdField]=e.author.id),void 0!==e.author.name&&(a[n.authorNameField]=e.author.name),void 0!==e.author.avatarUrl&&(a[n.authorImageUrlField]=e.author.avatarUrl),void 0!==e.author.avatarAltText&&(a[n.authorImageAltTextField]=e.author.avatarAltText)),void 0!==e.pinnedAt&&(a.pinnedAt=e.pinnedAt),void 0!==e.pinnedBy&&(a.pinnedBy=e.pinnedBy),void 0!==e.attachmentLayout&&(a.attachmentLayout=e.attachmentLayout),a},e.outputViewDefaults=lt,e.promptViewDefaults=st});
|
package/messages/index.d.ts
CHANGED
|
@@ -33,6 +33,10 @@ export declare const aIPromptNoOutputs = "aIPrompt.noOutputs";
|
|
|
33
33
|
* @hidden
|
|
34
34
|
*/
|
|
35
35
|
export declare const aIPromptCancel = "aIPrompt.cancel";
|
|
36
|
+
/**
|
|
37
|
+
* @hidden
|
|
38
|
+
*/
|
|
39
|
+
export declare const aIPromptInputPlaceholder = "aIPrompt.inputPlaceholder";
|
|
36
40
|
/**
|
|
37
41
|
* @hidden
|
|
38
42
|
*/
|
|
@@ -200,6 +204,7 @@ export declare const messages: {
|
|
|
200
204
|
"messageList.ariaLabel": string;
|
|
201
205
|
"aIPrompt.cancel": string;
|
|
202
206
|
"aIPrompt.noOutputs": string;
|
|
207
|
+
"aIPrompt.inputPlaceholder": string;
|
|
203
208
|
"chat.senderDeletedMessage": string;
|
|
204
209
|
"chat.receiverDeletedMessage": string;
|
|
205
210
|
"chat.copyNotification": string;
|
package/messages/index.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="newMessage.sendButton",t="newMessage.optionsButton",o="newMessage.messageInput",a="avatar.alt",s="messageList.ariaLabel",l="aIPrompt.noOutputs",c="aIPrompt.cancel",n="chat.senderDeletedMessage",
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="newMessage.sendButton",t="newMessage.optionsButton",o="newMessage.messageInput",a="avatar.alt",s="messageList.ariaLabel",l="aIPrompt.noOutputs",c="aIPrompt.cancel",n="aIPrompt.inputPlaceholder",r="chat.senderDeletedMessage",i="chat.receiverDeletedMessage",p="chat.copyNotification",h="chat.downloadAllFiles",g="chat.closeReply",d="chat.collapseMessage",m="chat.expandMessage",A="chat.removeFile",v="chat.fileActions",M="chat.attachFile",u="chat.downloadAll",B="chat.scrollLeft",x="chat.scrollRight",C="chat.scrollToBottom",S="chat.messageFailed",F="chat.retryMessage",R="chat.stopGenerating",w="promptBox.input",f="promptBox.sendButton",I="promptBox.attachFile",P="promptBox.removeFile",b="promptBox.stopGenerating",k="promptBox.ariaLabel",y="promptBox.attachedFiles",L="chat.messageToolbar",O="chat.unpinMessage",T="chat.messageAttachedFiles",N="toolCall.state.active",D="toolCall.state.completed",G="toolCall.state.awaitingApproval",j="toolCall.state.error",E="checkpoint.startOver",U="checkpoint.restore",Y="checkpoint.restored",q="checkpoint.redo",z="toolCall.approve",H="toolCall.reject",J="citation.previous",K="citation.next",Q={[e]:"Send",[t]:"Options",[o]:"Message",[a]:"Avatar",[s]:"Message list",[c]:"Cancel",[l]:"No output from AI available",[n]:"Ask or generate content with AI ...",[r]:"You removed this message",[i]:"The message was removed by its sender",[p]:"Text copied to clipboard",[h]:"Download all files",[g]:"Close reply",[d]:"Collapse message",[m]:"Expand message",[A]:"Remove file",[v]:"File actions for",[S]:"Failed to send",[F]:"Retry",[R]:"Stop generating",[M]:"Attach file",[u]:"Download all",[B]:"Scroll left",[x]:"Scroll right",[C]:"Scroll to bottom",[w]:"Prompt",[f]:"Send",[I]:"Attach file",[P]:"Remove file",[b]:"Stop generating",[k]:"Prompt box",[y]:"Attached files",[L]:"Toolbar",[O]:"Unpin message",[T]:"Attached files",[N]:"Active",[D]:"Completed",[G]:"Awaiting Approval",[j]:"Error",[E]:"Start Over",[U]:"Restore Checkpoint",[Y]:"Checkpoint Restored",[q]:"Redo",[z]:"Approve",[H]:"Reject",[J]:"Previous",[K]:"Next"};exports.aIPromptCancel=c;exports.aIPromptInputPlaceholder=n;exports.aIPromptNoOutputs=l;exports.ariaLabelMessageList=s;exports.attachFile=M;exports.avatarAlt=a;exports.chatCopyNotification=p;exports.chatMessageAttachedFiles=T;exports.chatMessageToolbar=L;exports.chatReceiverDeletedMessage=i;exports.chatSenderDeletedMessage=r;exports.chatStopGenerating=R;exports.chatUnpinMessage=O;exports.checkpointRedo=q;exports.checkpointRestore=U;exports.checkpointRestored=Y;exports.checkpointStartOver=E;exports.citationNext=K;exports.citationPrevious=J;exports.closeReply=g;exports.collapseMessage=d;exports.downloadAll=u;exports.downloadAllFiles=h;exports.expandMessage=m;exports.fileActions=v;exports.messageFailed=S;exports.messages=Q;exports.newMessageMessageInput=o;exports.newMessageOptionsButton=t;exports.newMessageSendButton=e;exports.promptBoxAriaLabel=k;exports.promptBoxAttachFile=I;exports.promptBoxAttachedFiles=y;exports.promptBoxInput=w;exports.promptBoxRemoveFile=P;exports.promptBoxSendButton=f;exports.promptBoxStopGenerating=b;exports.removeFile=A;exports.retryMessage=F;exports.scrollLeft=B;exports.scrollRight=x;exports.scrollToBottom=C;exports.toolCallApprove=z;exports.toolCallReject=H;exports.toolCallStateActive=N;exports.toolCallStateAwaitingApproval=G;exports.toolCallStateCompleted=D;exports.toolCallStateError=j;
|
package/messages/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
const t = "newMessage.sendButton", e = "newMessage.optionsButton", o = "newMessage.messageInput", a = "avatar.alt", s = "messageList.ariaLabel", c = "aIPrompt.noOutputs", l = "aIPrompt.cancel", n = "chat.senderDeletedMessage",
|
|
8
|
+
const t = "newMessage.sendButton", e = "newMessage.optionsButton", o = "newMessage.messageInput", a = "avatar.alt", s = "messageList.ariaLabel", c = "aIPrompt.noOutputs", l = "aIPrompt.cancel", n = "aIPrompt.inputPlaceholder", r = "chat.senderDeletedMessage", i = "chat.receiverDeletedMessage", p = "chat.copyNotification", h = "chat.downloadAllFiles", d = "chat.closeReply", g = "chat.collapseMessage", m = "chat.expandMessage", v = "chat.removeFile", A = "chat.fileActions", M = "chat.attachFile", u = "chat.downloadAll", x = "chat.scrollLeft", B = "chat.scrollRight", C = "chat.scrollToBottom", F = "chat.messageFailed", S = "chat.retryMessage", w = "chat.stopGenerating", R = "promptBox.input", f = "promptBox.sendButton", b = "promptBox.attachFile", I = "promptBox.removeFile", P = "promptBox.stopGenerating", k = "promptBox.ariaLabel", y = "promptBox.attachedFiles", L = "chat.messageToolbar", O = "chat.unpinMessage", T = "chat.messageAttachedFiles", D = "toolCall.state.active", N = "toolCall.state.completed", G = "toolCall.state.awaitingApproval", j = "toolCall.state.error", E = "checkpoint.startOver", U = "checkpoint.restore", Y = "checkpoint.restored", q = "checkpoint.redo", z = "toolCall.approve", H = "toolCall.reject", J = "citation.previous", K = "citation.next", Q = {
|
|
9
9
|
[t]: "Send",
|
|
10
10
|
[e]: "Options",
|
|
11
11
|
[o]: "Message",
|
|
@@ -13,92 +13,94 @@ const t = "newMessage.sendButton", e = "newMessage.optionsButton", o = "newMessa
|
|
|
13
13
|
[s]: "Message list",
|
|
14
14
|
[l]: "Cancel",
|
|
15
15
|
[c]: "No output from AI available",
|
|
16
|
-
[n]: "
|
|
17
|
-
[r]: "
|
|
18
|
-
[i]: "
|
|
19
|
-
[p]: "
|
|
20
|
-
[h]: "
|
|
16
|
+
[n]: "Ask or generate content with AI ...",
|
|
17
|
+
[r]: "You removed this message",
|
|
18
|
+
[i]: "The message was removed by its sender",
|
|
19
|
+
[p]: "Text copied to clipboard",
|
|
20
|
+
[h]: "Download all files",
|
|
21
|
+
[d]: "Close reply",
|
|
21
22
|
[g]: "Collapse message",
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
23
|
+
[m]: "Expand message",
|
|
24
|
+
[v]: "Remove file",
|
|
25
|
+
[A]: "File actions for",
|
|
26
|
+
[F]: "Failed to send",
|
|
27
|
+
[S]: "Retry",
|
|
28
|
+
[w]: "Stop generating",
|
|
29
|
+
[M]: "Attach file",
|
|
30
|
+
[u]: "Download all",
|
|
30
31
|
[x]: "Scroll left",
|
|
31
32
|
[B]: "Scroll right",
|
|
32
|
-
[
|
|
33
|
+
[C]: "Scroll to bottom",
|
|
33
34
|
[R]: "Prompt",
|
|
34
35
|
[f]: "Send",
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
36
|
+
[b]: "Attach file",
|
|
37
|
+
[I]: "Remove file",
|
|
38
|
+
[P]: "Stop generating",
|
|
39
|
+
[k]: "Prompt box",
|
|
40
|
+
[y]: "Attached files",
|
|
40
41
|
[L]: "Toolbar",
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
[
|
|
54
|
-
[
|
|
42
|
+
[O]: "Unpin message",
|
|
43
|
+
[T]: "Attached files",
|
|
44
|
+
[D]: "Active",
|
|
45
|
+
[N]: "Completed",
|
|
46
|
+
[G]: "Awaiting Approval",
|
|
47
|
+
[j]: "Error",
|
|
48
|
+
[E]: "Start Over",
|
|
49
|
+
[U]: "Restore Checkpoint",
|
|
50
|
+
[Y]: "Checkpoint Restored",
|
|
51
|
+
[q]: "Redo",
|
|
52
|
+
[z]: "Approve",
|
|
53
|
+
[H]: "Reject",
|
|
54
|
+
[J]: "Previous",
|
|
55
|
+
[K]: "Next"
|
|
55
56
|
};
|
|
56
57
|
export {
|
|
57
58
|
l as aIPromptCancel,
|
|
59
|
+
n as aIPromptInputPlaceholder,
|
|
58
60
|
c as aIPromptNoOutputs,
|
|
59
61
|
s as ariaLabelMessageList,
|
|
60
|
-
|
|
62
|
+
M as attachFile,
|
|
61
63
|
a as avatarAlt,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
p as chatCopyNotification,
|
|
65
|
+
T as chatMessageAttachedFiles,
|
|
64
66
|
L as chatMessageToolbar,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
i as chatReceiverDeletedMessage,
|
|
68
|
+
r as chatSenderDeletedMessage,
|
|
69
|
+
w as chatStopGenerating,
|
|
70
|
+
O as chatUnpinMessage,
|
|
71
|
+
q as checkpointRedo,
|
|
72
|
+
U as checkpointRestore,
|
|
73
|
+
Y as checkpointRestored,
|
|
74
|
+
E as checkpointStartOver,
|
|
75
|
+
K as citationNext,
|
|
76
|
+
J as citationPrevious,
|
|
77
|
+
d as closeReply,
|
|
76
78
|
g as collapseMessage,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
u as downloadAll,
|
|
80
|
+
h as downloadAllFiles,
|
|
81
|
+
m as expandMessage,
|
|
82
|
+
A as fileActions,
|
|
83
|
+
F as messageFailed,
|
|
84
|
+
Q as messages,
|
|
83
85
|
o as newMessageMessageInput,
|
|
84
86
|
e as newMessageOptionsButton,
|
|
85
87
|
t as newMessageSendButton,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
k as promptBoxAriaLabel,
|
|
89
|
+
b as promptBoxAttachFile,
|
|
90
|
+
y as promptBoxAttachedFiles,
|
|
89
91
|
R as promptBoxInput,
|
|
90
|
-
|
|
92
|
+
I as promptBoxRemoveFile,
|
|
91
93
|
f as promptBoxSendButton,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
P as promptBoxStopGenerating,
|
|
95
|
+
v as removeFile,
|
|
96
|
+
S as retryMessage,
|
|
95
97
|
x as scrollLeft,
|
|
96
98
|
B as scrollRight,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
C as scrollToBottom,
|
|
100
|
+
z as toolCallApprove,
|
|
101
|
+
H as toolCallReject,
|
|
102
|
+
D as toolCallStateActive,
|
|
103
|
+
G as toolCallStateAwaitingApproval,
|
|
104
|
+
N as toolCallStateCompleted,
|
|
105
|
+
j as toolCallStateError
|
|
104
106
|
};
|
package/package-metadata.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1787924129,version:"16.1.0-develop.11",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -7,8 +7,8 @@ export const packageMetadata = Object.freeze({
|
|
|
7
7
|
productName: 'KendoReact',
|
|
8
8
|
productCode: 'KENDOUIREACT',
|
|
9
9
|
productCodes: ['KENDOUIREACT'],
|
|
10
|
-
publishDate:
|
|
11
|
-
version: '16.1.0-develop.
|
|
10
|
+
publishDate: 1787924129,
|
|
11
|
+
version: '16.1.0-develop.11',
|
|
12
12
|
licensingDocsUrl:
|
|
13
13
|
'https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
14
14
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-conversational-ui",
|
|
3
|
-
"version": "16.1.0-develop.
|
|
3
|
+
"version": "16.1.0-develop.11",
|
|
4
4
|
"description": "React Chat component allows the user to participate in chat sessions with users or chat bots. KendoReact Conversational UI components",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -26,17 +26,17 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@progress/kendo-licensing": "^1.7.2",
|
|
29
|
-
"@progress/kendo-react-animation": "16.1.0-develop.
|
|
30
|
-
"@progress/kendo-react-buttons": "16.1.0-develop.
|
|
31
|
-
"@progress/kendo-react-common": "16.1.0-develop.
|
|
32
|
-
"@progress/kendo-react-intl": "16.1.0-develop.
|
|
33
|
-
"@progress/kendo-react-indicators": "16.1.0-develop.
|
|
34
|
-
"@progress/kendo-react-inputs": "16.1.0-develop.
|
|
35
|
-
"@progress/kendo-react-layout": "16.1.0-develop.
|
|
36
|
-
"@progress/kendo-react-notification": "16.1.0-develop.
|
|
37
|
-
"@progress/kendo-react-tooltip": "16.1.0-develop.
|
|
38
|
-
"@progress/kendo-react-popup": "16.1.0-develop.
|
|
39
|
-
"@progress/kendo-react-upload": "16.1.0-develop.
|
|
29
|
+
"@progress/kendo-react-animation": "16.1.0-develop.11",
|
|
30
|
+
"@progress/kendo-react-buttons": "16.1.0-develop.11",
|
|
31
|
+
"@progress/kendo-react-common": "16.1.0-develop.11",
|
|
32
|
+
"@progress/kendo-react-intl": "16.1.0-develop.11",
|
|
33
|
+
"@progress/kendo-react-indicators": "16.1.0-develop.11",
|
|
34
|
+
"@progress/kendo-react-inputs": "16.1.0-develop.11",
|
|
35
|
+
"@progress/kendo-react-layout": "16.1.0-develop.11",
|
|
36
|
+
"@progress/kendo-react-notification": "16.1.0-develop.11",
|
|
37
|
+
"@progress/kendo-react-tooltip": "16.1.0-develop.11",
|
|
38
|
+
"@progress/kendo-react-popup": "16.1.0-develop.11",
|
|
39
|
+
"@progress/kendo-react-upload": "16.1.0-develop.11",
|
|
40
40
|
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
41
41
|
"react": "^18.0.0 || ^19.0.0",
|
|
42
42
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"package": {
|
|
130
130
|
"productName": "KendoReact",
|
|
131
131
|
"productCode": "KENDOUIREACT",
|
|
132
|
-
"publishDate":
|
|
132
|
+
"publishDate": 1787924129,
|
|
133
133
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
|
|
134
134
|
}
|
|
135
135
|
},
|