@inkeep/agents-ui 0.15.2 → 0.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/primitives/components/embedded-chat/use-chat-action.cjs +1 -1
- package/dist/primitives/components/embedded-chat/use-chat-action.d.ts +1 -1
- package/dist/primitives/components/embedded-chat/use-chat-action.js +20 -17
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +2 -2
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.d.ts +0 -1
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +61 -62
- package/dist/primitives/components/embedded-chat.cjs +3 -3
- package/dist/primitives/components/embedded-chat.d.ts +16 -10
- package/dist/primitives/components/embedded-chat.js +419 -426
- package/dist/primitives/providers/base-events-provider.cjs +1 -1
- package/dist/primitives/providers/base-events-provider.js +1 -1
- package/dist/primitives/utils/component-ids.cjs +1 -1
- package/dist/primitives/utils/component-ids.d.ts +4 -4
- package/dist/primitives/utils/component-ids.js +2 -2
- package/dist/react/embedded-chat.cjs +1 -1
- package/dist/react/embedded-chat.js +19 -13
- package/dist/styled/components/embedded-chat.cjs +1 -1
- package/dist/styled/components/embedded-chat.d.ts +3 -3
- package/dist/styled/components/embedded-chat.js +29 -29
- package/dist/types/config/ai.d.ts +10 -3
- package/dist/types/config/settings/actions.d.ts +13 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../../providers/base-events-provider.cjs"),c=require("../../providers/chat-form-provider.cjs"),d=require("../modal/modal-provider.cjs"),u=require("./chat-provider.cjs"),m=(e,s)=>{const{logEvent:t}=p.useBaseEvents(),{conversationId:n,messages:i}=u.useChat(),{openForm:a}=c.useChatForm(),r=d.useModal();return{handleAction:l=>{if(e.action.type==="open_form"){l?.onOpenForm?.();const o="name"in e?e:void 0;a?.(e.action.formSettings,o)}else if(e.action.type==="invoke_callback"||e.action.type==="invoke_message_callback"){const o={conversation:{id:n,messages:i}};e.action.type==="invoke_message_callback"?e.action.callback({...o,messageId:s}):e.action.callback({...o}),e.action.shouldCloseModal&&r?.setOpen(!1)}},logHelpAction:()=>{"name"in e&&(t({eventName:"get_help_option_clicked",properties:{getHelpOption:e,conversationId:n}}),e.action.type!=="open_form"&&t({eventName:"user_escalation_indicated",properties:{escalationType:"get_help_option",getHelpOption:e,conversationId:n}}))}}};exports.useChatAction=m;
|
|
@@ -2,7 +2,7 @@ import { IkpChatAction } from '../../../types/index.ts';
|
|
|
2
2
|
interface HandleAction {
|
|
3
3
|
onOpenForm?: Function;
|
|
4
4
|
}
|
|
5
|
-
export declare const useChatAction: (chatAction: IkpChatAction) => {
|
|
5
|
+
export declare const useChatAction: (chatAction: IkpChatAction, messageId?: string) => {
|
|
6
6
|
handleAction: (opts?: HandleAction) => void;
|
|
7
7
|
logHelpAction: () => void;
|
|
8
8
|
};
|
|
@@ -1,38 +1,41 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useBaseEvents as r } from "../../providers/base-events-provider.js";
|
|
3
|
-
import { useChatForm as
|
|
4
|
-
import { useModal as
|
|
3
|
+
import { useChatForm as m } from "../../providers/chat-form-provider.js";
|
|
4
|
+
import { useModal as c } from "../modal/modal-provider.js";
|
|
5
5
|
import { useChat as f } from "./chat-provider.js";
|
|
6
|
-
const
|
|
7
|
-
const { logEvent:
|
|
6
|
+
const y = (e, t) => {
|
|
7
|
+
const { logEvent: s } = r(), { conversationId: n, messages: i } = f(), { openForm: l } = m(), a = c();
|
|
8
8
|
return { handleAction: (p) => {
|
|
9
9
|
if (e.action.type === "open_form") {
|
|
10
10
|
p?.onOpenForm?.();
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
} else e.action.type === "invoke_callback"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
const o = "name" in e ? e : void 0;
|
|
12
|
+
l?.(e.action.formSettings, o);
|
|
13
|
+
} else if (e.action.type === "invoke_callback" || e.action.type === "invoke_message_callback") {
|
|
14
|
+
const o = {
|
|
15
|
+
conversation: {
|
|
16
|
+
id: n,
|
|
17
|
+
messages: i
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
e.action.type === "invoke_message_callback" ? e.action.callback({ ...o, messageId: t }) : e.action.callback({ ...o }), e.action.shouldCloseModal && a?.setOpen(!1);
|
|
21
|
+
}
|
|
19
22
|
}, logHelpAction: () => {
|
|
20
|
-
"name" in e && (
|
|
23
|
+
"name" in e && (s({
|
|
21
24
|
eventName: "get_help_option_clicked",
|
|
22
25
|
properties: {
|
|
23
26
|
getHelpOption: e,
|
|
24
|
-
conversationId:
|
|
27
|
+
conversationId: n
|
|
25
28
|
}
|
|
26
|
-
}), e.action.type !== "open_form" &&
|
|
29
|
+
}), e.action.type !== "open_form" && s({
|
|
27
30
|
eventName: "user_escalation_indicated",
|
|
28
31
|
properties: {
|
|
29
32
|
escalationType: "get_help_option",
|
|
30
33
|
getHelpOption: e,
|
|
31
|
-
conversationId:
|
|
34
|
+
conversationId: n
|
|
32
35
|
}
|
|
33
36
|
}));
|
|
34
37
|
} };
|
|
35
38
|
};
|
|
36
39
|
export {
|
|
37
|
-
|
|
40
|
+
y as useChatAction
|
|
38
41
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("@ai-sdk/react"),Y=require("ai"),n=require("react"),Z=require("../../providers/config-provider.cjs"),ee=require("../../hooks/use-media-query.cjs"),R=require("../../utils/generate-uid.cjs"),te=require("../../providers/base-events-provider.cjs"),se=require("../../providers/chat-form-provider.cjs"),ne=require("../../providers/widget-provider.cjs"),re=require("@radix-ui/react-use-controllable-state"),ae=require("../../hooks/use-streaming-events.cjs"),x=`Hmm..
|
|
2
2
|
|
|
3
|
-
It seems I might be having some issues right now. Please clear the chat and try again.`,
|
|
3
|
+
It seems I might be having some issues right now. Please clear the chat and try again.`,oe=()=>{const{baseSettings:v,aiChatSettings:o}=Z.useInkeepConfig(),[s="",E]=re.useControllableState({prop:o.conversationId,defaultProp:o.conversationId??""}),{logEvent:i}=te.useBaseEvents(),{setConversationId:P,emitToParent:u}=ae.useStreamingEvents(),[a,l]=n.useState(""),k=e=>l(e.target.value),{filters:S}=v,{onInputMessageChange:A,filters:b,agentUrl:D,context:N,headers:U,apiKey:y}=o,T=e=>{switch(e.code){case 400:return e.message;case 403:return`There seems to be a configuration error. Please contact ${v.organizationDisplayName??"Administrator"}`;default:return x}},[O,d]=n.useState([]),[K,C]=n.useState(null),{messages:g,sendMessage:L,status:I,setMessages:w,stop:W,error:p}=X.useChat({transport:new Y.DefaultChatTransport({api:D,headers:{...y?{Authorization:`Bearer ${y}`}:{},...U},body:{requestContext:N}}),onData(e){u(e.type,e.data)},async onFinish(){u("completion",{conversationId:s}),await i({eventName:"assistant_message_received",properties:{conversationId:s}}),i({eventName:"assistant_answer_displayed",properties:{conversationId:s}})},onError(e){console.log("onError",e.message),w(c=>{const r=[...c],t=r[r.length-1];if(t){const F=T(e);t.role==="user"?r.push({id:R.generateUid(16),role:"assistant",parts:[{type:"text",text:F}]}):t.parts=[{type:"text",text:F}]}return r})}}),M=I==="submitted",$=I==="streaming",z=g.length===0,m=!a.trim()||M,B=ee.useMediaQuery("(max-width: 768px)"),[G,h]=n.useState(null);n.useEffect(()=>{p&&h(p)},[p]);const H=()=>h(null),_=n.useRef(null);n.useEffect(()=>{A?.(a)},[a]);const Q=e=>{e.key==="Enter"&&!e.shiftKey&&!m&&!e.nativeEvent.isComposing&&(e.preventDefault(),f())},f=async(e=a)=>{if(m&&(!e||e.trim().length===0))return;d([]),l(""),await i({eventName:"user_message_submitted",properties:{conversationId:s}});const c=S||b?JSON.stringify({...S,...b}):void 0,r={};c&&(r["inkeep-filters"]=c);let t=s;t||(t=`conv_${R.generateUid(16)}`,E(t)),P(t),L({text:e},{headers:r,body:{conversationId:t}})},j=()=>{W().then(()=>{u("aborted",{conversationId:s})})},q=()=>{H(),w([]),E(""),d([]),C(null),i({eventName:"chat_clear_button_clicked",properties:{conversationId:s}})},{openForm:J}=se.useChatForm(),V=ne.useWidget();return n.useImperativeHandle(o.chatFunctionsRef,()=>({submitMessage:f,updateInputMessage(e){l(e)},clearChat:q,openForm:e=>{V?.setView("chat"),J(e,void 0)},focusInput:()=>{_.current?.focus()}})),{messages:g,isLoading:M,isStreaming:$,error:G,setError:h,isSubmitDisabled:m,input:a,handleInputChange:k,handleInputKeyDown:Q,handleSubmit:f,stop:j,clear:q,isEmpty:g.length===0,inputRef:_,isMobile:B,messageAttachments:O,setMessageAttachments:d,selectedWorkflow:K,setSelectedWorkflow:C,isNewChat:z,conversationId:s}};exports.DEFAULT_ERROR_MESSAGE=x;exports.useInkeepChat=oe;
|
|
@@ -14,7 +14,6 @@ export declare const useInkeepChat: () => {
|
|
|
14
14
|
handleSubmit: (content?: string) => Promise<void>;
|
|
15
15
|
stop: () => void;
|
|
16
16
|
clear: () => void;
|
|
17
|
-
messageButtons: Record<string, any[]>;
|
|
18
17
|
isEmpty: boolean;
|
|
19
18
|
inputRef: RefObject<HTMLTextAreaElement | null>;
|
|
20
19
|
isMobile: boolean;
|
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useChat as
|
|
3
|
-
import { DefaultChatTransport as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useInkeepConfig as
|
|
6
|
-
import { useMediaQuery as
|
|
2
|
+
import { useChat as X } from "@ai-sdk/react";
|
|
3
|
+
import { DefaultChatTransport as Y } from "ai";
|
|
4
|
+
import { useState as c, useEffect as k, useRef as Z, useImperativeHandle as ee } from "react";
|
|
5
|
+
import { useInkeepConfig as te } from "../../providers/config-provider.js";
|
|
6
|
+
import { useMediaQuery as se } from "../../hooks/use-media-query.js";
|
|
7
7
|
import { generateUid as D } from "../../utils/generate-uid.js";
|
|
8
|
-
import { useBaseEvents as
|
|
9
|
-
import { useChatForm as
|
|
10
|
-
import { useWidget as
|
|
11
|
-
import { useControllableState as
|
|
12
|
-
import { useStreamingEvents as
|
|
13
|
-
const
|
|
8
|
+
import { useBaseEvents as ne } from "../../providers/base-events-provider.js";
|
|
9
|
+
import { useChatForm as oe } from "../../providers/chat-form-provider.js";
|
|
10
|
+
import { useWidget as re } from "../../providers/widget-provider.js";
|
|
11
|
+
import { useControllableState as ae } from "@radix-ui/react-use-controllable-state";
|
|
12
|
+
import { useStreamingEvents as ie } from "../../hooks/use-streaming-events.js";
|
|
13
|
+
const ce = `Hmm..
|
|
14
14
|
|
|
15
|
-
It seems I might be having some issues right now. Please clear the chat and try again.`,
|
|
16
|
-
const { baseSettings: v, aiChatSettings:
|
|
17
|
-
prop:
|
|
18
|
-
defaultProp:
|
|
19
|
-
}), { logEvent:
|
|
15
|
+
It seems I might be having some issues right now. Please clear the chat and try again.`, ye = () => {
|
|
16
|
+
const { baseSettings: v, aiChatSettings: r } = te(), [s = "", I] = ae({
|
|
17
|
+
prop: r.conversationId,
|
|
18
|
+
defaultProp: r.conversationId ?? ""
|
|
19
|
+
}), { logEvent: a } = ne(), { setConversationId: N, emitToParent: m } = ie(), [o, l] = c(""), A = (e) => l(e.target.value), {
|
|
20
20
|
/* shouldBypassCaptcha, */
|
|
21
21
|
filters: C
|
|
22
22
|
} = v, {
|
|
23
23
|
onInputMessageChange: R,
|
|
24
24
|
filters: y,
|
|
25
|
-
agentUrl:
|
|
26
|
-
context:
|
|
27
|
-
headers:
|
|
25
|
+
agentUrl: P,
|
|
26
|
+
context: T,
|
|
27
|
+
headers: K,
|
|
28
28
|
apiKey: E
|
|
29
|
-
} =
|
|
29
|
+
} = r, U = (e) => {
|
|
30
30
|
switch (e.code) {
|
|
31
31
|
case 400:
|
|
32
32
|
return e.message;
|
|
33
33
|
case 403:
|
|
34
34
|
return `There seems to be a configuration error. Please contact ${v.organizationDisplayName ?? "Administrator"}`;
|
|
35
35
|
default:
|
|
36
|
-
return
|
|
36
|
+
return ce;
|
|
37
37
|
}
|
|
38
|
-
}, [
|
|
39
|
-
messages:
|
|
40
|
-
sendMessage:
|
|
38
|
+
}, [W, p] = c([]), [$, b] = c(null), {
|
|
39
|
+
messages: u,
|
|
40
|
+
sendMessage: z,
|
|
41
41
|
status: w,
|
|
42
42
|
setMessages: S,
|
|
43
|
-
stop:
|
|
43
|
+
stop: B,
|
|
44
44
|
error: g
|
|
45
|
-
} =
|
|
46
|
-
transport: new
|
|
47
|
-
api:
|
|
45
|
+
} = X({
|
|
46
|
+
transport: new Y({
|
|
47
|
+
api: P,
|
|
48
48
|
headers: {
|
|
49
49
|
...E ? { Authorization: `Bearer ${E}` } : {},
|
|
50
|
-
...
|
|
50
|
+
...K
|
|
51
51
|
},
|
|
52
52
|
body: {
|
|
53
|
-
requestContext:
|
|
53
|
+
requestContext: T
|
|
54
54
|
}
|
|
55
55
|
}),
|
|
56
56
|
onData(e) {
|
|
57
57
|
m(e.type, e.data);
|
|
58
58
|
},
|
|
59
59
|
async onFinish() {
|
|
60
|
-
m("completion", { conversationId: s }), await
|
|
60
|
+
m("completion", { conversationId: s }), await a({
|
|
61
61
|
eventName: "assistant_message_received",
|
|
62
62
|
properties: {
|
|
63
63
|
conversationId: s
|
|
64
64
|
}
|
|
65
|
-
}),
|
|
65
|
+
}), a({
|
|
66
66
|
eventName: "assistant_answer_displayed",
|
|
67
67
|
properties: {
|
|
68
68
|
conversationId: s
|
|
@@ -70,10 +70,10 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
70
70
|
});
|
|
71
71
|
},
|
|
72
72
|
onError(e) {
|
|
73
|
-
console.log("onError", e.message), S((
|
|
74
|
-
const n = [...
|
|
73
|
+
console.log("onError", e.message), S((i) => {
|
|
74
|
+
const n = [...i], t = n[n.length - 1];
|
|
75
75
|
if (t) {
|
|
76
|
-
const F =
|
|
76
|
+
const F = U(e);
|
|
77
77
|
t.role === "user" ? n.push({
|
|
78
78
|
id: D(16),
|
|
79
79
|
role: "assistant",
|
|
@@ -83,31 +83,31 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
83
83
|
return n;
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
}), M = w === "submitted",
|
|
86
|
+
}), M = w === "submitted", H = w === "streaming", L = u.length === 0, d = !o.trim() || M, O = se("(max-width: 768px)"), [q, h] = c(null);
|
|
87
87
|
k(() => {
|
|
88
88
|
g && h(g);
|
|
89
89
|
}, [g]);
|
|
90
|
-
const
|
|
90
|
+
const G = () => h(null), _ = Z(null);
|
|
91
91
|
k(() => {
|
|
92
92
|
R?.(o);
|
|
93
93
|
}, [o]);
|
|
94
|
-
const
|
|
94
|
+
const J = (e) => {
|
|
95
95
|
e.key === "Enter" && !e.shiftKey && !d && !e.nativeEvent.isComposing && (e.preventDefault(), f());
|
|
96
96
|
}, f = async (e = o) => {
|
|
97
97
|
if (d && (!e || e.trim().length === 0)) return;
|
|
98
|
-
|
|
98
|
+
p([]), l(""), await a({
|
|
99
99
|
eventName: "user_message_submitted",
|
|
100
100
|
properties: {
|
|
101
101
|
conversationId: s
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
|
-
const
|
|
104
|
+
const i = C || y ? JSON.stringify({
|
|
105
105
|
...C,
|
|
106
106
|
...y
|
|
107
107
|
}) : void 0, n = {};
|
|
108
|
-
|
|
108
|
+
i && (n["inkeep-filters"] = i);
|
|
109
109
|
let t = s;
|
|
110
|
-
t || (t = `conv_${D(16)}`, I(t)), N(t),
|
|
110
|
+
t || (t = `conv_${D(16)}`, I(t)), N(t), z(
|
|
111
111
|
// { ...userMessage, files },
|
|
112
112
|
// { ...userMessage, },
|
|
113
113
|
{
|
|
@@ -120,57 +120,56 @@ It seems I might be having some issues right now. Please clear the chat and try
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
);
|
|
123
|
-
},
|
|
124
|
-
|
|
123
|
+
}, Q = () => {
|
|
124
|
+
B().then(() => {
|
|
125
125
|
m("aborted", { conversationId: s });
|
|
126
126
|
});
|
|
127
127
|
}, x = () => {
|
|
128
|
-
|
|
128
|
+
G(), S([]), I(""), p([]), b(null), a({
|
|
129
129
|
eventName: "chat_clear_button_clicked",
|
|
130
130
|
properties: {
|
|
131
131
|
conversationId: s
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
|
-
}, { openForm:
|
|
135
|
-
return
|
|
134
|
+
}, { openForm: V } = oe(), j = re();
|
|
135
|
+
return ee(r.chatFunctionsRef, () => ({
|
|
136
136
|
submitMessage: f,
|
|
137
137
|
updateInputMessage(e) {
|
|
138
138
|
l(e);
|
|
139
139
|
},
|
|
140
140
|
clearChat: x,
|
|
141
141
|
openForm: (e) => {
|
|
142
|
-
|
|
142
|
+
j?.setView("chat"), V(e, void 0);
|
|
143
143
|
},
|
|
144
144
|
focusInput: () => {
|
|
145
145
|
_.current?.focus();
|
|
146
146
|
}
|
|
147
147
|
})), {
|
|
148
|
-
messages:
|
|
148
|
+
messages: u,
|
|
149
149
|
isLoading: M,
|
|
150
|
-
isStreaming:
|
|
151
|
-
error:
|
|
150
|
+
isStreaming: H,
|
|
151
|
+
error: q,
|
|
152
152
|
setError: h,
|
|
153
153
|
isSubmitDisabled: d,
|
|
154
154
|
input: o,
|
|
155
155
|
handleInputChange: A,
|
|
156
|
-
handleInputKeyDown:
|
|
156
|
+
handleInputKeyDown: J,
|
|
157
157
|
handleSubmit: f,
|
|
158
|
-
stop:
|
|
158
|
+
stop: Q,
|
|
159
159
|
clear: x,
|
|
160
|
-
|
|
161
|
-
isEmpty: p.length === 0,
|
|
160
|
+
isEmpty: u.length === 0,
|
|
162
161
|
inputRef: _,
|
|
163
|
-
isMobile:
|
|
162
|
+
isMobile: O,
|
|
164
163
|
// Additional state for attachments and workflow
|
|
165
|
-
messageAttachments:
|
|
166
|
-
setMessageAttachments:
|
|
167
|
-
selectedWorkflow:
|
|
164
|
+
messageAttachments: W,
|
|
165
|
+
setMessageAttachments: p,
|
|
166
|
+
selectedWorkflow: $,
|
|
168
167
|
setSelectedWorkflow: b,
|
|
169
|
-
isNewChat:
|
|
168
|
+
isNewChat: L,
|
|
170
169
|
conversationId: s
|
|
171
170
|
};
|
|
172
171
|
};
|
|
173
172
|
export {
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
ce as DEFAULT_ERROR_MESSAGE,
|
|
174
|
+
ye as useInkeepChat
|
|
176
175
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),h=require("react"),ha=require("react-dom/client"),Z=require("react-textarea-autosize"),ua=require("@radix-ui/react-avatar"),Ca=require("@radix-ui/react-checkbox"),pa=require("@radix-ui/react-popover"),va=require("@radix-ui/react-tooltip"),ba=require("@radix-ui/react-scroll-area"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),h=require("react"),ha=require("react-dom/client"),Z=require("react-textarea-autosize"),ua=require("@radix-ui/react-avatar"),Ca=require("@radix-ui/react-checkbox"),pa=require("@radix-ui/react-popover"),va=require("@radix-ui/react-tooltip"),ba=require("@radix-ui/react-scroll-area"),y=require("../atoms/select.cjs"),E=require("../atoms/dialog.cjs"),ga=require("../atoms/avatars/ai.cjs"),Pa=require("../atoms/avatars/user.cjs"),f=require("../atoms/icons/custom-icon.cjs"),T=require("../atoms/icons/built-in-icon-renderer.cjs"),Aa=require("../atoms/link.cjs"),Q=require("../atoms/markdown/index.cjs"),D=require("../providers/attachment-item-provider.cjs"),S=require("../providers/attachments-bar-provider.cjs"),j=require("../providers/source-item-provider.cjs"),b=require("../providers/config-provider.cjs"),ee=require("../providers/feedback-provider.cjs"),q=require("../providers/message-attachments-provider.cjs"),_=require("../providers/message-provider.cjs"),le=require("../atoms/icons/checkbox-icon.cjs"),J=require("../hooks/use-copy-to-clipboard.cjs"),V=require("../providers/feedback-item-provider.cjs"),u=require("../utils/misc.cjs"),a=require("./factory.cjs"),P=require("./embedded-chat/chat-provider.cjs"),_a=require("./tagline-logo-icon.cjs"),Ea=require("../hooks/use-settle-action.cjs"),Fa=require("../hooks/use-container-size.cjs"),te=require("./embedded-chat/use-chat-action.cjs"),X=require("../providers/help-menu-provider.cjs"),F=require("../providers/chat-form-provider.cjs"),H=require("../providers/form-field-provider.cjs"),ka=require("react-hook-form"),Ia=require("../utils/highlight-emphasis.cjs"),Ma=require("./modal/modal-provider.cjs"),fa=require("../../color-mode/index.cjs"),ie=require("../utils/compose-refs.cjs"),C=require("../utils/compose-event-handlers.cjs"),Sa=require("../hooks/use-simple-scroll.cjs"),xa=require("../hooks/use-debounce.cjs"),ae=require("../providers/hover-popover-provider.cjs"),Ba=require("./modal/widget-auto-focus.cjs"),ne=require("../providers/base-events-provider.cjs"),ya=require("../atoms/shadow/context.cjs"),Ta=require("../utils/get-source-icon.cjs");function R(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const ja=R(ha),re=R(ua),$=R(Ca),w=R(pa),L=R(va),W=R(ba),Ha="__intro__",wa=a.ikp("div",{_id:"aiChatWrapper"}),he=h.forwardRef((t,e)=>{const{...i}=t,{isHidden:r,isMobile:s}=P.useChat(),[o,d]=Fa.useContainerSize(),c=ie.useComposedRefs(e,o),m=d?.width?d.width>580:!0,l=Ma.useModal();return n.jsx(wa,{ref:c,"data-widget-md":u.dataAttr(m),"data-hidden":u.dataAttr(r),"data-in-modal":u.dataAttr(!!l),"data-mobile":u.dataAttr(s),...i})}),La=a.ikp("div",{_id:"aiChatRoot"}),ue=t=>{const{isHidden:e}=P.useChat(),{form:i}=F.useChatForm();return i?null:n.jsx(La,{"data-hidden":u.dataAttr(e),...t})},Da=a.ikp("div",{_id:"aiChatHeader"}),Ce=a.ikp("div",{_id:"aiChatHeader__Toolbar"}),pe=a.ikp("div",{_id:"aiChatHeader__ToolbarHeaderWrapper"}),Ra=a.ikp("div",{_id:"aiChatHeader__ToolbarHeader"}),ve=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig(),i=`Ask ${e.aiAssistantName||"AI"}`;return n.jsx(Ra,{...t,children:i})}),be=a.ikp("div",{_id:"aiChatContent"}),ge=a.ikp(W.Root,{_id:"aiChatContentScrollArea"}),Oa=a.ikp(W.Viewport,{_id:"aiChatContentScrollArea__Viewport"}),Pe=h.forwardRef(({children:t,...e},i)=>{const{containerRef:r,scrollToBottom:s}=Sa.useSimpleScroll(),o=ie.useComposedRefs(i,r),{messages:d}=P.useChat();return h.useEffect(()=>{d.length>0&&s()},[d.length,s]),n.jsx(Oa,{ref:o,children:n.jsx("div",{"data-part":"grid",style:{display:"grid"},children:t}),...e})}),Ae=a.ikp(W.ScrollAreaScrollbar,{_id:"aiChatContentScrollArea__Scrollbar"}),_e=a.ikp(W.ScrollAreaThumb,{_id:"aiChatContentScrollArea__Thumb"}),Ee=a.ikp(W.Corner,{_id:"aiChatContentScrollArea__Corner"}),qa=a.ikp("div",{_id:"aiChatMessages"}),Fe=t=>{const e=P.useChat(),{children:i,...r}=t;return n.jsx(qa,{children:u.maybeRender(i,e),...r})},Wa=a.ikp("div",{_id:"aiChatDisclaimer"}),ke=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig(),[i,r]=h.useState(!1),s=xa.useDebounce(i,100);return e.disclaimerSettings?.isEnabled?n.jsx(ae.HoverPopoverProvider,{open:i,setOpen:r,children:n.jsx(w.Root,{open:s,onOpenChange:r,children:n.jsx(Wa,{...t})})}):null}),Na=a.ikp("span",{_id:"aiChatDisclaimerLabel"}),Ie=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig(),i=e.disclaimerSettings;return n.jsx(Na,{children:i?.label,...t})}),Qa=a.ikp(w.Trigger,{_id:"aiChatDisclaimerTrigger",children:n.jsx(f.CustomIcon,{iconKey:"info"})}),Me=h.memo(t=>{const{setOpen:e}=ae.useHoverPopover(),i=()=>e(!0),r=()=>e(!1);return n.jsx(Qa,{onMouseEnter:i,onMouseLeave:r,...t})}),Va=a.ikp(w.Content,{_id:"aiChatDisclaimerContent"}),fe=t=>{const{setOpen:e}=ae.useHoverPopover(),i=()=>e(!0),r=()=>e(!1);return n.jsx(Va,{onMouseEnter:i,onMouseLeave:r,side:"top",sideOffset:8,align:"end",alignOffset:-10,...t})},$a=a.ikp(Q.Markdown,{_id:"aiChatDisclaimerText"}),Se=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig(),i=e.aiAssistantName,s=e.disclaimerSettings?.tooltip||`Information provided by ${i||"this AI assistant"} is not guaranteed to be accurate or comprehensive.`;return n.jsx($a,{shouldOpenLinksInNewTab:!0,children:s,...t})}),xe=a.ikp(w.Arrow,{_id:"aiChatDisclaimerArrow"}),Ua=a.ikp("div",{_id:"aiChatExampleQuestions"}),Be=t=>{const{aiChatSettings:e}=b.useInkeepConfig(),{messages:i}=P.useChat();return!e.exampleQuestions?.length||i.length?null:n.jsx(Ua,{...t})},Ka=a.ikp("h3",{_id:"aiChatExampleQuestionsLabel"}),ye=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig();return n.jsx(Ka,{children:e.exampleQuestionsLabel,...t})}),za=a.ikp("div",{_id:"aiChatExampleQuestionsList"}),Te=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig(),i=e.exampleQuestions,{children:r,...s}=t;return n.jsx(za,{children:u.maybeRender(r,i),...s})}),Ga=a.ikp("div",{_id:"aiChatExampleQuestion"}),je=h.forwardRef((t,e)=>{const{aiChatSettings:i}=b.useInkeepConfig(),r=i.isFirstExampleQuestionHighlighted;return n.jsx(Ga,{ref:e,"data-highlight":u.dataAttr(r),...t})}),Ya=a.ikp("button",{_id:"aiChatExampleQuestionButton"}),He=t=>{const{question:e,onClick:i,...r}=t,s=typeof e=="object"?e.value:e,o=typeof e=="object"?e.label:e,{handleSubmit:d}=P.useChat();return n.jsx(Ya,{onClick:C.composeEventHandlers(i,()=>d(s)),children:o,...r})},Ja=a.ikp("div",{_id:"aiChatWorkflows"}),we=t=>{const{aiChatSettings:e}=b.useInkeepConfig(),{messages:i}=P.useChat();return!e.workflows?.length||i.length?null:n.jsx(Ja,{...t})},Xa=a.ikp("h3",{_id:"aiChatWorkflowsLabel"}),Le=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig();return n.jsx(Xa,{children:e.workflowsHeader,...t})}),Za=a.ikp("div",{_id:"aiChatWorkflowsList"}),De=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig(),i=e.workflows,{children:r,...s}=t;return n.jsx(Za,{children:u.maybeRender(r,i),...s})}),en=a.ikp("button",{_id:"aiChatWorkflow"}),Re=t=>{const{workflow:e,onClick:i,...r}=t,s=o=>{};return n.jsx(en,{onClick:C.composeEventHandlers(i,()=>s()),children:e.displayName,...r})},tn=a.ikp("div",{_id:"aiChatMessageWrapper"}),se=t=>{const{message:e,...i}=t;return e.role==="system"?null:n.jsx(_.MessageProvider,{message:e,children:n.jsx(tn,{"data-role":e.role,...i})})},Oe=h.memo(t=>{const{message:e,...i}=t,{aiChatSettings:r,baseSettings:s}=b.useInkeepConfig(),o=r.aiAssistantName,d=o?`Hi, I'm ${o}!`:"Hi!",c=r.chatSubjectName??s.organizationDisplayName,m=c?`
|
|
2
2
|
|
|
3
3
|
Ask me anything about \`${c}\`.`:`
|
|
4
4
|
|
|
5
|
-
How can I help?`,v={parts:[{type:"text",text:r.introMessage??`${d}${m}`}],id:Ha,...e,role:"assistant"};return n.jsx(se,{message:v,...i})}),an=a.ikp("div",{_id:"aiChatMessageHeader"}),qe=t=>{const{message:e}=E.useMessage();return n.jsx(an,{"data-role":e.role,...t})},nn=a.ikp("div",{_id:"aiChatMessageLoading",children:"Thinking..."}),We=t=>n.jsx(nn,{...t}),rn=a.ikp("div",{_id:"aiChatMessageAvatar"}),Ne=t=>{const{message:e}=E.useMessage();return n.jsx(rn,{"data-role":e.role,...t})},sn=a.ikp(re.Root,{_id:"aiChatMessageAvatarContent"}),Qe=t=>{const{message:e}=E.useMessage(),{baseSettings:i}=b.useInkeepConfig();return n.jsx(sn,{"data-username":u.dataAttr(e.role==="user"&&!!i.userProperties.name),"data-role":e.role,...t})},on=a.ikp(re.Fallback,{_id:"aiChatMessageAvatarFallback"}),Ve=h.memo(t=>{const{baseSettings:e}=b.useInkeepConfig(),{message:i}=E.useMessage();return e.userProperties.name?n.jsx(on,{"data-role":i.role,children:u.getInitials(e.userProperties.name),...t}):null}),me=a.ikp(re.Image,{_id:"aiChatMessageAvatarImage"}),$e=h.memo(t=>{const{onLoadingStatusChange:e,...i}=t,{aiChatSettings:r,baseSettings:{userProperties:s}}=b.useInkeepConfig(),{message:o}=E.useMessage(),{aiAssistantAvatar:d}=r??{},c=typeof d=="string"?d:d?.light,m=(typeof d=="string"?d:d?.dark)??c,l=fa.useColorModeValue(c,m),[v,g]=h.useState(l);h.useEffect(()=>{g(l)},[l]);const p=A=>{A==="error"&&g(null)};return o.role==="user"?s.name?null:r.userAvatar?n.jsx(me,{"data-type":"image",alt:"User avatar","data-role":o.role,src:r.userAvatar,...t}):n.jsx(Pa.default,{"data-type":"icon","data-role":o.role,...t}):v?n.jsx(me,{src:v,alt:"AI assistant avatar","data-type":"image","data-role":o.role,onLoadingStatusChange:C.composeEventHandlers(e,p),...i}):n.jsx(ga.default,{"data-type":"icon","data-role":o.role,...t})}),dn=a.ikp("span",{_id:"aiChatMessageName"}),Ue=t=>{const{message:e}=E.useMessage();return n.jsx(dn,{"data-role":e.role,children:e.role==="user"?"You":"AI assistant",...t})},cn=a.ikp("div",{_id:"aiChatMessageContentWrapper"}),Ke=t=>{const{message:e}=E.useMessage(),{messageButtons:i}=P.useChat(),r=i[e.id]||[];return n.jsx(cn,{"data-role":e.role,"data-has-message-buttons":u.dataAttr(!!r.length),...t})},mn=a.ikp("div",{_id:"aiChatMessageContent"}),ze=t=>{const{message:e}=E.useMessage();return n.jsx(mn,{"data-role":e.role,...t})},ln=a.ikp("div",{_id:"aiChatMessageAttachments"}),Ge=t=>{const{message:e}=E.useMessage(),i=[];return e.role!=="user"||!i?.length?null:n.jsx(q.MessageAttachmentsProvider,{children:n.jsx(ln,{...t})})},hn=a.ikp("div",{_id:"aiChatMessageAttachments__List"}),Ye=t=>{const{children:e,...i}=t,r=[];return r?n.jsx(hn,{children:u.maybeRender(e,r),...i}):null},un=a.ikp("div",{_id:"aiChatMessageAttachments__Item"}),Je=t=>{const{attachment:e,onClick:i,...r}=t,{selectItem:s,onOpen:o}=q.useMessageAttachments(),d=()=>{s(e),o()};return n.jsx(D.AttachmentItemProvider,{attachment:e,children:n.jsx(un,{onClick:C.composeEventHandlers(i,d),...r})})},Cn=a.ikp(y.BuiltInIconRenderer,{_id:"aiChatMessageAttachments__ItemIcon"}),Xe=t=>{const{attachment:e}=D.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?n.jsx(Cn,{iconSettings:i,...t}):null},pn=a.ikp("span",{_id:"aiChatMessageAttachments__ItemTitle"}),Ze=t=>{const{attachment:e}=D.useAttachmentItem();return n.jsx(pn,{children:e.title,...t})},vn=a.ikp(_.Root,{_id:"aiChatMessageAttachmentsPreview"}),et=t=>{const{onOpenChange:e,...i}=t,{selectItem:r,isOpen:s,onClose:o,selectedItem:d}=q.useMessageAttachments(),c=m=>{m||(o(),r(null))};return n.jsx(vn,{open:s&&d!==null,onOpenChange:C.composeEventHandlers(e,c),...i})},tt=a.ikp(_.Overlay,{_id:"aiChatMessageAttachmentsPreview__Overlay"}),it=a.ikp(_.Content,{_id:"aiChatMessageAttachmentsPreview__Content","aria-describedby":void 0}),bn=a.ikp(_.Title,{_id:"aiChatMessageAttachmentsPreview__Header"}),at=t=>{const{selectedItem:e}=q.useMessageAttachments();return n.jsx(bn,{children:e?.title||"Attachment",...t})},nt=a.ikp(_.Close,{_id:"aiChatMessageAttachmentsPreview__Close",children:n.jsx(f.CustomIcon,{iconKey:"close"})}),gn=a.ikp("p",{_id:"aiChatMessageAttachmentsPreview__Body"}),rt=t=>{const{selectedItem:e}=q.useMessageAttachments();return n.jsx(gn,{children:e?.content,...t})},st=t=>{const{text:e,componentStyles:i,...r}=t,{aiChatSettings:s}=b.useInkeepConfig(),{shouldOpenLinksInNewTab:o}=s;return n.jsx(Q.Markdown,{children:e,componentStyles:i,shouldOpenLinksInNewTab:o,...r})},ot=({name:t,props:e,componentDef:i})=>{const s=Ta.useShadow()?.shadowHost,o=h.useRef(void 0),d=h.useRef(null),c=h.useRef(null),m=h.useRef(!1),[l,v]=h.useState(!1),[g,p]=h.useState(!1),A=h.useRef(i);h.useMemo(()=>{i!==A.current&&(typeof i=="function"&&typeof A.current=="function"?i.toString()!==A.current.toString()&&(A.current=i):A.current=i)},[i]);const B=A.current;return h.useEffect(()=>{o.current||(o.current=`dyn:${t}:${crypto.randomUUID()}`,v(!0))},[t]),h.useLayoutEffect(()=>{if(!B||!s||!l||!o.current)return;const k=o.current,I=document.createElement("div");return I.setAttribute("data-ikp-component",""),I.setAttribute("data-component",t),I.setAttribute("slot",k),d.current=I,m.current=!1,s.appendChild(I),p(!0),()=>{m.current=!0,p(!1),queueMicrotask(()=>{try{c.current&&(c.current.unmount(),c.current=null)}catch(M){console.debug("Ignoring unmount error:",M)}I.parentNode===s&&I.remove(),d.current=null})}},[B,s,l,t]),h.useEffect(()=>{const k=d.current;if(!k||m.current)return;const I=x=>{if(typeof x!="function"||x.length>1)return!1;try{if(typeof x=="function"&&x.constructor===Function){const O=x({});return h.isValidElement(O)}return!1}catch{return!0}};let M;if(I(B))try{const x=B;M=h.createElement(x,e||{})}catch(x){console.error("Error creating React element from component:",x);return}else if(typeof B=="function")M=B(e||{},k,null);else{console.error("Invalid component definition");return}if(h.isValidElement(M)||typeof M=="string"){if(m.current)return;c.current||(c.current=ja.createRoot(k)),!m.current&&c.current&&c.current.render(M);return}c.current&&!m.current&&c.current.render(null)},[i,e,g]),n.jsx("slot",{name:o.current})},Pn=a.ikp("div",{_id:"aiChatMessagePart"}),An=a.ikp("div",{_id:"aiChatMessageToolbar"}),dt=t=>{const{isLoading:e,messages:i}=P.useChat(),{message:r}=E.useMessage();return i.at(-1)?.id===r?.id&&e||r.role==="user"?null:n.jsx(An,{...t})},_n=a.ikp("div",{_id:"aiChatMessageAnnotationActions"}),ct=t=>{const{children:e,...i}=t,{message:r}=E.useMessage(),{messageButtons:s}=P.useChat(),o=s[r.id]||[];return n.jsx(_n,{children:u.maybeRender(e,o),...i})},En=a.ikp("a",{_id:"aiChatMessageAnnotationAction"}),Fn=a.ikp("button",{_id:"aiChatMessageAnnotationAction"}),mt=t=>{const{onClick:e,action:i,...r}=t,{handleAction:s}=te.useChatAction(i),{logEvent:o}=ne.useBaseEvents(),{conversationId:d}=P.useChat(),c=()=>{s(),o({eventName:"user_escalation_indicated",properties:{escalationType:"contact_us",conversationId:d}})},m=i.label||"Contact Support",l=n.jsxs(n.Fragment,{children:[i.icon&&n.jsx(y.BuiltInIconRenderer,{iconSettings:i.icon}),m]});return i.action.type==="open_link"?n.jsx(En,{href:i.action.url,target:"_blank",rel:"noopener","data-type":i.action.type,onClick:C.composeEventHandlers(e,c),children:l,...r}):n.jsx(Fn,{"data-type":i.action.type,onClick:C.composeEventHandlers(e,c),children:l,...r})},kn=a.ikp("button",{_id:"aiChatMessageAction"}),lt=t=>{const{action:e,onClick:i,className:r,...s}=t,{conversationId:o}=P.useChat(),{baseSettings:{onFeedback:d}}=b.useInkeepConfig(),{message:c}=E.useMessage(),{isStreaming:m,messages:l}=P.useChat(),[v,g]=J.useCopyToClipboard(),{feedback:p,submitPositiveFeedback:A,setCurrentFeedback:B,currentFeedback:k}=ee.useMessageFeedback(),{logEvent:I}=ne.useBaseEvents(),[M,x]=Ea.useSettleAction(),O=l.at(-1)?.id===c?.id,z=c.role==="assistant";if(O&&m||!z)return null;const N={copy(){g(u.getMessageContent(c)),I({eventName:"assistant_message_copied",properties:{conversationId:o}})},upvote(){A(c.id).then(()=>{x()})},downvote(){B(c.id)}},G={copy:"Copy Message",upvote:"Upvote Message",downvote:"Downvote Message"},Y={copy:n.jsx(f.CustomIcon,{iconKey:v?"messageCopied":"messageCopy"}),upvote:n.jsx(f.CustomIcon,{iconKey:M?"messageCopied":"thumbsUp"}),downvote:n.jsx(f.CustomIcon,{iconKey:"thumbsDown"})},la={copy:{"data-copied":u.dataAttr(v)},upvote:{"data-upvoted":u.dataAttr(p[c.id]?.type==="positive")},downvote:{"data-downvoted":u.dataAttr(p[c.id]?.type==="negative"),"data-state":k===null?"closed":"open"}};return{copy:!1,upvote:!d,downvote:!d}[e]?null:n.jsx(kn,{"data-action":e,...la[e],children:Y[e],"aria-label":G[e],className:`${r} ${e}`,onClick:C.composeEventHandlers(i,N[e]),...s})},In=a.ikp("div",{_id:"aiChatMessageSources"}),ht=t=>{const{message:e}=E.useMessage();return e.role!=="assistant"||!e.parts.filter(r=>r.type==="data-artifact"&&r.data?.type?.toLowerCase()==="citation")?.length?null:n.jsx(In,{...t})},Mn=a.ikp("div",{_id:"aiChatMessageSources__Header"}),ut=t=>n.jsx(Mn,{children:"Sources",...t}),fn=a.ikp("div",{_id:"aiChatMessageSources__List"}),Ct=t=>{const{message:e}=E.useMessage(),{children:i,...r}=t,{baseSettings:{transformSource:s,organizationDisplayName:o},aiChatSettings:{shouldOpenLinksInNewTab:d},searchSettings:{tabs:c}}=b.useInkeepConfig();if(e.role!=="assistant")return null;const m=e.parts.filter(g=>g.type==="data-artifact"&&g.data?.type?.toLowerCase()==="citation");if(!m?.length)return null;const l=new Map,v=m.filter(g=>{const p=g.data.artifactSummary.url;return!p||l.has(p)?!1:(l.set(p,!0),!0)}).map(g=>{const p=g.data,A={id:p?.artifactId,title:p?.artifactSummary?.title||p?.name,url:p?.artifactSummary?.url||"",description:"",breadcrumbs:[],type:p?.artifactSummary?.record_type,contentType:p?.artifactType,tag:p?.artifactType},k=(s??(M=>({...M,shouldOpenInNewTab:d,icon:ya.getIcon(M)})))(A,"chatSourceItem",{organizationDisplayName:o,tabs:c}),I=k.shouldOpenInNewTab!==void 0?k.shouldOpenInNewTab:d;return{...k,isExternal:I}});return n.jsx(fn,{children:u.maybeRender(i,v),...r})},Sn=a.ikp(Aa.LinkWithQueryParams,{_id:"aiChatMessageSourceItem"}),pt=t=>{const{source:e,onClick:i,...r}=t,{logEvent:s}=ne.useBaseEvents(),{conversationId:o}=P.useChat(),d=()=>{s({eventName:"assistant_source_item_clicked",properties:{conversationId:o,link:e}})};return n.jsx(j.SourceItemProvider,{source:e,children:n.jsx(Sn,{"data-type":e.type,appendToUrl:e.appendToUrl,isExternal:e.isExternal,"data-breadcrumbs":!!e.breadcrumbs?.length,onClick:C.composeEventHandlers(i,d),...r})})},xn=a.ikp("div",{_id:"aiChatMessageSourceItem__Breadcrumbs"}),vt=t=>{const{source:e}=j.useSourceItem();return e.breadcrumbs?.length?n.jsx(xn,{"data-type":e.type,...t}):null},Bn=a.ikp(f.CustomIcon,{_id:"aiChatMessageSourceItem__BreadcrumbIcon",iconKey:"breadcrumbSeparator"}),Tn=a.ikp(y.BuiltInIconRenderer,{_id:"aiChatMessageSourceItem__Icon"}),bt=t=>{const{source:e}=j.useSourceItem();return n.jsx(Tn,{iconSettings:e.icon,"data-type":e.type,...t})},yn=a.ikp("span",{_id:"aiChatMessageSourceItem__Title"}),gt=t=>{const{source:e}=j.useSourceItem();return n.jsx(yn,{"data-type":e.type,children:e.title,...t})},jn=a.ikp("span",{_id:"aiChatMessageSourceItem__Tag"}),Pt=t=>{const{source:e}=j.useSourceItem();return n.jsx(jn,{"data-type":e.type,...t})},Hn=a.ikp("span",{_id:"aiChatMessageSourceItem__Description"}),At=t=>{const{source:e}=j.useSourceItem(),{children:i,...r}=t,s=h.useMemo(()=>e.description?Ia.highlightEmphasis(e.description):[],[e.description]);return s.length?n.jsx(Hn,{"data-type":e.type,children:u.maybeRender(i,s),...r}):null},wn=a.ikp("span",{_id:"aiChatMessageSourceItem__DescriptionPart"}),_t=t=>{const{part:e,...i}=t,{source:r}=j.useSourceItem();return typeof e=="string"?e:n.jsx(wn,{"data-type":r.type,children:e.content,"data-highlighted":u.dataAttr(e.highlighted),...i})},Ln=a.ikp(f.CustomIcon,{_id:"aiChatMessageSourceItem__Indicator"}),Et=t=>{const{source:e}=j.useSourceItem();return n.jsx(Ln,{iconKey:e.isExternal?"openLinkInNewTab":"openLinkInSameTab",...t})},Ft=a.ikp("div",{_id:"aiChatFooter"}),kt=a.ikp("div",{_id:"aiChatInput__Fieldset"}),It=a.ikp("div",{_id:"aiChatInput__Group"}),Dn=a.ikp("textarea",{_id:"aiChatInput"}),Mt=h.forwardRef(({onChange:t,onKeyDown:e,...i},r)=>{const{handleInputChange:s,handleInputKeyDown:o,input:d,error:c,shouldAutoFocusInput:m,inputRef:l}=P.useChat(),{aiChatSettings:v}=b.useInkeepConfig(),g=ie.useComposedRefs(r,l);return Ba.useWidgetAutoFocus("chat",l,m),n.jsx(Dn,{asChild:!0,ref:g,maxLength:99999,placeholder:v.placeholder,value:d,onChange:C.composeEventHandlers(t,s),onKeyDown:C.composeEventHandlers(e,o),disabled:!!c||v.isViewOnly,...i,children:n.jsx(Z,{})})}),Rn=a.ikp("button",{_id:"aiChatInput__SendButton"}),ft=t=>{const{handleSubmit:e,isSubmitDisabled:i,error:r}=P.useChat(),{aiChatSettings:s}=b.useInkeepConfig(),{onClick:o,...d}=t;return n.jsx(Rn,{onClick:C.composeEventHandlers(o,()=>e()),"aria-label":"Send message",disabled:i||!!r||s.isViewOnly,...d})},St=a.ikp(f.CustomIcon,{_id:"aiChatInput__SendButtonIcon",iconKey:"chatSubmit"}),On=a.ikp("div",{_id:"aiChatAttachmentsBar"}),xt=t=>{const e={supportedInputs:[]};return!e||!e.supportedInputs?.length?null:n.jsx(S.AttachmentsBarProvider,{children:n.jsx(On,{...t})})},qn=a.ikp("div",{_id:"aiChatAttachmentsBar__List"}),Bt=t=>{const{children:e,...i}=t,r=[];return n.jsx(qn,{children:u.maybeRender(e,r),...i})},Wn=a.ikp("div",{_id:"aiChatAttachmentsBar__Attachment"}),Tt=t=>{const{attachment:e,...i}=t;return n.jsx(D.AttachmentItemProvider,{attachment:e,children:n.jsx(Wn,{...i})})},Nn=a.ikp(y.BuiltInIconRenderer,{_id:"aiChatAttachmentsBar__AttachmentIcon"}),yt=t=>{const{attachment:e}=D.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?n.jsx(Nn,{iconSettings:i,...t}):null},Qn=a.ikp("span",{_id:"aiChatAttachmentsBar__AttachmentTitle"}),jt=t=>{const{attachment:e}=D.useAttachmentItem();return n.jsx(Qn,{children:e.title,...t})},Vn=a.ikp("button",{_id:"aiChatAttachmentsBar__AttachmentDelete"}),Ht=t=>{const{onClick:e,...i}=t,r=()=>{};return n.jsx(Vn,{"aria-label":"Remove attachment",children:n.jsx(f.CustomIcon,{iconKey:"close"}),onClick:C.composeEventHandlers(e,r),...i})},wt=a.ikp("div",{_id:"aiChatAttachmentsBar__Actions"}),Lt=a.ikp(L.Tooltip,{_id:"aiChatAttachmentsBar__InfoTip",delayDuration:0}),Dt=a.ikp(L.Trigger,{_id:"aiChatAttachmentsBar__InfoTipIcon",children:n.jsx(f.CustomIcon,{iconKey:"info"})}),oe=a.ikp(L.Arrow,{_id:"aiChatAttachmentsBar__InfoTipArrow"}),Rt=a.ikp(L.Content,{_id:"aiChatAttachmentsBar__InfoTipText",side:"bottom",sideOffset:3,align:"center",children:n.jsxs(n.Fragment,{children:[n.jsx(oe,{}),"Attachments will be kept in context for the entire conversation."]})}),$n=a.ikp("div",{_id:"aiChatAttachmentsBar__Inputs"}),Ot=t=>{const{children:e,...i}=t,r={supportedInputs:[]};return r?.supportedInputs?n.jsx($n,{children:u.maybeRender(e,r.supportedInputs),...i}):null},Un=a.ikp("button",{_id:"aiChatAttachmentsBar__Input"}),qt=t=>{const{input:e,onClick:i,...r}=t,s={supportedInputs:[]},o=[],d=()=>{},{selectInput:c,onOpen:m}=S.useAttachmentsBar(),l=()=>{if(e.type==="FUNCTIONAL_MULTI_ATTACHMENT")return s?e.onInvoke(s,e,d,[...o]):void 0;c(e),m()};return n.jsx(Un,{children:e.displayName,onClick:C.composeEventHandlers(i,l),...r})},Kn=a.ikp(_.Root,{_id:"aiChatAttachmentsBar__Modal"}),Wt=t=>{const{onOpenChange:e,...i}=t,{selectInput:r,isOpen:s,onClose:o,selectedInput:d}=S.useAttachmentsBar(),c=m=>{m||(o(),r(null))};return n.jsx(Kn,{open:s&&d!==null,onOpenChange:C.composeEventHandlers(e,c),...i})},Nt=a.ikp(_.Overlay,{_id:"aiChatAttachmentsBar__ModalOverlay"}),Qt=a.ikp(_.Content,{_id:"aiChatAttachmentsBar__ModalContent","aria-describedby":void 0}),Vt=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHeader"}),zn=a.ikp(_.Title,{_id:"aiChatAttachmentsBar__ModalHeading"}),$t=t=>{const{selectedInput:e}=S.useAttachmentsBar(),i=`Add ${e?.displayName}`;return n.jsx(zn,{children:i,...t})},Gn=a.ikp("span",{_id:"aiChatAttachmentsBar__ModalDescription"}),Ut=t=>{const{selectedInput:e}=S.useAttachmentsBar(),i=e?.workflowModalProps?.modalHelpText;return i?n.jsx(Gn,{children:i,...t}):null},Yn=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHelp"}),Kt=t=>{const{children:e,...i}=t,{selectedInput:r}=S.useAttachmentsBar(),s=r?.workflowModalProps?.modalHelpElement;return s?n.jsx(Yn,{asChild:!e,children:e||s,...i}):null},zt=a.ikp(_.Close,{_id:"aiChatAttachmentsBar__ModalClose",children:n.jsx(f.CustomIcon,{iconKey:"close"})}),Gt=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalBody"}),Jn=a.ikp("form",{_id:"aiChatAttachmentsBar__Form"}),Yt=t=>{const{onSubmit:e,...i}=t,{form:r}=S.useAttachmentsBar();return n.jsx(Jn,{onSubmit:C.composeEventHandlers(e,r.onSubmit),...i})},Jt=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),Xn=a.ikp("label",{_id:"aiChatAttachmentsBar__FormTitleLabel"}),Xt=t=>{const{form:e,selectedInput:i}=S.useAttachmentsBar();return n.jsx(Xn,{htmlFor:`${i?.id}-title`,children:e.labels.title,...t})},Zn=a.ikp("input",{_id:"aiChatAttachmentsBar__FormTitleInput"}),Zt=t=>{const{onChange:e,...i}=t,{form:r,selectedInput:s}=S.useAttachmentsBar();return n.jsx(Zn,{name:"title",value:r.data.title,id:`${s?.id}-title`,"data-invalid":u.dataAttr(!!r.errors.title),"aria-invalid":!!r.errors.title,onChange:C.composeEventHandlers(e,r.onChange),...i})},er=a.ikp("span",{_id:"aiChatAttachmentsBar__FormTitleError"}),ei=t=>{const{form:e}=S.useAttachmentsBar();return e.errors.title?n.jsx(er,{"aria-live":"polite",children:e.errors.title,...t}):null},ti=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),tr=a.ikp("label",{_id:"aiChatAttachmentsBar__FormContentLabel"}),ii=t=>{const{form:e,selectedInput:i}=S.useAttachmentsBar();return n.jsx(tr,{htmlFor:`${i?.id}-content`,children:e.labels.content,...t})},ir=a.ikp("textarea",{_id:"aiChatAttachmentsBar__FormTitleInput"}),ai=t=>{const{onChange:e,...i}=t,{form:r,selectedInput:s}=S.useAttachmentsBar();return n.jsx(ir,{asChild:!0,rows:4,name:"content",value:r.data.content,id:`${s?.id}-content`,"data-invalid":u.dataAttr(!!r.errors.content),"aria-invalid":!!r.errors.content,onChange:C.composeEventHandlers(e,r.onChange),...i,children:n.jsx(Z,{maxRows:10})})},ar=a.ikp("span",{_id:"aiChatAttachmentsBar__FormContentError"}),ni=t=>{const{form:e}=S.useAttachmentsBar();return e.errors.content?n.jsx(ar,{"aria-live":"polite",children:e.errors.content,...t}):null},ri=a.ikp("button",{_id:"aiChatAttachmentsBar__FormSubmitButton",children:"Upload",type:"submit"}),si=a.ikp("div",{_id:"aiChatActionBar"}),oi=a.ikp("div",{_id:"aiChat__ChatActions"}),di=a.ikp("div",{_id:"aiChatTagline__Container"}),ci=a.ikp("span",{_id:"aiChatTagline__Text",children:"Powered by"}),mi=a.ikp(_a.default,{_id:"aiChatTagline__Logo"}),li=a.ikp("a",{_id:"aiChatTagline__BrandName",children:"inkeep",href:"https://www.inkeep.com/",target:"_blank",rel:"noopener noreferrer"}),nr=a.ikp(L.Trigger,{_id:"aiChat__ChatAction"}),U=t=>{const{action:e,onClick:i,className:r,...s}=t,o={},{clear:d,stop:c,isLoading:m,isStreaming:l,messages:v}=P.useChat(),{conversationId:g}=P.useChat(),{aiChatSettings:p}=b.useInkeepConfig(),[A,B]=J.useCopyToClipboard(),[k]=J.useCopyToClipboard();if({help:!1,copy:v.length===0||!p.isCopyChatButtonVisible||m||l,share:v.length===0||!p.isShareButtonVisible||!g||!!o||m||l,clear:v.length===0||p.isViewOnly||m||l,stop:!m&&!l}[e])return null;const O={help:()=>{},copy:()=>{const ce=v.map(N=>{const G=`**${N.role==="assistant"?"AI Assistant":"User"}**`,Y=u.getMessageContent(N);return`${G}
|
|
5
|
+
How can I help?`,p={parts:[{type:"text",text:r.introMessage??`${d}${m}`}],id:Ha,...e,role:"assistant"};return n.jsx(se,{message:p,...i})}),an=a.ikp("div",{_id:"aiChatMessageHeader"}),qe=t=>{const{message:e}=_.useMessage();return n.jsx(an,{"data-role":e.role,...t})},nn=a.ikp("div",{_id:"aiChatMessageLoading",children:"Thinking..."}),We=t=>n.jsx(nn,{...t}),rn=a.ikp("div",{_id:"aiChatMessageAvatar"}),Ne=t=>{const{message:e}=_.useMessage();return n.jsx(rn,{"data-role":e.role,...t})},sn=a.ikp(re.Root,{_id:"aiChatMessageAvatarContent"}),Qe=t=>{const{message:e}=_.useMessage(),{baseSettings:i}=b.useInkeepConfig();return n.jsx(sn,{"data-username":u.dataAttr(e.role==="user"&&!!i.userProperties.name),"data-role":e.role,...t})},on=a.ikp(re.Fallback,{_id:"aiChatMessageAvatarFallback"}),Ve=h.memo(t=>{const{baseSettings:e}=b.useInkeepConfig(),{message:i}=_.useMessage();return e.userProperties.name?n.jsx(on,{"data-role":i.role,children:u.getInitials(e.userProperties.name),...t}):null}),me=a.ikp(re.Image,{_id:"aiChatMessageAvatarImage"}),$e=h.memo(t=>{const{onLoadingStatusChange:e,...i}=t,{aiChatSettings:r,baseSettings:{userProperties:s}}=b.useInkeepConfig(),{message:o}=_.useMessage(),{aiAssistantAvatar:d}=r??{},c=typeof d=="string"?d:d?.light,m=(typeof d=="string"?d:d?.dark)??c,l=fa.useColorModeValue(c,m),[p,g]=h.useState(l);h.useEffect(()=>{g(l)},[l]);const v=A=>{A==="error"&&g(null)};return o.role==="user"?s.name?null:r.userAvatar?n.jsx(me,{"data-type":"image",alt:"User avatar","data-role":o.role,src:r.userAvatar,...t}):n.jsx(Pa.default,{"data-type":"icon","data-role":o.role,...t}):p?n.jsx(me,{src:p,alt:"AI assistant avatar","data-type":"image","data-role":o.role,onLoadingStatusChange:C.composeEventHandlers(e,v),...i}):n.jsx(ga.default,{"data-type":"icon","data-role":o.role,...t})}),dn=a.ikp("span",{_id:"aiChatMessageName"}),Ue=t=>{const{message:e}=_.useMessage();return n.jsx(dn,{"data-role":e.role,children:e.role==="user"?"You":"AI assistant",...t})},cn=a.ikp("div",{_id:"aiChatMessageContentWrapper"}),Ke=t=>{const{message:e}=_.useMessage();return n.jsx(cn,{"data-role":e.role,...t})},mn=a.ikp("div",{_id:"aiChatMessageContent"}),ze=t=>{const{message:e}=_.useMessage();return n.jsx(mn,{"data-role":e.role,...t})},ln=a.ikp("div",{_id:"aiChatMessageAttachments"}),Ge=t=>{const{message:e}=_.useMessage(),i=[];return e.role!=="user"||!i?.length?null:n.jsx(q.MessageAttachmentsProvider,{children:n.jsx(ln,{...t})})},hn=a.ikp("div",{_id:"aiChatMessageAttachments__List"}),Ye=t=>{const{children:e,...i}=t,r=[];return r?n.jsx(hn,{children:u.maybeRender(e,r),...i}):null},un=a.ikp("div",{_id:"aiChatMessageAttachments__Item"}),Je=t=>{const{attachment:e,onClick:i,...r}=t,{selectItem:s,onOpen:o}=q.useMessageAttachments(),d=()=>{s(e),o()};return n.jsx(D.AttachmentItemProvider,{attachment:e,children:n.jsx(un,{onClick:C.composeEventHandlers(i,d),...r})})},Cn=a.ikp(T.BuiltInIconRenderer,{_id:"aiChatMessageAttachments__ItemIcon"}),Xe=t=>{const{attachment:e}=D.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?n.jsx(Cn,{iconSettings:i,...t}):null},pn=a.ikp("span",{_id:"aiChatMessageAttachments__ItemTitle"}),Ze=t=>{const{attachment:e}=D.useAttachmentItem();return n.jsx(pn,{children:e.title,...t})},vn=a.ikp(E.Root,{_id:"aiChatMessageAttachmentsPreview"}),et=t=>{const{onOpenChange:e,...i}=t,{selectItem:r,isOpen:s,onClose:o,selectedItem:d}=q.useMessageAttachments(),c=m=>{m||(o(),r(null))};return n.jsx(vn,{open:s&&d!==null,onOpenChange:C.composeEventHandlers(e,c),...i})},tt=a.ikp(E.Overlay,{_id:"aiChatMessageAttachmentsPreview__Overlay"}),it=a.ikp(E.Content,{_id:"aiChatMessageAttachmentsPreview__Content","aria-describedby":void 0}),bn=a.ikp(E.Title,{_id:"aiChatMessageAttachmentsPreview__Header"}),at=t=>{const{selectedItem:e}=q.useMessageAttachments();return n.jsx(bn,{children:e?.title||"Attachment",...t})},nt=a.ikp(E.Close,{_id:"aiChatMessageAttachmentsPreview__Close",children:n.jsx(f.CustomIcon,{iconKey:"close"})}),gn=a.ikp("p",{_id:"aiChatMessageAttachmentsPreview__Body"}),rt=t=>{const{selectedItem:e}=q.useMessageAttachments();return n.jsx(gn,{children:e?.content,...t})},st=t=>{const{text:e,componentStyles:i,...r}=t,{aiChatSettings:s}=b.useInkeepConfig(),{shouldOpenLinksInNewTab:o}=s;return n.jsx(Q.Markdown,{children:e,componentStyles:i,shouldOpenLinksInNewTab:o,...r})},ot=({name:t,props:e,componentDef:i})=>{const s=ya.useShadow()?.shadowHost,o=h.useRef(void 0),d=h.useRef(null),c=h.useRef(null),m=h.useRef(!1),[l,p]=h.useState(!1),[g,v]=h.useState(!1),A=h.useRef(i);h.useMemo(()=>{i!==A.current&&(typeof i=="function"&&typeof A.current=="function"?i.toString()!==A.current.toString()&&(A.current=i):A.current=i)},[i]);const B=A.current;return h.useEffect(()=>{o.current||(o.current=`dyn:${t}:${crypto.randomUUID()}`,p(!0))},[t]),h.useLayoutEffect(()=>{if(!B||!s||!l||!o.current)return;const k=o.current,I=document.createElement("div");return I.setAttribute("data-ikp-component",""),I.setAttribute("data-component",t),I.setAttribute("slot",k),d.current=I,m.current=!1,s.appendChild(I),v(!0),()=>{m.current=!0,v(!1),queueMicrotask(()=>{try{c.current&&(c.current.unmount(),c.current=null)}catch(M){console.debug("Ignoring unmount error:",M)}I.parentNode===s&&I.remove(),d.current=null})}},[B,s,l,t]),h.useEffect(()=>{const k=d.current;if(!k||m.current)return;const I=x=>{if(typeof x!="function"||x.length>1)return!1;try{if(typeof x=="function"&&x.constructor===Function){const O=x({});return h.isValidElement(O)}return!1}catch{return!0}};let M;if(I(B))try{const x=B;M=h.createElement(x,e||{})}catch(x){console.error("Error creating React element from component:",x);return}else if(typeof B=="function")M=B(e||{},k,null);else{console.error("Invalid component definition");return}if(h.isValidElement(M)||typeof M=="string"){if(m.current)return;c.current||(c.current=ja.createRoot(k)),!m.current&&c.current&&c.current.render(M);return}c.current&&!m.current&&c.current.render(null)},[i,e,g]),n.jsx("slot",{name:o.current})},Pn=a.ikp("div",{_id:"aiChatMessagePart"}),An=a.ikp("div",{_id:"aiChatMessageToolbar"}),dt=t=>{const{isLoading:e,messages:i}=P.useChat(),{message:r}=_.useMessage();return i.at(-1)?.id===r?.id&&e||r.role==="user"?null:n.jsx(An,{...t})},_n=a.ikp("div",{_id:"aiChatMessageCustomActions"}),ct=t=>{const{children:e,...i}=t,{aiChatSettings:r}=b.useInkeepConfig(),{message:s}=_.useMessage(),{isStreaming:o,messages:d}=P.useChat(),c=d.at(-1)?.id===s?.id,m=s.role==="assistant",l=r.messageActions||[];return c&&o||!m?null:n.jsx(_n,{children:u.maybeRender(e,l),...i})},En=a.ikp("a",{_id:"aiChatMessageCustomAction"}),Fn=a.ikp("button",{_id:"aiChatMessageCustomAction"}),mt=t=>{const{onClick:e,action:i,...r}=t,{message:s}=_.useMessage(),{handleAction:o}=te.useChatAction(i,s.id),{logEvent:d}=ne.useBaseEvents(),{conversationId:c}=P.useChat(),m=()=>{o(),d({eventName:"user_escalation_indicated",properties:{escalationType:"contact_us",conversationId:c}})},l=i.label,p=n.jsxs(n.Fragment,{children:[i.icon&&n.jsx(T.BuiltInIconRenderer,{iconSettings:i.icon}),l]});return i.action.type==="open_link"?n.jsx(En,{href:i.action.url,target:"_blank",rel:"noopener","data-type":i.action.type,onClick:C.composeEventHandlers(e,m),children:p,...r}):n.jsx(Fn,{"data-type":i.action.type,onClick:C.composeEventHandlers(e,m),children:p,...r})},kn=a.ikp("button",{_id:"aiChatMessageAction"}),lt=t=>{const{action:e,onClick:i,className:r,...s}=t,{conversationId:o}=P.useChat(),{baseSettings:{onFeedback:d}}=b.useInkeepConfig(),{message:c}=_.useMessage(),{isStreaming:m,messages:l}=P.useChat(),[p,g]=J.useCopyToClipboard(),{feedback:v,submitPositiveFeedback:A,setCurrentFeedback:B,currentFeedback:k}=ee.useMessageFeedback(),{logEvent:I}=ne.useBaseEvents(),[M,x]=Ea.useSettleAction(),O=l.at(-1)?.id===c?.id,z=c.role==="assistant";if(O&&m||!z)return null;const N={copy(){g(u.getMessageContent(c)),I({eventName:"assistant_message_copied",properties:{conversationId:o}})},upvote(){A(c.id).then(()=>{x()})},downvote(){B(c.id)}},G={copy:"Copy Message",upvote:"Upvote Message",downvote:"Downvote Message"},Y={copy:n.jsx(f.CustomIcon,{iconKey:p?"messageCopied":"messageCopy"}),upvote:n.jsx(f.CustomIcon,{iconKey:M?"messageCopied":"thumbsUp"}),downvote:n.jsx(f.CustomIcon,{iconKey:"thumbsDown"})},la={copy:{"data-copied":u.dataAttr(p)},upvote:{"data-upvoted":u.dataAttr(v[c.id]?.type==="positive")},downvote:{"data-downvoted":u.dataAttr(v[c.id]?.type==="negative"),"data-state":k===null?"closed":"open"}};return{copy:!1,upvote:!d,downvote:!d}[e]?null:n.jsx(kn,{"data-action":e,...la[e],children:Y[e],"aria-label":G[e],className:`${r} ${e}`,onClick:C.composeEventHandlers(i,N[e]),...s})},In=a.ikp("div",{_id:"aiChatMessageSources"}),ht=t=>{const{message:e}=_.useMessage();return e.role!=="assistant"||!e.parts.filter(r=>r.type==="data-artifact"&&r.data?.type?.toLowerCase()==="citation")?.length?null:n.jsx(In,{...t})},Mn=a.ikp("div",{_id:"aiChatMessageSources__Header"}),ut=t=>n.jsx(Mn,{children:"Sources",...t}),fn=a.ikp("div",{_id:"aiChatMessageSources__List"}),Ct=t=>{const{message:e}=_.useMessage(),{children:i,...r}=t,{baseSettings:{transformSource:s,organizationDisplayName:o},aiChatSettings:{shouldOpenLinksInNewTab:d},searchSettings:{tabs:c}}=b.useInkeepConfig();if(e.role!=="assistant")return null;const m=e.parts.filter(g=>g.type==="data-artifact"&&g.data?.type?.toLowerCase()==="citation");if(!m?.length)return null;const l=new Map,p=m.filter(g=>{const v=g.data.artifactSummary.url;return!v||l.has(v)?!1:(l.set(v,!0),!0)}).map(g=>{const v=g.data,A={id:v?.artifactId,title:v?.artifactSummary?.title||v?.name,url:v?.artifactSummary?.url||"",description:"",breadcrumbs:[],type:v?.artifactSummary?.record_type,contentType:v?.artifactType,tag:v?.artifactType},k=(s??(M=>({...M,shouldOpenInNewTab:d,icon:Ta.getIcon(M)})))(A,"chatSourceItem",{organizationDisplayName:o,tabs:c}),I=k.shouldOpenInNewTab!==void 0?k.shouldOpenInNewTab:d;return{...k,isExternal:I}});return n.jsx(fn,{children:u.maybeRender(i,p),...r})},Sn=a.ikp(Aa.LinkWithQueryParams,{_id:"aiChatMessageSourceItem"}),pt=t=>{const{source:e,onClick:i,...r}=t,{logEvent:s}=ne.useBaseEvents(),{conversationId:o}=P.useChat(),d=()=>{s({eventName:"assistant_source_item_clicked",properties:{conversationId:o,link:e}})};return n.jsx(j.SourceItemProvider,{source:e,children:n.jsx(Sn,{"data-type":e.type,appendToUrl:e.appendToUrl,isExternal:e.isExternal,"data-breadcrumbs":!!e.breadcrumbs?.length,onClick:C.composeEventHandlers(i,d),...r})})},xn=a.ikp("div",{_id:"aiChatMessageSourceItem__Breadcrumbs"}),vt=t=>{const{source:e}=j.useSourceItem();return e.breadcrumbs?.length?n.jsx(xn,{"data-type":e.type,...t}):null},Bn=a.ikp(f.CustomIcon,{_id:"aiChatMessageSourceItem__BreadcrumbIcon",iconKey:"breadcrumbSeparator"}),yn=a.ikp(T.BuiltInIconRenderer,{_id:"aiChatMessageSourceItem__Icon"}),bt=t=>{const{source:e}=j.useSourceItem();return n.jsx(yn,{iconSettings:e.icon,"data-type":e.type,...t})},Tn=a.ikp("span",{_id:"aiChatMessageSourceItem__Title"}),gt=t=>{const{source:e}=j.useSourceItem();return n.jsx(Tn,{"data-type":e.type,children:e.title,...t})},jn=a.ikp("span",{_id:"aiChatMessageSourceItem__Tag"}),Pt=t=>{const{source:e}=j.useSourceItem();return n.jsx(jn,{"data-type":e.type,...t})},Hn=a.ikp("span",{_id:"aiChatMessageSourceItem__Description"}),At=t=>{const{source:e}=j.useSourceItem(),{children:i,...r}=t,s=h.useMemo(()=>e.description?Ia.highlightEmphasis(e.description):[],[e.description]);return s.length?n.jsx(Hn,{"data-type":e.type,children:u.maybeRender(i,s),...r}):null},wn=a.ikp("span",{_id:"aiChatMessageSourceItem__DescriptionPart"}),_t=t=>{const{part:e,...i}=t,{source:r}=j.useSourceItem();return typeof e=="string"?e:n.jsx(wn,{"data-type":r.type,children:e.content,"data-highlighted":u.dataAttr(e.highlighted),...i})},Ln=a.ikp(f.CustomIcon,{_id:"aiChatMessageSourceItem__Indicator"}),Et=t=>{const{source:e}=j.useSourceItem();return n.jsx(Ln,{iconKey:e.isExternal?"openLinkInNewTab":"openLinkInSameTab",...t})},Ft=a.ikp("div",{_id:"aiChatFooter"}),kt=a.ikp("div",{_id:"aiChatInput__Fieldset"}),It=a.ikp("div",{_id:"aiChatInput__Group"}),Dn=a.ikp("textarea",{_id:"aiChatInput"}),Mt=h.forwardRef(({onChange:t,onKeyDown:e,...i},r)=>{const{handleInputChange:s,handleInputKeyDown:o,input:d,error:c,shouldAutoFocusInput:m,inputRef:l}=P.useChat(),{aiChatSettings:p}=b.useInkeepConfig(),g=ie.useComposedRefs(r,l);return Ba.useWidgetAutoFocus("chat",l,m),n.jsx(Dn,{asChild:!0,ref:g,maxLength:99999,placeholder:p.placeholder,value:d,onChange:C.composeEventHandlers(t,s),onKeyDown:C.composeEventHandlers(e,o),disabled:!!c||p.isViewOnly,...i,children:n.jsx(Z,{})})}),Rn=a.ikp("button",{_id:"aiChatInput__SendButton"}),ft=t=>{const{handleSubmit:e,isSubmitDisabled:i,error:r}=P.useChat(),{aiChatSettings:s}=b.useInkeepConfig(),{onClick:o,...d}=t;return n.jsx(Rn,{onClick:C.composeEventHandlers(o,()=>e()),"aria-label":"Send message",disabled:i||!!r||s.isViewOnly,...d})},St=a.ikp(f.CustomIcon,{_id:"aiChatInput__SendButtonIcon",iconKey:"chatSubmit"}),On=a.ikp("div",{_id:"aiChatAttachmentsBar"}),xt=t=>{const e={supportedInputs:[]};return!e||!e.supportedInputs?.length?null:n.jsx(S.AttachmentsBarProvider,{children:n.jsx(On,{...t})})},qn=a.ikp("div",{_id:"aiChatAttachmentsBar__List"}),Bt=t=>{const{children:e,...i}=t,r=[];return n.jsx(qn,{children:u.maybeRender(e,r),...i})},Wn=a.ikp("div",{_id:"aiChatAttachmentsBar__Attachment"}),yt=t=>{const{attachment:e,...i}=t;return n.jsx(D.AttachmentItemProvider,{attachment:e,children:n.jsx(Wn,{...i})})},Nn=a.ikp(T.BuiltInIconRenderer,{_id:"aiChatAttachmentsBar__AttachmentIcon"}),Tt=t=>{const{attachment:e}=D.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?n.jsx(Nn,{iconSettings:i,...t}):null},Qn=a.ikp("span",{_id:"aiChatAttachmentsBar__AttachmentTitle"}),jt=t=>{const{attachment:e}=D.useAttachmentItem();return n.jsx(Qn,{children:e.title,...t})},Vn=a.ikp("button",{_id:"aiChatAttachmentsBar__AttachmentDelete"}),Ht=t=>{const{onClick:e,...i}=t,r=()=>{};return n.jsx(Vn,{"aria-label":"Remove attachment",children:n.jsx(f.CustomIcon,{iconKey:"close"}),onClick:C.composeEventHandlers(e,r),...i})},wt=a.ikp("div",{_id:"aiChatAttachmentsBar__Actions"}),Lt=a.ikp(L.Tooltip,{_id:"aiChatAttachmentsBar__InfoTip",delayDuration:0}),Dt=a.ikp(L.Trigger,{_id:"aiChatAttachmentsBar__InfoTipIcon",children:n.jsx(f.CustomIcon,{iconKey:"info"})}),oe=a.ikp(L.Arrow,{_id:"aiChatAttachmentsBar__InfoTipArrow"}),Rt=a.ikp(L.Content,{_id:"aiChatAttachmentsBar__InfoTipText",side:"bottom",sideOffset:3,align:"center",children:n.jsxs(n.Fragment,{children:[n.jsx(oe,{}),"Attachments will be kept in context for the entire conversation."]})}),$n=a.ikp("div",{_id:"aiChatAttachmentsBar__Inputs"}),Ot=t=>{const{children:e,...i}=t,r={supportedInputs:[]};return r?.supportedInputs?n.jsx($n,{children:u.maybeRender(e,r.supportedInputs),...i}):null},Un=a.ikp("button",{_id:"aiChatAttachmentsBar__Input"}),qt=t=>{const{input:e,onClick:i,...r}=t,s={supportedInputs:[]},o=[],d=()=>{},{selectInput:c,onOpen:m}=S.useAttachmentsBar(),l=()=>{if(e.type==="FUNCTIONAL_MULTI_ATTACHMENT")return s?e.onInvoke(s,e,d,[...o]):void 0;c(e),m()};return n.jsx(Un,{children:e.displayName,onClick:C.composeEventHandlers(i,l),...r})},Kn=a.ikp(E.Root,{_id:"aiChatAttachmentsBar__Modal"}),Wt=t=>{const{onOpenChange:e,...i}=t,{selectInput:r,isOpen:s,onClose:o,selectedInput:d}=S.useAttachmentsBar(),c=m=>{m||(o(),r(null))};return n.jsx(Kn,{open:s&&d!==null,onOpenChange:C.composeEventHandlers(e,c),...i})},Nt=a.ikp(E.Overlay,{_id:"aiChatAttachmentsBar__ModalOverlay"}),Qt=a.ikp(E.Content,{_id:"aiChatAttachmentsBar__ModalContent","aria-describedby":void 0}),Vt=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHeader"}),zn=a.ikp(E.Title,{_id:"aiChatAttachmentsBar__ModalHeading"}),$t=t=>{const{selectedInput:e}=S.useAttachmentsBar(),i=`Add ${e?.displayName}`;return n.jsx(zn,{children:i,...t})},Gn=a.ikp("span",{_id:"aiChatAttachmentsBar__ModalDescription"}),Ut=t=>{const{selectedInput:e}=S.useAttachmentsBar(),i=e?.workflowModalProps?.modalHelpText;return i?n.jsx(Gn,{children:i,...t}):null},Yn=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHelp"}),Kt=t=>{const{children:e,...i}=t,{selectedInput:r}=S.useAttachmentsBar(),s=r?.workflowModalProps?.modalHelpElement;return s?n.jsx(Yn,{asChild:!e,children:e||s,...i}):null},zt=a.ikp(E.Close,{_id:"aiChatAttachmentsBar__ModalClose",children:n.jsx(f.CustomIcon,{iconKey:"close"})}),Gt=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalBody"}),Jn=a.ikp("form",{_id:"aiChatAttachmentsBar__Form"}),Yt=t=>{const{onSubmit:e,...i}=t,{form:r}=S.useAttachmentsBar();return n.jsx(Jn,{onSubmit:C.composeEventHandlers(e,r.onSubmit),...i})},Jt=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),Xn=a.ikp("label",{_id:"aiChatAttachmentsBar__FormTitleLabel"}),Xt=t=>{const{form:e,selectedInput:i}=S.useAttachmentsBar();return n.jsx(Xn,{htmlFor:`${i?.id}-title`,children:e.labels.title,...t})},Zn=a.ikp("input",{_id:"aiChatAttachmentsBar__FormTitleInput"}),Zt=t=>{const{onChange:e,...i}=t,{form:r,selectedInput:s}=S.useAttachmentsBar();return n.jsx(Zn,{name:"title",value:r.data.title,id:`${s?.id}-title`,"data-invalid":u.dataAttr(!!r.errors.title),"aria-invalid":!!r.errors.title,onChange:C.composeEventHandlers(e,r.onChange),...i})},er=a.ikp("span",{_id:"aiChatAttachmentsBar__FormTitleError"}),ei=t=>{const{form:e}=S.useAttachmentsBar();return e.errors.title?n.jsx(er,{"aria-live":"polite",children:e.errors.title,...t}):null},ti=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),tr=a.ikp("label",{_id:"aiChatAttachmentsBar__FormContentLabel"}),ii=t=>{const{form:e,selectedInput:i}=S.useAttachmentsBar();return n.jsx(tr,{htmlFor:`${i?.id}-content`,children:e.labels.content,...t})},ir=a.ikp("textarea",{_id:"aiChatAttachmentsBar__FormTitleInput"}),ai=t=>{const{onChange:e,...i}=t,{form:r,selectedInput:s}=S.useAttachmentsBar();return n.jsx(ir,{asChild:!0,rows:4,name:"content",value:r.data.content,id:`${s?.id}-content`,"data-invalid":u.dataAttr(!!r.errors.content),"aria-invalid":!!r.errors.content,onChange:C.composeEventHandlers(e,r.onChange),...i,children:n.jsx(Z,{maxRows:10})})},ar=a.ikp("span",{_id:"aiChatAttachmentsBar__FormContentError"}),ni=t=>{const{form:e}=S.useAttachmentsBar();return e.errors.content?n.jsx(ar,{"aria-live":"polite",children:e.errors.content,...t}):null},ri=a.ikp("button",{_id:"aiChatAttachmentsBar__FormSubmitButton",children:"Upload",type:"submit"}),si=a.ikp("div",{_id:"aiChatActionBar"}),oi=a.ikp("div",{_id:"aiChat__ChatActions"}),di=a.ikp("div",{_id:"aiChatTagline__Container"}),ci=a.ikp("span",{_id:"aiChatTagline__Text",children:"Powered by"}),mi=a.ikp(_a.default,{_id:"aiChatTagline__Logo"}),li=a.ikp("a",{_id:"aiChatTagline__BrandName",children:"inkeep",href:"https://www.inkeep.com/",target:"_blank",rel:"noopener noreferrer"}),nr=a.ikp(L.Trigger,{_id:"aiChat__ChatAction"}),U=t=>{const{action:e,onClick:i,className:r,...s}=t,o={},{clear:d,stop:c,isLoading:m,isStreaming:l,messages:p}=P.useChat(),{conversationId:g}=P.useChat(),{aiChatSettings:v}=b.useInkeepConfig(),[A,B]=J.useCopyToClipboard(),[k]=J.useCopyToClipboard();if({help:!1,copy:p.length===0||!v.isCopyChatButtonVisible||m||l,share:p.length===0||!v.isShareButtonVisible||!g||!!o||m||l,clear:p.length===0||v.isViewOnly||m||l,stop:!m&&!l}[e])return null;const O={help:()=>{},copy:()=>{const ce=p.map(N=>{const G=`**${N.role==="assistant"?"AI Assistant":"User"}**`,Y=u.getMessageContent(N);return`${G}
|
|
6
6
|
|
|
7
7
|
${Y}`}).join(`
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
`);B(ce)},share:async()=>{},clear:d,stop:c},z={copy:A,share:k};return n.jsx(L.Tooltip,{delayDuration:0,open:z[e],children:n.jsx(nr,{"data-type":e,"data-copied":u.dataAttr(A||k),className:`${r} ${e}`,children:n.jsx(de,{action:e}),onClick:C.composeEventHandlers(i,O[e]),...s})})},rr=a.ikp("span",{_id:"aiChat__ChatActionLabel"}),de=t=>{const{action:e,...i}=t,{aiChatSettings:r}=b.useInkeepConfig(),s=r.toolbarButtonLabels??{},o={help:s.getHelp??"Get Help",copy:s.copyChat??"Copy",share:s.share??"Share",clear:s.clear??"Clear",stop:s.stop??"Stop"};return n.jsx(rr,{children:o[e],...i})},sr=a.ikp(L.TooltipContent,{_id:"aiChat__ChatActionFeeback"}),hi=t=>{const{action:e,children:i,...r}=t,s={copy:"Copied!",share:"Link copied!"};return n.jsxs(sr,{sideOffset:5,...r,children:[n.jsx(L.Arrow,{}),i||s[e]]})},or=a.ikp(w.Root,{_id:"aiChatHelpActions"}),ui=t=>{const{children:e,...i}=t,{aiChatSettings:r}=b.useInkeepConfig(),{getHelpOptions:s}=r;if(!s||(s??[]).length===0)return null;const{_pinned:o,_unpinned:d}=s.reduce((v,g)=>{const p=g.isPinnedToToolbar?"_pinned":"_unpinned";return{...v,[p]:[...v[p],g]}},{_pinned:[],_unpinned:[]}),c=d.length===1?[...o,d[0]]:o,m=d.length===1?[]:d,l=X.useHelpMenuState();return n.jsx(X.HelpMenuProvider,{value:l,children:n.jsx(or,{open:l.open,onOpenChange:l.setOpen,children:u.maybeRender(e,{pinned:c,unpinned:m}),...i})})},dr=a.ikp(U,{_id:"aiChatHelpAction",action:"help"}),cr=a.ikp("a",{_id:"aiChatHelpAction",target:"_blank",rel:"noreferrer"}),Ci=t=>{const{action:e,onClick:i,...r}=t,{handleAction:s,logHelpAction:o}=te.useChatAction(e),d=e.action.type,c={"aria-label":e.name,"data-name":e.name,children:e.name,onClick:C.composeEventHandlers(i,()=>{s(),o()}),...r};return d==="open_link"?n.jsx(cr,{href:e.action.url,...c}):n.jsx(dr,{...c})},mr=a.ikp(w.Trigger,{_id:"aiChatHelpActions__Trigger"}),pi=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig();return n.jsx(U,{action:"help",...t,asChild:!0,children:n.jsx(mr,{children:e.toolbarButtonLabels?.getHelp??"Get Help"})})}),lr=a.ikp(w.Content,{_id:"aiChatHelpActions__Menu"}),vi=t=>n.jsx(lr,{side:"top",sideOffset:8,align:"center",alignOffset:-10,...t}),bi=a.ikp(w.Arrow,{_id:"aiChatHelpActions__MenuArrow"}),gi=t=>{const{action:e,onClick:i,...r}=t,{handleAction:s,logHelpAction:o}=te.useChatAction(e),{setOpen:d}=X.useHelpMenu(),c=()=>{s({onOpenForm:()=>d(!1)}),o()},m=e.action.type,l=a.ikp(m==="open_link"?"a":"button",{_id:"aiChatHelpActions__MenuItem",children:e.name,"aria-label":e.name,"data-name":e.name,"data-type":e.action.type,...m==="open_link"&&{href:e.action.url,target:"_blank",rel:"noopener"},onClick:C.composeEventHandlers(i,c)});return n.jsx(l,{...r})},hr=a.ikp(y.BuiltInIconRenderer,{_id:"aiChatHelpActions_MenuItemIcon"}),Pi=t=>{const{action:e,...i}=t;return e.icon?n.jsx(hr,{iconSettings:e.icon,...i}):null},ur=a.ikp(_.Root,{_id:"aiChatFeedbackModal"}),Ai=t=>{const{onOpenChange:e,...i}=t,{currentFeedback:r,setCurrentFeedback:s}=ee.useMessageFeedback();return n.jsx(ur,{open:r!==null,onOpenChange:C.composeEventHandlers(e,()=>s(null)),...i})},_i=a.ikp(_.Overlay,{_id:"aiChatFeedbackModal__Overlay"}),Ei=a.ikp(_.Content,{_id:"aiChatFeedbackModal__Content","aria-describedby":void 0}),Fi=a.ikp(_.Title,{_id:"aiChatFeedbackModal__Header",children:"Help improve my answers!"}),ki=a.ikp(_.Close,{_id:"aiChatFeedbackModal__Close",children:n.jsx(f.CustomIcon,{iconKey:"close"})}),Ii=a.ikp("div",{_id:"aiChatFeedbackModal__Body"}),Cr=a.ikp("form",{_id:"aiChatFeedbackForm"}),Mi=t=>{const{onSubmit:e,...i}=t,{submitNegativeFeedback:r,currentFeedback:s,setCurrentFeedback:o}=ee.useMessageFeedback(),d=c=>{c.preventDefault();const m=c.target,l=new FormData(m),v=Object.fromEntries(l.entries());s&&(r(s,v),o(null))};return n.jsx(Cr,{onSubmit:C.composeEventHandlers(e,d),...i})},pr=a.ikp("div",{_id:"aiChatFeedbackItem"}),fi=t=>{const{name:e,...i}=t;return n.jsx(V.FeedbackItemProvider,{name:e,children:n.jsx(pr,{...i})})},vr=a.ikp($.Root,{_id:"aiChatFeedbackItem__Checkbox"}),Si=t=>{const{name:e,focusItem:i}=V.useFeedbackItem(),{onCheckedChange:r,...s}=t,o=d=>{d&&i?.current?.focus()};return n.jsx(vr,{id:`feedback-${e}`,name:e,onCheckedChange:C.composeEventHandlers(r,o),...s})},xi=a.ikp($.Indicator,{_id:"aiChatFeedbackItem__CheckboxIndicator",children:n.jsx(le.CheckboxIcon,{})}),br=a.ikp("label",{_id:"aiChatFeedbackItem__Label"}),Bi=t=>{const{name:e}=V.useFeedbackItem(),i={unrelated_response:"Didn't answer my question",inaccurate_statement:"Inaccurate statement",inaccurate_code_snippet:"Inaccurate code snippet",irrelevant_citations:"Irrelevant citations"};return n.jsx(br,{htmlFor:`feedback-${e}`,children:i[e],...t})},gr=a.ikp("textarea",{_id:"aiChatFeedbackItem__Description",placeholder:"Please describe"}),Ti=t=>{const{name:e,focusItem:i}=V.useFeedbackItem();return n.jsx(gr,{ref:i,name:`${e}:description`,...t})},yi=a.ikp("button",{_id:"aiChatFeedbackForm__SubmitButton",children:"Submit",type:"submit"}),Pr=a.ikp("div",{_id:"aiChatForm__Wrapper"}),ji=t=>{const{form:e}=F.useChatForm();return e?n.jsx(Pr,{...t}):null},Ar=a.ikp("form",{_id:"aiChatForm"}),Hi=t=>{const{onSubmit:e,...i}=t,{conversationId:r,messages:s}=P.useChat(),{handleSubmit:o,isSuccess:d}=F.useChatForm();return d?null:n.jsx(Ar,{onSubmit:C.composeEventHandlers(e,c=>o(c,{id:r,messages:s})),...i})},_r=a.ikp("button",{_id:"aiChatForm__Close",children:n.jsx(f.CustomIcon,{iconKey:"close"})}),wi=t=>{const{onClick:e,...i}=t,{closeForm:r}=F.useChatForm();return n.jsx(_r,{onClick:C.composeEventHandlers(e,r),...i})},Li=a.ikp("div",{_id:"aiChatForm__Header"}),Er=a.ikp("h2",{_id:"aiChatForm__Heading"}),Di=t=>{const{form:e}=F.useChatForm();return e?.heading?n.jsx(Er,{children:e.heading,...t}):null},Fr=a.ikp(Q.Markdown,{_id:"aiChatForm__Description"}),Ri=t=>{const{form:e}=F.useChatForm();return e?.description?n.jsx(Fr,{children:e.description,...t}):null},kr=a.ikp("div",{_id:"aiChatForm__Content"}),Oi=t=>{const{children:e,...i}=t,{getFields:r}=F.useChatForm(),{conversationId:s}=P.useChat(),o=r(s)||[];return n.jsx(kr,{children:u.maybeRender(e,o),...i})},Ir=a.ikp("div",{_id:"aiChatForm__Field"}),qi=t=>{const{field:e,autoFocus:i,...r}=t,{control:s,errors:o}=F.useChatForm();return n.jsx(ka.Controller,{name:e.name,control:s,rules:{required:e.isRequired?`${e.label} is required.`:void 0},render:({field:d})=>{const c=d.value!==void 0||e.inputType==="file";return n.jsx(H.FormFieldProvider,{"data-invalid":u.dataAttr(!!o[e.name]),field:e,fieldProps:d,autoFocus:i,children:c&&n.jsx(Ir,{"data-input-type":e.inputType,"data-hidden":u.dataAttr(e.isHidden),...r})})}})},Mr=a.ikp("label",{_id:"aiChatForm__FieldLabel"}),Wi=t=>{const{field:e}=H.useFormField();return n.jsx(Mr,{"data-required":u.dataAttr(e.isRequired),htmlFor:e.name,children:e.label,...t})},fr=a.ikp("input",{_id:"aiChatForm__FieldText",type:"text"}),K=t=>{const{field:e,error:i,fieldProps:{onChange:r,onBlur:s,...o},autoFocus:d}=H.useFormField(),{onChange:c,onBlur:m,...l}=t;return n.jsx(fr,{id:e.name,autoFocus:d,placeholder:"placeholder"in e?e.placeholder:void 0,"data-invalid":u.dataAttr(!!i),onChange:C.composeEventHandlers(c,r),onBlur:C.composeEventHandlers(m,s),...o,...l})},Ni=a.ikp(K,{_id:"aiChatForm__FieldEmail",type:"email"}),Sr=a.ikp("input",{_id:"aiChatForm__FieldFile",type:"file",multiple:!0}),Qi=t=>{const{field:e,error:i,fieldProps:{value:r,onChange:s,onBlur:o,...d},autoFocus:c}=H.useFormField(),{onChange:m,onBlur:l,...v}=t,g=p=>{const A=p.target.files;s(A)};return n.jsx(Sr,{id:e.name,autoFocus:c,"data-value":r,"data-invalid":u.dataAttr(!!i),...v,...d,onChange:C.composeEventHandlers(m,g),onBlur:C.composeEventHandlers(l,o)})},Vi=a.ikp(K,{_id:"aiChatForm__FieldTextArea",type:"textarea",asChild:!0,children:n.jsx(Z,{maxRows:8})}),xr=a.ikp($.Root,{_id:"aiChatForm__FieldCheckbox"}),$i=t=>{const{field:e,error:i,fieldProps:r,autoFocus:s}=H.useFormField(),{onCheckedChange:o,...d}=t;return n.jsx(xr,{id:e.name,name:e.name,autoFocus:s,"data-invalid":u.dataAttr(!!i),checked:r.value,onCheckedChange:C.composeEventHandlers(o,r.onChange),...d})},Ui=a.ikp($.Indicator,{_id:"aiChatForm__FieldCheckboxIndicator",children:n.jsx(le.CheckboxIcon,{})}),Br=a.ikp(T.Root,{_id:"aiChatForm__FieldSelect"}),Ki=t=>{const{field:e,error:i,fieldProps:r}=H.useFormField(),{onValueChange:s,...o}=t;return n.jsx(Br,{name:e.name,"data-invalid":u.dataAttr(!!i),value:r.value,onValueChange:C.composeEventHandlers(s,r.onChange),...o})},zi=a.ikp(T.Trigger,{_id:"aiChatForm__FieldSelect__Trigger"}),Tr=a.ikp(T.Value,{_id:"aiChatForm__FieldSelect__Value"}),Gi=t=>{const{field:e}=H.useFormField();return n.jsx(Tr,{placeholder:"placeholder"in e?e.placeholder:void 0,...t})},Yi=a.ikp(T.Icon,{_id:"aiChatForm__FieldSelect__Icon",asChild:!0,children:n.jsx(y.BuiltInIconRenderer,{iconSettings:{builtIn:"LuChevronDown"}})}),Ji=a.ikp(T.Content,{_id:"aiChatForm__FieldSelect__Content",position:"popper"}),Xi=a.ikp(T.Viewport,{_id:"aiChatForm__FieldSelect__Viewport"}),Zi=a.ikp(T.Item,{_id:"aiChatForm__FieldSelect__Item"}),ea=a.ikp(T.ItemText,{_id:"aiChatForm__FieldSelect__ItemText"}),ta=a.ikp(T.ItemIndicator,{_id:"aiChatForm__FieldSelect__ItemIndicator",asChild:!0,children:n.jsx(y.BuiltInIconRenderer,{iconSettings:{builtIn:"LuCheck"}})}),yr=a.ikp("span",{_id:"aiChatForm__FieldError"}),ia=t=>{const{error:e}=H.useFormField();return e?n.jsx(yr,{children:e.message?.toString(),...t}):null},jr=a.ikp("span",{_id:"aiChatForm__Error"}),aa=t=>{const{formError:e}=F.useChatForm();return e?n.jsx(jr,{children:e.message,...t}):null},na=a.ikp("div",{_id:"aiChatForm__Footer"}),Hr=a.ikp("button",{_id:"aiChatForm__Cancel",children:"Cancel",type:"button"}),ra=t=>{const{onClick:e,...i}=t,{closeForm:r}=F.useChatForm();return n.jsx(Hr,{onClick:C.composeEventHandlers(e,r),...i})},wr=a.ikp("button",{_id:"aiChatForm__Submit",children:"Submit",type:"submit"}),sa=t=>{const{onClick:e,...i}=t,{isSubmitting:r,form:s}=F.useChatForm(),o=s?.buttons.submit.label||"Submit";return n.jsx(wr,{disabled:r,...i,children:o})},Lr=a.ikp("div",{_id:"aiChatForm__Success"}),oa=t=>{const{isSuccess:e}=F.useChatForm();return e?n.jsx(Lr,{...t}):null},Dr=a.ikp("h2",{_id:"aiChatForm__SuccessHeading"}),da=t=>{const{form:e}=F.useChatForm();return n.jsx(Dr,{children:e?.successView?.heading,...t})},Rr=a.ikp(Q.Markdown,{_id:"aiChatForm__SuccessMessage"}),ca=t=>{const{form:e}=F.useChatForm();return n.jsx(Rr,{children:e?.successView?.message,...t})},Or=a.ikp("button",{_id:"aiChatForm__SuccessButton"}),ma=t=>{const{onClick:e,...i}=t,{form:r,closeForm:s}=F.useChatForm(),o=r?.successView?.doneButton;if(!o)return null;const d=o.icon&&n.jsx(y.BuiltInIconRenderer,{iconSettings:o.icon}),c=o.label;return n.jsx(Or,{onClick:C.composeEventHandlers(e,s),children:n.jsxs(n.Fragment,{children:[d,c]}),...i})};exports.Provider=P.ChatProvider;exports.ActionBar=si;exports.Actions=oi;exports.AttachmentsBar=xt;exports.AttachmentsBarActions=wt;exports.AttachmentsBarAttachment=Tt;exports.AttachmentsBarAttachmentDelete=Ht;exports.AttachmentsBarAttachmentIcon=yt;exports.AttachmentsBarAttachmentTitle=jt;exports.AttachmentsBarForm=Yt;exports.AttachmentsBarFormContent=ti;exports.AttachmentsBarFormContentError=ni;exports.AttachmentsBarFormContentInput=ai;exports.AttachmentsBarFormContentLabel=ii;exports.AttachmentsBarFormSubmitButton=ri;exports.AttachmentsBarFormTitle=Jt;exports.AttachmentsBarFormTitleError=ei;exports.AttachmentsBarFormTitleInput=Zt;exports.AttachmentsBarFormTitleLabel=Xt;exports.AttachmentsBarInfoTip=Lt;exports.AttachmentsBarInfoTipArrow=oe;exports.AttachmentsBarInfoTipIcon=Dt;exports.AttachmentsBarInfoTipText=Rt;exports.AttachmentsBarInput=qt;exports.AttachmentsBarInputs=Ot;exports.AttachmentsBarList=Bt;exports.AttachmentsBarModal=Wt;exports.AttachmentsBarModalBody=Gt;exports.AttachmentsBarModalClose=zt;exports.AttachmentsBarModalContent=Qt;exports.AttachmentsBarModalDescription=Ut;exports.AttachmentsBarModalHeader=Vt;exports.AttachmentsBarModalHeading=$t;exports.AttachmentsBarModalHelp=Kt;exports.AttachmentsBarModalOverlay=Nt;exports.ChatAction=U;exports.ChatActionFeedback=hi;exports.ChatActionLabel=de;exports.ChatHelpAction=Ci;exports.Content=be;exports.ContentScrollArea=ge;exports.ContentScrollAreaCorner=Ee;exports.ContentScrollAreaScrollbar=Ae;exports.ContentScrollAreaThumb=_e;exports.ContentScrollAreaViewport=Pe;exports.Disclaimer=ke;exports.DisclaimerArrow=xe;exports.DisclaimerContent=fe;exports.DisclaimerLabel=Ie;exports.DisclaimerText=Se;exports.DisclaimerTrigger=Me;exports.DynamicComponent=ot;exports.EmbeddedChatPrimitiveActionBar=si;exports.EmbeddedChatPrimitiveActions=oi;exports.EmbeddedChatPrimitiveAttachmentsBar=xt;exports.EmbeddedChatPrimitiveAttachmentsBarActions=wt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachment=Tt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentDelete=Ht;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentIcon=yt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentTitle=jt;exports.EmbeddedChatPrimitiveAttachmentsBarForm=Yt;exports.EmbeddedChatPrimitiveAttachmentsBarFormContent=ti;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentError=ni;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentInput=ai;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentLabel=ii;exports.EmbeddedChatPrimitiveAttachmentsBarFormSubmitButton=ri;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitle=Jt;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleError=ei;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleInput=Zt;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleLabel=Xt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTip=Lt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipArrow=oe;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipIcon=Dt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipText=Rt;exports.EmbeddedChatPrimitiveAttachmentsBarInput=qt;exports.EmbeddedChatPrimitiveAttachmentsBarInputs=Ot;exports.EmbeddedChatPrimitiveAttachmentsBarList=Bt;exports.EmbeddedChatPrimitiveAttachmentsBarModal=Wt;exports.EmbeddedChatPrimitiveAttachmentsBarModalBody=Gt;exports.EmbeddedChatPrimitiveAttachmentsBarModalClose=zt;exports.EmbeddedChatPrimitiveAttachmentsBarModalContent=Qt;exports.EmbeddedChatPrimitiveAttachmentsBarModalDescription=Ut;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeader=Vt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeading=$t;exports.EmbeddedChatPrimitiveAttachmentsBarModalHelp=Kt;exports.EmbeddedChatPrimitiveAttachmentsBarModalOverlay=Nt;exports.EmbeddedChatPrimitiveChatAction=U;exports.EmbeddedChatPrimitiveChatActionFeedback=hi;exports.EmbeddedChatPrimitiveChatActionLabel=de;exports.EmbeddedChatPrimitiveChatHelpAction=Ci;exports.EmbeddedChatPrimitiveContent=be;exports.EmbeddedChatPrimitiveContentScrollArea=ge;exports.EmbeddedChatPrimitiveContentScrollAreaCorner=Ee;exports.EmbeddedChatPrimitiveContentScrollAreaScrollbar=Ae;exports.EmbeddedChatPrimitiveContentScrollAreaThumb=_e;exports.EmbeddedChatPrimitiveContentScrollAreaViewport=Pe;exports.EmbeddedChatPrimitiveDisclaimer=ke;exports.EmbeddedChatPrimitiveDisclaimerArrow=xe;exports.EmbeddedChatPrimitiveDisclaimerContent=fe;exports.EmbeddedChatPrimitiveDisclaimerLabel=Ie;exports.EmbeddedChatPrimitiveDisclaimerText=Se;exports.EmbeddedChatPrimitiveDisclaimerTrigger=Me;exports.EmbeddedChatPrimitiveDynamicComponent=ot;exports.EmbeddedChatPrimitiveExampleQuestion=je;exports.EmbeddedChatPrimitiveExampleQuestionButton=He;exports.EmbeddedChatPrimitiveExampleQuestions=Be;exports.EmbeddedChatPrimitiveExampleQuestionsLabel=Te;exports.EmbeddedChatPrimitiveExampleQuestionsList=ye;exports.EmbeddedChatPrimitiveFeedbackForm=Mi;exports.EmbeddedChatPrimitiveFeedbackItem=fi;exports.EmbeddedChatPrimitiveFeedbackItemCheckbox=Si;exports.EmbeddedChatPrimitiveFeedbackItemCheckboxIndicator=xi;exports.EmbeddedChatPrimitiveFeedbackItemDescription=Ti;exports.EmbeddedChatPrimitiveFeedbackItemLabel=Bi;exports.EmbeddedChatPrimitiveFeedbackModal=Ai;exports.EmbeddedChatPrimitiveFeedbackModalBody=Ii;exports.EmbeddedChatPrimitiveFeedbackModalClose=ki;exports.EmbeddedChatPrimitiveFeedbackModalContent=Ei;exports.EmbeddedChatPrimitiveFeedbackModalHeader=Fi;exports.EmbeddedChatPrimitiveFeedbackModalOverlay=_i;exports.EmbeddedChatPrimitiveFeedbackSubmitButton=yi;exports.EmbeddedChatPrimitiveFooter=Ft;exports.EmbeddedChatPrimitiveForm=Hi;exports.EmbeddedChatPrimitiveFormCancel=ra;exports.EmbeddedChatPrimitiveFormClose=wi;exports.EmbeddedChatPrimitiveFormContent=Oi;exports.EmbeddedChatPrimitiveFormDescription=Ri;exports.EmbeddedChatPrimitiveFormError=aa;exports.EmbeddedChatPrimitiveFormField=qi;exports.EmbeddedChatPrimitiveFormFieldCheckbox=$i;exports.EmbeddedChatPrimitiveFormFieldCheckboxIndicator=Ui;exports.EmbeddedChatPrimitiveFormFieldEmail=Ni;exports.EmbeddedChatPrimitiveFormFieldError=ia;exports.EmbeddedChatPrimitiveFormFieldFile=Qi;exports.EmbeddedChatPrimitiveFormFieldLabel=Wi;exports.EmbeddedChatPrimitiveFormFieldSelect=Ki;exports.EmbeddedChatPrimitiveFormFieldSelectContent=Ji;exports.EmbeddedChatPrimitiveFormFieldSelectIcon=Yi;exports.EmbeddedChatPrimitiveFormFieldSelectItem=Zi;exports.EmbeddedChatPrimitiveFormFieldSelectItemIndicator=ta;exports.EmbeddedChatPrimitiveFormFieldSelectItemText=ea;exports.EmbeddedChatPrimitiveFormFieldSelectTrigger=zi;exports.EmbeddedChatPrimitiveFormFieldSelectValue=Gi;exports.EmbeddedChatPrimitiveFormFieldSelectViewport=Xi;exports.EmbeddedChatPrimitiveFormFieldText=K;exports.EmbeddedChatPrimitiveFormFieldTextArea=Vi;exports.EmbeddedChatPrimitiveFormFooter=na;exports.EmbeddedChatPrimitiveFormHeader=Li;exports.EmbeddedChatPrimitiveFormHeading=Di;exports.EmbeddedChatPrimitiveFormSubmit=sa;exports.EmbeddedChatPrimitiveFormSuccess=oa;exports.EmbeddedChatPrimitiveFormSuccessButton=ma;exports.EmbeddedChatPrimitiveFormSuccessHeading=da;exports.EmbeddedChatPrimitiveFormSuccessMessage=ca;exports.EmbeddedChatPrimitiveFormWrapper=ji;exports.EmbeddedChatPrimitiveHeaderToolbar=Ce;exports.EmbeddedChatPrimitiveHelpActions=ui;exports.EmbeddedChatPrimitiveHelpActionsMenu=vi;exports.EmbeddedChatPrimitiveHelpActionsMenuArrow=bi;exports.EmbeddedChatPrimitiveHelpActionsMenuItem=gi;exports.EmbeddedChatPrimitiveHelpActionsMenuItemIcon=Pi;exports.EmbeddedChatPrimitiveHelpActionsTrigger=pi;exports.EmbeddedChatPrimitiveInput=Mt;exports.EmbeddedChatPrimitiveInputFieldset=kt;exports.EmbeddedChatPrimitiveInputGroup=It;exports.EmbeddedChatPrimitiveIntroMessageWrapper=Oe;exports.EmbeddedChatPrimitiveMarkdown=st;exports.EmbeddedChatPrimitiveMessageAction=lt;exports.EmbeddedChatPrimitiveMessageAnnotationAction=mt;exports.EmbeddedChatPrimitiveMessageAnnotationActions=ct;exports.EmbeddedChatPrimitiveMessageAttachments=Ge;exports.EmbeddedChatPrimitiveMessageAttachmentsItem=Je;exports.EmbeddedChatPrimitiveMessageAttachmentsItemIcon=Xe;exports.EmbeddedChatPrimitiveMessageAttachmentsItemTitle=Ze;exports.EmbeddedChatPrimitiveMessageAttachmentsList=Ye;exports.EmbeddedChatPrimitiveMessageAttachmentsPreview=et;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewBody=rt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewClose=nt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewContent=it;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewHeader=at;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewOverlay=tt;exports.EmbeddedChatPrimitiveMessageAvatar=Ne;exports.EmbeddedChatPrimitiveMessageAvatarContent=Qe;exports.EmbeddedChatPrimitiveMessageAvatarFallback=Ve;exports.EmbeddedChatPrimitiveMessageAvatarImage=$e;exports.EmbeddedChatPrimitiveMessageContent=ze;exports.EmbeddedChatPrimitiveMessageContentWrapper=Ke;exports.EmbeddedChatPrimitiveMessageHeader=qe;exports.EmbeddedChatPrimitiveMessageLoading=We;exports.EmbeddedChatPrimitiveMessageName=Ue;exports.EmbeddedChatPrimitiveMessageSourceItem=pt;exports.EmbeddedChatPrimitiveMessageSourceItemBreadcrumbs=vt;exports.EmbeddedChatPrimitiveMessageSourceItemDescription=At;exports.EmbeddedChatPrimitiveMessageSourceItemDescriptionPart=_t;exports.EmbeddedChatPrimitiveMessageSourceItemIcon=bt;exports.EmbeddedChatPrimitiveMessageSourceItemIndicator=Et;exports.EmbeddedChatPrimitiveMessageSourceItemTag=Pt;exports.EmbeddedChatPrimitiveMessageSourceItemTitle=gt;exports.EmbeddedChatPrimitiveMessageSources=ht;exports.EmbeddedChatPrimitiveMessageSourcesHeader=ut;exports.EmbeddedChatPrimitiveMessageSourcesList=Ct;exports.EmbeddedChatPrimitiveMessageToolbar=dt;exports.EmbeddedChatPrimitiveMessageWrapper=se;exports.EmbeddedChatPrimitiveMessages=Fe;exports.EmbeddedChatPrimitiveRoot=ue;exports.EmbeddedChatPrimitiveSendButton=ft;exports.EmbeddedChatPrimitiveSendButtonIcon=St;exports.EmbeddedChatPrimitiveTaglineBrandName=li;exports.EmbeddedChatPrimitiveTaglineContainer=di;exports.EmbeddedChatPrimitiveTaglineLogo=mi;exports.EmbeddedChatPrimitiveTaglineText=ci;exports.EmbeddedChatPrimitiveToolbarHeader=ve;exports.EmbeddedChatPrimitiveToolbarHeaderWrapper=pe;exports.EmbeddedChatPrimitiveWorkflow=Re;exports.EmbeddedChatPrimitiveWorkflows=we;exports.EmbeddedChatPrimitiveWorkflowsLabel=Le;exports.EmbeddedChatPrimitiveWorkflowsList=De;exports.EmbeddedChatPrimitiveWrapper=he;exports.ExampleQuestion=je;exports.ExampleQuestionButton=He;exports.ExampleQuestions=Be;exports.ExampleQuestionsLabel=Te;exports.ExampleQuestionsList=ye;exports.FeedbackForm=Mi;exports.FeedbackItem=fi;exports.FeedbackItemCheckbox=Si;exports.FeedbackItemCheckboxIndicator=xi;exports.FeedbackItemDescription=Ti;exports.FeedbackItemLabel=Bi;exports.FeedbackModal=Ai;exports.FeedbackModalBody=Ii;exports.FeedbackModalClose=ki;exports.FeedbackModalContent=Ei;exports.FeedbackModalHeader=Fi;exports.FeedbackModalOverlay=_i;exports.FeedbackSubmitButton=yi;exports.Footer=Ft;exports.Form=Hi;exports.FormCancel=ra;exports.FormClose=wi;exports.FormContent=Oi;exports.FormDescription=Ri;exports.FormError=aa;exports.FormField=qi;exports.FormFieldCheckbox=$i;exports.FormFieldCheckboxIndicator=Ui;exports.FormFieldEmail=Ni;exports.FormFieldError=ia;exports.FormFieldFile=Qi;exports.FormFieldLabel=Wi;exports.FormFieldSelect=Ki;exports.FormFieldSelectContent=Ji;exports.FormFieldSelectIcon=Yi;exports.FormFieldSelectItem=Zi;exports.FormFieldSelectItemIndicator=ta;exports.FormFieldSelectItemText=ea;exports.FormFieldSelectTrigger=zi;exports.FormFieldSelectValue=Gi;exports.FormFieldSelectViewport=Xi;exports.FormFieldText=K;exports.FormFieldTextArea=Vi;exports.FormFooter=na;exports.FormHeader=Li;exports.FormHeading=Di;exports.FormSubmit=sa;exports.FormSuccess=oa;exports.FormSuccessButton=ma;exports.FormSuccessHeading=da;exports.FormSuccessMessage=ca;exports.FormWrapper=ji;exports.Header=Da;exports.HeaderToolbar=Ce;exports.HeaderToolbarWrapper=pe;exports.HelpActions=ui;exports.HelpActionsMenu=vi;exports.HelpActionsMenuArrow=bi;exports.HelpActionsMenuItem=gi;exports.HelpActionsMenuItemIcon=Pi;exports.HelpActionsTrigger=pi;exports.Input=Mt;exports.InputFieldset=kt;exports.InputGroup=It;exports.IntroMessageWrapper=Oe;exports.Markdown=st;exports.MessageAction=lt;exports.MessageAnnotationAction=mt;exports.MessageAnnotationActions=ct;exports.MessageAttachments=Ge;exports.MessageAttachmentsItem=Je;exports.MessageAttachmentsItemIcon=Xe;exports.MessageAttachmentsItemTitle=Ze;exports.MessageAttachmentsList=Ye;exports.MessageAttachmentsPreview=et;exports.MessageAttachmentsPreviewBody=rt;exports.MessageAttachmentsPreviewClose=nt;exports.MessageAttachmentsPreviewContent=it;exports.MessageAttachmentsPreviewHeader=at;exports.MessageAttachmentsPreviewOverlay=tt;exports.MessageAvatar=Ne;exports.MessageAvatarContent=Qe;exports.MessageAvatarFallback=Ve;exports.MessageAvatarImage=$e;exports.MessageContent=ze;exports.MessageContentWrapper=Ke;exports.MessageHeader=qe;exports.MessageLoading=We;exports.MessageName=Ue;exports.MessageSourceItem=pt;exports.MessageSourceItemBreadcrumbIcon=Bn;exports.MessageSourceItemBreadcrumbs=vt;exports.MessageSourceItemDescription=At;exports.MessageSourceItemDescriptionPart=_t;exports.MessageSourceItemIcon=bt;exports.MessageSourceItemIndicator=Et;exports.MessageSourceItemTag=Pt;exports.MessageSourceItemTitle=gt;exports.MessageSources=ht;exports.MessageSourcesHeader=ut;exports.MessageSourcesList=Ct;exports.MessageToolbar=dt;exports.MessageWrapper=se;exports.Messages=Fe;exports.PrimitiveMessagePart=Pn;exports.Root=ue;exports.SendButton=ft;exports.SendButtonIcon=St;exports.TaglineBrandName=li;exports.TaglineContainer=di;exports.TaglineLogo=mi;exports.TaglineText=ci;exports.ToolbarHeader=ve;exports.Workflow=Re;exports.Workflows=we;exports.WorkflowsLabel=Le;exports.WorkflowsList=De;exports.Wrapper=he;
|
|
11
|
+
`);B(ce)},share:async()=>{},clear:d,stop:c},z={copy:A,share:k};return n.jsx(L.Tooltip,{delayDuration:0,open:z[e],children:n.jsx(nr,{"data-type":e,"data-copied":u.dataAttr(A||k),className:`${r} ${e}`,children:n.jsx(de,{action:e}),onClick:C.composeEventHandlers(i,O[e]),...s})})},rr=a.ikp("span",{_id:"aiChat__ChatActionLabel"}),de=t=>{const{action:e,...i}=t,{aiChatSettings:r}=b.useInkeepConfig(),s=r.toolbarButtonLabels??{},o={help:s.getHelp??"Get Help",copy:s.copyChat??"Copy",share:s.share??"Share",clear:s.clear??"Clear",stop:s.stop??"Stop"};return n.jsx(rr,{children:o[e],...i})},sr=a.ikp(L.TooltipContent,{_id:"aiChat__ChatActionFeeback"}),hi=t=>{const{action:e,children:i,...r}=t,s={copy:"Copied!",share:"Link copied!"};return n.jsxs(sr,{sideOffset:5,...r,children:[n.jsx(L.Arrow,{}),i||s[e]]})},or=a.ikp(w.Root,{_id:"aiChatHelpActions"}),ui=t=>{const{children:e,...i}=t,{aiChatSettings:r}=b.useInkeepConfig(),{getHelpOptions:s}=r;if(!s||(s??[]).length===0)return null;const{_pinned:o,_unpinned:d}=s.reduce((p,g)=>{const v=g.isPinnedToToolbar?"_pinned":"_unpinned";return{...p,[v]:[...p[v],g]}},{_pinned:[],_unpinned:[]}),c=d.length===1?[...o,d[0]]:o,m=d.length===1?[]:d,l=X.useHelpMenuState();return n.jsx(X.HelpMenuProvider,{value:l,children:n.jsx(or,{open:l.open,onOpenChange:l.setOpen,children:u.maybeRender(e,{pinned:c,unpinned:m}),...i})})},dr=a.ikp(U,{_id:"aiChatHelpAction",action:"help"}),cr=a.ikp("a",{_id:"aiChatHelpAction",target:"_blank",rel:"noreferrer"}),Ci=t=>{const{action:e,onClick:i,...r}=t,{handleAction:s,logHelpAction:o}=te.useChatAction(e),d=e.action.type,c={"aria-label":e.name,"data-name":e.name,children:e.name,onClick:C.composeEventHandlers(i,()=>{s(),o()}),...r};return d==="open_link"?n.jsx(cr,{href:e.action.url,...c}):n.jsx(dr,{...c})},mr=a.ikp(w.Trigger,{_id:"aiChatHelpActions__Trigger"}),pi=h.memo(t=>{const{aiChatSettings:e}=b.useInkeepConfig();return n.jsx(U,{action:"help",...t,asChild:!0,children:n.jsx(mr,{children:e.toolbarButtonLabels?.getHelp??"Get Help"})})}),lr=a.ikp(w.Content,{_id:"aiChatHelpActions__Menu"}),vi=t=>n.jsx(lr,{side:"top",sideOffset:8,align:"center",alignOffset:-10,...t}),bi=a.ikp(w.Arrow,{_id:"aiChatHelpActions__MenuArrow"}),gi=t=>{const{action:e,onClick:i,...r}=t,{handleAction:s,logHelpAction:o}=te.useChatAction(e),{setOpen:d}=X.useHelpMenu(),c=()=>{s({onOpenForm:()=>d(!1)}),o()},m=e.action.type,l=a.ikp(m==="open_link"?"a":"button",{_id:"aiChatHelpActions__MenuItem",children:e.name,"aria-label":e.name,"data-name":e.name,"data-type":e.action.type,...m==="open_link"&&{href:e.action.url,target:"_blank",rel:"noopener"},onClick:C.composeEventHandlers(i,c)});return n.jsx(l,{...r})},hr=a.ikp(T.BuiltInIconRenderer,{_id:"aiChatHelpActions_MenuItemIcon"}),Pi=t=>{const{action:e,...i}=t;return e.icon?n.jsx(hr,{iconSettings:e.icon,...i}):null},ur=a.ikp(E.Root,{_id:"aiChatFeedbackModal"}),Ai=t=>{const{onOpenChange:e,...i}=t,{currentFeedback:r,setCurrentFeedback:s}=ee.useMessageFeedback();return n.jsx(ur,{open:r!==null,onOpenChange:C.composeEventHandlers(e,()=>s(null)),...i})},_i=a.ikp(E.Overlay,{_id:"aiChatFeedbackModal__Overlay"}),Ei=a.ikp(E.Content,{_id:"aiChatFeedbackModal__Content","aria-describedby":void 0}),Fi=a.ikp(E.Title,{_id:"aiChatFeedbackModal__Header",children:"Help improve my answers!"}),ki=a.ikp(E.Close,{_id:"aiChatFeedbackModal__Close",children:n.jsx(f.CustomIcon,{iconKey:"close"})}),Ii=a.ikp("div",{_id:"aiChatFeedbackModal__Body"}),Cr=a.ikp("form",{_id:"aiChatFeedbackForm"}),Mi=t=>{const{onSubmit:e,...i}=t,{submitNegativeFeedback:r,currentFeedback:s,setCurrentFeedback:o}=ee.useMessageFeedback(),d=c=>{c.preventDefault();const m=c.target,l=new FormData(m),p=Object.fromEntries(l.entries());s&&(r(s,p),o(null))};return n.jsx(Cr,{onSubmit:C.composeEventHandlers(e,d),...i})},pr=a.ikp("div",{_id:"aiChatFeedbackItem"}),fi=t=>{const{name:e,...i}=t;return n.jsx(V.FeedbackItemProvider,{name:e,children:n.jsx(pr,{...i})})},vr=a.ikp($.Root,{_id:"aiChatFeedbackItem__Checkbox"}),Si=t=>{const{name:e,focusItem:i}=V.useFeedbackItem(),{onCheckedChange:r,...s}=t,o=d=>{d&&i?.current?.focus()};return n.jsx(vr,{id:`feedback-${e}`,name:e,onCheckedChange:C.composeEventHandlers(r,o),...s})},xi=a.ikp($.Indicator,{_id:"aiChatFeedbackItem__CheckboxIndicator",children:n.jsx(le.CheckboxIcon,{})}),br=a.ikp("label",{_id:"aiChatFeedbackItem__Label"}),Bi=t=>{const{name:e}=V.useFeedbackItem(),i={unrelated_response:"Didn't answer my question",inaccurate_statement:"Inaccurate statement",inaccurate_code_snippet:"Inaccurate code snippet",irrelevant_citations:"Irrelevant citations"};return n.jsx(br,{htmlFor:`feedback-${e}`,children:i[e],...t})},gr=a.ikp("textarea",{_id:"aiChatFeedbackItem__Description",placeholder:"Please describe"}),yi=t=>{const{name:e,focusItem:i}=V.useFeedbackItem();return n.jsx(gr,{ref:i,name:`${e}:description`,...t})},Ti=a.ikp("button",{_id:"aiChatFeedbackForm__SubmitButton",children:"Submit",type:"submit"}),Pr=a.ikp("div",{_id:"aiChatForm__Wrapper"}),ji=t=>{const{form:e}=F.useChatForm();return e?n.jsx(Pr,{...t}):null},Ar=a.ikp("form",{_id:"aiChatForm"}),Hi=t=>{const{onSubmit:e,...i}=t,{conversationId:r,messages:s}=P.useChat(),{handleSubmit:o,isSuccess:d}=F.useChatForm();return d?null:n.jsx(Ar,{onSubmit:C.composeEventHandlers(e,c=>o(c,{id:r,messages:s})),...i})},_r=a.ikp("button",{_id:"aiChatForm__Close",children:n.jsx(f.CustomIcon,{iconKey:"close"})}),wi=t=>{const{onClick:e,...i}=t,{closeForm:r}=F.useChatForm();return n.jsx(_r,{onClick:C.composeEventHandlers(e,r),...i})},Li=a.ikp("div",{_id:"aiChatForm__Header"}),Er=a.ikp("h2",{_id:"aiChatForm__Heading"}),Di=t=>{const{form:e}=F.useChatForm();return e?.heading?n.jsx(Er,{children:e.heading,...t}):null},Fr=a.ikp(Q.Markdown,{_id:"aiChatForm__Description"}),Ri=t=>{const{form:e}=F.useChatForm();return e?.description?n.jsx(Fr,{children:e.description,...t}):null},kr=a.ikp("div",{_id:"aiChatForm__Content"}),Oi=t=>{const{children:e,...i}=t,{getFields:r}=F.useChatForm(),{conversationId:s}=P.useChat(),o=r(s)||[];return n.jsx(kr,{children:u.maybeRender(e,o),...i})},Ir=a.ikp("div",{_id:"aiChatForm__Field"}),qi=t=>{const{field:e,autoFocus:i,...r}=t,{control:s,errors:o}=F.useChatForm();return n.jsx(ka.Controller,{name:e.name,control:s,rules:{required:e.isRequired?`${e.label} is required.`:void 0},render:({field:d})=>{const c=d.value!==void 0||e.inputType==="file";return n.jsx(H.FormFieldProvider,{"data-invalid":u.dataAttr(!!o[e.name]),field:e,fieldProps:d,autoFocus:i,children:c&&n.jsx(Ir,{"data-input-type":e.inputType,"data-hidden":u.dataAttr(e.isHidden),...r})})}})},Mr=a.ikp("label",{_id:"aiChatForm__FieldLabel"}),Wi=t=>{const{field:e}=H.useFormField();return n.jsx(Mr,{"data-required":u.dataAttr(e.isRequired),htmlFor:e.name,children:e.label,...t})},fr=a.ikp("input",{_id:"aiChatForm__FieldText",type:"text"}),K=t=>{const{field:e,error:i,fieldProps:{onChange:r,onBlur:s,...o},autoFocus:d}=H.useFormField(),{onChange:c,onBlur:m,...l}=t;return n.jsx(fr,{id:e.name,autoFocus:d,placeholder:"placeholder"in e?e.placeholder:void 0,"data-invalid":u.dataAttr(!!i),onChange:C.composeEventHandlers(c,r),onBlur:C.composeEventHandlers(m,s),...o,...l})},Ni=a.ikp(K,{_id:"aiChatForm__FieldEmail",type:"email"}),Sr=a.ikp("input",{_id:"aiChatForm__FieldFile",type:"file",multiple:!0}),Qi=t=>{const{field:e,error:i,fieldProps:{value:r,onChange:s,onBlur:o,...d},autoFocus:c}=H.useFormField(),{onChange:m,onBlur:l,...p}=t,g=v=>{const A=v.target.files;s(A)};return n.jsx(Sr,{id:e.name,autoFocus:c,"data-value":r,"data-invalid":u.dataAttr(!!i),...p,...d,onChange:C.composeEventHandlers(m,g),onBlur:C.composeEventHandlers(l,o)})},Vi=a.ikp(K,{_id:"aiChatForm__FieldTextArea",type:"textarea",asChild:!0,children:n.jsx(Z,{maxRows:8})}),xr=a.ikp($.Root,{_id:"aiChatForm__FieldCheckbox"}),$i=t=>{const{field:e,error:i,fieldProps:r,autoFocus:s}=H.useFormField(),{onCheckedChange:o,...d}=t;return n.jsx(xr,{id:e.name,name:e.name,autoFocus:s,"data-invalid":u.dataAttr(!!i),checked:r.value,onCheckedChange:C.composeEventHandlers(o,r.onChange),...d})},Ui=a.ikp($.Indicator,{_id:"aiChatForm__FieldCheckboxIndicator",children:n.jsx(le.CheckboxIcon,{})}),Br=a.ikp(y.Root,{_id:"aiChatForm__FieldSelect"}),Ki=t=>{const{field:e,error:i,fieldProps:r}=H.useFormField(),{onValueChange:s,...o}=t;return n.jsx(Br,{name:e.name,"data-invalid":u.dataAttr(!!i),value:r.value,onValueChange:C.composeEventHandlers(s,r.onChange),...o})},zi=a.ikp(y.Trigger,{_id:"aiChatForm__FieldSelect__Trigger"}),yr=a.ikp(y.Value,{_id:"aiChatForm__FieldSelect__Value"}),Gi=t=>{const{field:e}=H.useFormField();return n.jsx(yr,{placeholder:"placeholder"in e?e.placeholder:void 0,...t})},Yi=a.ikp(y.Icon,{_id:"aiChatForm__FieldSelect__Icon",asChild:!0,children:n.jsx(T.BuiltInIconRenderer,{iconSettings:{builtIn:"LuChevronDown"}})}),Ji=a.ikp(y.Content,{_id:"aiChatForm__FieldSelect__Content",position:"popper"}),Xi=a.ikp(y.Viewport,{_id:"aiChatForm__FieldSelect__Viewport"}),Zi=a.ikp(y.Item,{_id:"aiChatForm__FieldSelect__Item"}),ea=a.ikp(y.ItemText,{_id:"aiChatForm__FieldSelect__ItemText"}),ta=a.ikp(y.ItemIndicator,{_id:"aiChatForm__FieldSelect__ItemIndicator",asChild:!0,children:n.jsx(T.BuiltInIconRenderer,{iconSettings:{builtIn:"LuCheck"}})}),Tr=a.ikp("span",{_id:"aiChatForm__FieldError"}),ia=t=>{const{error:e}=H.useFormField();return e?n.jsx(Tr,{children:e.message?.toString(),...t}):null},jr=a.ikp("span",{_id:"aiChatForm__Error"}),aa=t=>{const{formError:e}=F.useChatForm();return e?n.jsx(jr,{children:e.message,...t}):null},na=a.ikp("div",{_id:"aiChatForm__Footer"}),Hr=a.ikp("button",{_id:"aiChatForm__Cancel",children:"Cancel",type:"button"}),ra=t=>{const{onClick:e,...i}=t,{closeForm:r}=F.useChatForm();return n.jsx(Hr,{onClick:C.composeEventHandlers(e,r),...i})},wr=a.ikp("button",{_id:"aiChatForm__Submit",children:"Submit",type:"submit"}),sa=t=>{const{onClick:e,...i}=t,{isSubmitting:r,form:s}=F.useChatForm(),o=s?.buttons.submit.label||"Submit";return n.jsx(wr,{disabled:r,...i,children:o})},Lr=a.ikp("div",{_id:"aiChatForm__Success"}),oa=t=>{const{isSuccess:e}=F.useChatForm();return e?n.jsx(Lr,{...t}):null},Dr=a.ikp("h2",{_id:"aiChatForm__SuccessHeading"}),da=t=>{const{form:e}=F.useChatForm();return n.jsx(Dr,{children:e?.successView?.heading,...t})},Rr=a.ikp(Q.Markdown,{_id:"aiChatForm__SuccessMessage"}),ca=t=>{const{form:e}=F.useChatForm();return n.jsx(Rr,{children:e?.successView?.message,...t})},Or=a.ikp("button",{_id:"aiChatForm__SuccessButton"}),ma=t=>{const{onClick:e,...i}=t,{form:r,closeForm:s}=F.useChatForm(),o=r?.successView?.doneButton;if(!o)return null;const d=o.icon&&n.jsx(T.BuiltInIconRenderer,{iconSettings:o.icon}),c=o.label;return n.jsx(Or,{onClick:C.composeEventHandlers(e,s),children:n.jsxs(n.Fragment,{children:[d,c]}),...i})};exports.Provider=P.ChatProvider;exports.ActionBar=si;exports.Actions=oi;exports.AttachmentsBar=xt;exports.AttachmentsBarActions=wt;exports.AttachmentsBarAttachment=yt;exports.AttachmentsBarAttachmentDelete=Ht;exports.AttachmentsBarAttachmentIcon=Tt;exports.AttachmentsBarAttachmentTitle=jt;exports.AttachmentsBarForm=Yt;exports.AttachmentsBarFormContent=ti;exports.AttachmentsBarFormContentError=ni;exports.AttachmentsBarFormContentInput=ai;exports.AttachmentsBarFormContentLabel=ii;exports.AttachmentsBarFormSubmitButton=ri;exports.AttachmentsBarFormTitle=Jt;exports.AttachmentsBarFormTitleError=ei;exports.AttachmentsBarFormTitleInput=Zt;exports.AttachmentsBarFormTitleLabel=Xt;exports.AttachmentsBarInfoTip=Lt;exports.AttachmentsBarInfoTipArrow=oe;exports.AttachmentsBarInfoTipIcon=Dt;exports.AttachmentsBarInfoTipText=Rt;exports.AttachmentsBarInput=qt;exports.AttachmentsBarInputs=Ot;exports.AttachmentsBarList=Bt;exports.AttachmentsBarModal=Wt;exports.AttachmentsBarModalBody=Gt;exports.AttachmentsBarModalClose=zt;exports.AttachmentsBarModalContent=Qt;exports.AttachmentsBarModalDescription=Ut;exports.AttachmentsBarModalHeader=Vt;exports.AttachmentsBarModalHeading=$t;exports.AttachmentsBarModalHelp=Kt;exports.AttachmentsBarModalOverlay=Nt;exports.ChatAction=U;exports.ChatActionFeedback=hi;exports.ChatActionLabel=de;exports.ChatHelpAction=Ci;exports.Content=be;exports.ContentScrollArea=ge;exports.ContentScrollAreaCorner=Ee;exports.ContentScrollAreaScrollbar=Ae;exports.ContentScrollAreaThumb=_e;exports.ContentScrollAreaViewport=Pe;exports.Disclaimer=ke;exports.DisclaimerArrow=xe;exports.DisclaimerContent=fe;exports.DisclaimerLabel=Ie;exports.DisclaimerText=Se;exports.DisclaimerTrigger=Me;exports.DynamicComponent=ot;exports.EmbeddedChatPrimitiveActionBar=si;exports.EmbeddedChatPrimitiveActions=oi;exports.EmbeddedChatPrimitiveAttachmentsBar=xt;exports.EmbeddedChatPrimitiveAttachmentsBarActions=wt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachment=yt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentDelete=Ht;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentIcon=Tt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentTitle=jt;exports.EmbeddedChatPrimitiveAttachmentsBarForm=Yt;exports.EmbeddedChatPrimitiveAttachmentsBarFormContent=ti;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentError=ni;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentInput=ai;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentLabel=ii;exports.EmbeddedChatPrimitiveAttachmentsBarFormSubmitButton=ri;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitle=Jt;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleError=ei;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleInput=Zt;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleLabel=Xt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTip=Lt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipArrow=oe;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipIcon=Dt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipText=Rt;exports.EmbeddedChatPrimitiveAttachmentsBarInput=qt;exports.EmbeddedChatPrimitiveAttachmentsBarInputs=Ot;exports.EmbeddedChatPrimitiveAttachmentsBarList=Bt;exports.EmbeddedChatPrimitiveAttachmentsBarModal=Wt;exports.EmbeddedChatPrimitiveAttachmentsBarModalBody=Gt;exports.EmbeddedChatPrimitiveAttachmentsBarModalClose=zt;exports.EmbeddedChatPrimitiveAttachmentsBarModalContent=Qt;exports.EmbeddedChatPrimitiveAttachmentsBarModalDescription=Ut;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeader=Vt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeading=$t;exports.EmbeddedChatPrimitiveAttachmentsBarModalHelp=Kt;exports.EmbeddedChatPrimitiveAttachmentsBarModalOverlay=Nt;exports.EmbeddedChatPrimitiveChatAction=U;exports.EmbeddedChatPrimitiveChatActionFeedback=hi;exports.EmbeddedChatPrimitiveChatActionLabel=de;exports.EmbeddedChatPrimitiveChatHelpAction=Ci;exports.EmbeddedChatPrimitiveContent=be;exports.EmbeddedChatPrimitiveContentScrollArea=ge;exports.EmbeddedChatPrimitiveContentScrollAreaCorner=Ee;exports.EmbeddedChatPrimitiveContentScrollAreaScrollbar=Ae;exports.EmbeddedChatPrimitiveContentScrollAreaThumb=_e;exports.EmbeddedChatPrimitiveContentScrollAreaViewport=Pe;exports.EmbeddedChatPrimitiveDisclaimer=ke;exports.EmbeddedChatPrimitiveDisclaimerArrow=xe;exports.EmbeddedChatPrimitiveDisclaimerContent=fe;exports.EmbeddedChatPrimitiveDisclaimerLabel=Ie;exports.EmbeddedChatPrimitiveDisclaimerText=Se;exports.EmbeddedChatPrimitiveDisclaimerTrigger=Me;exports.EmbeddedChatPrimitiveDynamicComponent=ot;exports.EmbeddedChatPrimitiveExampleQuestion=je;exports.EmbeddedChatPrimitiveExampleQuestionButton=He;exports.EmbeddedChatPrimitiveExampleQuestions=Be;exports.EmbeddedChatPrimitiveExampleQuestionsLabel=ye;exports.EmbeddedChatPrimitiveExampleQuestionsList=Te;exports.EmbeddedChatPrimitiveFeedbackForm=Mi;exports.EmbeddedChatPrimitiveFeedbackItem=fi;exports.EmbeddedChatPrimitiveFeedbackItemCheckbox=Si;exports.EmbeddedChatPrimitiveFeedbackItemCheckboxIndicator=xi;exports.EmbeddedChatPrimitiveFeedbackItemDescription=yi;exports.EmbeddedChatPrimitiveFeedbackItemLabel=Bi;exports.EmbeddedChatPrimitiveFeedbackModal=Ai;exports.EmbeddedChatPrimitiveFeedbackModalBody=Ii;exports.EmbeddedChatPrimitiveFeedbackModalClose=ki;exports.EmbeddedChatPrimitiveFeedbackModalContent=Ei;exports.EmbeddedChatPrimitiveFeedbackModalHeader=Fi;exports.EmbeddedChatPrimitiveFeedbackModalOverlay=_i;exports.EmbeddedChatPrimitiveFeedbackSubmitButton=Ti;exports.EmbeddedChatPrimitiveFooter=Ft;exports.EmbeddedChatPrimitiveForm=Hi;exports.EmbeddedChatPrimitiveFormCancel=ra;exports.EmbeddedChatPrimitiveFormClose=wi;exports.EmbeddedChatPrimitiveFormContent=Oi;exports.EmbeddedChatPrimitiveFormDescription=Ri;exports.EmbeddedChatPrimitiveFormError=aa;exports.EmbeddedChatPrimitiveFormField=qi;exports.EmbeddedChatPrimitiveFormFieldCheckbox=$i;exports.EmbeddedChatPrimitiveFormFieldCheckboxIndicator=Ui;exports.EmbeddedChatPrimitiveFormFieldEmail=Ni;exports.EmbeddedChatPrimitiveFormFieldError=ia;exports.EmbeddedChatPrimitiveFormFieldFile=Qi;exports.EmbeddedChatPrimitiveFormFieldLabel=Wi;exports.EmbeddedChatPrimitiveFormFieldSelect=Ki;exports.EmbeddedChatPrimitiveFormFieldSelectContent=Ji;exports.EmbeddedChatPrimitiveFormFieldSelectIcon=Yi;exports.EmbeddedChatPrimitiveFormFieldSelectItem=Zi;exports.EmbeddedChatPrimitiveFormFieldSelectItemIndicator=ta;exports.EmbeddedChatPrimitiveFormFieldSelectItemText=ea;exports.EmbeddedChatPrimitiveFormFieldSelectTrigger=zi;exports.EmbeddedChatPrimitiveFormFieldSelectValue=Gi;exports.EmbeddedChatPrimitiveFormFieldSelectViewport=Xi;exports.EmbeddedChatPrimitiveFormFieldText=K;exports.EmbeddedChatPrimitiveFormFieldTextArea=Vi;exports.EmbeddedChatPrimitiveFormFooter=na;exports.EmbeddedChatPrimitiveFormHeader=Li;exports.EmbeddedChatPrimitiveFormHeading=Di;exports.EmbeddedChatPrimitiveFormSubmit=sa;exports.EmbeddedChatPrimitiveFormSuccess=oa;exports.EmbeddedChatPrimitiveFormSuccessButton=ma;exports.EmbeddedChatPrimitiveFormSuccessHeading=da;exports.EmbeddedChatPrimitiveFormSuccessMessage=ca;exports.EmbeddedChatPrimitiveFormWrapper=ji;exports.EmbeddedChatPrimitiveHeaderToolbar=Ce;exports.EmbeddedChatPrimitiveHelpActions=ui;exports.EmbeddedChatPrimitiveHelpActionsMenu=vi;exports.EmbeddedChatPrimitiveHelpActionsMenuArrow=bi;exports.EmbeddedChatPrimitiveHelpActionsMenuItem=gi;exports.EmbeddedChatPrimitiveHelpActionsMenuItemIcon=Pi;exports.EmbeddedChatPrimitiveHelpActionsTrigger=pi;exports.EmbeddedChatPrimitiveInput=Mt;exports.EmbeddedChatPrimitiveInputFieldset=kt;exports.EmbeddedChatPrimitiveInputGroup=It;exports.EmbeddedChatPrimitiveIntroMessageWrapper=Oe;exports.EmbeddedChatPrimitiveMarkdown=st;exports.EmbeddedChatPrimitiveMessageAction=lt;exports.EmbeddedChatPrimitiveMessageAttachments=Ge;exports.EmbeddedChatPrimitiveMessageAttachmentsItem=Je;exports.EmbeddedChatPrimitiveMessageAttachmentsItemIcon=Xe;exports.EmbeddedChatPrimitiveMessageAttachmentsItemTitle=Ze;exports.EmbeddedChatPrimitiveMessageAttachmentsList=Ye;exports.EmbeddedChatPrimitiveMessageAttachmentsPreview=et;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewBody=rt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewClose=nt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewContent=it;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewHeader=at;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewOverlay=tt;exports.EmbeddedChatPrimitiveMessageAvatar=Ne;exports.EmbeddedChatPrimitiveMessageAvatarContent=Qe;exports.EmbeddedChatPrimitiveMessageAvatarFallback=Ve;exports.EmbeddedChatPrimitiveMessageAvatarImage=$e;exports.EmbeddedChatPrimitiveMessageContent=ze;exports.EmbeddedChatPrimitiveMessageContentWrapper=Ke;exports.EmbeddedChatPrimitiveMessageCustomAction=mt;exports.EmbeddedChatPrimitiveMessageCustomActions=ct;exports.EmbeddedChatPrimitiveMessageHeader=qe;exports.EmbeddedChatPrimitiveMessageLoading=We;exports.EmbeddedChatPrimitiveMessageName=Ue;exports.EmbeddedChatPrimitiveMessageSourceItem=pt;exports.EmbeddedChatPrimitiveMessageSourceItemBreadcrumbs=vt;exports.EmbeddedChatPrimitiveMessageSourceItemDescription=At;exports.EmbeddedChatPrimitiveMessageSourceItemDescriptionPart=_t;exports.EmbeddedChatPrimitiveMessageSourceItemIcon=bt;exports.EmbeddedChatPrimitiveMessageSourceItemIndicator=Et;exports.EmbeddedChatPrimitiveMessageSourceItemTag=Pt;exports.EmbeddedChatPrimitiveMessageSourceItemTitle=gt;exports.EmbeddedChatPrimitiveMessageSources=ht;exports.EmbeddedChatPrimitiveMessageSourcesHeader=ut;exports.EmbeddedChatPrimitiveMessageSourcesList=Ct;exports.EmbeddedChatPrimitiveMessageToolbar=dt;exports.EmbeddedChatPrimitiveMessageWrapper=se;exports.EmbeddedChatPrimitiveMessages=Fe;exports.EmbeddedChatPrimitiveRoot=ue;exports.EmbeddedChatPrimitiveSendButton=ft;exports.EmbeddedChatPrimitiveSendButtonIcon=St;exports.EmbeddedChatPrimitiveTaglineBrandName=li;exports.EmbeddedChatPrimitiveTaglineContainer=di;exports.EmbeddedChatPrimitiveTaglineLogo=mi;exports.EmbeddedChatPrimitiveTaglineText=ci;exports.EmbeddedChatPrimitiveToolbarHeader=ve;exports.EmbeddedChatPrimitiveToolbarHeaderWrapper=pe;exports.EmbeddedChatPrimitiveWorkflow=Re;exports.EmbeddedChatPrimitiveWorkflows=we;exports.EmbeddedChatPrimitiveWorkflowsLabel=Le;exports.EmbeddedChatPrimitiveWorkflowsList=De;exports.EmbeddedChatPrimitiveWrapper=he;exports.ExampleQuestion=je;exports.ExampleQuestionButton=He;exports.ExampleQuestions=Be;exports.ExampleQuestionsLabel=ye;exports.ExampleQuestionsList=Te;exports.FeedbackForm=Mi;exports.FeedbackItem=fi;exports.FeedbackItemCheckbox=Si;exports.FeedbackItemCheckboxIndicator=xi;exports.FeedbackItemDescription=yi;exports.FeedbackItemLabel=Bi;exports.FeedbackModal=Ai;exports.FeedbackModalBody=Ii;exports.FeedbackModalClose=ki;exports.FeedbackModalContent=Ei;exports.FeedbackModalHeader=Fi;exports.FeedbackModalOverlay=_i;exports.FeedbackSubmitButton=Ti;exports.Footer=Ft;exports.Form=Hi;exports.FormCancel=ra;exports.FormClose=wi;exports.FormContent=Oi;exports.FormDescription=Ri;exports.FormError=aa;exports.FormField=qi;exports.FormFieldCheckbox=$i;exports.FormFieldCheckboxIndicator=Ui;exports.FormFieldEmail=Ni;exports.FormFieldError=ia;exports.FormFieldFile=Qi;exports.FormFieldLabel=Wi;exports.FormFieldSelect=Ki;exports.FormFieldSelectContent=Ji;exports.FormFieldSelectIcon=Yi;exports.FormFieldSelectItem=Zi;exports.FormFieldSelectItemIndicator=ta;exports.FormFieldSelectItemText=ea;exports.FormFieldSelectTrigger=zi;exports.FormFieldSelectValue=Gi;exports.FormFieldSelectViewport=Xi;exports.FormFieldText=K;exports.FormFieldTextArea=Vi;exports.FormFooter=na;exports.FormHeader=Li;exports.FormHeading=Di;exports.FormSubmit=sa;exports.FormSuccess=oa;exports.FormSuccessButton=ma;exports.FormSuccessHeading=da;exports.FormSuccessMessage=ca;exports.FormWrapper=ji;exports.Header=Da;exports.HeaderToolbar=Ce;exports.HeaderToolbarWrapper=pe;exports.HelpActions=ui;exports.HelpActionsMenu=vi;exports.HelpActionsMenuArrow=bi;exports.HelpActionsMenuItem=gi;exports.HelpActionsMenuItemIcon=Pi;exports.HelpActionsTrigger=pi;exports.Input=Mt;exports.InputFieldset=kt;exports.InputGroup=It;exports.IntroMessageWrapper=Oe;exports.Markdown=st;exports.MessageAction=lt;exports.MessageAttachments=Ge;exports.MessageAttachmentsItem=Je;exports.MessageAttachmentsItemIcon=Xe;exports.MessageAttachmentsItemTitle=Ze;exports.MessageAttachmentsList=Ye;exports.MessageAttachmentsPreview=et;exports.MessageAttachmentsPreviewBody=rt;exports.MessageAttachmentsPreviewClose=nt;exports.MessageAttachmentsPreviewContent=it;exports.MessageAttachmentsPreviewHeader=at;exports.MessageAttachmentsPreviewOverlay=tt;exports.MessageAvatar=Ne;exports.MessageAvatarContent=Qe;exports.MessageAvatarFallback=Ve;exports.MessageAvatarImage=$e;exports.MessageContent=ze;exports.MessageContentWrapper=Ke;exports.MessageCustomAction=mt;exports.MessageCustomActions=ct;exports.MessageHeader=qe;exports.MessageLoading=We;exports.MessageName=Ue;exports.MessageSourceItem=pt;exports.MessageSourceItemBreadcrumbIcon=Bn;exports.MessageSourceItemBreadcrumbs=vt;exports.MessageSourceItemDescription=At;exports.MessageSourceItemDescriptionPart=_t;exports.MessageSourceItemIcon=bt;exports.MessageSourceItemIndicator=Et;exports.MessageSourceItemTag=Pt;exports.MessageSourceItemTitle=gt;exports.MessageSources=ht;exports.MessageSourcesHeader=ut;exports.MessageSourcesList=Ct;exports.MessageToolbar=dt;exports.MessageWrapper=se;exports.Messages=Fe;exports.PrimitiveMessagePart=Pn;exports.Root=ue;exports.SendButton=ft;exports.SendButtonIcon=St;exports.TaglineBrandName=li;exports.TaglineContainer=di;exports.TaglineLogo=mi;exports.TaglineText=ci;exports.ToolbarHeader=ve;exports.Workflow=Re;exports.Workflows=we;exports.WorkflowsLabel=Le;exports.WorkflowsList=De;exports.Wrapper=he;
|