@inkeep/cxkit-primitives 0.5.72 → 0.5.75
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/atoms/icons/built-in-icon-renderer.cjs +1 -1
- package/dist/atoms/icons/built-in-icon-renderer.js +3 -1
- package/dist/atoms/icons/built-in-icons.cjs +1 -1
- package/dist/atoms/icons/built-in-icons.js +81 -79
- package/dist/atoms/icons/collections/bi.cjs +1 -0
- package/dist/atoms/icons/collections/bi.js +49 -0
- package/dist/atoms/icons/collections/fi.cjs +1 -0
- package/dist/atoms/icons/collections/fi.js +29 -0
- package/dist/atoms/icons/collections/gr.cjs +1 -0
- package/dist/atoms/icons/collections/gr.js +21 -0
- package/dist/atoms/icons/collections/io5.cjs +1 -0
- package/dist/atoms/icons/collections/io5.js +806 -0
- package/dist/atoms/icons/collections/pi.cjs +1 -0
- package/dist/atoms/icons/collections/pi.js +49 -0
- package/dist/atoms/icons/generate-icon.cjs +1 -0
- package/dist/atoms/icons/generate-icon.js +56 -0
- package/dist/components/embedded-chat.cjs +4 -4
- package/dist/components/embedded-chat.js +808 -811
- package/dist/index.d.cts +0 -11
- package/dist/index.d.ts +0 -11
- package/dist/providers/base-events-provider.cjs +1 -1
- package/dist/providers/base-events-provider.js +1 -1
- package/package.json +5 -5
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/fa6/index.cjs +0 -1
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/fa6/index.js +0 -92
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/fi/index.cjs +0 -1
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/fi/index.js +0 -8
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/hi2/index.cjs +0 -1
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/hi2/index.js +0 -8
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/io5/index.cjs +0 -1
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/io5/index.js +0 -128
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/lib/iconBase.cjs +0 -1
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/lib/iconBase.js +0 -109
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/lib/iconContext.cjs +0 -1
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/lib/iconContext.js +0 -13
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/lu/index.cjs +0 -1
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/lu/index.js +0 -88
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../generate-icon.cjs");function t(a){return l.GenIcon({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M44,120H212a4,4,0,0,0,4-4V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76A4,4,0,0,0,44,120ZM152,44l44,44H152Zm72,108.53a8.18,8.18,0,0,1-8.25,7.47H192v16h15.73a8.17,8.17,0,0,1,8.25,7.47,8,8,0,0,1-8,8.53H192v15.73a8.17,8.17,0,0,1-7.47,8.25,8,8,0,0,1-8.53-8V152a8,8,0,0,1,8-8h32A8,8,0,0,1,224,152.53ZM64,144H48a8,8,0,0,0-8,8v55.73A8.17,8.17,0,0,0,47.47,216,8,8,0,0,0,56,208v-8h7.4c15.24,0,28.14-11.92,28.59-27.15A28,28,0,0,0,64,144Zm-.35,40H56V160h8a12,12,0,0,1,12,13.16A12.25,12.25,0,0,1,63.65,184ZM128,144H112a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h15.32c19.66,0,36.21-15.48,36.67-35.13A36,36,0,0,0,128,144Zm-.49,56H120V160h8a20,20,0,0,1,20,20.77C147.58,191.59,138.34,200,127.51,200Z"},child:[]}]})(a)}function i(a){return l.GenIcon({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,152a8,8,0,0,1-8,8H192v16h16a8,8,0,0,1,0,16H192v16a8,8,0,0,1-16,0V152a8,8,0,0,1,8-8h32A8,8,0,0,1,224,152ZM92,172a28,28,0,0,1-28,28H56v8a8,8,0,0,1-16,0V152a8,8,0,0,1,8-8H64A28,28,0,0,1,92,172Zm-16,0a12,12,0,0,0-12-12H56v24h8A12,12,0,0,0,76,172Zm88,8a36,36,0,0,1-36,36H112a8,8,0,0,1-8-8V152a8,8,0,0,1,8-8h16A36,36,0,0,1,164,180Zm-16,0a20,20,0,0,0-20-20h-8v40h8A20,20,0,0,0,148,180ZM40,112V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0ZM160,80h28.69L160,51.31Z"},child:[]}]})(a)}function e(a){return l.GenIcon({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M72.61,83.06a8,8,0,0,1,1.73-8.72l48-48a8,8,0,0,1,11.32,0l48,48A8,8,0,0,1,176,88H80A8,8,0,0,1,72.61,83.06ZM176,168H80a8,8,0,0,0-5.66,13.66l48,48a8,8,0,0,0,11.32,0l48-48A8,8,0,0,0,176,168Z"},child:[]}]})(a)}exports.PiCaretUpDownFill=e;exports.PiFilePdf=i;exports.PiFilePdfFill=t;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { GenIcon as t } from "../generate-icon.js";
|
|
3
|
+
function r(a) {
|
|
4
|
+
return t({
|
|
5
|
+
attr: { viewBox: "0 0 256 256", fill: "currentColor" },
|
|
6
|
+
child: [
|
|
7
|
+
{
|
|
8
|
+
tag: "path",
|
|
9
|
+
attr: {
|
|
10
|
+
d: "M44,120H212a4,4,0,0,0,4-4V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76A4,4,0,0,0,44,120ZM152,44l44,44H152Zm72,108.53a8.18,8.18,0,0,1-8.25,7.47H192v16h15.73a8.17,8.17,0,0,1,8.25,7.47,8,8,0,0,1-8,8.53H192v15.73a8.17,8.17,0,0,1-7.47,8.25,8,8,0,0,1-8.53-8V152a8,8,0,0,1,8-8h32A8,8,0,0,1,224,152.53ZM64,144H48a8,8,0,0,0-8,8v55.73A8.17,8.17,0,0,0,47.47,216,8,8,0,0,0,56,208v-8h7.4c15.24,0,28.14-11.92,28.59-27.15A28,28,0,0,0,64,144Zm-.35,40H56V160h8a12,12,0,0,1,12,13.16A12.25,12.25,0,0,1,63.65,184ZM128,144H112a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h15.32c19.66,0,36.21-15.48,36.67-35.13A36,36,0,0,0,128,144Zm-.49,56H120V160h8a20,20,0,0,1,20,20.77C147.58,191.59,138.34,200,127.51,200Z"
|
|
11
|
+
},
|
|
12
|
+
child: []
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
})(a);
|
|
16
|
+
}
|
|
17
|
+
function i(a) {
|
|
18
|
+
return t({
|
|
19
|
+
attr: { viewBox: "0 0 256 256", fill: "currentColor" },
|
|
20
|
+
child: [
|
|
21
|
+
{
|
|
22
|
+
tag: "path",
|
|
23
|
+
attr: {
|
|
24
|
+
d: "M224,152a8,8,0,0,1-8,8H192v16h16a8,8,0,0,1,0,16H192v16a8,8,0,0,1-16,0V152a8,8,0,0,1,8-8h32A8,8,0,0,1,224,152ZM92,172a28,28,0,0,1-28,28H56v8a8,8,0,0,1-16,0V152a8,8,0,0,1,8-8H64A28,28,0,0,1,92,172Zm-16,0a12,12,0,0,0-12-12H56v24h8A12,12,0,0,0,76,172Zm88,8a36,36,0,0,1-36,36H112a8,8,0,0,1-8-8V152a8,8,0,0,1,8-8h16A36,36,0,0,1,164,180Zm-16,0a20,20,0,0,0-20-20h-8v40h8A20,20,0,0,0,148,180ZM40,112V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0ZM160,80h28.69L160,51.31Z"
|
|
25
|
+
},
|
|
26
|
+
child: []
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
})(a);
|
|
30
|
+
}
|
|
31
|
+
function h(a) {
|
|
32
|
+
return t({
|
|
33
|
+
attr: { viewBox: "0 0 256 256", fill: "currentColor" },
|
|
34
|
+
child: [
|
|
35
|
+
{
|
|
36
|
+
tag: "path",
|
|
37
|
+
attr: {
|
|
38
|
+
d: "M72.61,83.06a8,8,0,0,1,1.73-8.72l48-48a8,8,0,0,1,11.32,0l48,48A8,8,0,0,1,176,88H80A8,8,0,0,1,72.61,83.06ZM176,168H80a8,8,0,0,0-5.66,13.66l48,48a8,8,0,0,0,11.32,0l48-48A8,8,0,0,0,176,168Z"
|
|
39
|
+
},
|
|
40
|
+
child: []
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
})(a);
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
h as PiCaretUpDownFill,
|
|
47
|
+
i as PiFilePdf,
|
|
48
|
+
r as PiFilePdfFill
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),h=require("react");function v(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const u=v(h),s={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},l=u.createContext?.(s);function d(e){return e?.map((r,t)=>u.createElement(r.tag,{key:t,...r.attr},d(r.child)))}function x(e){return r=>o.jsx(m,{attr:{...e.attr},...r,children:d(e.child)})}function m(e){const r=t=>{const{attr:c,size:f,title:i,...g}=e,a=f||t.size||"1em";let n;return t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className),o.jsxs("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",...t.attr,...c,...g,className:n,style:{color:e.color||t.color,...t.style,...e.style},height:a,width:a,xmlns:"http://www.w3.org/2000/svg",children:[i&&o.jsx("title",{children:i}),e.children]})};return l!==void 0?o.jsx(l.Consumer,{children:t=>r(t)}):r(s)}exports.DefaultContext=s;exports.GenIcon=x;exports.IconBase=m;exports.IconContext=l;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as s, jsxs as v } from "react/jsx-runtime";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
const a = {
|
|
5
|
+
color: void 0,
|
|
6
|
+
size: void 0,
|
|
7
|
+
className: void 0,
|
|
8
|
+
style: void 0,
|
|
9
|
+
attr: void 0
|
|
10
|
+
}, c = n.createContext?.(a);
|
|
11
|
+
function m(t) {
|
|
12
|
+
return t?.map(
|
|
13
|
+
(r, e) => n.createElement(r.tag, { key: e, ...r.attr }, m(r.child))
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function C(t) {
|
|
17
|
+
return (r) => /* @__PURE__ */ s(x, { attr: { ...t.attr }, ...r, children: m(t.child) });
|
|
18
|
+
}
|
|
19
|
+
function x(t) {
|
|
20
|
+
const r = (e) => {
|
|
21
|
+
const { attr: d, size: u, title: i, ...h } = t, o = u || e.size || "1em";
|
|
22
|
+
let l;
|
|
23
|
+
return e.className && (l = e.className), t.className && (l = (l ? l + " " : "") + t.className), // biome-ignore lint/a11y/noSvgWithoutTitle: <explanation>
|
|
24
|
+
/* @__PURE__ */ v(
|
|
25
|
+
"svg",
|
|
26
|
+
{
|
|
27
|
+
stroke: "currentColor",
|
|
28
|
+
fill: "currentColor",
|
|
29
|
+
strokeWidth: "0",
|
|
30
|
+
...e.attr,
|
|
31
|
+
...d,
|
|
32
|
+
...h,
|
|
33
|
+
className: l,
|
|
34
|
+
style: {
|
|
35
|
+
color: t.color || e.color,
|
|
36
|
+
...e.style,
|
|
37
|
+
...t.style
|
|
38
|
+
},
|
|
39
|
+
height: o,
|
|
40
|
+
width: o,
|
|
41
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
42
|
+
children: [
|
|
43
|
+
i && /* @__PURE__ */ s("title", { children: i }),
|
|
44
|
+
t.children
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
return c !== void 0 ? /* @__PURE__ */ s(c.Consumer, { children: (e) => r(e) }) : r(a);
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
a as DefaultContext,
|
|
53
|
+
C as GenIcon,
|
|
54
|
+
x as IconBase,
|
|
55
|
+
c as IconContext
|
|
56
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),g=require("react"),ie=require("react-textarea-autosize"),ba=require("@radix-ui/react-avatar"),ga=require("@radix-ui/react-checkbox"),Pa=require("@radix-ui/react-popover"),Aa=require("@radix-ui/react-tooltip"),_a=require("@radix-ui/react-scroll-area"),Fa=require("@radix-ui/react-select"),A=require("../atoms/dialog.cjs"),Ea=require("../atoms/avatars/ai.cjs"),ka=require("../atoms/avatars/user.cjs"),F=require("../atoms/icons/custom-icon.cjs"),x=require("../atoms/icons/built-in-icon-renderer.cjs"),Ia=require("../atoms/link.cjs"),ae=require("../atoms/markdown/index.cjs"),w=require("../providers/attachment-item-provider.cjs"),E=require("../providers/attachments-bar-provider.cjs"),B=require("../providers/source-item-provider.cjs"),C=require("../providers/config-provider.cjs"),O=require("../providers/conversation-provider.cjs"),V=require("../providers/chat-events-provider.cjs"),ne=require("../providers/feedback-provider.cjs"),q=require("../providers/message-attachments-provider.cjs"),P=require("../providers/message-provider.cjs"),be=require("../atoms/icons/checkbox-icon.cjs"),ee=require("../hooks/use-copy-to-clipboard.cjs"),U=require("../providers/feedback-item-provider.cjs"),Ma=require("../utils/get-message-metadata.cjs"),l=require("../utils/misc.cjs"),a=require("./factory.cjs"),v=require("./embedded-chat/chat-provider.cjs"),Sa=require("./tagline-logo-icon.cjs"),xa=require("../hooks/use-settle-action.cjs"),Ba=require("../hooks/use-container-size.cjs"),se=require("./embedded-chat/use-chat-action.cjs"),te=require("../providers/help-menu-provider.cjs"),_=require("../providers/chat-form-provider.cjs"),f=require("../providers/form-field-provider.cjs"),fa=require("react-hook-form"),Ta=require("../utils/highlight-emphasis.cjs"),ja=require("./modal/modal-provider.cjs"),ya=require("@inkeep/cxkit-color-mode"),re=require("../utils/compose-refs.cjs"),u=require("../utils/compose-event-handlers.cjs"),Ha=require("../hooks/use-scroll-to-bottom.cjs"),wa=require("../atoms/api/analytics/conversation.cjs"),La=require("../utils/transform-source/index.cjs"),Da=require("../hooks/use-debounce.cjs"),oe=require("../providers/hover-popover-provider.cjs"),Oa=require("./modal/widget-auto-focus.cjs");function L(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const de=L(ba),K=L(ga),T=L(Pa),j=L(Aa),R=L(_a),I=L(Fa),qa="__intro__",Ra=a.ikp("div",{_id:"aiChatWrapper"}),ge=g.forwardRef((t,e)=>{const{...i}=t,{isHidden:s,isMobile:r}=v.useChat(),[o,d]=Ba.useContainerSize(),c=re.useComposedRefs(e,o),m=d?.width?d.width>580:!0,h=ja.useModal();return n.jsx(Ra,{ref:c,"data-widget-md":l.dataAttr(m),"data-hidden":l.dataAttr(s),"data-in-modal":l.dataAttr(!!h),"data-mobile":l.dataAttr(r),...i})}),Wa=a.ikp("div",{_id:"aiChatConversationLoading"}),Pe=t=>{const{isLoadingConversation:e}=v.useChat();return e?n.jsx(Wa,{children:n.jsx("span",{children:"Loading..."}),...t}):null},Na=a.ikp("div",{_id:"aiChatRoot"}),Ae=t=>{const{isLoadingConversation:e,isHidden:i}=v.useChat(),{form:s}=_.useChatForm();return e||s?null:n.jsx(Na,{"data-hidden":l.dataAttr(i),...t})},Qa=a.ikp("div",{_id:"aiChatHeader"}),_e=a.ikp("div",{_id:"aiChatHeader__Toolbar"}),Fe=a.ikp("div",{_id:"aiChatHeader__ToolbarHeaderWrapper"}),$a=a.ikp("div",{_id:"aiChatHeader__ToolbarHeader"}),Ee=g.memo(t=>{const{aiChatSettings:e}=C.useInkeepConfig(),i=`Ask ${e.aiAssistantName||"AI"}`;return n.jsx($a,{...t,children:i})}),ke=a.ikp("div",{_id:"aiChatContent"}),Ie=a.ikp(R.Root,{_id:"aiChatContentScrollArea"}),Va=a.ikp(R.Viewport,{_id:"aiChatContentScrollArea__Viewport"}),Me=g.forwardRef(({children:t,...e},i)=>{const{containerRef:s}=Ha.useScrollToBottom(),r=re.useComposedRefs(i,s);return n.jsx(Va,{ref:r,children:n.jsx("div",{"data-part":"grid",style:{display:"grid"},children:t}),...e})}),Se=a.ikp(R.ScrollAreaScrollbar,{_id:"aiChatContentScrollArea__Scrollbar"}),xe=a.ikp(R.ScrollAreaThumb,{_id:"aiChatContentScrollArea__Thumb"}),Be=a.ikp(R.Corner,{_id:"aiChatContentScrollArea__Corner"}),Ua=a.ikp("div",{_id:"aiChatMessages"}),fe=t=>{const e=v.useChat(),{children:i,...s}=t;return n.jsx(Ua,{children:l.maybeRender(i,e),...s})},Ka=a.ikp("div",{_id:"aiChatDisclaimer"}),Te=g.memo(t=>{const{aiChatSettings:e}=C.useInkeepConfig(),[i,s]=g.useState(!1),r=Da.useDebounce(i,100);return e.disclaimerSettings?.isEnabled?n.jsx(oe.HoverPopoverProvider,{open:i,setOpen:s,children:n.jsx(T.Root,{open:r,onOpenChange:s,children:n.jsx(Ka,{...t})})}):null}),za=a.ikp("span",{_id:"aiChatDisclaimerLabel"}),je=g.memo(t=>{const{aiChatSettings:e}=C.useInkeepConfig(),i=e.disclaimerSettings;return n.jsx(za,{children:i?.label,...t})}),Ga=a.ikp(T.Trigger,{_id:"aiChatDisclaimerTrigger",children:n.jsx(F.CustomIcon,{iconKey:"info"})}),ye=g.memo(t=>{const{setOpen:e}=oe.useHoverPopover(),i=()=>e(!0),s=()=>e(!1);return n.jsx(Ga,{onMouseEnter:i,onMouseLeave:s,...t})}),Ya=a.ikp(T.Content,{_id:"aiChatDisclaimerContent"}),He=t=>{const{setOpen:e}=oe.useHoverPopover(),i=()=>e(!0),s=()=>e(!1);return n.jsx(Ya,{onMouseEnter:i,onMouseLeave:s,side:"top",sideOffset:8,align:"end",alignOffset:-10,...t})},Ja=a.ikp(ae.Markdown,{_id:"aiChatDisclaimerText"}),we=g.memo(t=>{const{aiChatSettings:e}=C.useInkeepConfig(),i=e.aiAssistantName,r=e.disclaimerSettings?.tooltip||`Information provided by ${i||"this AI assistant"} is not guaranteed to be accurate or comprehensive.`;return n.jsx(Ja,{shouldOpenLinksInNewTab:!0,children:r,...t})}),Le=a.ikp(T.Arrow,{_id:"aiChatDisclaimerArrow"}),Xa=a.ikp("div",{_id:"aiChatExampleQuestions"}),De=t=>{const{aiChatSettings:e}=C.useInkeepConfig(),{messages:i}=v.useChat();return!e.exampleQuestions?.length||i.length?null:n.jsx(Xa,{...t})},Za=a.ikp("h3",{_id:"aiChatExampleQuestionsLabel"}),Oe=g.memo(t=>{const{aiChatSettings:e}=C.useInkeepConfig();return n.jsx(Za,{children:e.exampleQuestionsLabel,...t})}),en=a.ikp("div",{_id:"aiChatExampleQuestionsList"}),qe=g.memo(t=>{const{aiChatSettings:e}=C.useInkeepConfig(),i=e.exampleQuestions,{children:s,...r}=t;return n.jsx(en,{children:l.maybeRender(s,i),...r})}),tn=a.ikp("div",{_id:"aiChatExampleQuestion"}),Re=g.forwardRef((t,e)=>{const{aiChatSettings:i}=C.useInkeepConfig(),s=i.isFirstExampleQuestionHighlighted;return n.jsx(tn,{ref:e,"data-highlight":l.dataAttr(s),...t})}),an=a.ikp("button",{_id:"aiChatExampleQuestionButton"}),We=t=>{const{question:e,onClick:i,...s}=t,{handleSubmit:r}=v.useChat();return n.jsx(an,{onClick:u.composeEventHandlers(i,()=>r(e)),children:e,...s})},nn=a.ikp("div",{_id:"aiChatWorkflows"}),Ne=t=>{const{aiChatSettings:e}=C.useInkeepConfig(),{messages:i}=v.useChat();return!e.workflows?.length||i.length?null:n.jsx(nn,{...t})},sn=a.ikp("h3",{_id:"aiChatWorkflowsLabel"}),Qe=g.memo(t=>{const{aiChatSettings:e}=C.useInkeepConfig();return n.jsx(sn,{children:e.workflowsHeader,...t})}),rn=a.ikp("div",{_id:"aiChatWorkflowsList"}),$e=g.memo(t=>{const{aiChatSettings:e}=C.useInkeepConfig(),i=e.workflows,{children:s,...r}=t;return n.jsx(rn,{children:l.maybeRender(s,i),...r})}),on=a.ikp("button",{_id:"aiChatWorkflow"}),Ve=t=>{const{workflow:e,onClick:i,...s}=t,{handleWorkflow:r}=v.useChat();return n.jsx(on,{onClick:u.composeEventHandlers(i,()=>r(e)),children:e.displayName,...s})},dn=a.ikp("div",{_id:"aiChatMessageWrapper"}),ce=t=>{const{message:e,...i}=t;return e.role==="system"?null:n.jsx(P.MessageProvider,{message:e,children:n.jsx(dn,{"data-role":e.role,...i})})},Ue=g.memo(t=>{const{message:e,...i}=t,{aiChatSettings:s,baseSettings:r}=C.useInkeepConfig(),o=s.aiAssistantName,d=o?`Hi, I'm ${o}!`:"Hi!",c=s.chatSubjectName??r.organizationDisplayName,m=`${d}
|
|
2
2
|
|
|
3
3
|
I'm an AI assistant trained on documentation, help articles, and other content.`,h=c?`
|
|
4
4
|
|
|
5
5
|
Ask me anything about \`${c}\`.`:`
|
|
6
6
|
|
|
7
|
-
Let me know how I can help.`,v={content:r.introMessage??`${m}${h}`,id:$a,...e,role:"assistant",links:[]};return n.jsx(ce,{message:v,...i})}),Cn=a.ikp("div",{_id:"aiChatMessageHeader"}),ze=t=>{const{message:e}=P.useMessage();return n.jsx(Cn,{"data-role":e.role,...t})},pn=a.ikp("div",{_id:"aiChatMessageLoading"}),Ge=t=>{const{isLoading:e,isStreaming:i,messages:r}=g.useChat(),{message:s}=P.useMessage();return!(r.at(-1)?.id===s?.id)||s.role!=="assistant"||!e||i?null:n.jsx(pn,{children:"Thinking...",...t})},vn=a.ikp("div",{_id:"aiChatMessageAvatar"}),Ye=t=>{const{message:e}=P.useMessage();return n.jsx(vn,{"data-role":e.role,...t})},bn=a.ikp(de.Root,{_id:"aiChatMessageAvatarContent"}),Je=t=>{const{message:e}=P.useMessage(),{baseSettings:i}=C.useInkeepConfig();return n.jsx(bn,{"data-username":l.dataAttr(e.role==="user"&&!!i.userProperties.name),"data-role":e.role,...t})},gn=a.ikp(de.Fallback,{_id:"aiChatMessageAvatarFallback"}),Xe=b.memo(t=>{const{baseSettings:e}=C.useInkeepConfig(),{message:i}=P.useMessage();return e.userProperties.name?n.jsx(gn,{"data-role":i.role,children:l.getInitials(e.userProperties.name),...t}):null}),pe=a.ikp(de.Image,{_id:"aiChatMessageAvatarImage"}),Ze=b.memo(t=>{const{onLoadingStatusChange:e,...i}=t,{aiChatSettings:r,baseSettings:{userProperties:s}}=C.useInkeepConfig(),{message:o}=P.useMessage(),{aiAssistantAvatar:d}=r??{},c=typeof d=="string"?d:d?.light,m=(typeof d=="string"?d:d?.dark)??c,h=Da.useColorModeValue(c,m),[p,v]=b.useState(h);b.useEffect(()=>{v(h)},[h]);const k=y=>{y==="error"&&v(null)};return o.role==="user"?s.name?null:r.userAvatar?n.jsx(pe,{"data-type":"image","data-role":o.role,src:r.userAvatar,...t}):n.jsx(xa.default,{"data-type":"icon","data-role":o.role,...t}):p?n.jsx(pe,{src:p,"data-type":"image","data-role":o.role,onLoadingStatusChange:u.composeEventHandlers(e,k),...i}):n.jsx(Sa.default,{"data-type":"icon","data-role":o.role,...t})}),Pn=a.ikp("span",{_id:"aiChatMessageName"}),et=t=>{const{message:e}=P.useMessage();return n.jsx(Pn,{"data-role":e.role,children:e.role==="user"?"You":"AI assistant",...t})},_n=a.ikp("div",{_id:"aiChatMessageContentWrapper"}),tt=t=>{const{message:e}=P.useMessage();return n.jsx(_n,{"data-role":e.role,...t})},An=a.ikp("div",{_id:"aiChatMessageContent"}),it=t=>{const{message:e}=P.useMessage();return n.jsx(An,{"data-role":e.role,...t})},En=a.ikp("div",{_id:"aiChatMessageAttachments"}),at=t=>{const{message:e}=P.useMessage(),i=e.metadata?.attributes?.attachments;return e.role!=="user"||!i?.length?null:n.jsx(q.MessageAttachmentsProvider,{children:n.jsx(En,{...t})})},Fn=a.ikp("div",{_id:"aiChatMessageAttachments__List"}),nt=t=>{const{children:e,...i}=t,{message:r}=P.useMessage(),s=r.metadata?.attributes?.attachments;return s?n.jsx(Fn,{children:l.maybeRender(e,s),...i}):null},kn=a.ikp("div",{_id:"aiChatMessageAttachments__Item"}),rt=t=>{const{attachment:e,onClick:i,...r}=t,{selectItem:s,onOpen:o}=q.useMessageAttachments(),d=()=>{s(e),o()};return n.jsx(w.AttachmentItemProvider,{attachment:e,children:n.jsx(kn,{onClick:u.composeEventHandlers(i,d),...r})})},In=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatMessageAttachments__ItemIcon"}),st=t=>{const{attachment:e}=w.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?n.jsx(In,{iconSettings:i,...t}):null},Mn=a.ikp("span",{_id:"aiChatMessageAttachments__ItemTitle"}),ot=t=>{const{attachment:e}=w.useAttachmentItem();return n.jsx(Mn,{children:e.title,...t})},Sn=a.ikp(_.Root,{_id:"aiChatMessageAttachmentsPreview"}),dt=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(Sn,{open:s&&d!==null,onOpenChange:u.composeEventHandlers(e,c),...i})},ct=a.ikp(_.Overlay,{_id:"aiChatMessageAttachmentsPreview__Overlay"}),mt=a.ikp(_.Content,{_id:"aiChatMessageAttachmentsPreview__Content","aria-describedby":void 0}),xn=a.ikp(_.Title,{_id:"aiChatMessageAttachmentsPreview__Header"}),lt=t=>{const{selectedItem:e}=q.useMessageAttachments();return n.jsx(xn,{children:e?.title||"Attachment",...t})},ht=a.ikp(_.Close,{_id:"aiChatMessageAttachmentsPreview__Close",children:n.jsx(E.CustomIcon,{iconKey:"close"})}),Bn=a.ikp("p",{_id:"aiChatMessageAttachmentsPreview__Body"}),ut=t=>{const{selectedItem:e}=q.useMessageAttachments();return n.jsx(Bn,{children:e?.content,...t})},ve=a.ikp("div",{_id:"aiChatMessage"}),Ct=t=>{const{aiChatSettings:e}=C.useInkeepConfig(),{componentStyles:i,...r}=t,{message:s}=P.useMessage(),{logEvent:o}=V.useChatEvents(),d=l.getMessageContent(s),{conversation:c}=O.useInkeepConversation();return s.role==="user"?n.jsx(ve,{"data-role":s.role,children:d,...r}):n.jsx(ve,{"data-role":s.role,...r,children:n.jsx(ae.Markdown,{children:d,componentStyles:i,shouldOpenLinksInNewTab:e.shouldOpenLinksInNewTab,onLinkClick:(m,h)=>{o({eventName:"assistant_message_inline_link_opened",properties:{title:h?.toString(),url:m}})},onCodeCopy:(m,h)=>{o({eventName:"assistant_code_block_copied",properties:{conversation:c,language:m,code:h}})}})})},fn=a.ikp("div",{_id:"aiChatMessageToolbar"}),pt=t=>{const{isLoading:e,messages:i}=g.useChat(),{message:r}=P.useMessage();return i.at(-1)?.id===r?.id&&e||r.role==="user"?null:n.jsx(fn,{...t})},Tn=a.ikp("div",{_id:"aiChatMessageToolActions"}),vt=t=>{const{children:e,...i}=t,{message:r}=P.useMessage(),{messageButtons:s}=g.useChat(),o=s[r.id]||[];return n.jsx(Tn,{children:l.maybeRender(e,o),...i})},jn=a.ikp("a",{_id:"aiChatMessageToolAction"}),yn=a.ikp("button",{_id:"aiChatMessageToolAction"}),bt=t=>{const{onClick:e,action:i,...r}=t,{handleAction:s}=re.useChatAction(i),o=()=>{s()},d=i.label||"Contact Support",c=n.jsxs(n.Fragment,{children:[i.icon&&n.jsx(x.BuiltInIconRenderer,{iconSettings:i.icon}),d]});return i.action.type==="open_link"?n.jsx(jn,{href:i.action.url,target:"_blank",rel:"noopener","data-type":i.action.type,onClick:u.composeEventHandlers(e,o),children:c,...r}):n.jsx(yn,{"data-type":i.action.type,onClick:u.composeEventHandlers(e,o),children:c,...r})},Hn=a.ikp("button",{_id:"aiChatMessageAction"}),gt=t=>{const{action:e,onClick:i,className:r,...s}=t,{conversation:o}=O.useInkeepConversation(),{message:d}=P.useMessage(),{isStreaming:c,messages:m}=g.useChat(),[h,p]=ee.useCopyToClipboard(),{feedback:v,submitPositiveFeedback:k,setCurrentFeedback:y,currentFeedback:R}=ne.useMessageFeedback(),{logEvent:Y}=V.useChatEvents(),[N,J]=ja.useSettleAction(),{baseSettings:{privacyPreferences:he}}=C.useInkeepConfig(),{optOutAllAnalytics:X}=he,ue=m.at(-1)?.id===d?.id,Z=d.role==="assistant";if(ue&&c||!Z||{copy:!1,upvote:X,downvote:X}[e])return null;const H={copy(){p(l.getMessageContent(d)),Y({eventName:"assistant_message_copied",properties:{conversation:o}})},upvote(){k(d.id).then(()=>{J()})},downvote(){y(d.id)}},D={copy:"Copy Message",upvote:"Upvote Message",downvote:"Downvote Message"},M={copy:n.jsx(E.CustomIcon,{iconKey:h?"messageCopied":"messageCopy"}),upvote:n.jsx(E.CustomIcon,{iconKey:N?"messageCopied":"thumbsUp"}),downvote:n.jsx(E.CustomIcon,{iconKey:"thumbsDown"})},S={copy:{"data-copied":l.dataAttr(h)},upvote:{"data-upvoted":l.dataAttr(v[d.id]?.type==="positive")},downvote:{"data-downvoted":l.dataAttr(v[d.id]?.type==="negative"),"data-state":R===null?"closed":"open"}};return n.jsx(Hn,{"data-action":e,...S[e],children:M[e],"aria-label":D[e],className:`${r} ${e}`,onClick:u.composeEventHandlers(i,H[e]),...s})},wn=a.ikp("div",{_id:"aiChatMessageSources"}),Pt=t=>{const{message:e}=P.useMessage();return e.role!=="assistant"||!e.links?.length?null:n.jsx(wn,{...t})},Ln=a.ikp("div",{_id:"aiChatMessageSources__Header"}),_t=t=>n.jsx(Ln,{children:"Sources",...t}),Dn=a.ikp("div",{_id:"aiChatMessageSources__List"}),At=t=>{const{message:e}=P.useMessage(),{children:i,...r}=t,{baseSettings:{transformSource:s,organizationDisplayName:o},aiChatSettings:{shouldOpenLinksInNewTab:d},searchSettings:{tabs:c}}=C.useInkeepConfig();if(e.role!=="assistant")return null;const m=e.links.map(h=>{const p=Wa.transformInkeepSource(h,"chatSourceItem",{organizationDisplayName:o,tabs:c,transformSource:s}),v=p.shouldOpenInNewTab!==void 0?p.shouldOpenInNewTab:d;return{...p,isExternal:v}});return n.jsx(Dn,{children:l.maybeRender(i,m),...r})},On=a.ikp(Ba.LinkWithQueryParams,{_id:"aiChatMessageSourceItem"}),Et=t=>{const{source:e,onClick:i,...r}=t,{logEvent:s}=V.useChatEvents(),{conversation:o}=O.useInkeepConversation(),d=()=>{s({eventName:"assistant_source_item_clicked",properties:{conversation:o,link:e}})};return n.jsx(B.SourceItemProvider,{source:e,children:n.jsx(On,{"data-type":e.type,appendToUrl:e.appendToUrl,isExternal:e.isExternal,"data-breadcrumbs":!!e.breadcrumbs?.length,onClick:u.composeEventHandlers(i,d),...r})})},qn=a.ikp("div",{_id:"aiChatMessageSourceItem__Breadcrumbs"}),Ft=t=>{const{source:e}=B.useSourceItem();return e.breadcrumbs?.length?n.jsx(qn,{"data-type":e.type,...t}):null},Wn=a.ikp(E.CustomIcon,{_id:"aiChatMessageSourceItem__BreadcrumbIcon",iconKey:"breadcrumbSeparator"}),Rn=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatMessageSourceItem__Icon"}),kt=t=>{const{source:e}=B.useSourceItem();return n.jsx(Rn,{iconSettings:e.icon,"data-type":e.type,...t})},Nn=a.ikp("span",{_id:"aiChatMessageSourceItem__Title"}),It=t=>{const{source:e}=B.useSourceItem();return n.jsx(Nn,{"data-type":e.type,children:e.title,...t})},$n=a.ikp("span",{_id:"aiChatMessageSourceItem__Tag"}),Mt=t=>{const{source:e}=B.useSourceItem();return n.jsx($n,{"data-type":e.type,...t})},Qn=a.ikp("span",{_id:"aiChatMessageSourceItem__Description"}),St=t=>{const{source:e}=B.useSourceItem(),{children:i,...r}=t,s=b.useMemo(()=>e.description?wa.highlightEmphasis(e.description):[],[e.description]);return s.length?n.jsx(Qn,{"data-type":e.type,children:l.maybeRender(i,s),...r}):null},Vn=a.ikp("span",{_id:"aiChatMessageSourceItem__DescriptionPart"}),xt=t=>{const{part:e,...i}=t,{source:r}=B.useSourceItem();return typeof e=="string"?e:n.jsx(Vn,{"data-type":r.type,children:e.content,"data-highlighted":l.dataAttr(e.highlighted),...i})},Un=a.ikp(E.CustomIcon,{_id:"aiChatMessageSourceItem__Indicator"}),Bt=t=>{const{source:e}=B.useSourceItem();return n.jsx(Un,{iconKey:e.isExternal?"openLinkInNewTab":"openLinkInSameTab",...t})},ft=a.ikp("div",{_id:"aiChatFooter"}),Tt=a.ikp("div",{_id:"aiChatInput__Fieldset"}),jt=a.ikp("div",{_id:"aiChatInput__Group"}),Kn=a.ikp("textarea",{_id:"aiChatInput"}),yt=b.forwardRef(({onChange:t,onKeyDown:e,...i},r)=>{const{handleInputChange:s,handleInputKeyDown:o,input:d,error:c,shouldAutoFocusInput:m,inputRef:h}=g.useChat(),{aiChatSettings:p}=C.useInkeepConfig(),v=se.useComposedRefs(r,h);return Na.useWidgetAutoFocus("chat",h,m),n.jsx(Kn,{asChild:!0,ref:v,maxLength:99999,placeholder:p.placeholder,value:d,onChange:u.composeEventHandlers(t,s),onKeyDown:u.composeEventHandlers(e,o),disabled:!!c||p.isViewOnly,...i,children:n.jsx(ie,{})})}),zn=a.ikp("button",{_id:"aiChatInput__SendButton"}),Ht=t=>{const{handleSubmit:e,isSubmitDisabled:i,error:r}=g.useChat(),{aiChatSettings:s}=C.useInkeepConfig(),{onClick:o,...d}=t;return n.jsx(zn,{onClick:u.composeEventHandlers(o,()=>e()),"aria-label":"Send message",disabled:i||!!r||s.isViewOnly,...d})},wt=a.ikp(E.CustomIcon,{_id:"aiChatInput__SendButtonIcon",iconKey:"chatSubmit"}),Gn=a.ikp("div",{_id:"aiChatAttachmentsBar"}),Lt=t=>{const{selectedWorkflow:e}=g.useChat();return!e||!e.supportedInputs?.length?null:n.jsx(F.AttachmentsBarProvider,{children:n.jsx(Gn,{...t})})},Yn=a.ikp("div",{_id:"aiChatAttachmentsBar__List"}),Dt=t=>{const{children:e,...i}=t,{messageAttachments:r}=g.useChat();return n.jsx(Yn,{children:l.maybeRender(e,r),...i})},Jn=a.ikp("div",{_id:"aiChatAttachmentsBar__Attachment"}),Ot=t=>{const{attachment:e,...i}=t;return n.jsx(w.AttachmentItemProvider,{attachment:e,children:n.jsx(Jn,{...i})})},Xn=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatAttachmentsBar__AttachmentIcon"}),qt=t=>{const{attachment:e}=w.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?n.jsx(Xn,{iconSettings:i,...t}):null},Zn=a.ikp("span",{_id:"aiChatAttachmentsBar__AttachmentTitle"}),Wt=t=>{const{attachment:e}=w.useAttachmentItem();return n.jsx(Zn,{children:e.title,...t})},er=a.ikp("button",{_id:"aiChatAttachmentsBar__AttachmentDelete"}),Rt=t=>{const{onClick:e,...i}=t,{attachment:r}=w.useAttachmentItem(),{setMessageAttachments:s}=g.useChat(),o=()=>{s(d=>d.filter(c=>c.id!==r.id))};return n.jsx(er,{"aria-label":"Remove attachment",children:n.jsx(E.CustomIcon,{iconKey:"close"}),onClick:u.composeEventHandlers(e,o),...i})},Nt=a.ikp("div",{_id:"aiChatAttachmentsBar__Actions"}),$t=a.ikp(j.Tooltip,{_id:"aiChatAttachmentsBar__InfoTip",delayDuration:0}),Qt=a.ikp(j.Trigger,{_id:"aiChatAttachmentsBar__InfoTipIcon",children:n.jsx(E.CustomIcon,{iconKey:"info"})}),me=a.ikp(j.Arrow,{_id:"aiChatAttachmentsBar__InfoTipArrow"}),Vt=a.ikp(j.Content,{_id:"aiChatAttachmentsBar__InfoTipText",side:"bottom",sideOffset:3,align:"center",children:n.jsxs(n.Fragment,{children:[n.jsx(me,{}),"Attachments will be kept in context for the entire conversation."]})}),tr=a.ikp("div",{_id:"aiChatAttachmentsBar__Inputs"}),Ut=t=>{const{children:e,...i}=t,{selectedWorkflow:r}=g.useChat();return r?.supportedInputs?n.jsx(tr,{children:l.maybeRender(e,r.supportedInputs),...i}):null},ir=a.ikp("button",{_id:"aiChatAttachmentsBar__Input"}),Kt=t=>{const{input:e,onClick:i,...r}=t,{selectedWorkflow:s,messageAttachments:o,setMessageAttachments:d}=g.useChat(),{selectInput:c,onOpen:m}=F.useAttachmentsBar(),h=()=>{if(e.type==="FUNCTIONAL_MULTI_ATTACHMENT")return s?e.onInvoke(s,e,d,[...o]):void 0;c(e),m()};return n.jsx(ir,{children:e.displayName,onClick:u.composeEventHandlers(i,h),...r})},zt=a.ikp(Ma.IoAdd,{_id:"aiChatAttachmentsBar__InputIcon"}),ar=a.ikp(_.Root,{_id:"aiChatAttachmentsBar__Modal"}),Gt=t=>{const{onOpenChange:e,...i}=t,{selectInput:r,isOpen:s,onClose:o,selectedInput:d}=F.useAttachmentsBar(),c=m=>{m||(o(),r(null))};return n.jsx(ar,{open:s&&d!==null,onOpenChange:u.composeEventHandlers(e,c),...i})},Yt=a.ikp(_.Overlay,{_id:"aiChatAttachmentsBar__ModalOverlay"}),Jt=a.ikp(_.Content,{_id:"aiChatAttachmentsBar__ModalContent","aria-describedby":void 0}),Xt=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHeader"}),nr=a.ikp(_.Title,{_id:"aiChatAttachmentsBar__ModalHeading"}),Zt=t=>{const{selectedInput:e}=F.useAttachmentsBar(),i=`Add ${e?.displayName}`;return n.jsx(nr,{children:i,...t})},rr=a.ikp("span",{_id:"aiChatAttachmentsBar__ModalDescription"}),ei=t=>{const{selectedInput:e}=F.useAttachmentsBar(),i=e?.workflowModalProps?.modalHelpText;return i?n.jsx(rr,{children:i,...t}):null},sr=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHelp"}),ti=t=>{const{children:e,...i}=t,{selectedInput:r}=F.useAttachmentsBar(),s=r?.workflowModalProps?.modalHelpElement;return s?n.jsx(sr,{asChild:!e,children:e||s,...i}):null},ii=a.ikp(_.Close,{_id:"aiChatAttachmentsBar__ModalClose",children:n.jsx(E.CustomIcon,{iconKey:"close"})}),ai=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalBody"}),or=a.ikp("form",{_id:"aiChatAttachmentsBar__Form"}),ni=t=>{const{onSubmit:e,...i}=t,{form:r}=F.useAttachmentsBar();return n.jsx(or,{onSubmit:u.composeEventHandlers(e,r.onSubmit),...i})},ri=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),dr=a.ikp("label",{_id:"aiChatAttachmentsBar__FormTitleLabel"}),si=t=>{const{form:e,selectedInput:i}=F.useAttachmentsBar();return n.jsx(dr,{htmlFor:`${i?.id}-title`,children:e.labels.title,...t})},cr=a.ikp("input",{_id:"aiChatAttachmentsBar__FormTitleInput"}),oi=t=>{const{onChange:e,...i}=t,{form:r,selectedInput:s}=F.useAttachmentsBar();return n.jsx(cr,{name:"title",value:r.data.title,id:`${s?.id}-title`,"data-invalid":l.dataAttr(!!r.errors.title),"aria-invalid":!!r.errors.title,onChange:u.composeEventHandlers(e,r.onChange),...i})},mr=a.ikp("span",{_id:"aiChatAttachmentsBar__FormTitleError"}),di=t=>{const{form:e}=F.useAttachmentsBar();return e.errors.title?n.jsx(mr,{"aria-live":"polite",children:e.errors.title,...t}):null},ci=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),lr=a.ikp("label",{_id:"aiChatAttachmentsBar__FormContentLabel"}),mi=t=>{const{form:e,selectedInput:i}=F.useAttachmentsBar();return n.jsx(lr,{htmlFor:`${i?.id}-content`,children:e.labels.content,...t})},hr=a.ikp("textarea",{_id:"aiChatAttachmentsBar__FormTitleInput"}),li=t=>{const{onChange:e,...i}=t,{form:r,selectedInput:s}=F.useAttachmentsBar();return n.jsx(hr,{asChild:!0,rows:4,name:"content",value:r.data.content,id:`${s?.id}-content`,"data-invalid":l.dataAttr(!!r.errors.content),"aria-invalid":!!r.errors.content,onChange:u.composeEventHandlers(e,r.onChange),...i,children:n.jsx(ie,{maxRows:10})})},ur=a.ikp("span",{_id:"aiChatAttachmentsBar__FormContentError"}),hi=t=>{const{form:e}=F.useAttachmentsBar();return e.errors.content?n.jsx(ur,{"aria-live":"polite",children:e.errors.content,...t}):null},ui=a.ikp("button",{_id:"aiChatAttachmentsBar__FormSubmitButton",children:"Upload",type:"submit"}),Ci=a.ikp("div",{_id:"aiChatActionBar"}),pi=a.ikp("div",{_id:"aiChat__ChatActions"}),vi=a.ikp("div",{_id:"aiChatTagline__Container"}),bi=a.ikp("span",{_id:"aiChatTagline__Text",children:"Powered by"}),gi=a.ikp(Ta.default,{_id:"aiChatTagline__Logo"}),Pi=a.ikp("a",{_id:"aiChatTagline__BrandName",children:"inkeep",href:"https://www.inkeep.com/",target:"_blank",rel:"noopener noreferrer"}),Cr=a.ikp(j.Trigger,{_id:"aiChat__ChatAction"}),z=t=>{const{action:e,onClick:i,className:r,...s}=t,{clear:o,stop:d,isLoading:c,messages:m,selectedWorkflow:h}=g.useChat(),{conversation:p}=O.useInkeepConversation(),{aiChatSettings:v,baseSettings:k}=C.useInkeepConfig(),{logEvent:y}=V.useChatEvents(),[R,Y]=ee.useCopyToClipboard(),[N,J]=ee.useCopyToClipboard();if({help:!1,copy:m.length===0||!v.isCopyChatButtonVisible||c,share:m.length===0||!v.isShareButtonVisible||!p.id||!!h||c,clear:m.length===0||v.isViewOnly||c,stop:!c}[e])return null;const Z={help:()=>{},copy:()=>{const $=m.map(H=>{const D=`**${H.role==="assistant"?"AI Assistant":"User"}**`,M=l.getMessageContent(H),S=fa.stringifyAttachments(H.metadata?.attributes?.attachments),Q=S?`
|
|
7
|
+
Let me know how I can help.`,b={content:s.introMessage??`${m}${h}`,id:qa,...e,role:"assistant",links:[]};return n.jsx(ce,{message:b,...i})}),cn=a.ikp("div",{_id:"aiChatMessageHeader"}),Ke=t=>{const{message:e}=P.useMessage();return n.jsx(cn,{"data-role":e.role,...t})},mn=a.ikp("div",{_id:"aiChatMessageLoading"}),ze=t=>{const{isLoading:e,isStreaming:i,messages:s}=v.useChat(),{message:r}=P.useMessage();return!(s.at(-1)?.id===r?.id)||r.role!=="assistant"||!e||i?null:n.jsx(mn,{children:"Thinking...",...t})},ln=a.ikp("div",{_id:"aiChatMessageAvatar"}),Ge=t=>{const{message:e}=P.useMessage();return n.jsx(ln,{"data-role":e.role,...t})},hn=a.ikp(de.Root,{_id:"aiChatMessageAvatarContent"}),Ye=t=>{const{message:e}=P.useMessage(),{baseSettings:i}=C.useInkeepConfig();return n.jsx(hn,{"data-username":l.dataAttr(e.role==="user"&&!!i.userProperties.name),"data-role":e.role,...t})},un=a.ikp(de.Fallback,{_id:"aiChatMessageAvatarFallback"}),Je=g.memo(t=>{const{baseSettings:e}=C.useInkeepConfig(),{message:i}=P.useMessage();return e.userProperties.name?n.jsx(un,{"data-role":i.role,children:l.getInitials(e.userProperties.name),...t}):null}),pe=a.ikp(de.Image,{_id:"aiChatMessageAvatarImage"}),Xe=g.memo(t=>{const{onLoadingStatusChange:e,...i}=t,{aiChatSettings:s,baseSettings:{userProperties:r}}=C.useInkeepConfig(),{message:o}=P.useMessage(),{aiAssistantAvatar:d}=s??{},c=typeof d=="string"?d:d?.light,m=(typeof d=="string"?d:d?.dark)??c,h=ya.useColorModeValue(c,m),[p,b]=g.useState(h);g.useEffect(()=>{b(h)},[h]);const k=y=>{y==="error"&&b(null)};return o.role==="user"?r.name?null:s.userAvatar?n.jsx(pe,{"data-type":"image","data-role":o.role,src:s.userAvatar,...t}):n.jsx(ka.default,{"data-type":"icon","data-role":o.role,...t}):p?n.jsx(pe,{src:p,"data-type":"image","data-role":o.role,onLoadingStatusChange:u.composeEventHandlers(e,k),...i}):n.jsx(Ea.default,{"data-type":"icon","data-role":o.role,...t})}),Cn=a.ikp("span",{_id:"aiChatMessageName"}),Ze=t=>{const{message:e}=P.useMessage();return n.jsx(Cn,{"data-role":e.role,children:e.role==="user"?"You":"AI assistant",...t})},pn=a.ikp("div",{_id:"aiChatMessageContentWrapper"}),et=t=>{const{message:e}=P.useMessage(),{messageButtons:i}=v.useChat(),s=i[e.id]||[];return n.jsx(pn,{"data-role":e.role,"data-has-message-buttons":l.dataAttr(!!s.length),...t})},vn=a.ikp("div",{_id:"aiChatMessageContent"}),tt=t=>{const{message:e}=P.useMessage();return n.jsx(vn,{"data-role":e.role,...t})},bn=a.ikp("div",{_id:"aiChatMessageAttachments"}),it=t=>{const{message:e}=P.useMessage(),i=e.metadata?.attributes?.attachments;return e.role!=="user"||!i?.length?null:n.jsx(q.MessageAttachmentsProvider,{children:n.jsx(bn,{...t})})},gn=a.ikp("div",{_id:"aiChatMessageAttachments__List"}),at=t=>{const{children:e,...i}=t,{message:s}=P.useMessage(),r=s.metadata?.attributes?.attachments;return r?n.jsx(gn,{children:l.maybeRender(e,r),...i}):null},Pn=a.ikp("div",{_id:"aiChatMessageAttachments__Item"}),nt=t=>{const{attachment:e,onClick:i,...s}=t,{selectItem:r,onOpen:o}=q.useMessageAttachments(),d=()=>{r(e),o()};return n.jsx(w.AttachmentItemProvider,{attachment:e,children:n.jsx(Pn,{onClick:u.composeEventHandlers(i,d),...s})})},An=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatMessageAttachments__ItemIcon"}),st=t=>{const{attachment:e}=w.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?n.jsx(An,{iconSettings:i,...t}):null},_n=a.ikp("span",{_id:"aiChatMessageAttachments__ItemTitle"}),rt=t=>{const{attachment:e}=w.useAttachmentItem();return n.jsx(_n,{children:e.title,...t})},Fn=a.ikp(A.Root,{_id:"aiChatMessageAttachmentsPreview"}),ot=t=>{const{onOpenChange:e,...i}=t,{selectItem:s,isOpen:r,onClose:o,selectedItem:d}=q.useMessageAttachments(),c=m=>{m||(o(),s(null))};return n.jsx(Fn,{open:r&&d!==null,onOpenChange:u.composeEventHandlers(e,c),...i})},dt=a.ikp(A.Overlay,{_id:"aiChatMessageAttachmentsPreview__Overlay"}),ct=a.ikp(A.Content,{_id:"aiChatMessageAttachmentsPreview__Content","aria-describedby":void 0}),En=a.ikp(A.Title,{_id:"aiChatMessageAttachmentsPreview__Header"}),mt=t=>{const{selectedItem:e}=q.useMessageAttachments();return n.jsx(En,{children:e?.title||"Attachment",...t})},lt=a.ikp(A.Close,{_id:"aiChatMessageAttachmentsPreview__Close",children:n.jsx(F.CustomIcon,{iconKey:"close"})}),kn=a.ikp("p",{_id:"aiChatMessageAttachmentsPreview__Body"}),ht=t=>{const{selectedItem:e}=q.useMessageAttachments();return n.jsx(kn,{children:e?.content,...t})},ve=a.ikp("div",{_id:"aiChatMessage"}),ut=t=>{const{aiChatSettings:e}=C.useInkeepConfig(),{componentStyles:i,...s}=t,{message:r}=P.useMessage(),{logEvent:o}=V.useChatEvents(),d=l.getMessageContent(r),{conversation:c}=O.useInkeepConversation();return r.role==="user"?n.jsx(ve,{"data-role":r.role,children:d,...s}):n.jsx(ve,{"data-role":r.role,...s,children:n.jsx(ae.Markdown,{children:d,componentStyles:i,shouldOpenLinksInNewTab:e.shouldOpenLinksInNewTab,onLinkClick:(m,h)=>{o({eventName:"assistant_message_inline_link_opened",properties:{title:h?.toString(),url:m}})},onCodeCopy:(m,h)=>{o({eventName:"assistant_code_block_copied",properties:{conversation:c,language:m,code:h}})}})})},In=a.ikp("div",{_id:"aiChatMessageToolbar"}),Ct=t=>{const{isLoading:e,messages:i}=v.useChat(),{message:s}=P.useMessage();return i.at(-1)?.id===s?.id&&e||s.role==="user"?null:n.jsx(In,{...t})},Mn=a.ikp("div",{_id:"aiChatMessageToolActions"}),pt=t=>{const{children:e,...i}=t,{message:s}=P.useMessage(),{messageButtons:r}=v.useChat(),o=r[s.id]||[];return n.jsx(Mn,{children:l.maybeRender(e,o),...i})},Sn=a.ikp("a",{_id:"aiChatMessageToolAction"}),xn=a.ikp("button",{_id:"aiChatMessageToolAction"}),vt=t=>{const{onClick:e,action:i,...s}=t,{handleAction:r}=se.useChatAction(i),o=()=>{r()},d=i.label||"Contact Support",c=n.jsxs(n.Fragment,{children:[i.icon&&n.jsx(x.BuiltInIconRenderer,{iconSettings:i.icon}),d]});return i.action.type==="open_link"?n.jsx(Sn,{href:i.action.url,target:"_blank",rel:"noopener","data-type":i.action.type,onClick:u.composeEventHandlers(e,o),children:c,...s}):n.jsx(xn,{"data-type":i.action.type,onClick:u.composeEventHandlers(e,o),children:c,...s})},Bn=a.ikp("button",{_id:"aiChatMessageAction"}),bt=t=>{const{action:e,onClick:i,className:s,...r}=t,{conversation:o}=O.useInkeepConversation(),{message:d}=P.useMessage(),{isStreaming:c,messages:m}=v.useChat(),[h,p]=ee.useCopyToClipboard(),{feedback:b,submitPositiveFeedback:k,setCurrentFeedback:y,currentFeedback:W}=ne.useMessageFeedback(),{logEvent:Y}=V.useChatEvents(),[N,J]=xa.useSettleAction(),{baseSettings:{privacyPreferences:he}}=C.useInkeepConfig(),{optOutAllAnalytics:X}=he,ue=m.at(-1)?.id===d?.id,Z=d.role==="assistant";if(ue&&c||!Z||{copy:!1,upvote:X,downvote:X}[e])return null;const H={copy(){p(l.getMessageContent(d)),Y({eventName:"assistant_message_copied",properties:{conversation:o}})},upvote(){k(d.id).then(()=>{J()})},downvote(){y(d.id)}},D={copy:"Copy Message",upvote:"Upvote Message",downvote:"Downvote Message"},M={copy:n.jsx(F.CustomIcon,{iconKey:h?"messageCopied":"messageCopy"}),upvote:n.jsx(F.CustomIcon,{iconKey:N?"messageCopied":"thumbsUp"}),downvote:n.jsx(F.CustomIcon,{iconKey:"thumbsDown"})},S={copy:{"data-copied":l.dataAttr(h)},upvote:{"data-upvoted":l.dataAttr(b[d.id]?.type==="positive")},downvote:{"data-downvoted":l.dataAttr(b[d.id]?.type==="negative"),"data-state":W===null?"closed":"open"}};return n.jsx(Bn,{"data-action":e,...S[e],children:M[e],"aria-label":D[e],className:`${s} ${e}`,onClick:u.composeEventHandlers(i,H[e]),...r})},fn=a.ikp("div",{_id:"aiChatMessageSources"}),gt=t=>{const{message:e}=P.useMessage();return e.role!=="assistant"||!e.links?.length?null:n.jsx(fn,{...t})},Tn=a.ikp("div",{_id:"aiChatMessageSources__Header"}),Pt=t=>n.jsx(Tn,{children:"Sources",...t}),jn=a.ikp("div",{_id:"aiChatMessageSources__List"}),At=t=>{const{message:e}=P.useMessage(),{children:i,...s}=t,{baseSettings:{transformSource:r,organizationDisplayName:o},aiChatSettings:{shouldOpenLinksInNewTab:d},searchSettings:{tabs:c}}=C.useInkeepConfig();if(e.role!=="assistant")return null;const m=e.links.map(h=>{const p=La.transformInkeepSource(h,"chatSourceItem",{organizationDisplayName:o,tabs:c,transformSource:r}),b=p.shouldOpenInNewTab!==void 0?p.shouldOpenInNewTab:d;return{...p,isExternal:b}});return n.jsx(jn,{children:l.maybeRender(i,m),...s})},yn=a.ikp(Ia.LinkWithQueryParams,{_id:"aiChatMessageSourceItem"}),_t=t=>{const{source:e,onClick:i,...s}=t,{logEvent:r}=V.useChatEvents(),{conversation:o}=O.useInkeepConversation(),d=()=>{r({eventName:"assistant_source_item_clicked",properties:{conversation:o,link:e}})};return n.jsx(B.SourceItemProvider,{source:e,children:n.jsx(yn,{"data-type":e.type,appendToUrl:e.appendToUrl,isExternal:e.isExternal,"data-breadcrumbs":!!e.breadcrumbs?.length,onClick:u.composeEventHandlers(i,d),...s})})},Hn=a.ikp("div",{_id:"aiChatMessageSourceItem__Breadcrumbs"}),Ft=t=>{const{source:e}=B.useSourceItem();return e.breadcrumbs?.length?n.jsx(Hn,{"data-type":e.type,...t}):null},wn=a.ikp(F.CustomIcon,{_id:"aiChatMessageSourceItem__BreadcrumbIcon",iconKey:"breadcrumbSeparator"}),Ln=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatMessageSourceItem__Icon"}),Et=t=>{const{source:e}=B.useSourceItem();return n.jsx(Ln,{iconSettings:e.icon,"data-type":e.type,...t})},Dn=a.ikp("span",{_id:"aiChatMessageSourceItem__Title"}),kt=t=>{const{source:e}=B.useSourceItem();return n.jsx(Dn,{"data-type":e.type,children:e.title,...t})},On=a.ikp("span",{_id:"aiChatMessageSourceItem__Tag"}),It=t=>{const{source:e}=B.useSourceItem();return n.jsx(On,{"data-type":e.type,...t})},qn=a.ikp("span",{_id:"aiChatMessageSourceItem__Description"}),Mt=t=>{const{source:e}=B.useSourceItem(),{children:i,...s}=t,r=g.useMemo(()=>e.description?Ta.highlightEmphasis(e.description):[],[e.description]);return r.length?n.jsx(qn,{"data-type":e.type,children:l.maybeRender(i,r),...s}):null},Rn=a.ikp("span",{_id:"aiChatMessageSourceItem__DescriptionPart"}),St=t=>{const{part:e,...i}=t,{source:s}=B.useSourceItem();return typeof e=="string"?e:n.jsx(Rn,{"data-type":s.type,children:e.content,"data-highlighted":l.dataAttr(e.highlighted),...i})},Wn=a.ikp(F.CustomIcon,{_id:"aiChatMessageSourceItem__Indicator"}),xt=t=>{const{source:e}=B.useSourceItem();return n.jsx(Wn,{iconKey:e.isExternal?"openLinkInNewTab":"openLinkInSameTab",...t})},Bt=a.ikp("div",{_id:"aiChatFooter"}),ft=a.ikp("div",{_id:"aiChatInput__Fieldset"}),Tt=a.ikp("div",{_id:"aiChatInput__Group"}),Nn=a.ikp("textarea",{_id:"aiChatInput"}),jt=g.forwardRef(({onChange:t,onKeyDown:e,...i},s)=>{const{handleInputChange:r,handleInputKeyDown:o,input:d,error:c,shouldAutoFocusInput:m,inputRef:h}=v.useChat(),{aiChatSettings:p}=C.useInkeepConfig(),b=re.useComposedRefs(s,h);return Oa.useWidgetAutoFocus("chat",h,m),n.jsx(Nn,{asChild:!0,ref:b,maxLength:99999,placeholder:p.placeholder,value:d,onChange:u.composeEventHandlers(t,r),onKeyDown:u.composeEventHandlers(e,o),disabled:!!c||p.isViewOnly,...i,children:n.jsx(ie,{})})}),Qn=a.ikp("button",{_id:"aiChatInput__SendButton"}),yt=t=>{const{handleSubmit:e,isSubmitDisabled:i,error:s}=v.useChat(),{aiChatSettings:r}=C.useInkeepConfig(),{onClick:o,...d}=t;return n.jsx(Qn,{onClick:u.composeEventHandlers(o,()=>e()),"aria-label":"Send message",disabled:i||!!s||r.isViewOnly,...d})},Ht=a.ikp(F.CustomIcon,{_id:"aiChatInput__SendButtonIcon",iconKey:"chatSubmit"}),$n=a.ikp("div",{_id:"aiChatAttachmentsBar"}),wt=t=>{const{selectedWorkflow:e}=v.useChat();return!e||!e.supportedInputs?.length?null:n.jsx(E.AttachmentsBarProvider,{children:n.jsx($n,{...t})})},Vn=a.ikp("div",{_id:"aiChatAttachmentsBar__List"}),Lt=t=>{const{children:e,...i}=t,{messageAttachments:s}=v.useChat();return n.jsx(Vn,{children:l.maybeRender(e,s),...i})},Un=a.ikp("div",{_id:"aiChatAttachmentsBar__Attachment"}),Dt=t=>{const{attachment:e,...i}=t;return n.jsx(w.AttachmentItemProvider,{attachment:e,children:n.jsx(Un,{...i})})},Kn=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatAttachmentsBar__AttachmentIcon"}),Ot=t=>{const{attachment:e}=w.useAttachmentItem(),i=e.contentType?.attachmentIcon;return i?n.jsx(Kn,{iconSettings:i,...t}):null},zn=a.ikp("span",{_id:"aiChatAttachmentsBar__AttachmentTitle"}),qt=t=>{const{attachment:e}=w.useAttachmentItem();return n.jsx(zn,{children:e.title,...t})},Gn=a.ikp("button",{_id:"aiChatAttachmentsBar__AttachmentDelete"}),Rt=t=>{const{onClick:e,...i}=t,{attachment:s}=w.useAttachmentItem(),{setMessageAttachments:r}=v.useChat(),o=()=>{r(d=>d.filter(c=>c.id!==s.id))};return n.jsx(Gn,{"aria-label":"Remove attachment",children:n.jsx(F.CustomIcon,{iconKey:"close"}),onClick:u.composeEventHandlers(e,o),...i})},Wt=a.ikp("div",{_id:"aiChatAttachmentsBar__Actions"}),Nt=a.ikp(j.Tooltip,{_id:"aiChatAttachmentsBar__InfoTip",delayDuration:0}),Qt=a.ikp(j.Trigger,{_id:"aiChatAttachmentsBar__InfoTipIcon",children:n.jsx(F.CustomIcon,{iconKey:"info"})}),me=a.ikp(j.Arrow,{_id:"aiChatAttachmentsBar__InfoTipArrow"}),$t=a.ikp(j.Content,{_id:"aiChatAttachmentsBar__InfoTipText",side:"bottom",sideOffset:3,align:"center",children:n.jsxs(n.Fragment,{children:[n.jsx(me,{}),"Attachments will be kept in context for the entire conversation."]})}),Yn=a.ikp("div",{_id:"aiChatAttachmentsBar__Inputs"}),Vt=t=>{const{children:e,...i}=t,{selectedWorkflow:s}=v.useChat();return s?.supportedInputs?n.jsx(Yn,{children:l.maybeRender(e,s.supportedInputs),...i}):null},Jn=a.ikp("button",{_id:"aiChatAttachmentsBar__Input"}),Ut=t=>{const{input:e,onClick:i,...s}=t,{selectedWorkflow:r,messageAttachments:o,setMessageAttachments:d}=v.useChat(),{selectInput:c,onOpen:m}=E.useAttachmentsBar(),h=()=>{if(e.type==="FUNCTIONAL_MULTI_ATTACHMENT")return r?e.onInvoke(r,e,d,[...o]):void 0;c(e),m()};return n.jsx(Jn,{children:e.displayName,onClick:u.composeEventHandlers(i,h),...s})},Xn=a.ikp(A.Root,{_id:"aiChatAttachmentsBar__Modal"}),Kt=t=>{const{onOpenChange:e,...i}=t,{selectInput:s,isOpen:r,onClose:o,selectedInput:d}=E.useAttachmentsBar(),c=m=>{m||(o(),s(null))};return n.jsx(Xn,{open:r&&d!==null,onOpenChange:u.composeEventHandlers(e,c),...i})},zt=a.ikp(A.Overlay,{_id:"aiChatAttachmentsBar__ModalOverlay"}),Gt=a.ikp(A.Content,{_id:"aiChatAttachmentsBar__ModalContent","aria-describedby":void 0}),Yt=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHeader"}),Zn=a.ikp(A.Title,{_id:"aiChatAttachmentsBar__ModalHeading"}),Jt=t=>{const{selectedInput:e}=E.useAttachmentsBar(),i=`Add ${e?.displayName}`;return n.jsx(Zn,{children:i,...t})},es=a.ikp("span",{_id:"aiChatAttachmentsBar__ModalDescription"}),Xt=t=>{const{selectedInput:e}=E.useAttachmentsBar(),i=e?.workflowModalProps?.modalHelpText;return i?n.jsx(es,{children:i,...t}):null},ts=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalHelp"}),Zt=t=>{const{children:e,...i}=t,{selectedInput:s}=E.useAttachmentsBar(),r=s?.workflowModalProps?.modalHelpElement;return r?n.jsx(ts,{asChild:!e,children:e||r,...i}):null},ei=a.ikp(A.Close,{_id:"aiChatAttachmentsBar__ModalClose",children:n.jsx(F.CustomIcon,{iconKey:"close"})}),ti=a.ikp("div",{_id:"aiChatAttachmentsBar__ModalBody"}),is=a.ikp("form",{_id:"aiChatAttachmentsBar__Form"}),ii=t=>{const{onSubmit:e,...i}=t,{form:s}=E.useAttachmentsBar();return n.jsx(is,{onSubmit:u.composeEventHandlers(e,s.onSubmit),...i})},ai=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),as=a.ikp("label",{_id:"aiChatAttachmentsBar__FormTitleLabel"}),ni=t=>{const{form:e,selectedInput:i}=E.useAttachmentsBar();return n.jsx(as,{htmlFor:`${i?.id}-title`,children:e.labels.title,...t})},ns=a.ikp("input",{_id:"aiChatAttachmentsBar__FormTitleInput"}),si=t=>{const{onChange:e,...i}=t,{form:s,selectedInput:r}=E.useAttachmentsBar();return n.jsx(ns,{name:"title",value:s.data.title,id:`${r?.id}-title`,"data-invalid":l.dataAttr(!!s.errors.title),"aria-invalid":!!s.errors.title,onChange:u.composeEventHandlers(e,s.onChange),...i})},ss=a.ikp("span",{_id:"aiChatAttachmentsBar__FormTitleError"}),ri=t=>{const{form:e}=E.useAttachmentsBar();return e.errors.title?n.jsx(ss,{"aria-live":"polite",children:e.errors.title,...t}):null},oi=a.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),rs=a.ikp("label",{_id:"aiChatAttachmentsBar__FormContentLabel"}),di=t=>{const{form:e,selectedInput:i}=E.useAttachmentsBar();return n.jsx(rs,{htmlFor:`${i?.id}-content`,children:e.labels.content,...t})},os=a.ikp("textarea",{_id:"aiChatAttachmentsBar__FormTitleInput"}),ci=t=>{const{onChange:e,...i}=t,{form:s,selectedInput:r}=E.useAttachmentsBar();return n.jsx(os,{asChild:!0,rows:4,name:"content",value:s.data.content,id:`${r?.id}-content`,"data-invalid":l.dataAttr(!!s.errors.content),"aria-invalid":!!s.errors.content,onChange:u.composeEventHandlers(e,s.onChange),...i,children:n.jsx(ie,{maxRows:10})})},ds=a.ikp("span",{_id:"aiChatAttachmentsBar__FormContentError"}),mi=t=>{const{form:e}=E.useAttachmentsBar();return e.errors.content?n.jsx(ds,{"aria-live":"polite",children:e.errors.content,...t}):null},li=a.ikp("button",{_id:"aiChatAttachmentsBar__FormSubmitButton",children:"Upload",type:"submit"}),hi=a.ikp("div",{_id:"aiChatActionBar"}),ui=a.ikp("div",{_id:"aiChat__ChatActions"}),Ci=a.ikp("div",{_id:"aiChatTagline__Container"}),pi=a.ikp("span",{_id:"aiChatTagline__Text",children:"Powered by"}),vi=a.ikp(Sa.default,{_id:"aiChatTagline__Logo"}),bi=a.ikp("a",{_id:"aiChatTagline__BrandName",children:"inkeep",href:"https://www.inkeep.com/",target:"_blank",rel:"noopener noreferrer"}),cs=a.ikp(j.Trigger,{_id:"aiChat__ChatAction"}),z=t=>{const{action:e,onClick:i,className:s,...r}=t,{clear:o,stop:d,isLoading:c,messages:m,selectedWorkflow:h}=v.useChat(),{conversation:p}=O.useInkeepConversation(),{aiChatSettings:b,baseSettings:k}=C.useInkeepConfig(),{logEvent:y}=V.useChatEvents(),[W,Y]=ee.useCopyToClipboard(),[N,J]=ee.useCopyToClipboard();if({help:!1,copy:m.length===0||!b.isCopyChatButtonVisible||c,share:m.length===0||!b.isShareButtonVisible||!p.id||!!h||c,clear:m.length===0||b.isViewOnly||c,stop:!c}[e])return null;const Z={help:()=>{},copy:()=>{const Q=m.map(H=>{const D=`**${H.role==="assistant"?"AI Assistant":"User"}**`,M=l.getMessageContent(H),S=Ma.stringifyAttachments(H.metadata?.attributes?.attachments),$=S?`
|
|
8
8
|
|
|
9
9
|
**Attachments**
|
|
10
10
|
|
|
11
11
|
${S}`:"";return`${D}
|
|
12
12
|
|
|
13
|
-
${M}${
|
|
13
|
+
${M}${$}`}).join(`
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
`);Y($)},share:async()=>{const $={visibility:"public",tags:[],userProperties:{},messages:p.messages.map(S=>({...S,createdAt:void 0,updatedAt:void 0,id:Date.now().toString()+S.id,conversationId:void 0}))},{apiKey:H,analyticsApiBaseUrl:D}=k,M=await qa.logConversation("",$,H,D);if(M){const Q=`${v.shareChatUrlBasePath}?${O.SHARE_QUERY_PARAM}=${M?.id}`;J(Q),y({eventName:"chat_share_button_clicked",properties:{sharedConversationId:M?.id,originalConversationId:p.id,sharedChatUrl:Q,conversation:M}})}},clear:o,stop:d},Ce={copy:R,share:N};return n.jsx(j.Tooltip,{delayDuration:0,open:Ce[e],children:n.jsx(Cr,{"data-type":e,"data-copied":l.dataAttr(R||N),className:`${r} ${e}`,children:n.jsx(le,{action:e}),onClick:u.composeEventHandlers(i,Z[e]),...s})})},pr=a.ikp("span",{_id:"aiChat__ChatActionLabel"}),le=t=>{const{action:e,...i}=t,{aiChatSettings:r}=C.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(pr,{children:o[e],...i})},vr=a.ikp(j.TooltipContent,{_id:"aiChat__ChatActionFeeback"}),_i=t=>{const{action:e,children:i,...r}=t,s={copy:"Copied!",share:"Link copied!"};return n.jsxs(vr,{sideOffset:5,...r,children:[n.jsx(j.Arrow,{}),i||s[e]]})},br=a.ikp(T.Root,{_id:"aiChatHelpActions"}),Ai=t=>{const{children:e,...i}=t,{aiChatSettings:r}=C.useInkeepConfig(),{getHelpOptions:s}=r;if(!s||(s??[]).length===0)return null;const{_pinned:o,_unpinned:d}=s.reduce((p,v)=>{const k=v.isPinnedToToolbar?"_pinned":"_unpinned";return{...p,[k]:[...p[k],v]}},{_pinned:[],_unpinned:[]}),c=d.length===1?[...o,d[0]]:o,m=d.length===1?[]:d,h=te.useHelpMenuState();return n.jsx(te.HelpMenuProvider,{value:h,children:n.jsx(br,{open:h.open,onOpenChange:h.setOpen,children:l.maybeRender(e,{pinned:c,unpinned:m}),...i})})},gr=a.ikp(z,{_id:"aiChatHelpAction",action:"help"}),Pr=a.ikp("a",{_id:"aiChatHelpAction",target:"_blank",rel:"noreferrer"}),Ei=t=>{const{action:e,onClick:i,...r}=t,{handleAction:s,logHelpAction:o}=re.useChatAction(e),d=e.action.type,c={"aria-label":e.name,"data-name":e.name,children:e.name,onClick:u.composeEventHandlers(i,()=>{s(),o()}),...r};return d==="open_link"?n.jsx(Pr,{href:e.action.url,...c}):n.jsx(gr,{...c})},_r=a.ikp(T.Trigger,{_id:"aiChatHelpActions__Trigger"}),Fi=b.memo(t=>{const{aiChatSettings:e}=C.useInkeepConfig();return n.jsx(z,{action:"help",...t,asChild:!0,children:n.jsx(_r,{children:e.toolbarButtonLabels?.getHelp??"Get Help"})})}),Ar=a.ikp(T.Content,{_id:"aiChatHelpActions__Menu"}),ki=t=>n.jsx(Ar,{side:"top",sideOffset:8,align:"center",alignOffset:-10,...t}),Ii=a.ikp(T.Arrow,{_id:"aiChatHelpActions__MenuArrow"}),Mi=t=>{const{action:e,onClick:i,...r}=t,{handleAction:s,logHelpAction:o}=re.useChatAction(e),{setOpen:d}=te.useHelpMenu(),c=()=>{s({onOpenForm:()=>d(!1)}),o()},m=e.action.type,h=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:u.composeEventHandlers(i,c)});return n.jsx(h,{...r})},Er=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatHelpActions_MenuItemIcon"}),Si=t=>{const{action:e,...i}=t;return e.icon?n.jsx(Er,{iconSettings:e.icon,...i}):null},Fr=a.ikp(_.Root,{_id:"aiChatFeedbackModal"}),xi=t=>{const{onOpenChange:e,...i}=t,{currentFeedback:r,setCurrentFeedback:s}=ne.useMessageFeedback();return n.jsx(Fr,{open:r!==null,onOpenChange:u.composeEventHandlers(e,()=>s(null)),...i})},Bi=a.ikp(_.Overlay,{_id:"aiChatFeedbackModal__Overlay"}),fi=a.ikp(_.Content,{_id:"aiChatFeedbackModal__Content","aria-describedby":void 0}),Ti=a.ikp(_.Title,{_id:"aiChatFeedbackModal__Header",children:"Help improve my answers!"}),ji=a.ikp(_.Close,{_id:"aiChatFeedbackModal__Close",children:n.jsx(E.CustomIcon,{iconKey:"close"})}),yi=a.ikp("div",{_id:"aiChatFeedbackModal__Body"}),kr=a.ikp("form",{_id:"aiChatFeedbackForm"}),Hi=t=>{const{onSubmit:e,...i}=t,{submitNegativeFeedback:r,currentFeedback:s,setCurrentFeedback:o}=ne.useMessageFeedback(),d=c=>{c.preventDefault();const m=c.target,h=new FormData(m),p=Object.fromEntries(h.entries());s&&(r(s,p),o(null))};return n.jsx(kr,{onSubmit:u.composeEventHandlers(e,d),...i})},Ir=a.ikp("div",{_id:"aiChatFeedbackItem"}),wi=t=>{const{name:e,...i}=t;return n.jsx(U.FeedbackItemProvider,{name:e,children:n.jsx(Ir,{...i})})},Mr=a.ikp(K.Root,{_id:"aiChatFeedbackItem__Checkbox"}),Li=t=>{const{name:e,focusItem:i}=U.useFeedbackItem(),{onCheckedChange:r,...s}=t,o=d=>{d&&i?.current?.focus()};return n.jsx(Mr,{id:`feedback-${e}`,name:e,onCheckedChange:u.composeEventHandlers(r,o),...s})},Di=a.ikp(K.Indicator,{_id:"aiChatFeedbackItem__CheckboxIndicator",children:n.jsx(be.CheckboxIcon,{})}),Sr=a.ikp("label",{_id:"aiChatFeedbackItem__Label"}),Oi=t=>{const{name:e}=U.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(Sr,{htmlFor:`feedback-${e}`,children:i[e],...t})},xr=a.ikp("textarea",{_id:"aiChatFeedbackItem__Description",placeholder:"Please describe"}),qi=t=>{const{name:e,focusItem:i}=U.useFeedbackItem();return n.jsx(xr,{ref:i,name:`${e}:description`,...t})},Wi=a.ikp("button",{_id:"aiChatFeedbackForm__SubmitButton",children:"Submit",type:"submit"}),Br=a.ikp("div",{_id:"aiChatForm__Wrapper"}),Ri=t=>{const{form:e}=A.useChatForm();return e?n.jsx(Br,{...t}):null},fr=a.ikp("form",{_id:"aiChatForm"}),Ni=t=>{const{onSubmit:e,...i}=t,{handleSubmit:r,isSuccess:s}=A.useChatForm();return s?null:n.jsx(fr,{onSubmit:u.composeEventHandlers(e,r),...i})},Tr=a.ikp("button",{_id:"aiChatForm__Close",children:n.jsx(E.CustomIcon,{iconKey:"close"})}),$i=t=>{const{onClick:e,...i}=t,{closeForm:r}=A.useChatForm();return n.jsx(Tr,{onClick:u.composeEventHandlers(e,r),...i})},Qi=a.ikp("div",{_id:"aiChatForm__Header"}),jr=a.ikp("h2",{_id:"aiChatForm__Heading"}),Vi=t=>{const{form:e}=A.useChatForm();return e?.heading?n.jsx(jr,{children:e.heading,...t}):null},yr=a.ikp("span",{_id:"aiChatForm__Description"}),Ui=t=>{const{form:e}=A.useChatForm();return e?.description?n.jsx(yr,{children:e.description,...t}):null},Hr=a.ikp("div",{_id:"aiChatForm__Content"}),Ki=t=>{const{children:e,...i}=t,{fields:r=[]}=A.useChatForm();return n.jsx(Hr,{children:l.maybeRender(e,r),...i})},wr=a.ikp("div",{_id:"aiChatForm__Field"}),zi=t=>{const{field:e,autoFocus:i,...r}=t,{control:s,errors:o}=A.useChatForm();return n.jsx(Ha.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(f.FormFieldProvider,{"data-invalid":l.dataAttr(!!o[e.name]),field:e,fieldProps:d,autoFocus:i,children:c&&n.jsx(wr,{"data-input-type":e.inputType,"data-hidden":l.dataAttr(e.isHidden),...r})})}})},Lr=a.ikp("label",{_id:"aiChatForm__FieldLabel"}),Gi=t=>{const{field:e}=f.useFormField();return n.jsx(Lr,{"data-required":l.dataAttr(e.isRequired),htmlFor:e.name,children:e.label,...t})},Dr=a.ikp("input",{_id:"aiChatForm__FieldText",type:"text"}),G=t=>{const{field:e,error:i,fieldProps:{onChange:r,onBlur:s,...o},autoFocus:d}=f.useFormField(),{onChange:c,onBlur:m,...h}=t;return n.jsx(Dr,{id:e.name,autoFocus:d,placeholder:"placeholder"in e?e.placeholder:void 0,"data-invalid":l.dataAttr(!!i),onChange:u.composeEventHandlers(c,r),onBlur:u.composeEventHandlers(m,s),...o,...h})},Yi=a.ikp(G,{_id:"aiChatForm__FieldEmail",type:"email"}),Or=a.ikp("input",{_id:"aiChatForm__FieldFile",type:"file",multiple:!0}),Ji=t=>{const{field:e,error:i,fieldProps:{value:r,onChange:s,onBlur:o,...d},autoFocus:c}=f.useFormField(),{onChange:m,onBlur:h,...p}=t,v=k=>{const y=k.target.files;s(y)};return n.jsx(Or,{id:e.name,autoFocus:c,"data-value":r,"data-invalid":l.dataAttr(!!i),...p,...d,onChange:u.composeEventHandlers(m,v),onBlur:u.composeEventHandlers(h,o)})},Xi=a.ikp(G,{_id:"aiChatForm__FieldTextArea",type:"textarea",asChild:!0,children:n.jsx(ie,{maxRows:8})}),qr=a.ikp(K.Root,{_id:"aiChatForm__FieldCheckbox"}),Zi=t=>{const{field:e,error:i,fieldProps:r,autoFocus:s}=f.useFormField(),{onCheckedChange:o,...d}=t;return n.jsx(qr,{id:e.name,name:e.name,autoFocus:s,"data-invalid":l.dataAttr(!!i),checked:r.value,onCheckedChange:u.composeEventHandlers(o,r.onChange),...d})},ea=a.ikp(K.Indicator,{_id:"aiChatForm__FieldCheckboxIndicator",children:n.jsx(be.CheckboxIcon,{})}),Wr=a.ikp(I.Root,{_id:"aiChatForm__FieldSelect"}),ta=t=>{const{field:e,error:i,fieldProps:r}=f.useFormField(),{onValueChange:s,...o}=t;return n.jsx(Wr,{name:e.name,"data-invalid":l.dataAttr(!!i),value:r.value,onValueChange:u.composeEventHandlers(s,r.onChange),...o})},ia=a.ikp(I.Trigger,{_id:"aiChatForm__FieldSelect__Trigger"}),Rr=a.ikp(I.Value,{_id:"aiChatForm__FieldSelect__Value"}),aa=t=>{const{field:e}=f.useFormField();return n.jsx(Rr,{placeholder:"placeholder"in e?e.placeholder:void 0,...t})},na=a.ikp(I.Icon,{_id:"aiChatForm__FieldSelect__Icon",asChild:!0,children:n.jsx(x.BuiltInIconRenderer,{iconSettings:{builtIn:"LuChevronDown"}})}),ra=a.ikp(I.Content,{_id:"aiChatForm__FieldSelect__Content",position:"popper"}),sa=a.ikp(I.Viewport,{_id:"aiChatForm__FieldSelect__Viewport"}),oa=a.ikp(I.Item,{_id:"aiChatForm__FieldSelect__Item"}),da=a.ikp(I.ItemText,{_id:"aiChatForm__FieldSelect__ItemText"}),ca=a.ikp(I.ItemIndicator,{_id:"aiChatForm__FieldSelect__ItemIndicator",asChild:!0,children:n.jsx(x.BuiltInIconRenderer,{iconSettings:{builtIn:"LuCheck"}})}),Nr=a.ikp("span",{_id:"aiChatForm__FieldError"}),ma=t=>{const{error:e}=f.useFormField();return e?n.jsx(Nr,{children:e.message?.toString(),...t}):null},$r=a.ikp("span",{_id:"aiChatForm__Error"}),la=t=>{const{formError:e}=A.useChatForm();return e?n.jsx($r,{children:e.message,...t}):null},ha=a.ikp("div",{_id:"aiChatForm__Footer"}),Qr=a.ikp("button",{_id:"aiChatForm__Cancel",children:"Cancel"}),ua=t=>{const{onClick:e,...i}=t,{closeForm:r}=A.useChatForm();return n.jsx(Qr,{onClick:u.composeEventHandlers(e,r),...i})},Vr=a.ikp("button",{_id:"aiChatForm__Submit",children:"Submit",type:"submit"}),Ca=t=>{const{onClick:e,...i}=t,{isSubmitting:r}=A.useChatForm();return n.jsx(Vr,{disabled:r,...i})},Ur=a.ikp("div",{_id:"aiChatForm__Success"}),pa=t=>{const{isSuccess:e}=A.useChatForm();return e?n.jsx(Ur,{...t}):null},Kr=a.ikp("h2",{_id:"aiChatForm__SuccessHeading"}),va=t=>{const{form:e}=A.useChatForm();return n.jsx(Kr,{children:e?.successView.heading,...t})},zr=a.ikp(ae.Markdown,{_id:"aiChatForm__SuccessMessage"}),ba=t=>{const{form:e}=A.useChatForm();return n.jsx(zr,{children:e?.successView.message,...t})},Gr=a.ikp("button",{_id:"aiChatForm__SuccessButton"}),ga=t=>{const{onClick:e,...i}=t,{form:r,closeForm:s}=A.useChatForm(),o=r?.successView?.doneButton;if(!o)return null;const d=o.icon&&n.jsx(x.BuiltInIconRenderer,{iconSettings:o.icon}),c=o.label;return n.jsx(Gr,{onClick:u.composeEventHandlers(e,s),children:n.jsxs(n.Fragment,{children:[d,c]}),...i})};exports.Provider=g.ChatProvider;exports.ActionBar=Ci;exports.Actions=pi;exports.AttachmentsBar=Lt;exports.AttachmentsBarActions=Nt;exports.AttachmentsBarAttachment=Ot;exports.AttachmentsBarAttachmentDelete=Rt;exports.AttachmentsBarAttachmentIcon=qt;exports.AttachmentsBarAttachmentTitle=Wt;exports.AttachmentsBarForm=ni;exports.AttachmentsBarFormContent=ci;exports.AttachmentsBarFormContentError=hi;exports.AttachmentsBarFormContentInput=li;exports.AttachmentsBarFormContentLabel=mi;exports.AttachmentsBarFormSubmitButton=ui;exports.AttachmentsBarFormTitle=ri;exports.AttachmentsBarFormTitleError=di;exports.AttachmentsBarFormTitleInput=oi;exports.AttachmentsBarFormTitleLabel=si;exports.AttachmentsBarInfoTip=$t;exports.AttachmentsBarInfoTipArrow=me;exports.AttachmentsBarInfoTipIcon=Qt;exports.AttachmentsBarInfoTipText=Vt;exports.AttachmentsBarInput=Kt;exports.AttachmentsBarInputIcon=zt;exports.AttachmentsBarInputs=Ut;exports.AttachmentsBarList=Dt;exports.AttachmentsBarModal=Gt;exports.AttachmentsBarModalBody=ai;exports.AttachmentsBarModalClose=ii;exports.AttachmentsBarModalContent=Jt;exports.AttachmentsBarModalDescription=ei;exports.AttachmentsBarModalHeader=Xt;exports.AttachmentsBarModalHeading=Zt;exports.AttachmentsBarModalHelp=ti;exports.AttachmentsBarModalOverlay=Yt;exports.ChatAction=z;exports.ChatActionFeedback=_i;exports.ChatActionLabel=le;exports.ChatHelpAction=Ei;exports.Content=ke;exports.ContentScrollArea=Ie;exports.ContentScrollAreaCorner=Be;exports.ContentScrollAreaScrollbar=Se;exports.ContentScrollAreaThumb=xe;exports.ContentScrollAreaViewport=Me;exports.ConversationLoading=Pe;exports.Disclaimer=Te;exports.DisclaimerArrow=Le;exports.DisclaimerContent=He;exports.DisclaimerLabel=je;exports.DisclaimerText=we;exports.DisclaimerTrigger=ye;exports.EmbeddedChatPrimitiveActionBar=Ci;exports.EmbeddedChatPrimitiveActions=pi;exports.EmbeddedChatPrimitiveAttachmentsBar=Lt;exports.EmbeddedChatPrimitiveAttachmentsBarActions=Nt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachment=Ot;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentDelete=Rt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentIcon=qt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentTitle=Wt;exports.EmbeddedChatPrimitiveAttachmentsBarForm=ni;exports.EmbeddedChatPrimitiveAttachmentsBarFormContent=ci;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentError=hi;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentInput=li;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentLabel=mi;exports.EmbeddedChatPrimitiveAttachmentsBarFormSubmitButton=ui;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitle=ri;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleError=di;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleInput=oi;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleLabel=si;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTip=$t;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipArrow=me;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipIcon=Qt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipText=Vt;exports.EmbeddedChatPrimitiveAttachmentsBarInput=Kt;exports.EmbeddedChatPrimitiveAttachmentsBarInputIcon=zt;exports.EmbeddedChatPrimitiveAttachmentsBarInputs=Ut;exports.EmbeddedChatPrimitiveAttachmentsBarList=Dt;exports.EmbeddedChatPrimitiveAttachmentsBarModal=Gt;exports.EmbeddedChatPrimitiveAttachmentsBarModalBody=ai;exports.EmbeddedChatPrimitiveAttachmentsBarModalClose=ii;exports.EmbeddedChatPrimitiveAttachmentsBarModalContent=Jt;exports.EmbeddedChatPrimitiveAttachmentsBarModalDescription=ei;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeader=Xt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeading=Zt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHelp=ti;exports.EmbeddedChatPrimitiveAttachmentsBarModalOverlay=Yt;exports.EmbeddedChatPrimitiveChatAction=z;exports.EmbeddedChatPrimitiveChatActionFeedback=_i;exports.EmbeddedChatPrimitiveChatActionLabel=le;exports.EmbeddedChatPrimitiveChatHelpAction=Ei;exports.EmbeddedChatPrimitiveContent=ke;exports.EmbeddedChatPrimitiveContentScrollArea=Ie;exports.EmbeddedChatPrimitiveContentScrollAreaCorner=Be;exports.EmbeddedChatPrimitiveContentScrollAreaScrollbar=Se;exports.EmbeddedChatPrimitiveContentScrollAreaThumb=xe;exports.EmbeddedChatPrimitiveContentScrollAreaViewport=Me;exports.EmbeddedChatPrimitiveConversationLoading=Pe;exports.EmbeddedChatPrimitiveDisclaimer=Te;exports.EmbeddedChatPrimitiveDisclaimerArrow=Le;exports.EmbeddedChatPrimitiveDisclaimerContent=He;exports.EmbeddedChatPrimitiveDisclaimerLabel=je;exports.EmbeddedChatPrimitiveDisclaimerText=we;exports.EmbeddedChatPrimitiveDisclaimerTrigger=ye;exports.EmbeddedChatPrimitiveExampleQuestion=We;exports.EmbeddedChatPrimitiveExampleQuestionButton=Re;exports.EmbeddedChatPrimitiveExampleQuestions=De;exports.EmbeddedChatPrimitiveExampleQuestionsLabel=Oe;exports.EmbeddedChatPrimitiveExampleQuestionsList=qe;exports.EmbeddedChatPrimitiveFeedbackForm=Hi;exports.EmbeddedChatPrimitiveFeedbackItem=wi;exports.EmbeddedChatPrimitiveFeedbackItemCheckbox=Li;exports.EmbeddedChatPrimitiveFeedbackItemCheckboxIndicator=Di;exports.EmbeddedChatPrimitiveFeedbackItemDescription=qi;exports.EmbeddedChatPrimitiveFeedbackItemLabel=Oi;exports.EmbeddedChatPrimitiveFeedbackModal=xi;exports.EmbeddedChatPrimitiveFeedbackModalBody=yi;exports.EmbeddedChatPrimitiveFeedbackModalClose=ji;exports.EmbeddedChatPrimitiveFeedbackModalContent=fi;exports.EmbeddedChatPrimitiveFeedbackModalHeader=Ti;exports.EmbeddedChatPrimitiveFeedbackModalOverlay=Bi;exports.EmbeddedChatPrimitiveFeedbackSubmitButton=Wi;exports.EmbeddedChatPrimitiveFooter=ft;exports.EmbeddedChatPrimitiveForm=Ni;exports.EmbeddedChatPrimitiveFormCancel=ua;exports.EmbeddedChatPrimitiveFormClose=$i;exports.EmbeddedChatPrimitiveFormContent=Ki;exports.EmbeddedChatPrimitiveFormDescription=Ui;exports.EmbeddedChatPrimitiveFormError=la;exports.EmbeddedChatPrimitiveFormField=zi;exports.EmbeddedChatPrimitiveFormFieldCheckbox=Zi;exports.EmbeddedChatPrimitiveFormFieldCheckboxIndicator=ea;exports.EmbeddedChatPrimitiveFormFieldEmail=Yi;exports.EmbeddedChatPrimitiveFormFieldError=ma;exports.EmbeddedChatPrimitiveFormFieldFile=Ji;exports.EmbeddedChatPrimitiveFormFieldLabel=Gi;exports.EmbeddedChatPrimitiveFormFieldSelect=ta;exports.EmbeddedChatPrimitiveFormFieldSelectContent=ra;exports.EmbeddedChatPrimitiveFormFieldSelectIcon=na;exports.EmbeddedChatPrimitiveFormFieldSelectItem=oa;exports.EmbeddedChatPrimitiveFormFieldSelectItemIndicator=ca;exports.EmbeddedChatPrimitiveFormFieldSelectItemText=da;exports.EmbeddedChatPrimitiveFormFieldSelectTrigger=ia;exports.EmbeddedChatPrimitiveFormFieldSelectValue=aa;exports.EmbeddedChatPrimitiveFormFieldSelectViewport=sa;exports.EmbeddedChatPrimitiveFormFieldText=G;exports.EmbeddedChatPrimitiveFormFieldTextArea=Xi;exports.EmbeddedChatPrimitiveFormFooter=ha;exports.EmbeddedChatPrimitiveFormHeader=Qi;exports.EmbeddedChatPrimitiveFormHeading=Vi;exports.EmbeddedChatPrimitiveFormSubmit=Ca;exports.EmbeddedChatPrimitiveFormSuccess=pa;exports.EmbeddedChatPrimitiveFormSuccessButton=ga;exports.EmbeddedChatPrimitiveFormSuccessHeading=va;exports.EmbeddedChatPrimitiveFormSuccessMessage=ba;exports.EmbeddedChatPrimitiveFormWrapper=Ri;exports.EmbeddedChatPrimitiveHeaderToolbar=Ae;exports.EmbeddedChatPrimitiveHelpActions=Ai;exports.EmbeddedChatPrimitiveHelpActionsMenu=ki;exports.EmbeddedChatPrimitiveHelpActionsMenuArrow=Ii;exports.EmbeddedChatPrimitiveHelpActionsMenuItem=Mi;exports.EmbeddedChatPrimitiveHelpActionsMenuItemIcon=Si;exports.EmbeddedChatPrimitiveHelpActionsTrigger=Fi;exports.EmbeddedChatPrimitiveInput=yt;exports.EmbeddedChatPrimitiveInputFieldset=Tt;exports.EmbeddedChatPrimitiveInputGroup=jt;exports.EmbeddedChatPrimitiveIntroMessageWrapper=Ke;exports.EmbeddedChatPrimitiveMessage=Ct;exports.EmbeddedChatPrimitiveMessageAction=gt;exports.EmbeddedChatPrimitiveMessageAttachments=at;exports.EmbeddedChatPrimitiveMessageAttachmentsItem=rt;exports.EmbeddedChatPrimitiveMessageAttachmentsItemIcon=st;exports.EmbeddedChatPrimitiveMessageAttachmentsItemTitle=ot;exports.EmbeddedChatPrimitiveMessageAttachmentsList=nt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreview=dt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewBody=ut;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewClose=ht;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewContent=mt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewHeader=lt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewOverlay=ct;exports.EmbeddedChatPrimitiveMessageAvatar=Ye;exports.EmbeddedChatPrimitiveMessageAvatarContent=Je;exports.EmbeddedChatPrimitiveMessageAvatarFallback=Xe;exports.EmbeddedChatPrimitiveMessageAvatarImage=Ze;exports.EmbeddedChatPrimitiveMessageContent=it;exports.EmbeddedChatPrimitiveMessageContentWrapper=tt;exports.EmbeddedChatPrimitiveMessageHeader=ze;exports.EmbeddedChatPrimitiveMessageLoading=Ge;exports.EmbeddedChatPrimitiveMessageName=et;exports.EmbeddedChatPrimitiveMessageSourceItem=Et;exports.EmbeddedChatPrimitiveMessageSourceItemBreadcrumbs=Ft;exports.EmbeddedChatPrimitiveMessageSourceItemDescription=St;exports.EmbeddedChatPrimitiveMessageSourceItemDescriptionPart=xt;exports.EmbeddedChatPrimitiveMessageSourceItemIcon=kt;exports.EmbeddedChatPrimitiveMessageSourceItemIndicator=Bt;exports.EmbeddedChatPrimitiveMessageSourceItemTag=Mt;exports.EmbeddedChatPrimitiveMessageSourceItemTitle=It;exports.EmbeddedChatPrimitiveMessageSources=Pt;exports.EmbeddedChatPrimitiveMessageSourcesHeader=_t;exports.EmbeddedChatPrimitiveMessageSourcesList=At;exports.EmbeddedChatPrimitiveMessageToolAction=bt;exports.EmbeddedChatPrimitiveMessageToolActions=vt;exports.EmbeddedChatPrimitiveMessageToolbar=pt;exports.EmbeddedChatPrimitiveMessageWrapper=ce;exports.EmbeddedChatPrimitiveMessages=fe;exports.EmbeddedChatPrimitiveRoot=_e;exports.EmbeddedChatPrimitiveSendButton=Ht;exports.EmbeddedChatPrimitiveSendButtonIcon=wt;exports.EmbeddedChatPrimitiveTaglineBrandName=Pi;exports.EmbeddedChatPrimitiveTaglineContainer=vi;exports.EmbeddedChatPrimitiveTaglineLogo=gi;exports.EmbeddedChatPrimitiveTaglineText=bi;exports.EmbeddedChatPrimitiveToolbarHeader=Fe;exports.EmbeddedChatPrimitiveToolbarHeaderWrapper=Ee;exports.EmbeddedChatPrimitiveWorkflow=Ve;exports.EmbeddedChatPrimitiveWorkflowIcon=Ue;exports.EmbeddedChatPrimitiveWorkflows=Ne;exports.EmbeddedChatPrimitiveWorkflowsLabel=$e;exports.EmbeddedChatPrimitiveWorkflowsList=Qe;exports.EmbeddedChatPrimitiveWrapper=ge;exports.ExampleQuestion=We;exports.ExampleQuestionButton=Re;exports.ExampleQuestions=De;exports.ExampleQuestionsLabel=Oe;exports.ExampleQuestionsList=qe;exports.FeedbackForm=Hi;exports.FeedbackItem=wi;exports.FeedbackItemCheckbox=Li;exports.FeedbackItemCheckboxIndicator=Di;exports.FeedbackItemDescription=qi;exports.FeedbackItemLabel=Oi;exports.FeedbackModal=xi;exports.FeedbackModalBody=yi;exports.FeedbackModalClose=ji;exports.FeedbackModalContent=fi;exports.FeedbackModalHeader=Ti;exports.FeedbackModalOverlay=Bi;exports.FeedbackSubmitButton=Wi;exports.Footer=ft;exports.Form=Ni;exports.FormCancel=ua;exports.FormClose=$i;exports.FormContent=Ki;exports.FormDescription=Ui;exports.FormError=la;exports.FormField=zi;exports.FormFieldCheckbox=Zi;exports.FormFieldCheckboxIndicator=ea;exports.FormFieldEmail=Yi;exports.FormFieldError=ma;exports.FormFieldFile=Ji;exports.FormFieldLabel=Gi;exports.FormFieldSelect=ta;exports.FormFieldSelectContent=ra;exports.FormFieldSelectIcon=na;exports.FormFieldSelectItem=oa;exports.FormFieldSelectItemIndicator=ca;exports.FormFieldSelectItemText=da;exports.FormFieldSelectTrigger=ia;exports.FormFieldSelectValue=aa;exports.FormFieldSelectViewport=sa;exports.FormFieldText=G;exports.FormFieldTextArea=Xi;exports.FormFooter=ha;exports.FormHeader=Qi;exports.FormHeading=Vi;exports.FormSubmit=Ca;exports.FormSuccess=pa;exports.FormSuccessButton=ga;exports.FormSuccessHeading=va;exports.FormSuccessMessage=ba;exports.FormWrapper=Ri;exports.Header=Ka;exports.HeaderToolbar=Ae;exports.HeaderToolbarWrapper=Ee;exports.HelpActions=Ai;exports.HelpActionsMenu=ki;exports.HelpActionsMenuArrow=Ii;exports.HelpActionsMenuItem=Mi;exports.HelpActionsMenuItemIcon=Si;exports.HelpActionsTrigger=Fi;exports.Input=yt;exports.InputFieldset=Tt;exports.InputGroup=jt;exports.IntroMessageWrapper=Ke;exports.Message=Ct;exports.MessageAction=gt;exports.MessageAttachments=at;exports.MessageAttachmentsItem=rt;exports.MessageAttachmentsItemIcon=st;exports.MessageAttachmentsItemTitle=ot;exports.MessageAttachmentsList=nt;exports.MessageAttachmentsPreview=dt;exports.MessageAttachmentsPreviewBody=ut;exports.MessageAttachmentsPreviewClose=ht;exports.MessageAttachmentsPreviewContent=mt;exports.MessageAttachmentsPreviewHeader=lt;exports.MessageAttachmentsPreviewOverlay=ct;exports.MessageAvatar=Ye;exports.MessageAvatarContent=Je;exports.MessageAvatarFallback=Xe;exports.MessageAvatarImage=Ze;exports.MessageContent=it;exports.MessageContentWrapper=tt;exports.MessageHeader=ze;exports.MessageLoading=Ge;exports.MessageName=et;exports.MessageSourceItem=Et;exports.MessageSourceItemBreadcrumbIcon=Wn;exports.MessageSourceItemBreadcrumbs=Ft;exports.MessageSourceItemDescription=St;exports.MessageSourceItemDescriptionPart=xt;exports.MessageSourceItemIcon=kt;exports.MessageSourceItemIndicator=Bt;exports.MessageSourceItemTag=Mt;exports.MessageSourceItemTitle=It;exports.MessageSources=Pt;exports.MessageSourcesHeader=_t;exports.MessageSourcesList=At;exports.MessageToolAction=bt;exports.MessageToolActions=vt;exports.MessageToolbar=pt;exports.MessageWrapper=ce;exports.Messages=fe;exports.Root=_e;exports.SendButton=Ht;exports.SendButtonIcon=wt;exports.TaglineBrandName=Pi;exports.TaglineContainer=vi;exports.TaglineLogo=gi;exports.TaglineText=bi;exports.ToolbarHeader=Fe;exports.Workflow=Ve;exports.WorkflowIcon=Ue;exports.Workflows=Ne;exports.WorkflowsLabel=$e;exports.WorkflowsList=Qe;exports.Wrapper=ge;
|
|
17
|
+
`);Y(Q)},share:async()=>{const Q={visibility:"public",tags:[],userProperties:{},messages:p.messages.map(S=>({...S,createdAt:void 0,updatedAt:void 0,id:Date.now().toString()+S.id,conversationId:void 0}))},{apiKey:H,analyticsApiBaseUrl:D}=k,M=await wa.logConversation("",Q,H,D);if(M){const $=`${b.shareChatUrlBasePath}?${O.SHARE_QUERY_PARAM}=${M?.id}`;J($),y({eventName:"chat_share_button_clicked",properties:{sharedConversationId:M?.id,originalConversationId:p.id,sharedChatUrl:$,conversation:M}})}},clear:o,stop:d},Ce={copy:W,share:N};return n.jsx(j.Tooltip,{delayDuration:0,open:Ce[e],children:n.jsx(cs,{"data-type":e,"data-copied":l.dataAttr(W||N),className:`${s} ${e}`,children:n.jsx(le,{action:e}),onClick:u.composeEventHandlers(i,Z[e]),...r})})},ms=a.ikp("span",{_id:"aiChat__ChatActionLabel"}),le=t=>{const{action:e,...i}=t,{aiChatSettings:s}=C.useInkeepConfig(),r=s.toolbarButtonLabels??{},o={help:r.getHelp??"Get Help",copy:r.copyChat??"Copy",share:r.share??"Share",clear:r.clear??"Clear",stop:r.stop??"Stop"};return n.jsx(ms,{children:o[e],...i})},ls=a.ikp(j.TooltipContent,{_id:"aiChat__ChatActionFeeback"}),gi=t=>{const{action:e,children:i,...s}=t,r={copy:"Copied!",share:"Link copied!"};return n.jsxs(ls,{sideOffset:5,...s,children:[n.jsx(j.Arrow,{}),i||r[e]]})},hs=a.ikp(T.Root,{_id:"aiChatHelpActions"}),Pi=t=>{const{children:e,...i}=t,{aiChatSettings:s}=C.useInkeepConfig(),{getHelpOptions:r}=s;if(!r||(r??[]).length===0)return null;const{_pinned:o,_unpinned:d}=r.reduce((p,b)=>{const k=b.isPinnedToToolbar?"_pinned":"_unpinned";return{...p,[k]:[...p[k],b]}},{_pinned:[],_unpinned:[]}),c=d.length===1?[...o,d[0]]:o,m=d.length===1?[]:d,h=te.useHelpMenuState();return n.jsx(te.HelpMenuProvider,{value:h,children:n.jsx(hs,{open:h.open,onOpenChange:h.setOpen,children:l.maybeRender(e,{pinned:c,unpinned:m}),...i})})},us=a.ikp(z,{_id:"aiChatHelpAction",action:"help"}),Cs=a.ikp("a",{_id:"aiChatHelpAction",target:"_blank",rel:"noreferrer"}),Ai=t=>{const{action:e,onClick:i,...s}=t,{handleAction:r,logHelpAction:o}=se.useChatAction(e),d=e.action.type,c={"aria-label":e.name,"data-name":e.name,children:e.name,onClick:u.composeEventHandlers(i,()=>{r(),o()}),...s};return d==="open_link"?n.jsx(Cs,{href:e.action.url,...c}):n.jsx(us,{...c})},ps=a.ikp(T.Trigger,{_id:"aiChatHelpActions__Trigger"}),_i=g.memo(t=>{const{aiChatSettings:e}=C.useInkeepConfig();return n.jsx(z,{action:"help",...t,asChild:!0,children:n.jsx(ps,{children:e.toolbarButtonLabels?.getHelp??"Get Help"})})}),vs=a.ikp(T.Content,{_id:"aiChatHelpActions__Menu"}),Fi=t=>n.jsx(vs,{side:"top",sideOffset:8,align:"center",alignOffset:-10,...t}),Ei=a.ikp(T.Arrow,{_id:"aiChatHelpActions__MenuArrow"}),ki=t=>{const{action:e,onClick:i,...s}=t,{handleAction:r,logHelpAction:o}=se.useChatAction(e),{setOpen:d}=te.useHelpMenu(),c=()=>{r({onOpenForm:()=>d(!1)}),o()},m=e.action.type,h=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:u.composeEventHandlers(i,c)});return n.jsx(h,{...s})},bs=a.ikp(x.BuiltInIconRenderer,{_id:"aiChatHelpActions_MenuItemIcon"}),Ii=t=>{const{action:e,...i}=t;return e.icon?n.jsx(bs,{iconSettings:e.icon,...i}):null},gs=a.ikp(A.Root,{_id:"aiChatFeedbackModal"}),Mi=t=>{const{onOpenChange:e,...i}=t,{currentFeedback:s,setCurrentFeedback:r}=ne.useMessageFeedback();return n.jsx(gs,{open:s!==null,onOpenChange:u.composeEventHandlers(e,()=>r(null)),...i})},Si=a.ikp(A.Overlay,{_id:"aiChatFeedbackModal__Overlay"}),xi=a.ikp(A.Content,{_id:"aiChatFeedbackModal__Content","aria-describedby":void 0}),Bi=a.ikp(A.Title,{_id:"aiChatFeedbackModal__Header",children:"Help improve my answers!"}),fi=a.ikp(A.Close,{_id:"aiChatFeedbackModal__Close",children:n.jsx(F.CustomIcon,{iconKey:"close"})}),Ti=a.ikp("div",{_id:"aiChatFeedbackModal__Body"}),Ps=a.ikp("form",{_id:"aiChatFeedbackForm"}),ji=t=>{const{onSubmit:e,...i}=t,{submitNegativeFeedback:s,currentFeedback:r,setCurrentFeedback:o}=ne.useMessageFeedback(),d=c=>{c.preventDefault();const m=c.target,h=new FormData(m),p=Object.fromEntries(h.entries());r&&(s(r,p),o(null))};return n.jsx(Ps,{onSubmit:u.composeEventHandlers(e,d),...i})},As=a.ikp("div",{_id:"aiChatFeedbackItem"}),yi=t=>{const{name:e,...i}=t;return n.jsx(U.FeedbackItemProvider,{name:e,children:n.jsx(As,{...i})})},_s=a.ikp(K.Root,{_id:"aiChatFeedbackItem__Checkbox"}),Hi=t=>{const{name:e,focusItem:i}=U.useFeedbackItem(),{onCheckedChange:s,...r}=t,o=d=>{d&&i?.current?.focus()};return n.jsx(_s,{id:`feedback-${e}`,name:e,onCheckedChange:u.composeEventHandlers(s,o),...r})},wi=a.ikp(K.Indicator,{_id:"aiChatFeedbackItem__CheckboxIndicator",children:n.jsx(be.CheckboxIcon,{})}),Fs=a.ikp("label",{_id:"aiChatFeedbackItem__Label"}),Li=t=>{const{name:e}=U.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(Fs,{htmlFor:`feedback-${e}`,children:i[e],...t})},Es=a.ikp("textarea",{_id:"aiChatFeedbackItem__Description",placeholder:"Please describe"}),Di=t=>{const{name:e,focusItem:i}=U.useFeedbackItem();return n.jsx(Es,{ref:i,name:`${e}:description`,...t})},Oi=a.ikp("button",{_id:"aiChatFeedbackForm__SubmitButton",children:"Submit",type:"submit"}),ks=a.ikp("div",{_id:"aiChatForm__Wrapper"}),qi=t=>{const{form:e}=_.useChatForm();return e?n.jsx(ks,{...t}):null},Is=a.ikp("form",{_id:"aiChatForm"}),Ri=t=>{const{onSubmit:e,...i}=t,{handleSubmit:s,isSuccess:r}=_.useChatForm();return r?null:n.jsx(Is,{onSubmit:u.composeEventHandlers(e,s),...i})},Ms=a.ikp("button",{_id:"aiChatForm__Close",children:n.jsx(F.CustomIcon,{iconKey:"close"})}),Wi=t=>{const{onClick:e,...i}=t,{closeForm:s}=_.useChatForm();return n.jsx(Ms,{onClick:u.composeEventHandlers(e,s),...i})},Ni=a.ikp("div",{_id:"aiChatForm__Header"}),Ss=a.ikp("h2",{_id:"aiChatForm__Heading"}),Qi=t=>{const{form:e}=_.useChatForm();return e?.heading?n.jsx(Ss,{children:e.heading,...t}):null},xs=a.ikp("span",{_id:"aiChatForm__Description"}),$i=t=>{const{form:e}=_.useChatForm();return e?.description?n.jsx(xs,{children:e.description,...t}):null},Bs=a.ikp("div",{_id:"aiChatForm__Content"}),Vi=t=>{const{children:e,...i}=t,{fields:s=[]}=_.useChatForm();return n.jsx(Bs,{children:l.maybeRender(e,s),...i})},fs=a.ikp("div",{_id:"aiChatForm__Field"}),Ui=t=>{const{field:e,autoFocus:i,...s}=t,{control:r,errors:o}=_.useChatForm();return n.jsx(fa.Controller,{name:e.name,control:r,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(f.FormFieldProvider,{"data-invalid":l.dataAttr(!!o[e.name]),field:e,fieldProps:d,autoFocus:i,children:c&&n.jsx(fs,{"data-input-type":e.inputType,"data-hidden":l.dataAttr(e.isHidden),...s})})}})},Ts=a.ikp("label",{_id:"aiChatForm__FieldLabel"}),Ki=t=>{const{field:e}=f.useFormField();return n.jsx(Ts,{"data-required":l.dataAttr(e.isRequired),htmlFor:e.name,children:e.label,...t})},js=a.ikp("input",{_id:"aiChatForm__FieldText",type:"text"}),G=t=>{const{field:e,error:i,fieldProps:{onChange:s,onBlur:r,...o},autoFocus:d}=f.useFormField(),{onChange:c,onBlur:m,...h}=t;return n.jsx(js,{id:e.name,autoFocus:d,placeholder:"placeholder"in e?e.placeholder:void 0,"data-invalid":l.dataAttr(!!i),onChange:u.composeEventHandlers(c,s),onBlur:u.composeEventHandlers(m,r),...o,...h})},zi=a.ikp(G,{_id:"aiChatForm__FieldEmail",type:"email"}),ys=a.ikp("input",{_id:"aiChatForm__FieldFile",type:"file",multiple:!0}),Gi=t=>{const{field:e,error:i,fieldProps:{value:s,onChange:r,onBlur:o,...d},autoFocus:c}=f.useFormField(),{onChange:m,onBlur:h,...p}=t,b=k=>{const y=k.target.files;r(y)};return n.jsx(ys,{id:e.name,autoFocus:c,"data-value":s,"data-invalid":l.dataAttr(!!i),...p,...d,onChange:u.composeEventHandlers(m,b),onBlur:u.composeEventHandlers(h,o)})},Yi=a.ikp(G,{_id:"aiChatForm__FieldTextArea",type:"textarea",asChild:!0,children:n.jsx(ie,{maxRows:8})}),Hs=a.ikp(K.Root,{_id:"aiChatForm__FieldCheckbox"}),Ji=t=>{const{field:e,error:i,fieldProps:s,autoFocus:r}=f.useFormField(),{onCheckedChange:o,...d}=t;return n.jsx(Hs,{id:e.name,name:e.name,autoFocus:r,"data-invalid":l.dataAttr(!!i),checked:s.value,onCheckedChange:u.composeEventHandlers(o,s.onChange),...d})},Xi=a.ikp(K.Indicator,{_id:"aiChatForm__FieldCheckboxIndicator",children:n.jsx(be.CheckboxIcon,{})}),ws=a.ikp(I.Root,{_id:"aiChatForm__FieldSelect"}),Zi=t=>{const{field:e,error:i,fieldProps:s}=f.useFormField(),{onValueChange:r,...o}=t;return n.jsx(ws,{name:e.name,"data-invalid":l.dataAttr(!!i),value:s.value,onValueChange:u.composeEventHandlers(r,s.onChange),...o})},ea=a.ikp(I.Trigger,{_id:"aiChatForm__FieldSelect__Trigger"}),Ls=a.ikp(I.Value,{_id:"aiChatForm__FieldSelect__Value"}),ta=t=>{const{field:e}=f.useFormField();return n.jsx(Ls,{placeholder:"placeholder"in e?e.placeholder:void 0,...t})},ia=a.ikp(I.Icon,{_id:"aiChatForm__FieldSelect__Icon",asChild:!0,children:n.jsx(x.BuiltInIconRenderer,{iconSettings:{builtIn:"LuChevronDown"}})}),aa=a.ikp(I.Content,{_id:"aiChatForm__FieldSelect__Content",position:"popper"}),na=a.ikp(I.Viewport,{_id:"aiChatForm__FieldSelect__Viewport"}),sa=a.ikp(I.Item,{_id:"aiChatForm__FieldSelect__Item"}),ra=a.ikp(I.ItemText,{_id:"aiChatForm__FieldSelect__ItemText"}),oa=a.ikp(I.ItemIndicator,{_id:"aiChatForm__FieldSelect__ItemIndicator",asChild:!0,children:n.jsx(x.BuiltInIconRenderer,{iconSettings:{builtIn:"LuCheck"}})}),Ds=a.ikp("span",{_id:"aiChatForm__FieldError"}),da=t=>{const{error:e}=f.useFormField();return e?n.jsx(Ds,{children:e.message?.toString(),...t}):null},Os=a.ikp("span",{_id:"aiChatForm__Error"}),ca=t=>{const{formError:e}=_.useChatForm();return e?n.jsx(Os,{children:e.message,...t}):null},ma=a.ikp("div",{_id:"aiChatForm__Footer"}),qs=a.ikp("button",{_id:"aiChatForm__Cancel",children:"Cancel"}),la=t=>{const{onClick:e,...i}=t,{closeForm:s}=_.useChatForm();return n.jsx(qs,{onClick:u.composeEventHandlers(e,s),...i})},Rs=a.ikp("button",{_id:"aiChatForm__Submit",children:"Submit",type:"submit"}),ha=t=>{const{onClick:e,...i}=t,{isSubmitting:s}=_.useChatForm();return n.jsx(Rs,{disabled:s,...i})},Ws=a.ikp("div",{_id:"aiChatForm__Success"}),ua=t=>{const{isSuccess:e}=_.useChatForm();return e?n.jsx(Ws,{...t}):null},Ns=a.ikp("h2",{_id:"aiChatForm__SuccessHeading"}),Ca=t=>{const{form:e}=_.useChatForm();return n.jsx(Ns,{children:e?.successView.heading,...t})},Qs=a.ikp(ae.Markdown,{_id:"aiChatForm__SuccessMessage"}),pa=t=>{const{form:e}=_.useChatForm();return n.jsx(Qs,{children:e?.successView.message,...t})},$s=a.ikp("button",{_id:"aiChatForm__SuccessButton"}),va=t=>{const{onClick:e,...i}=t,{form:s,closeForm:r}=_.useChatForm(),o=s?.successView?.doneButton;if(!o)return null;const d=o.icon&&n.jsx(x.BuiltInIconRenderer,{iconSettings:o.icon}),c=o.label;return n.jsx($s,{onClick:u.composeEventHandlers(e,r),children:n.jsxs(n.Fragment,{children:[d,c]}),...i})};exports.Provider=v.ChatProvider;exports.ActionBar=hi;exports.Actions=ui;exports.AttachmentsBar=wt;exports.AttachmentsBarActions=Wt;exports.AttachmentsBarAttachment=Dt;exports.AttachmentsBarAttachmentDelete=Rt;exports.AttachmentsBarAttachmentIcon=Ot;exports.AttachmentsBarAttachmentTitle=qt;exports.AttachmentsBarForm=ii;exports.AttachmentsBarFormContent=oi;exports.AttachmentsBarFormContentError=mi;exports.AttachmentsBarFormContentInput=ci;exports.AttachmentsBarFormContentLabel=di;exports.AttachmentsBarFormSubmitButton=li;exports.AttachmentsBarFormTitle=ai;exports.AttachmentsBarFormTitleError=ri;exports.AttachmentsBarFormTitleInput=si;exports.AttachmentsBarFormTitleLabel=ni;exports.AttachmentsBarInfoTip=Nt;exports.AttachmentsBarInfoTipArrow=me;exports.AttachmentsBarInfoTipIcon=Qt;exports.AttachmentsBarInfoTipText=$t;exports.AttachmentsBarInput=Ut;exports.AttachmentsBarInputs=Vt;exports.AttachmentsBarList=Lt;exports.AttachmentsBarModal=Kt;exports.AttachmentsBarModalBody=ti;exports.AttachmentsBarModalClose=ei;exports.AttachmentsBarModalContent=Gt;exports.AttachmentsBarModalDescription=Xt;exports.AttachmentsBarModalHeader=Yt;exports.AttachmentsBarModalHeading=Jt;exports.AttachmentsBarModalHelp=Zt;exports.AttachmentsBarModalOverlay=zt;exports.ChatAction=z;exports.ChatActionFeedback=gi;exports.ChatActionLabel=le;exports.ChatHelpAction=Ai;exports.Content=ke;exports.ContentScrollArea=Ie;exports.ContentScrollAreaCorner=Be;exports.ContentScrollAreaScrollbar=Se;exports.ContentScrollAreaThumb=xe;exports.ContentScrollAreaViewport=Me;exports.ConversationLoading=Pe;exports.Disclaimer=Te;exports.DisclaimerArrow=Le;exports.DisclaimerContent=He;exports.DisclaimerLabel=je;exports.DisclaimerText=we;exports.DisclaimerTrigger=ye;exports.EmbeddedChatPrimitiveActionBar=hi;exports.EmbeddedChatPrimitiveActions=ui;exports.EmbeddedChatPrimitiveAttachmentsBar=wt;exports.EmbeddedChatPrimitiveAttachmentsBarActions=Wt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachment=Dt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentDelete=Rt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentIcon=Ot;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentTitle=qt;exports.EmbeddedChatPrimitiveAttachmentsBarForm=ii;exports.EmbeddedChatPrimitiveAttachmentsBarFormContent=oi;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentError=mi;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentInput=ci;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentLabel=di;exports.EmbeddedChatPrimitiveAttachmentsBarFormSubmitButton=li;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitle=ai;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleError=ri;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleInput=si;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleLabel=ni;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTip=Nt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipArrow=me;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipIcon=Qt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipText=$t;exports.EmbeddedChatPrimitiveAttachmentsBarInput=Ut;exports.EmbeddedChatPrimitiveAttachmentsBarInputs=Vt;exports.EmbeddedChatPrimitiveAttachmentsBarList=Lt;exports.EmbeddedChatPrimitiveAttachmentsBarModal=Kt;exports.EmbeddedChatPrimitiveAttachmentsBarModalBody=ti;exports.EmbeddedChatPrimitiveAttachmentsBarModalClose=ei;exports.EmbeddedChatPrimitiveAttachmentsBarModalContent=Gt;exports.EmbeddedChatPrimitiveAttachmentsBarModalDescription=Xt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeader=Yt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeading=Jt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHelp=Zt;exports.EmbeddedChatPrimitiveAttachmentsBarModalOverlay=zt;exports.EmbeddedChatPrimitiveChatAction=z;exports.EmbeddedChatPrimitiveChatActionFeedback=gi;exports.EmbeddedChatPrimitiveChatActionLabel=le;exports.EmbeddedChatPrimitiveChatHelpAction=Ai;exports.EmbeddedChatPrimitiveContent=ke;exports.EmbeddedChatPrimitiveContentScrollArea=Ie;exports.EmbeddedChatPrimitiveContentScrollAreaCorner=Be;exports.EmbeddedChatPrimitiveContentScrollAreaScrollbar=Se;exports.EmbeddedChatPrimitiveContentScrollAreaThumb=xe;exports.EmbeddedChatPrimitiveContentScrollAreaViewport=Me;exports.EmbeddedChatPrimitiveConversationLoading=Pe;exports.EmbeddedChatPrimitiveDisclaimer=Te;exports.EmbeddedChatPrimitiveDisclaimerArrow=Le;exports.EmbeddedChatPrimitiveDisclaimerContent=He;exports.EmbeddedChatPrimitiveDisclaimerLabel=je;exports.EmbeddedChatPrimitiveDisclaimerText=we;exports.EmbeddedChatPrimitiveDisclaimerTrigger=ye;exports.EmbeddedChatPrimitiveExampleQuestion=Re;exports.EmbeddedChatPrimitiveExampleQuestionButton=We;exports.EmbeddedChatPrimitiveExampleQuestions=De;exports.EmbeddedChatPrimitiveExampleQuestionsLabel=Oe;exports.EmbeddedChatPrimitiveExampleQuestionsList=qe;exports.EmbeddedChatPrimitiveFeedbackForm=ji;exports.EmbeddedChatPrimitiveFeedbackItem=yi;exports.EmbeddedChatPrimitiveFeedbackItemCheckbox=Hi;exports.EmbeddedChatPrimitiveFeedbackItemCheckboxIndicator=wi;exports.EmbeddedChatPrimitiveFeedbackItemDescription=Di;exports.EmbeddedChatPrimitiveFeedbackItemLabel=Li;exports.EmbeddedChatPrimitiveFeedbackModal=Mi;exports.EmbeddedChatPrimitiveFeedbackModalBody=Ti;exports.EmbeddedChatPrimitiveFeedbackModalClose=fi;exports.EmbeddedChatPrimitiveFeedbackModalContent=xi;exports.EmbeddedChatPrimitiveFeedbackModalHeader=Bi;exports.EmbeddedChatPrimitiveFeedbackModalOverlay=Si;exports.EmbeddedChatPrimitiveFeedbackSubmitButton=Oi;exports.EmbeddedChatPrimitiveFooter=Bt;exports.EmbeddedChatPrimitiveForm=Ri;exports.EmbeddedChatPrimitiveFormCancel=la;exports.EmbeddedChatPrimitiveFormClose=Wi;exports.EmbeddedChatPrimitiveFormContent=Vi;exports.EmbeddedChatPrimitiveFormDescription=$i;exports.EmbeddedChatPrimitiveFormError=ca;exports.EmbeddedChatPrimitiveFormField=Ui;exports.EmbeddedChatPrimitiveFormFieldCheckbox=Ji;exports.EmbeddedChatPrimitiveFormFieldCheckboxIndicator=Xi;exports.EmbeddedChatPrimitiveFormFieldEmail=zi;exports.EmbeddedChatPrimitiveFormFieldError=da;exports.EmbeddedChatPrimitiveFormFieldFile=Gi;exports.EmbeddedChatPrimitiveFormFieldLabel=Ki;exports.EmbeddedChatPrimitiveFormFieldSelect=Zi;exports.EmbeddedChatPrimitiveFormFieldSelectContent=aa;exports.EmbeddedChatPrimitiveFormFieldSelectIcon=ia;exports.EmbeddedChatPrimitiveFormFieldSelectItem=sa;exports.EmbeddedChatPrimitiveFormFieldSelectItemIndicator=oa;exports.EmbeddedChatPrimitiveFormFieldSelectItemText=ra;exports.EmbeddedChatPrimitiveFormFieldSelectTrigger=ea;exports.EmbeddedChatPrimitiveFormFieldSelectValue=ta;exports.EmbeddedChatPrimitiveFormFieldSelectViewport=na;exports.EmbeddedChatPrimitiveFormFieldText=G;exports.EmbeddedChatPrimitiveFormFieldTextArea=Yi;exports.EmbeddedChatPrimitiveFormFooter=ma;exports.EmbeddedChatPrimitiveFormHeader=Ni;exports.EmbeddedChatPrimitiveFormHeading=Qi;exports.EmbeddedChatPrimitiveFormSubmit=ha;exports.EmbeddedChatPrimitiveFormSuccess=ua;exports.EmbeddedChatPrimitiveFormSuccessButton=va;exports.EmbeddedChatPrimitiveFormSuccessHeading=Ca;exports.EmbeddedChatPrimitiveFormSuccessMessage=pa;exports.EmbeddedChatPrimitiveFormWrapper=qi;exports.EmbeddedChatPrimitiveHeaderToolbar=_e;exports.EmbeddedChatPrimitiveHelpActions=Pi;exports.EmbeddedChatPrimitiveHelpActionsMenu=Fi;exports.EmbeddedChatPrimitiveHelpActionsMenuArrow=Ei;exports.EmbeddedChatPrimitiveHelpActionsMenuItem=ki;exports.EmbeddedChatPrimitiveHelpActionsMenuItemIcon=Ii;exports.EmbeddedChatPrimitiveHelpActionsTrigger=_i;exports.EmbeddedChatPrimitiveInput=jt;exports.EmbeddedChatPrimitiveInputFieldset=ft;exports.EmbeddedChatPrimitiveInputGroup=Tt;exports.EmbeddedChatPrimitiveIntroMessageWrapper=Ue;exports.EmbeddedChatPrimitiveMessage=ut;exports.EmbeddedChatPrimitiveMessageAction=bt;exports.EmbeddedChatPrimitiveMessageAttachments=it;exports.EmbeddedChatPrimitiveMessageAttachmentsItem=nt;exports.EmbeddedChatPrimitiveMessageAttachmentsItemIcon=st;exports.EmbeddedChatPrimitiveMessageAttachmentsItemTitle=rt;exports.EmbeddedChatPrimitiveMessageAttachmentsList=at;exports.EmbeddedChatPrimitiveMessageAttachmentsPreview=ot;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewBody=ht;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewClose=lt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewContent=ct;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewHeader=mt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewOverlay=dt;exports.EmbeddedChatPrimitiveMessageAvatar=Ge;exports.EmbeddedChatPrimitiveMessageAvatarContent=Ye;exports.EmbeddedChatPrimitiveMessageAvatarFallback=Je;exports.EmbeddedChatPrimitiveMessageAvatarImage=Xe;exports.EmbeddedChatPrimitiveMessageContent=tt;exports.EmbeddedChatPrimitiveMessageContentWrapper=et;exports.EmbeddedChatPrimitiveMessageHeader=Ke;exports.EmbeddedChatPrimitiveMessageLoading=ze;exports.EmbeddedChatPrimitiveMessageName=Ze;exports.EmbeddedChatPrimitiveMessageSourceItem=_t;exports.EmbeddedChatPrimitiveMessageSourceItemBreadcrumbs=Ft;exports.EmbeddedChatPrimitiveMessageSourceItemDescription=Mt;exports.EmbeddedChatPrimitiveMessageSourceItemDescriptionPart=St;exports.EmbeddedChatPrimitiveMessageSourceItemIcon=Et;exports.EmbeddedChatPrimitiveMessageSourceItemIndicator=xt;exports.EmbeddedChatPrimitiveMessageSourceItemTag=It;exports.EmbeddedChatPrimitiveMessageSourceItemTitle=kt;exports.EmbeddedChatPrimitiveMessageSources=gt;exports.EmbeddedChatPrimitiveMessageSourcesHeader=Pt;exports.EmbeddedChatPrimitiveMessageSourcesList=At;exports.EmbeddedChatPrimitiveMessageToolAction=vt;exports.EmbeddedChatPrimitiveMessageToolActions=pt;exports.EmbeddedChatPrimitiveMessageToolbar=Ct;exports.EmbeddedChatPrimitiveMessageWrapper=ce;exports.EmbeddedChatPrimitiveMessages=fe;exports.EmbeddedChatPrimitiveRoot=Ae;exports.EmbeddedChatPrimitiveSendButton=yt;exports.EmbeddedChatPrimitiveSendButtonIcon=Ht;exports.EmbeddedChatPrimitiveTaglineBrandName=bi;exports.EmbeddedChatPrimitiveTaglineContainer=Ci;exports.EmbeddedChatPrimitiveTaglineLogo=vi;exports.EmbeddedChatPrimitiveTaglineText=pi;exports.EmbeddedChatPrimitiveToolbarHeader=Ee;exports.EmbeddedChatPrimitiveToolbarHeaderWrapper=Fe;exports.EmbeddedChatPrimitiveWorkflow=Ve;exports.EmbeddedChatPrimitiveWorkflows=Ne;exports.EmbeddedChatPrimitiveWorkflowsLabel=Qe;exports.EmbeddedChatPrimitiveWorkflowsList=$e;exports.EmbeddedChatPrimitiveWrapper=ge;exports.ExampleQuestion=Re;exports.ExampleQuestionButton=We;exports.ExampleQuestions=De;exports.ExampleQuestionsLabel=Oe;exports.ExampleQuestionsList=qe;exports.FeedbackForm=ji;exports.FeedbackItem=yi;exports.FeedbackItemCheckbox=Hi;exports.FeedbackItemCheckboxIndicator=wi;exports.FeedbackItemDescription=Di;exports.FeedbackItemLabel=Li;exports.FeedbackModal=Mi;exports.FeedbackModalBody=Ti;exports.FeedbackModalClose=fi;exports.FeedbackModalContent=xi;exports.FeedbackModalHeader=Bi;exports.FeedbackModalOverlay=Si;exports.FeedbackSubmitButton=Oi;exports.Footer=Bt;exports.Form=Ri;exports.FormCancel=la;exports.FormClose=Wi;exports.FormContent=Vi;exports.FormDescription=$i;exports.FormError=ca;exports.FormField=Ui;exports.FormFieldCheckbox=Ji;exports.FormFieldCheckboxIndicator=Xi;exports.FormFieldEmail=zi;exports.FormFieldError=da;exports.FormFieldFile=Gi;exports.FormFieldLabel=Ki;exports.FormFieldSelect=Zi;exports.FormFieldSelectContent=aa;exports.FormFieldSelectIcon=ia;exports.FormFieldSelectItem=sa;exports.FormFieldSelectItemIndicator=oa;exports.FormFieldSelectItemText=ra;exports.FormFieldSelectTrigger=ea;exports.FormFieldSelectValue=ta;exports.FormFieldSelectViewport=na;exports.FormFieldText=G;exports.FormFieldTextArea=Yi;exports.FormFooter=ma;exports.FormHeader=Ni;exports.FormHeading=Qi;exports.FormSubmit=ha;exports.FormSuccess=ua;exports.FormSuccessButton=va;exports.FormSuccessHeading=Ca;exports.FormSuccessMessage=pa;exports.FormWrapper=qi;exports.Header=Qa;exports.HeaderToolbar=_e;exports.HeaderToolbarWrapper=Fe;exports.HelpActions=Pi;exports.HelpActionsMenu=Fi;exports.HelpActionsMenuArrow=Ei;exports.HelpActionsMenuItem=ki;exports.HelpActionsMenuItemIcon=Ii;exports.HelpActionsTrigger=_i;exports.Input=jt;exports.InputFieldset=ft;exports.InputGroup=Tt;exports.IntroMessageWrapper=Ue;exports.Message=ut;exports.MessageAction=bt;exports.MessageAttachments=it;exports.MessageAttachmentsItem=nt;exports.MessageAttachmentsItemIcon=st;exports.MessageAttachmentsItemTitle=rt;exports.MessageAttachmentsList=at;exports.MessageAttachmentsPreview=ot;exports.MessageAttachmentsPreviewBody=ht;exports.MessageAttachmentsPreviewClose=lt;exports.MessageAttachmentsPreviewContent=ct;exports.MessageAttachmentsPreviewHeader=mt;exports.MessageAttachmentsPreviewOverlay=dt;exports.MessageAvatar=Ge;exports.MessageAvatarContent=Ye;exports.MessageAvatarFallback=Je;exports.MessageAvatarImage=Xe;exports.MessageContent=tt;exports.MessageContentWrapper=et;exports.MessageHeader=Ke;exports.MessageLoading=ze;exports.MessageName=Ze;exports.MessageSourceItem=_t;exports.MessageSourceItemBreadcrumbIcon=wn;exports.MessageSourceItemBreadcrumbs=Ft;exports.MessageSourceItemDescription=Mt;exports.MessageSourceItemDescriptionPart=St;exports.MessageSourceItemIcon=Et;exports.MessageSourceItemIndicator=xt;exports.MessageSourceItemTag=It;exports.MessageSourceItemTitle=kt;exports.MessageSources=gt;exports.MessageSourcesHeader=Pt;exports.MessageSourcesList=At;exports.MessageToolAction=vt;exports.MessageToolActions=pt;exports.MessageToolbar=Ct;exports.MessageWrapper=ce;exports.Messages=fe;exports.Root=Ae;exports.SendButton=yt;exports.SendButtonIcon=Ht;exports.TaglineBrandName=bi;exports.TaglineContainer=Ci;exports.TaglineLogo=vi;exports.TaglineText=pi;exports.ToolbarHeader=Ee;exports.Workflow=Ve;exports.Workflows=Ne;exports.WorkflowsLabel=Qe;exports.WorkflowsList=$e;exports.Wrapper=ge;
|