@inkeep/cxkit-primitives 0.5.116 → 0.5.117
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/components/embedded-chat.cjs +5 -5
- package/dist/components/embedded-chat.js +47 -47
- package/dist/components/embedded-search.cjs +1 -1
- package/dist/components/embedded-search.js +149 -149
- package/dist/components/tagline-logo-icon.cjs +1 -1
- package/dist/components/tagline-logo-icon.js +11 -21
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/providers/base-events-provider.cjs +1 -1
- package/dist/providers/base-events-provider.js +1 -1
- package/dist/utils/component-ids.cjs +1 -1
- package/dist/utils/component-ids.js +2 -2
- package/package.json +4 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),g=require("react"),oe=require("react-textarea-autosize"),fa=require("@radix-ui/react-avatar"),Ba=require("@radix-ui/react-checkbox"),Ta=require("@radix-ui/react-popover"),ja=require("@radix-ui/react-tooltip"),ya=require("@radix-ui/react-scroll-area"),S=require("../atoms/select.cjs"),I=require("../atoms/combobox.cjs"),F=require("../atoms/dialog.cjs"),Ha=require("../atoms/avatars/ai.cjs"),wa=require("../atoms/avatars/user.cjs"),A=require("../atoms/icons/custom-icon.cjs"),M=require("../atoms/icons/built-in-icon-renderer.cjs"),La=require("../atoms/link.cjs"),K=require("../atoms/markdown/index.cjs"),L=require("../providers/attachment-item-provider.cjs"),E=require("../providers/attachments-bar-provider.cjs"),T=require("../providers/source-item-provider.cjs"),p=require("../providers/config-provider.cjs"),D=require("../providers/conversation-provider.cjs"),R=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"),ge=require("../atoms/icons/checkbox-icon.cjs"),ie=require("../hooks/use-copy-to-clipboard.cjs"),z=require("../providers/feedback-item-provider.cjs"),Da=require("../utils/get-message-metadata.cjs"),h=require("../utils/misc.cjs"),i=require("./factory.cjs"),Oa=require("./tagline-logo-icon.cjs"),b=require("./embedded-chat/chat-provider.cjs"),Ra=require("../hooks/use-settle-action.cjs"),qa=require("../hooks/use-container-size.cjs"),re=require("./embedded-chat/use-chat-action.cjs"),ae=require("../providers/help-menu-provider.cjs"),_=require("../providers/chat-form-provider.cjs"),x=require("../providers/form-field-provider.cjs"),Wa=require("react-hook-form"),Na=require("../utils/highlight-emphasis.cjs"),Va=require("./modal/modal-provider.cjs"),Qa=require("@inkeep/cxkit-color-mode"),se=require("../utils/compose-refs.cjs"),C=require("../utils/compose-event-handlers.cjs"),$a=require("../hooks/use-scroll-to-bottom.cjs"),Ua=require("../atoms/api/analytics/conversation.cjs"),Ka=require("../utils/transform-source/index.cjs"),za=require("../hooks/use-debounce.cjs"),de=require("../providers/hover-popover-provider.cjs"),Ga=require("./modal/widget-auto-focus.cjs"),Ya=require("../atoms/shadow/context.cjs");function W(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,n.get?n:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const ce=W(fa),G=W(Ba),j=W(Ta),y=W(ja),N=W(ya),Ja="__intro__",Xa=i.ikp("div",{_id:"aiChatWrapper"}),Pe=g.forwardRef((t,e)=>{const{...a}=t,{isHidden:n,isMobile:r}=b.useChat(),[s,d]=qa.useContainerSize(),c=se.useComposedRefs(e,s),m=d?.width?d.width>580:!0,l=Va.useModal();return o.jsx(Xa,{ref:c,"data-widget-md":h.dataAttr(m),"data-hidden":h.dataAttr(n),"data-in-modal":h.dataAttr(!!l),"data-mobile":h.dataAttr(r),...a})}),Za=i.ikp("div",{_id:"aiChatConversationLoading"}),Fe=t=>{const{isLoadingConversation:e}=b.useChat();return e?o.jsx(Za,{children:o.jsx("span",{children:"Loading..."}),...t}):null},eo=i.ikp("div",{_id:"aiChatRoot"}),_e=t=>{const{isLoadingConversation:e,isHidden:a}=b.useChat(),{form:n}=_.useChatForm();return e||n?null:o.jsx(eo,{"data-hidden":h.dataAttr(a),...t})},to=i.ikp("div",{_id:"aiChatHeader"}),Ae=i.ikp("div",{_id:"aiChatHeader__Toolbar"}),Ee=i.ikp("div",{_id:"aiChatHeader__ToolbarHeaderWrapper"}),io=i.ikp("div",{_id:"aiChatHeader__ToolbarHeader"}),ke=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig(),a=`Ask ${e.aiAssistantName||"AI"}`;return o.jsx(io,{...t,children:a})}),Ie=i.ikp("div",{_id:"aiChatContent"}),Me=i.ikp(N.Root,{_id:"aiChatContentScrollArea"}),ao=i.ikp(N.Viewport,{_id:"aiChatContentScrollArea__Viewport"}),xe=g.forwardRef(({children:t,...e},a)=>{const{containerRef:n}=$a.useScrollToBottom(),r=se.useComposedRefs(a,n);return o.jsx(ao,{ref:r,children:o.jsx("div",{"data-part":"grid",style:{display:"grid"},children:t}),...e})}),Se=i.ikp(N.ScrollAreaScrollbar,{_id:"aiChatContentScrollArea__Scrollbar"}),fe=i.ikp(N.ScrollAreaThumb,{_id:"aiChatContentScrollArea__Thumb"}),Be=i.ikp(N.Corner,{_id:"aiChatContentScrollArea__Corner"}),oo=i.ikp("div",{_id:"aiChatMessages"}),Te=t=>{const e=b.useChat(),{children:a,...n}=t;return o.jsx(oo,{children:h.maybeRender(a,e),...n})},no=i.ikp("div",{_id:"aiChatDisclaimer"}),je=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig(),[a,n]=g.useState(!1),r=za.useDebounce(a,100);return e.disclaimerSettings?.isEnabled?o.jsx(de.HoverPopoverProvider,{open:a,setOpen:n,children:o.jsx(j.Root,{open:r,onOpenChange:n,children:o.jsx(no,{...t})})}):null}),ro=i.ikp("span",{_id:"aiChatDisclaimerLabel"}),ye=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig(),a=e.disclaimerSettings;return o.jsx(ro,{children:a?.label,...t})}),so=i.ikp(j.Trigger,{_id:"aiChatDisclaimerTrigger",children:o.jsx(A.CustomIcon,{iconKey:"info"})}),He=g.memo(t=>{const{setOpen:e}=de.useHoverPopover(),a=()=>e(!0),n=()=>e(!1);return o.jsx(so,{onMouseEnter:a,onMouseLeave:n,...t})}),co=i.ikp(j.Content,{_id:"aiChatDisclaimerContent"}),we=t=>{const{setOpen:e}=de.useHoverPopover(),a=()=>e(!0),n=()=>e(!1);return o.jsx(co,{onMouseEnter:a,onMouseLeave:n,side:"top",sideOffset:8,align:"end",alignOffset:-10,...t})},mo=i.ikp(K.Markdown,{_id:"aiChatDisclaimerText"}),Le=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig(),a=e.aiAssistantName,r=e.disclaimerSettings?.tooltip||`Information provided by ${a||"this AI assistant"} is not guaranteed to be accurate or comprehensive.`;return o.jsx(mo,{shouldOpenLinksInNewTab:!0,children:r,...t})}),De=i.ikp(j.Arrow,{_id:"aiChatDisclaimerArrow"}),lo=i.ikp("div",{_id:"aiChatExampleQuestions"}),Oe=t=>{const{aiChatSettings:e}=p.useInkeepConfig(),{messages:a}=b.useChat();return!e.exampleQuestions?.length||a.length?null:o.jsx(lo,{...t})},ho=i.ikp("h3",{_id:"aiChatExampleQuestionsLabel"}),Re=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig();return o.jsx(ho,{children:e.exampleQuestionsLabel,...t})}),Co=i.ikp("div",{_id:"aiChatExampleQuestionsList"}),qe=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig(),a=e.exampleQuestions,{children:n,...r}=t;return o.jsx(Co,{children:h.maybeRender(n,a),...r})}),uo=i.ikp("div",{_id:"aiChatExampleQuestion"}),We=g.forwardRef((t,e)=>{const{aiChatSettings:a}=p.useInkeepConfig(),n=a.isFirstExampleQuestionHighlighted;return o.jsx(uo,{ref:e,"data-highlight":h.dataAttr(n),...t})}),po=i.ikp("button",{_id:"aiChatExampleQuestionButton"}),Ne=t=>{const{question:e,onClick:a,...n}=t,{handleSubmit:r}=b.useChat();return o.jsx(po,{onClick:C.composeEventHandlers(a,()=>r(e)),children:e,...n})},bo=i.ikp("div",{_id:"aiChatWorkflows"}),Ve=t=>{const{aiChatSettings:e}=p.useInkeepConfig(),{messages:a}=b.useChat();return!e.workflows?.length||a.length?null:o.jsx(bo,{...t})},vo=i.ikp("h3",{_id:"aiChatWorkflowsLabel"}),Qe=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig();return o.jsx(vo,{children:e.workflowsHeader,...t})}),go=i.ikp("div",{_id:"aiChatWorkflowsList"}),$e=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig(),a=e.workflows,{children:n,...r}=t;return o.jsx(go,{children:h.maybeRender(n,a),...r})}),Po=i.ikp("button",{_id:"aiChatWorkflow"}),Ue=t=>{const{workflow:e,onClick:a,...n}=t,{handleWorkflow:r}=b.useChat();return o.jsx(Po,{onClick:C.composeEventHandlers(a,()=>r(e)),children:e.displayName,...n})},Fo=i.ikp("div",{_id:"aiChatMessageWrapper"}),me=t=>{const{message:e,...a}=t;return e.role==="system"?null:o.jsx(P.MessageProvider,{message:e,children:o.jsx(Fo,{"data-role":e.role,...a})})},Ke=g.memo(t=>{const{message:e,...a}=t,{aiChatSettings:n,baseSettings:r}=p.useInkeepConfig(),s=n.aiAssistantName,d=s?`Hi, I'm ${s}!`:"Hi!",c=n.chatSubjectName??r.organizationDisplayName,m=`${d}
|
|
2
2
|
|
|
3
|
-
I'm an AI assistant trained on documentation, help articles, and other content.`,l=
|
|
3
|
+
I'm an AI assistant trained on documentation, help articles, and other content.`,l=c?`
|
|
4
4
|
|
|
5
|
-
Ask me anything about \`${
|
|
5
|
+
Ask me anything about \`${c}\`.`:`
|
|
6
6
|
|
|
7
|
-
Let me know how I can help.`,v={content:o.introMessage??`${c}${l}`,id:Ja,...e,role:"assistant",links:[]};return n.jsx(ce,{message:v,...a})}),_n=i.ikp("div",{_id:"aiChatMessageHeader"}),ze=t=>{const{message:e}=P.useMessage();return n.jsx(_n,{"data-role":e.role,...t})},An=i.ikp("div",{_id:"aiChatMessageLoading"}),Ge=t=>{const{isLoading:e,isStreaming:a,messages:o}=b.useChat(),{message:r}=P.useMessage();return!(o.at(-1)?.id===r?.id)||r.role!=="assistant"||!e||a?null:n.jsx(An,{children:"Thinking...",...t})},En=i.ikp("div",{_id:"aiChatMessageAvatar"}),Ye=t=>{const{message:e}=P.useMessage();return n.jsx(En,{"data-role":e.role,...t})},kn=i.ikp(me.Root,{_id:"aiChatMessageAvatarContent"}),Je=t=>{const{message:e}=P.useMessage(),{baseSettings:a}=p.useInkeepConfig();return n.jsx(kn,{"data-username":h.dataAttr(e.role==="user"&&!!a.userProperties.name),"data-role":e.role,...t})},In=i.ikp(me.Fallback,{_id:"aiChatMessageAvatarFallback"}),Xe=g.memo(t=>{const{baseSettings:e}=p.useInkeepConfig(),{message:a}=P.useMessage();return e.userProperties.name?n.jsx(In,{"data-role":a.role,children:h.getInitials(e.userProperties.name),...t}):null}),be=i.ikp(me.Image,{_id:"aiChatMessageAvatarImage"}),Ze=g.memo(t=>{const{onLoadingStatusChange:e,...a}=t,{aiChatSettings:o,baseSettings:{userProperties:r}}=p.useInkeepConfig(),{message:s}=P.useMessage(),{aiAssistantAvatar:d}=o??{},m=typeof d=="string"?d:d?.light,c=(typeof d=="string"?d:d?.dark)??m,l=Qa.useColorModeValue(m,c),[u,v]=g.useState(l);g.useEffect(()=>{v(l)},[l]);const k=H=>{H==="error"&&v(null)};return s.role==="user"?o.userAvatar?n.jsx(be,{"data-type":"image",alt:"User avatar","data-role":s.role,src:o.userAvatar,...t}):r.name?null:n.jsx(wa.default,{"data-type":"icon","data-role":s.role,...t}):u?n.jsx(be,{src:u,alt:"AI assistant avatar","data-type":"image","data-role":s.role,onLoadingStatusChange:C.composeEventHandlers(e,k),...a}):n.jsx(Ha.default,{"data-type":"icon","data-role":s.role,...t})}),Mn=i.ikp("span",{_id:"aiChatMessageName"}),et=t=>{const{message:e}=P.useMessage();return n.jsx(Mn,{"data-role":e.role,children:e.role==="user"?"You":"AI assistant",...t})},xn=i.ikp("div",{_id:"aiChatMessageContentWrapper"}),tt=t=>{const{message:e}=P.useMessage(),{messageButtons:a}=b.useChat(),o=a[e.id]||[];return n.jsx(xn,{"data-role":e.role,"data-has-message-buttons":h.dataAttr(!!o.length),...t})},Sn=i.ikp("div",{_id:"aiChatMessageContent"}),it=t=>{const{message:e}=P.useMessage();return n.jsx(Sn,{"data-role":e.role,...t})},fn=i.ikp("div",{_id:"aiChatMessageAttachments"}),at=t=>{const{message:e}=P.useMessage(),a=e.metadata?.attributes?.attachments;return e.role!=="user"||!a?.length?null:n.jsx(q.MessageAttachmentsProvider,{children:n.jsx(fn,{...t})})},Bn=i.ikp("div",{_id:"aiChatMessageAttachments__List"}),nt=t=>{const{children:e,...a}=t,{message:o}=P.useMessage(),r=o.metadata?.attributes?.attachments;return r?n.jsx(Bn,{children:h.maybeRender(e,r),...a}):null},Tn=i.ikp("div",{_id:"aiChatMessageAttachments__Item"}),ot=t=>{const{attachment:e,onClick:a,...o}=t,{selectItem:r,onOpen:s}=q.useMessageAttachments(),d=()=>{r(e),s()};return n.jsx(L.AttachmentItemProvider,{attachment:e,children:n.jsx(Tn,{onClick:C.composeEventHandlers(a,d),...o})})},jn=i.ikp(M.BuiltInIconRenderer,{_id:"aiChatMessageAttachments__ItemIcon"}),rt=t=>{const{attachment:e}=L.useAttachmentItem(),a=e.contentType?.attachmentIcon;return a?n.jsx(jn,{iconSettings:a,...t}):null},yn=i.ikp("span",{_id:"aiChatMessageAttachments__ItemTitle"}),st=t=>{const{attachment:e}=L.useAttachmentItem();return n.jsx(yn,{children:e.title,...t})},Hn=i.ikp(F.Root,{_id:"aiChatMessageAttachmentsPreview"}),dt=t=>{const{onOpenChange:e,...a}=t,{selectItem:o,isOpen:r,onClose:s,selectedItem:d}=q.useMessageAttachments(),m=c=>{c||(s(),o(null))};return n.jsx(Hn,{open:r&&d!==null,onOpenChange:C.composeEventHandlers(e,m),...a})},mt=i.ikp(F.Overlay,{_id:"aiChatMessageAttachmentsPreview__Overlay"}),ct=i.ikp(F.Content,{_id:"aiChatMessageAttachmentsPreview__Content","aria-describedby":void 0}),wn=i.ikp(F.Title,{_id:"aiChatMessageAttachmentsPreview__Header"}),lt=t=>{const{selectedItem:e}=q.useMessageAttachments();return n.jsx(wn,{children:e?.title||"Attachment",...t})},ht=i.ikp(F.Close,{_id:"aiChatMessageAttachmentsPreview__Close",children:n.jsx(A.CustomIcon,{iconKey:"close"})}),Ln=i.ikp("p",{_id:"aiChatMessageAttachmentsPreview__Body"}),Ct=t=>{const{selectedItem:e}=q.useMessageAttachments();return n.jsx(Ln,{children:e?.content,...t})},ve=i.ikp("div",{_id:"aiChatMessage"}),ut=t=>{const{aiChatSettings:e}=p.useInkeepConfig(),{componentStyles:a,...o}=t,{message:r}=P.useMessage(),{logEvent:s}=R.useChatEvents(),d=h.getMessageContent(r),{conversation:m}=D.useInkeepConversation();return r.role==="user"?n.jsx(ve,{"data-role":r.role,children:d,...o}):n.jsx(ve,{"data-role":r.role,...o,children:n.jsx(K.Markdown,{children:d,componentStyles:a,shouldOpenLinksInNewTab:e.shouldOpenLinksInNewTab,onLinkClick:(c,l)=>{s({eventName:"assistant_message_inline_link_opened",properties:{title:l?.toString(),url:c}})},onCodeCopy:(c,l)=>{s({eventName:"assistant_code_block_copied",properties:{conversation:m,language:c,code:l}})}})})},Dn=i.ikp("div",{_id:"aiChatMessageToolbar"}),pt=t=>{const{isLoading:e,messages:a}=b.useChat(),{message:o}=P.useMessage();return a.at(-1)?.id===o?.id&&e||o.role==="user"?null:n.jsx(Dn,{...t})},On=i.ikp("div",{_id:"aiChatMessageToolActions"}),bt=t=>{const{children:e,...a}=t,{message:o}=P.useMessage(),{messageButtons:r}=b.useChat(),s=r[o.id]||[];return n.jsx(On,{children:h.maybeRender(e,s),...a})},Rn=i.ikp("a",{_id:"aiChatMessageToolAction"}),qn=i.ikp("button",{_id:"aiChatMessageToolAction"}),vt=t=>{const{onClick:e,action:a,...o}=t,{handleAction:r}=re.useChatAction(a),{logEvent:s}=R.useChatEvents(),{conversation:d}=D.useInkeepConversation(),m=()=>{r(),s({eventName:"tool_call_action_clicked",properties:{conversation:d}}),a.action.type!=="open_form"&&s({eventName:"user_escalation_indicated",properties:{escalationType:"contact_us",conversation:d}})},c=a.label||"Contact Support",l=n.jsxs(n.Fragment,{children:[a.icon&&n.jsx(M.BuiltInIconRenderer,{iconSettings:a.icon}),c]});return a.action.type==="open_link"?n.jsx(Rn,{href:a.action.url,target:"_blank",rel:"noopener","data-type":a.action.type,onClick:C.composeEventHandlers(e,m),children:l,...o}):n.jsx(qn,{"data-type":a.action.type,onClick:C.composeEventHandlers(e,m),children:l,...o})},Wn=i.ikp("button",{_id:"aiChatMessageAction"}),gt=t=>{const{action:e,onClick:a,className:o,...r}=t,{conversation:s}=D.useInkeepConversation(),{message:d}=P.useMessage(),{isStreaming:m,messages:c}=b.useChat(),[l,u]=ie.useCopyToClipboard(),{feedback:v,submitPositiveFeedback:k,setCurrentFeedback:H,currentFeedback:V}=oe.useMessageFeedback(),{logEvent:X}=R.useChatEvents(),[Q,Z]=Ra.useSettleAction(),{baseSettings:{privacyPreferences:Ce}}=p.useInkeepConfig(),{optOutAllAnalytics:ee}=Ce,ue=c.at(-1)?.id===d?.id,te=d.role==="assistant";if(ue&&m||!te||{copy:!1,upvote:ee,downvote:ee}[e])return null;const w={copy(){u(h.getMessageContent(d)),X({eventName:"assistant_message_copied",properties:{conversation:s}})},upvote(){k(d.id).then(()=>{Z()})},downvote(){H(d.id)}},O={copy:"Copy Message",upvote:"Upvote Message",downvote:"Downvote Message"},f={copy:n.jsx(A.CustomIcon,{iconKey:l?"messageCopied":"messageCopy"}),upvote:n.jsx(A.CustomIcon,{iconKey:Q?"messageCopied":"thumbsUp"}),downvote:n.jsx(A.CustomIcon,{iconKey:"thumbsDown"})},B={copy:{"data-copied":h.dataAttr(l)},upvote:{"data-upvoted":h.dataAttr(v[d.id]?.type==="positive")},downvote:{"data-downvoted":h.dataAttr(v[d.id]?.type==="negative"),"data-state":V===null?"closed":"open"}};return n.jsx(Wn,{"data-action":e,...B[e],children:f[e],"aria-label":O[e],className:`${o} ${e}`,onClick:C.composeEventHandlers(a,w[e]),...r})},Nn=i.ikp("div",{_id:"aiChatMessageSources"}),Pt=t=>{const{message:e}=P.useMessage();return e.role!=="assistant"||!e.links?.length?null:n.jsx(Nn,{...t})},Vn=i.ikp("div",{_id:"aiChatMessageSources__Header"}),Ft=t=>n.jsx(Vn,{children:"Sources",...t}),Qn=i.ikp("div",{_id:"aiChatMessageSources__List"}),_t=t=>{const{message:e}=P.useMessage(),{children:a,...o}=t,{baseSettings:{transformSource:r,organizationDisplayName:s},aiChatSettings:{shouldOpenLinksInNewTab:d},searchSettings:{tabs:m}}=p.useInkeepConfig();if(e.role!=="assistant")return null;const c=e.links.map(l=>{const u=Ka.transformInkeepSource(l,"chatSourceItem",{organizationDisplayName:s,tabs:m,transformSource:r}),v=u.shouldOpenInNewTab!==void 0?u.shouldOpenInNewTab:d;return{...u,isExternal:v}});return n.jsx(Qn,{children:h.maybeRender(a,c),...o})},$n=i.ikp(La.LinkWithQueryParams,{_id:"aiChatMessageSourceItem"}),At=t=>{const{source:e,onClick:a,...o}=t,{logEvent:r}=R.useChatEvents(),{conversation:s}=D.useInkeepConversation(),d=()=>{r({eventName:"assistant_source_item_clicked",properties:{conversation:s,link:e}})};return n.jsx(T.SourceItemProvider,{source:e,children:n.jsx($n,{"data-type":e.type,appendToUrl:e.appendToUrl,isExternal:e.isExternal,"data-breadcrumbs":!!e.breadcrumbs?.length,onClick:C.composeEventHandlers(a,d),...o})})},Un=i.ikp("div",{_id:"aiChatMessageSourceItem__Breadcrumbs"}),Et=t=>{const{source:e}=T.useSourceItem();return e.breadcrumbs?.length?n.jsx(Un,{"data-type":e.type,...t}):null},Kn=i.ikp(A.CustomIcon,{_id:"aiChatMessageSourceItem__BreadcrumbIcon",iconKey:"breadcrumbSeparator"}),zn=i.ikp(M.BuiltInIconRenderer,{_id:"aiChatMessageSourceItem__Icon"}),kt=t=>{const{source:e}=T.useSourceItem();return n.jsx(zn,{iconSettings:e.icon,"data-type":e.type,...t})},Gn=i.ikp("span",{_id:"aiChatMessageSourceItem__Title"}),It=t=>{const{source:e}=T.useSourceItem();return n.jsx(Gn,{"data-type":e.type,children:e.title,...t})},Yn=i.ikp("span",{_id:"aiChatMessageSourceItem__Tag"}),Mt=t=>{const{source:e}=T.useSourceItem();return n.jsx(Yn,{"data-type":e.type,...t})},Jn=i.ikp("span",{_id:"aiChatMessageSourceItem__Description"}),xt=t=>{const{source:e}=T.useSourceItem(),{children:a,...o}=t,r=g.useMemo(()=>e.description?Na.highlightEmphasis(e.description):[],[e.description]);return r.length?n.jsx(Jn,{"data-type":e.type,children:h.maybeRender(a,r),...o}):null},Xn=i.ikp("span",{_id:"aiChatMessageSourceItem__DescriptionPart"}),St=t=>{const{part:e,...a}=t,{source:o}=T.useSourceItem();return typeof e=="string"?e:n.jsx(Xn,{"data-type":o.type,children:e.content,"data-highlighted":h.dataAttr(e.highlighted),...a})},Zn=i.ikp(A.CustomIcon,{_id:"aiChatMessageSourceItem__Indicator"}),ft=t=>{const{source:e}=T.useSourceItem();return n.jsx(Zn,{iconKey:e.isExternal?"openLinkInNewTab":"openLinkInSameTab",...t})},Bt=i.ikp("div",{_id:"aiChatFooter"}),Tt=i.ikp("div",{_id:"aiChatInput__Fieldset"}),jt=i.ikp("div",{_id:"aiChatInput__Group"}),eo=i.ikp("textarea",{_id:"aiChatInput"}),yt=g.forwardRef(({onChange:t,onKeyDown:e,...a},o)=>{const{handleInputChange:r,handleInputKeyDown:s,input:d,error:m,shouldAutoFocusInput:c,inputRef:l}=b.useChat(),{aiChatSettings:u}=p.useInkeepConfig(),v=se.useComposedRefs(o,l);return Ga.useWidgetAutoFocus("chat",l,c),n.jsx(eo,{asChild:!0,ref:v,maxLength:99999,placeholder:u.placeholder,value:d,onChange:C.composeEventHandlers(t,r),onKeyDown:C.composeEventHandlers(e,s),disabled:!!m||u.isViewOnly,...a,children:n.jsx(ne,{})})}),to=i.ikp("button",{_id:"aiChatInput__SendButton"}),Ht=t=>{const{handleSubmit:e,isSubmitDisabled:a,error:o}=b.useChat(),{aiChatSettings:r}=p.useInkeepConfig(),{onClick:s,...d}=t;return n.jsx(to,{onClick:C.composeEventHandlers(s,()=>e()),"aria-label":"Send message",disabled:a||!!o||r.isViewOnly,...d})},wt=i.ikp(A.CustomIcon,{_id:"aiChatInput__SendButtonIcon",iconKey:"chatSubmit"}),io=i.ikp("div",{_id:"aiChatAttachmentsBar"}),Lt=t=>{const{selectedWorkflow:e}=b.useChat();return!e||!e.supportedInputs?.length?null:n.jsx(E.AttachmentsBarProvider,{children:n.jsx(io,{...t})})},ao=i.ikp("div",{_id:"aiChatAttachmentsBar__List"}),Dt=t=>{const{children:e,...a}=t,{messageAttachments:o}=b.useChat();return n.jsx(ao,{children:h.maybeRender(e,o),...a})},no=i.ikp("div",{_id:"aiChatAttachmentsBar__Attachment"}),Ot=t=>{const{attachment:e,...a}=t;return n.jsx(L.AttachmentItemProvider,{attachment:e,children:n.jsx(no,{...a})})},oo=i.ikp(M.BuiltInIconRenderer,{_id:"aiChatAttachmentsBar__AttachmentIcon"}),Rt=t=>{const{attachment:e}=L.useAttachmentItem(),a=e.contentType?.attachmentIcon;return a?n.jsx(oo,{iconSettings:a,...t}):null},ro=i.ikp("span",{_id:"aiChatAttachmentsBar__AttachmentTitle"}),qt=t=>{const{attachment:e}=L.useAttachmentItem();return n.jsx(ro,{children:e.title,...t})},so=i.ikp("button",{_id:"aiChatAttachmentsBar__AttachmentDelete"}),Wt=t=>{const{onClick:e,...a}=t,{attachment:o}=L.useAttachmentItem(),{setMessageAttachments:r}=b.useChat(),s=()=>{r(d=>d.filter(m=>m.id!==o.id))};return n.jsx(so,{"aria-label":"Remove attachment",children:n.jsx(A.CustomIcon,{iconKey:"close"}),onClick:C.composeEventHandlers(e,s),...a})},Nt=i.ikp("div",{_id:"aiChatAttachmentsBar__Actions"}),Vt=i.ikp(y.Tooltip,{_id:"aiChatAttachmentsBar__InfoTip",delayDuration:0}),Qt=i.ikp(y.Trigger,{_id:"aiChatAttachmentsBar__InfoTipIcon",children:n.jsx(A.CustomIcon,{iconKey:"info"})}),le=i.ikp(y.Arrow,{_id:"aiChatAttachmentsBar__InfoTipArrow"}),$t=i.ikp(y.Content,{_id:"aiChatAttachmentsBar__InfoTipText",side:"bottom",sideOffset:3,align:"center",children:n.jsxs(n.Fragment,{children:[n.jsx(le,{}),"Attachments will be kept in context for the entire conversation."]})}),mo=i.ikp("div",{_id:"aiChatAttachmentsBar__Inputs"}),Ut=t=>{const{children:e,...a}=t,{selectedWorkflow:o}=b.useChat();return o?.supportedInputs?n.jsx(mo,{children:h.maybeRender(e,o.supportedInputs),...a}):null},co=i.ikp("button",{_id:"aiChatAttachmentsBar__Input"}),Kt=t=>{const{input:e,onClick:a,...o}=t,{selectedWorkflow:r,messageAttachments:s,setMessageAttachments:d}=b.useChat(),{selectInput:m,onOpen:c}=E.useAttachmentsBar(),l=()=>{if(e.type==="FUNCTIONAL_MULTI_ATTACHMENT")return r?e.onInvoke(r,e,d,[...s]):void 0;m(e),c()};return n.jsx(co,{children:e.displayName,onClick:C.composeEventHandlers(a,l),...o})},lo=i.ikp(F.Root,{_id:"aiChatAttachmentsBar__Modal"}),zt=t=>{const{onOpenChange:e,...a}=t,{selectInput:o,isOpen:r,onClose:s,selectedInput:d}=E.useAttachmentsBar(),m=c=>{c||(s(),o(null))};return n.jsx(lo,{open:r&&d!==null,onOpenChange:C.composeEventHandlers(e,m),...a})},Gt=i.ikp(F.Overlay,{_id:"aiChatAttachmentsBar__ModalOverlay"}),Yt=i.ikp(F.Content,{_id:"aiChatAttachmentsBar__ModalContent","aria-describedby":void 0}),Jt=i.ikp("div",{_id:"aiChatAttachmentsBar__ModalHeader"}),ho=i.ikp(F.Title,{_id:"aiChatAttachmentsBar__ModalHeading"}),Xt=t=>{const{selectedInput:e}=E.useAttachmentsBar(),a=`Add ${e?.displayName}`;return n.jsx(ho,{children:a,...t})},Co=i.ikp("span",{_id:"aiChatAttachmentsBar__ModalDescription"}),Zt=t=>{const{selectedInput:e}=E.useAttachmentsBar(),a=e?.workflowModalProps?.modalHelpText;return a?n.jsx(Co,{children:a,...t}):null},uo=i.ikp("div",{_id:"aiChatAttachmentsBar__ModalHelp"}),ei=t=>{const{children:e,...a}=t,{selectedInput:o}=E.useAttachmentsBar(),r=o?.workflowModalProps?.modalHelpElement;return r?n.jsx(uo,{asChild:!e,children:e||r,...a}):null},ti=i.ikp(F.Close,{_id:"aiChatAttachmentsBar__ModalClose",children:n.jsx(A.CustomIcon,{iconKey:"close"})}),ii=i.ikp("div",{_id:"aiChatAttachmentsBar__ModalBody"}),po=i.ikp("form",{_id:"aiChatAttachmentsBar__Form"}),ai=t=>{const{onSubmit:e,...a}=t,{form:o}=E.useAttachmentsBar();return n.jsx(po,{onSubmit:C.composeEventHandlers(e,o.onSubmit),...a})},ni=i.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),bo=i.ikp("label",{_id:"aiChatAttachmentsBar__FormTitleLabel"}),oi=t=>{const{form:e,selectedInput:a}=E.useAttachmentsBar();return n.jsx(bo,{htmlFor:`${a?.id}-title`,children:e.labels.title,...t})},vo=i.ikp("input",{_id:"aiChatAttachmentsBar__FormTitleInput"}),ri=t=>{const{onChange:e,...a}=t,{form:o,selectedInput:r}=E.useAttachmentsBar();return n.jsx(vo,{name:"title",value:o.data.title,id:`${r?.id}-title`,"data-invalid":h.dataAttr(!!o.errors.title),"aria-invalid":!!o.errors.title,onChange:C.composeEventHandlers(e,o.onChange),...a})},go=i.ikp("span",{_id:"aiChatAttachmentsBar__FormTitleError"}),si=t=>{const{form:e}=E.useAttachmentsBar();return e.errors.title?n.jsx(go,{"aria-live":"polite",children:e.errors.title,...t}):null},di=i.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),Po=i.ikp("label",{_id:"aiChatAttachmentsBar__FormContentLabel"}),mi=t=>{const{form:e,selectedInput:a}=E.useAttachmentsBar();return n.jsx(Po,{htmlFor:`${a?.id}-content`,children:e.labels.content,...t})},Fo=i.ikp("textarea",{_id:"aiChatAttachmentsBar__FormTitleInput"}),ci=t=>{const{onChange:e,...a}=t,{form:o,selectedInput:r}=E.useAttachmentsBar();return n.jsx(Fo,{asChild:!0,rows:4,name:"content",value:o.data.content,id:`${r?.id}-content`,"data-invalid":h.dataAttr(!!o.errors.content),"aria-invalid":!!o.errors.content,onChange:C.composeEventHandlers(e,o.onChange),...a,children:n.jsx(ne,{maxRows:10})})},_o=i.ikp("span",{_id:"aiChatAttachmentsBar__FormContentError"}),li=t=>{const{form:e}=E.useAttachmentsBar();return e.errors.content?n.jsx(_o,{"aria-live":"polite",children:e.errors.content,...t}):null},hi=i.ikp("button",{_id:"aiChatAttachmentsBar__FormSubmitButton",children:"Upload",type:"submit"}),Ci=i.ikp("div",{_id:"aiChatActionBar"}),ui=i.ikp("div",{_id:"aiChat__ChatActions"}),pi=i.ikp("div",{_id:"aiChatTagline__Container"}),bi=i.ikp("span",{_id:"aiChatTagline__Text",children:"Powered by"}),vi=i.ikp(Oa.default,{_id:"aiChatTagline__Logo"}),gi=i.ikp("a",{_id:"aiChatTagline__BrandName",children:"inkeep",href:"https://www.inkeep.com/",target:"_blank",rel:"noopener noreferrer"}),Ao=i.ikp(y.Trigger,{_id:"aiChat__ChatAction"}),Y=t=>{const{action:e,onClick:a,className:o,...r}=t,{clear:s,stop:d,isLoading:m,messages:c,selectedWorkflow:l}=b.useChat(),{conversation:u}=D.useInkeepConversation(),{aiChatSettings:v,baseSettings:k}=p.useInkeepConfig(),{logEvent:H}=R.useChatEvents(),[V,X]=ie.useCopyToClipboard(),[Q,Z]=ie.useCopyToClipboard();if({help:!1,copy:c.length===0||!v.isCopyChatButtonVisible||m,share:c.length===0||!v.isShareButtonVisible||!u.id||!!l||m,clear:c.length===0||v.isViewOnly||m,stop:!m}[e])return null;const te={help:()=>{},copy:()=>{const $=c.map(w=>{const O=`**${w.role==="assistant"?"AI Assistant":"User"}**`,f=h.getMessageContent(w),B=Da.stringifyAttachments(w.metadata?.attributes?.attachments),U=B?`
|
|
7
|
+
Let me know how I can help.`,v={content:n.introMessage??`${m}${l}`,id:Ja,...e,role:"assistant",links:[]};return o.jsx(me,{message:v,...a})}),_o=i.ikp("div",{_id:"aiChatMessageHeader"}),ze=t=>{const{message:e}=P.useMessage();return o.jsx(_o,{"data-role":e.role,...t})},Ao=i.ikp("div",{_id:"aiChatMessageLoading"}),Ge=t=>{const{isLoading:e,isStreaming:a,messages:n}=b.useChat(),{message:r}=P.useMessage();return!(n.at(-1)?.id===r?.id)||r.role!=="assistant"||!e||a?null:o.jsx(Ao,{children:"Thinking...",...t})},Eo=i.ikp("div",{_id:"aiChatMessageAvatar"}),Ye=t=>{const{message:e}=P.useMessage();return o.jsx(Eo,{"data-role":e.role,...t})},ko=i.ikp(ce.Root,{_id:"aiChatMessageAvatarContent"}),Je=t=>{const{message:e}=P.useMessage(),{baseSettings:a}=p.useInkeepConfig();return o.jsx(ko,{"data-username":h.dataAttr(e.role==="user"&&!!a.userProperties.name),"data-role":e.role,...t})},Io=i.ikp(ce.Fallback,{_id:"aiChatMessageAvatarFallback"}),Xe=g.memo(t=>{const{baseSettings:e}=p.useInkeepConfig(),{message:a}=P.useMessage();return e.userProperties.name?o.jsx(Io,{"data-role":a.role,children:h.getInitials(e.userProperties.name),...t}):null}),be=i.ikp(ce.Image,{_id:"aiChatMessageAvatarImage"}),Ze=g.memo(t=>{const{onLoadingStatusChange:e,...a}=t,{aiChatSettings:n,baseSettings:{userProperties:r}}=p.useInkeepConfig(),{message:s}=P.useMessage(),{aiAssistantAvatar:d}=n??{},c=typeof d=="string"?d:d?.light,m=(typeof d=="string"?d:d?.dark)??c,l=Qa.useColorModeValue(c,m),[u,v]=g.useState(l);g.useEffect(()=>{v(l)},[l]);const k=H=>{H==="error"&&v(null)};return s.role==="user"?n.userAvatar?o.jsx(be,{"data-type":"image",alt:"User avatar","data-role":s.role,src:n.userAvatar,...t}):r.name?null:o.jsx(wa.default,{"data-type":"icon","data-role":s.role,...t}):u?o.jsx(be,{src:u,alt:"AI assistant avatar","data-type":"image","data-role":s.role,onLoadingStatusChange:C.composeEventHandlers(e,k),...a}):o.jsx(Ha.default,{"data-type":"icon","data-role":s.role,...t})}),Mo=i.ikp("span",{_id:"aiChatMessageName"}),et=t=>{const{message:e}=P.useMessage();return o.jsx(Mo,{"data-role":e.role,children:e.role==="user"?"You":"AI assistant",...t})},xo=i.ikp("div",{_id:"aiChatMessageContentWrapper"}),tt=t=>{const{message:e}=P.useMessage(),{messageButtons:a}=b.useChat(),n=a[e.id]||[];return o.jsx(xo,{"data-role":e.role,"data-has-message-buttons":h.dataAttr(!!n.length),...t})},So=i.ikp("div",{_id:"aiChatMessageContent"}),it=t=>{const{message:e}=P.useMessage();return o.jsx(So,{"data-role":e.role,...t})},fo=i.ikp("div",{_id:"aiChatMessageAttachments"}),at=t=>{const{message:e}=P.useMessage(),a=e.metadata?.attributes?.attachments;return e.role!=="user"||!a?.length?null:o.jsx(q.MessageAttachmentsProvider,{children:o.jsx(fo,{...t})})},Bo=i.ikp("div",{_id:"aiChatMessageAttachments__List"}),ot=t=>{const{children:e,...a}=t,{message:n}=P.useMessage(),r=n.metadata?.attributes?.attachments;return r?o.jsx(Bo,{children:h.maybeRender(e,r),...a}):null},To=i.ikp("div",{_id:"aiChatMessageAttachments__Item"}),nt=t=>{const{attachment:e,onClick:a,...n}=t,{selectItem:r,onOpen:s}=q.useMessageAttachments(),d=()=>{r(e),s()};return o.jsx(L.AttachmentItemProvider,{attachment:e,children:o.jsx(To,{onClick:C.composeEventHandlers(a,d),...n})})},jo=i.ikp(M.BuiltInIconRenderer,{_id:"aiChatMessageAttachments__ItemIcon"}),rt=t=>{const{attachment:e}=L.useAttachmentItem(),a=e.contentType?.attachmentIcon;return a?o.jsx(jo,{iconSettings:a,...t}):null},yo=i.ikp("span",{_id:"aiChatMessageAttachments__ItemTitle"}),st=t=>{const{attachment:e}=L.useAttachmentItem();return o.jsx(yo,{children:e.title,...t})},Ho=i.ikp(F.Root,{_id:"aiChatMessageAttachmentsPreview"}),dt=t=>{const{onOpenChange:e,...a}=t,{selectItem:n,isOpen:r,onClose:s,selectedItem:d}=q.useMessageAttachments(),c=m=>{m||(s(),n(null))};return o.jsx(Ho,{open:r&&d!==null,onOpenChange:C.composeEventHandlers(e,c),...a})},ct=i.ikp(F.Overlay,{_id:"aiChatMessageAttachmentsPreview__Overlay"}),mt=i.ikp(F.Content,{_id:"aiChatMessageAttachmentsPreview__Content","aria-describedby":void 0}),wo=i.ikp(F.Title,{_id:"aiChatMessageAttachmentsPreview__Header"}),lt=t=>{const{selectedItem:e}=q.useMessageAttachments();return o.jsx(wo,{children:e?.title||"Attachment",...t})},ht=i.ikp(F.Close,{_id:"aiChatMessageAttachmentsPreview__Close",children:o.jsx(A.CustomIcon,{iconKey:"close"})}),Lo=i.ikp("p",{_id:"aiChatMessageAttachmentsPreview__Body"}),Ct=t=>{const{selectedItem:e}=q.useMessageAttachments();return o.jsx(Lo,{children:e?.content,...t})},ve=i.ikp("div",{_id:"aiChatMessage"}),ut=t=>{const{aiChatSettings:e}=p.useInkeepConfig(),{componentStyles:a,...n}=t,{message:r}=P.useMessage(),{logEvent:s}=R.useChatEvents(),d=h.getMessageContent(r),{conversation:c}=D.useInkeepConversation();return r.role==="user"?o.jsx(ve,{"data-role":r.role,children:d,...n}):o.jsx(ve,{"data-role":r.role,...n,children:o.jsx(K.Markdown,{children:d,componentStyles:a,shouldOpenLinksInNewTab:e.shouldOpenLinksInNewTab,onLinkClick:(m,l)=>{s({eventName:"assistant_message_inline_link_opened",properties:{title:l?.toString(),url:m}})},onCodeCopy:(m,l)=>{s({eventName:"assistant_code_block_copied",properties:{conversation:c,language:m,code:l}})}})})},Do=i.ikp("div",{_id:"aiChatMessageToolbar"}),pt=t=>{const{isLoading:e,messages:a}=b.useChat(),{message:n}=P.useMessage();return a.at(-1)?.id===n?.id&&e||n.role==="user"?null:o.jsx(Do,{...t})},Oo=i.ikp("div",{_id:"aiChatMessageToolActions"}),bt=t=>{const{children:e,...a}=t,{message:n}=P.useMessage(),{messageButtons:r}=b.useChat(),s=r[n.id]||[];return o.jsx(Oo,{children:h.maybeRender(e,s),...a})},Ro=i.ikp("a",{_id:"aiChatMessageToolAction"}),qo=i.ikp("button",{_id:"aiChatMessageToolAction"}),vt=t=>{const{onClick:e,action:a,...n}=t,{handleAction:r}=re.useChatAction(a),{logEvent:s}=R.useChatEvents(),{conversation:d}=D.useInkeepConversation(),c=()=>{r(),s({eventName:"tool_call_action_clicked",properties:{conversation:d}}),a.action.type!=="open_form"&&s({eventName:"user_escalation_indicated",properties:{escalationType:"contact_us",conversation:d}})},m=a.label||"Contact Support",l=o.jsxs(o.Fragment,{children:[a.icon&&o.jsx(M.BuiltInIconRenderer,{iconSettings:a.icon}),m]});return a.action.type==="open_link"?o.jsx(Ro,{href:a.action.url,target:"_blank",rel:"noopener","data-type":a.action.type,onClick:C.composeEventHandlers(e,c),children:l,...n}):o.jsx(qo,{"data-type":a.action.type,onClick:C.composeEventHandlers(e,c),children:l,...n})},Wo=i.ikp("button",{_id:"aiChatMessageAction"}),gt=t=>{const{action:e,onClick:a,className:n,...r}=t,{conversation:s}=D.useInkeepConversation(),{message:d}=P.useMessage(),{isStreaming:c,messages:m}=b.useChat(),[l,u]=ie.useCopyToClipboard(),{feedback:v,submitPositiveFeedback:k,setCurrentFeedback:H,currentFeedback:V}=ne.useMessageFeedback(),{logEvent:X}=R.useChatEvents(),[Q,Z]=Ra.useSettleAction(),{baseSettings:{privacyPreferences:Ce}}=p.useInkeepConfig(),{optOutAllAnalytics:ee}=Ce,ue=m.at(-1)?.id===d?.id,te=d.role==="assistant";if(ue&&c||!te||{copy:!1,upvote:ee,downvote:ee}[e])return null;const w={copy(){u(h.getMessageContent(d)),X({eventName:"assistant_message_copied",properties:{conversation:s}})},upvote(){k(d.id).then(()=>{Z()})},downvote(){H(d.id)}},O={copy:"Copy Message",upvote:"Upvote Message",downvote:"Downvote Message"},f={copy:o.jsx(A.CustomIcon,{iconKey:l?"messageCopied":"messageCopy"}),upvote:o.jsx(A.CustomIcon,{iconKey:Q?"messageCopied":"thumbsUp"}),downvote:o.jsx(A.CustomIcon,{iconKey:"thumbsDown"})},B={copy:{"data-copied":h.dataAttr(l)},upvote:{"data-upvoted":h.dataAttr(v[d.id]?.type==="positive")},downvote:{"data-downvoted":h.dataAttr(v[d.id]?.type==="negative"),"data-state":V===null?"closed":"open"}};return o.jsx(Wo,{"data-action":e,...B[e],children:f[e],"aria-label":O[e],className:`${n} ${e}`,onClick:C.composeEventHandlers(a,w[e]),...r})},No=i.ikp("div",{_id:"aiChatMessageSources"}),Pt=t=>{const{message:e}=P.useMessage();return e.role!=="assistant"||!e.links?.length?null:o.jsx(No,{...t})},Vo=i.ikp("div",{_id:"aiChatMessageSources__Header"}),Ft=t=>o.jsx(Vo,{children:"Sources",...t}),Qo=i.ikp("div",{_id:"aiChatMessageSources__List"}),_t=t=>{const{message:e}=P.useMessage(),{children:a,...n}=t,{baseSettings:{transformSource:r,organizationDisplayName:s},aiChatSettings:{shouldOpenLinksInNewTab:d},searchSettings:{tabs:c}}=p.useInkeepConfig();if(e.role!=="assistant")return null;const m=e.links.map(l=>{const u=Ka.transformInkeepSource(l,"chatSourceItem",{organizationDisplayName:s,tabs:c,transformSource:r}),v=u.shouldOpenInNewTab!==void 0?u.shouldOpenInNewTab:d;return{...u,isExternal:v}});return o.jsx(Qo,{children:h.maybeRender(a,m),...n})},$o=i.ikp(La.LinkWithQueryParams,{_id:"aiChatMessageSourceItem"}),At=t=>{const{source:e,onClick:a,...n}=t,{logEvent:r}=R.useChatEvents(),{conversation:s}=D.useInkeepConversation(),d=()=>{r({eventName:"assistant_source_item_clicked",properties:{conversation:s,link:e}})};return o.jsx(T.SourceItemProvider,{source:e,children:o.jsx($o,{"data-type":e.type,appendToUrl:e.appendToUrl,isExternal:e.isExternal,"data-breadcrumbs":!!e.breadcrumbs?.length,onClick:C.composeEventHandlers(a,d),...n})})},Uo=i.ikp("div",{_id:"aiChatMessageSourceItem__Breadcrumbs"}),Et=t=>{const{source:e}=T.useSourceItem();return e.breadcrumbs?.length?o.jsx(Uo,{"data-type":e.type,...t}):null},Ko=i.ikp(A.CustomIcon,{_id:"aiChatMessageSourceItem__BreadcrumbIcon",iconKey:"breadcrumbSeparator"}),zo=i.ikp(M.BuiltInIconRenderer,{_id:"aiChatMessageSourceItem__Icon"}),kt=t=>{const{source:e}=T.useSourceItem();return o.jsx(zo,{iconSettings:e.icon,"data-type":e.type,...t})},Go=i.ikp("span",{_id:"aiChatMessageSourceItem__Title"}),It=t=>{const{source:e}=T.useSourceItem();return o.jsx(Go,{"data-type":e.type,children:e.title,...t})},Yo=i.ikp("span",{_id:"aiChatMessageSourceItem__Tag"}),Mt=t=>{const{source:e}=T.useSourceItem();return o.jsx(Yo,{"data-type":e.type,...t})},Jo=i.ikp("span",{_id:"aiChatMessageSourceItem__Description"}),xt=t=>{const{source:e}=T.useSourceItem(),{children:a,...n}=t,r=g.useMemo(()=>e.description?Na.highlightEmphasis(e.description):[],[e.description]);return r.length?o.jsx(Jo,{"data-type":e.type,children:h.maybeRender(a,r),...n}):null},Xo=i.ikp("span",{_id:"aiChatMessageSourceItem__DescriptionPart"}),St=t=>{const{part:e,...a}=t,{source:n}=T.useSourceItem();return typeof e=="string"?e:o.jsx(Xo,{"data-type":n.type,children:e.content,"data-highlighted":h.dataAttr(e.highlighted),...a})},Zo=i.ikp(A.CustomIcon,{_id:"aiChatMessageSourceItem__Indicator"}),ft=t=>{const{source:e}=T.useSourceItem();return o.jsx(Zo,{iconKey:e.isExternal?"openLinkInNewTab":"openLinkInSameTab",...t})},Bt=i.ikp("div",{_id:"aiChatFooter"}),Tt=i.ikp("div",{_id:"aiChatInput__Fieldset"}),jt=i.ikp("div",{_id:"aiChatInput__Group"}),en=i.ikp("textarea",{_id:"aiChatInput"}),yt=g.forwardRef(({onChange:t,onKeyDown:e,...a},n)=>{const{handleInputChange:r,handleInputKeyDown:s,input:d,error:c,shouldAutoFocusInput:m,inputRef:l}=b.useChat(),{aiChatSettings:u}=p.useInkeepConfig(),v=se.useComposedRefs(n,l);return Ga.useWidgetAutoFocus("chat",l,m),o.jsx(en,{asChild:!0,ref:v,maxLength:99999,placeholder:u.placeholder,value:d,onChange:C.composeEventHandlers(t,r),onKeyDown:C.composeEventHandlers(e,s),disabled:!!c||u.isViewOnly,...a,children:o.jsx(oe,{})})}),tn=i.ikp("button",{_id:"aiChatInput__SendButton"}),Ht=t=>{const{handleSubmit:e,isSubmitDisabled:a,error:n}=b.useChat(),{aiChatSettings:r}=p.useInkeepConfig(),{onClick:s,...d}=t;return o.jsx(tn,{onClick:C.composeEventHandlers(s,()=>e()),"aria-label":"Send message",disabled:a||!!n||r.isViewOnly,...d})},wt=i.ikp(A.CustomIcon,{_id:"aiChatInput__SendButtonIcon",iconKey:"chatSubmit"}),an=i.ikp("div",{_id:"aiChatAttachmentsBar"}),Lt=t=>{const{selectedWorkflow:e}=b.useChat();return!e||!e.supportedInputs?.length?null:o.jsx(E.AttachmentsBarProvider,{children:o.jsx(an,{...t})})},on=i.ikp("div",{_id:"aiChatAttachmentsBar__List"}),Dt=t=>{const{children:e,...a}=t,{messageAttachments:n}=b.useChat();return o.jsx(on,{children:h.maybeRender(e,n),...a})},nn=i.ikp("div",{_id:"aiChatAttachmentsBar__Attachment"}),Ot=t=>{const{attachment:e,...a}=t;return o.jsx(L.AttachmentItemProvider,{attachment:e,children:o.jsx(nn,{...a})})},rn=i.ikp(M.BuiltInIconRenderer,{_id:"aiChatAttachmentsBar__AttachmentIcon"}),Rt=t=>{const{attachment:e}=L.useAttachmentItem(),a=e.contentType?.attachmentIcon;return a?o.jsx(rn,{iconSettings:a,...t}):null},sn=i.ikp("span",{_id:"aiChatAttachmentsBar__AttachmentTitle"}),qt=t=>{const{attachment:e}=L.useAttachmentItem();return o.jsx(sn,{children:e.title,...t})},dn=i.ikp("button",{_id:"aiChatAttachmentsBar__AttachmentDelete"}),Wt=t=>{const{onClick:e,...a}=t,{attachment:n}=L.useAttachmentItem(),{setMessageAttachments:r}=b.useChat(),s=()=>{r(d=>d.filter(c=>c.id!==n.id))};return o.jsx(dn,{"aria-label":"Remove attachment",children:o.jsx(A.CustomIcon,{iconKey:"close"}),onClick:C.composeEventHandlers(e,s),...a})},Nt=i.ikp("div",{_id:"aiChatAttachmentsBar__Actions"}),Vt=i.ikp(y.Tooltip,{_id:"aiChatAttachmentsBar__InfoTip",delayDuration:0}),Qt=i.ikp(y.Trigger,{_id:"aiChatAttachmentsBar__InfoTipIcon",children:o.jsx(A.CustomIcon,{iconKey:"info"})}),le=i.ikp(y.Arrow,{_id:"aiChatAttachmentsBar__InfoTipArrow"}),$t=i.ikp(y.Content,{_id:"aiChatAttachmentsBar__InfoTipText",side:"bottom",sideOffset:3,align:"center",children:o.jsxs(o.Fragment,{children:[o.jsx(le,{}),"Attachments will be kept in context for the entire conversation."]})}),cn=i.ikp("div",{_id:"aiChatAttachmentsBar__Inputs"}),Ut=t=>{const{children:e,...a}=t,{selectedWorkflow:n}=b.useChat();return n?.supportedInputs?o.jsx(cn,{children:h.maybeRender(e,n.supportedInputs),...a}):null},mn=i.ikp("button",{_id:"aiChatAttachmentsBar__Input"}),Kt=t=>{const{input:e,onClick:a,...n}=t,{selectedWorkflow:r,messageAttachments:s,setMessageAttachments:d}=b.useChat(),{selectInput:c,onOpen:m}=E.useAttachmentsBar(),l=()=>{if(e.type==="FUNCTIONAL_MULTI_ATTACHMENT")return r?e.onInvoke(r,e,d,[...s]):void 0;c(e),m()};return o.jsx(mn,{children:e.displayName,onClick:C.composeEventHandlers(a,l),...n})},ln=i.ikp(F.Root,{_id:"aiChatAttachmentsBar__Modal"}),zt=t=>{const{onOpenChange:e,...a}=t,{selectInput:n,isOpen:r,onClose:s,selectedInput:d}=E.useAttachmentsBar(),c=m=>{m||(s(),n(null))};return o.jsx(ln,{open:r&&d!==null,onOpenChange:C.composeEventHandlers(e,c),...a})},Gt=i.ikp(F.Overlay,{_id:"aiChatAttachmentsBar__ModalOverlay"}),Yt=i.ikp(F.Content,{_id:"aiChatAttachmentsBar__ModalContent","aria-describedby":void 0}),Jt=i.ikp("div",{_id:"aiChatAttachmentsBar__ModalHeader"}),hn=i.ikp(F.Title,{_id:"aiChatAttachmentsBar__ModalHeading"}),Xt=t=>{const{selectedInput:e}=E.useAttachmentsBar(),a=`Add ${e?.displayName}`;return o.jsx(hn,{children:a,...t})},Cn=i.ikp("span",{_id:"aiChatAttachmentsBar__ModalDescription"}),Zt=t=>{const{selectedInput:e}=E.useAttachmentsBar(),a=e?.workflowModalProps?.modalHelpText;return a?o.jsx(Cn,{children:a,...t}):null},un=i.ikp("div",{_id:"aiChatAttachmentsBar__ModalHelp"}),ei=t=>{const{children:e,...a}=t,{selectedInput:n}=E.useAttachmentsBar(),r=n?.workflowModalProps?.modalHelpElement;return r?o.jsx(un,{asChild:!e,children:e||r,...a}):null},ti=i.ikp(F.Close,{_id:"aiChatAttachmentsBar__ModalClose",children:o.jsx(A.CustomIcon,{iconKey:"close"})}),ii=i.ikp("div",{_id:"aiChatAttachmentsBar__ModalBody"}),pn=i.ikp("form",{_id:"aiChatAttachmentsBar__Form"}),ai=t=>{const{onSubmit:e,...a}=t,{form:n}=E.useAttachmentsBar();return o.jsx(pn,{onSubmit:C.composeEventHandlers(e,n.onSubmit),...a})},oi=i.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),bn=i.ikp("label",{_id:"aiChatAttachmentsBar__FormTitleLabel"}),ni=t=>{const{form:e,selectedInput:a}=E.useAttachmentsBar();return o.jsx(bn,{htmlFor:`${a?.id}-title`,children:e.labels.title,...t})},vn=i.ikp("input",{_id:"aiChatAttachmentsBar__FormTitleInput"}),ri=t=>{const{onChange:e,...a}=t,{form:n,selectedInput:r}=E.useAttachmentsBar();return o.jsx(vn,{name:"title",value:n.data.title,id:`${r?.id}-title`,"data-invalid":h.dataAttr(!!n.errors.title),"aria-invalid":!!n.errors.title,onChange:C.composeEventHandlers(e,n.onChange),...a})},gn=i.ikp("span",{_id:"aiChatAttachmentsBar__FormTitleError"}),si=t=>{const{form:e}=E.useAttachmentsBar();return e.errors.title?o.jsx(gn,{"aria-live":"polite",children:e.errors.title,...t}):null},di=i.ikp("div",{_id:"aiChatAttachmentsBar__FormTitle",role:"group"}),Pn=i.ikp("label",{_id:"aiChatAttachmentsBar__FormContentLabel"}),ci=t=>{const{form:e,selectedInput:a}=E.useAttachmentsBar();return o.jsx(Pn,{htmlFor:`${a?.id}-content`,children:e.labels.content,...t})},Fn=i.ikp("textarea",{_id:"aiChatAttachmentsBar__FormTitleInput"}),mi=t=>{const{onChange:e,...a}=t,{form:n,selectedInput:r}=E.useAttachmentsBar();return o.jsx(Fn,{asChild:!0,rows:4,name:"content",value:n.data.content,id:`${r?.id}-content`,"data-invalid":h.dataAttr(!!n.errors.content),"aria-invalid":!!n.errors.content,onChange:C.composeEventHandlers(e,n.onChange),...a,children:o.jsx(oe,{maxRows:10})})},_n=i.ikp("span",{_id:"aiChatAttachmentsBar__FormContentError"}),li=t=>{const{form:e}=E.useAttachmentsBar();return e.errors.content?o.jsx(_n,{"aria-live":"polite",children:e.errors.content,...t}):null},hi=i.ikp("button",{_id:"aiChatAttachmentsBar__FormSubmitButton",children:"Upload",type:"submit"}),Ci=i.ikp("div",{_id:"aiChatActionBar"}),ui=i.ikp("div",{_id:"aiChat__ChatActions"}),pi=i.ikp("div",{_id:"aiChatTagline__Container"}),bi=i.ikp("span",{_id:"aiChatTagline__Text",children:"Powered by"}),vi=i.ikp("a",{_id:"aiChatTagline__Logo",href:"https://www.inkeep.com/",target:"_blank",rel:"noopener noreferrer","aria-label":"Inkeep"}),gi=i.ikp(Oa.default,{_id:"aiChatTagline__LogoIcon"}),An=i.ikp(y.Trigger,{_id:"aiChat__ChatAction"}),Y=t=>{const{action:e,onClick:a,className:n,...r}=t,{clear:s,stop:d,isLoading:c,messages:m,selectedWorkflow:l}=b.useChat(),{conversation:u}=D.useInkeepConversation(),{aiChatSettings:v,baseSettings:k}=p.useInkeepConfig(),{logEvent:H}=R.useChatEvents(),[V,X]=ie.useCopyToClipboard(),[Q,Z]=ie.useCopyToClipboard();if({help:!1,copy:m.length===0||!v.isCopyChatButtonVisible||c,share:m.length===0||!v.isShareButtonVisible||!u.id||!!l||c,clear:m.length===0||v.isViewOnly||c,stop:!c}[e])return null;const te={help:()=>{},copy:()=>{const $=m.map(w=>{const O=`**${w.role==="assistant"?"AI Assistant":"User"}**`,f=h.getMessageContent(w),B=Da.stringifyAttachments(w.metadata?.attributes?.attachments),U=B?`
|
|
8
8
|
|
|
9
9
|
**Attachments**
|
|
10
10
|
|
|
@@ -14,4 +14,4 @@ ${f}${U}`}).join(`
|
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
`);X($)},share:async()=>{const $={visibility:"public",tags:[],userProperties:{},messages:u.messages.map(B=>({...B,createdAt:void 0,updatedAt:void 0,id:Date.now().toString()+B.id,conversationId:void 0}))},{apiKey:w,analyticsApiBaseUrl:O}=k,f=await Ua.logConversation("",$,w,O);if(f){const U=`${v.shareChatUrlBasePath}?${D.SHARE_QUERY_PARAM}=${f?.id}`;Z(U),H({eventName:"chat_share_button_clicked",properties:{sharedConversationId:f?.id,originalConversationId:u.id,sharedChatUrl:U,conversation:f}})}},clear:s,stop:d},pe={copy:V,share:Q};return n.jsx(y.Tooltip,{delayDuration:0,open:pe[e],children:n.jsx(Ao,{"data-type":e,"data-copied":h.dataAttr(V||Q),className:`${o} ${e}`,children:n.jsx(he,{action:e}),onClick:C.composeEventHandlers(a,te[e]),...r})})},Eo=i.ikp("span",{_id:"aiChat__ChatActionLabel"}),he=t=>{const{action:e,...a}=t,{aiChatSettings:o}=p.useInkeepConfig(),r=o.toolbarButtonLabels??{},s={help:r.getHelp??"Get Help",copy:r.copyChat??"Copy",share:r.share??"Share",clear:r.clear??"Clear",stop:r.stop??"Stop"};return n.jsx(Eo,{children:s[e],...a})},ko=i.ikp(y.TooltipContent,{_id:"aiChat__ChatActionFeeback"}),Pi=t=>{const{action:e,children:a,...o}=t,r={copy:"Copied!",share:"Link copied!"};return n.jsxs(ko,{sideOffset:5,...o,children:[n.jsx(y.Arrow,{}),a||r[e]]})},Io=i.ikp(j.Root,{_id:"aiChatHelpActions"}),Fi=t=>{const{children:e,...a}=t,{aiChatSettings:o}=p.useInkeepConfig(),{getHelpOptions:r}=o;if(!r||(r??[]).length===0)return null;const{_pinned:s,_unpinned:d}=r.reduce((u,v)=>{const k=v.isPinnedToToolbar?"_pinned":"_unpinned";return{...u,[k]:[...u[k],v]}},{_pinned:[],_unpinned:[]}),m=d.length===1?[...s,d[0]]:s,c=d.length===1?[]:d,l=ae.useHelpMenuState();return n.jsx(ae.HelpMenuProvider,{value:l,children:n.jsx(Io,{open:l.open,onOpenChange:l.setOpen,children:h.maybeRender(e,{pinned:m,unpinned:c}),...a})})},Mo=i.ikp(Y,{_id:"aiChatHelpAction",action:"help"}),xo=i.ikp("a",{_id:"aiChatHelpAction",target:"_blank",rel:"noreferrer"}),_i=t=>{const{action:e,onClick:a,...o}=t,{handleAction:r,logHelpAction:s}=re.useChatAction(e),d=e.action.type,m={"aria-label":e.name,"data-name":e.name,children:e.name,onClick:C.composeEventHandlers(a,()=>{r(),s()}),...o};return d==="open_link"?n.jsx(xo,{href:e.action.url,...m}):n.jsx(Mo,{...m})},So=i.ikp(j.Trigger,{_id:"aiChatHelpActions__Trigger"}),Ai=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig();return n.jsx(Y,{action:"help",...t,asChild:!0,children:n.jsx(So,{children:e.toolbarButtonLabels?.getHelp??"Get Help"})})}),fo=i.ikp(j.Content,{_id:"aiChatHelpActions__Menu"}),Ei=t=>n.jsx(fo,{side:"top",sideOffset:8,align:"center",alignOffset:-10,...t}),ki=i.ikp(j.Arrow,{_id:"aiChatHelpActions__MenuArrow"}),Ii=t=>{const{action:e,onClick:a,...o}=t,{handleAction:r,logHelpAction:s}=re.useChatAction(e),{setOpen:d}=ae.useHelpMenu(),m=()=>{r({onOpenForm:()=>d(!1)}),s()},c=e.action.type,l=i.ikp(c==="open_link"?"a":"button",{_id:"aiChatHelpActions__MenuItem",children:e.name,"aria-label":e.name,"data-name":e.name,"data-type":e.action.type,...c==="open_link"&&{href:e.action.url,target:"_blank",rel:"noopener"},onClick:C.composeEventHandlers(a,m)});return n.jsx(l,{...o})},Bo=i.ikp(M.BuiltInIconRenderer,{_id:"aiChatHelpActions_MenuItemIcon"}),Mi=t=>{const{action:e,...a}=t;return e.icon?n.jsx(Bo,{iconSettings:e.icon,...a}):null},To=i.ikp(F.Root,{_id:"aiChatFeedbackModal"}),xi=t=>{const{onOpenChange:e,...a}=t,{currentFeedback:o,setCurrentFeedback:r}=oe.useMessageFeedback();return n.jsx(To,{open:o!==null,onOpenChange:C.composeEventHandlers(e,()=>r(null)),...a})},Si=i.ikp(F.Overlay,{_id:"aiChatFeedbackModal__Overlay"}),fi=i.ikp(F.Content,{_id:"aiChatFeedbackModal__Content","aria-describedby":void 0}),Bi=i.ikp(F.Title,{_id:"aiChatFeedbackModal__Header",children:"Help improve my answers!"}),Ti=i.ikp(F.Close,{_id:"aiChatFeedbackModal__Close",children:n.jsx(A.CustomIcon,{iconKey:"close"})}),ji=i.ikp("div",{_id:"aiChatFeedbackModal__Body"}),jo=i.ikp("form",{_id:"aiChatFeedbackForm"}),yi=t=>{const{onSubmit:e,...a}=t,{submitNegativeFeedback:o,currentFeedback:r,setCurrentFeedback:s}=oe.useMessageFeedback(),d=m=>{m.preventDefault();const c=m.target,l=new FormData(c),u=Object.fromEntries(l.entries());r&&(o(r,u),s(null))};return n.jsx(jo,{onSubmit:C.composeEventHandlers(e,d),...a})},yo=i.ikp("div",{_id:"aiChatFeedbackItem"}),Hi=t=>{const{name:e,...a}=t;return n.jsx(z.FeedbackItemProvider,{name:e,children:n.jsx(yo,{...a})})},Ho=i.ikp(G.Root,{_id:"aiChatFeedbackItem__Checkbox"}),wi=t=>{const{name:e,focusItem:a}=z.useFeedbackItem(),{onCheckedChange:o,...r}=t,s=d=>{d&&a?.current?.focus()};return n.jsx(Ho,{id:`feedback-${e}`,name:e,onCheckedChange:C.composeEventHandlers(o,s),...r})},Li=i.ikp(G.Indicator,{_id:"aiChatFeedbackItem__CheckboxIndicator",children:n.jsx(ge.CheckboxIcon,{})}),wo=i.ikp("label",{_id:"aiChatFeedbackItem__Label"}),Di=t=>{const{name:e}=z.useFeedbackItem(),a={unrelated_response:"Didn't answer my question",inaccurate_statement:"Inaccurate statement",inaccurate_code_snippet:"Inaccurate code snippet",irrelevant_citations:"Irrelevant citations"};return n.jsx(wo,{htmlFor:`feedback-${e}`,children:a[e],...t})},Lo=i.ikp("textarea",{_id:"aiChatFeedbackItem__Description",placeholder:"Please describe"}),Oi=t=>{const{name:e,focusItem:a}=z.useFeedbackItem();return n.jsx(Lo,{ref:a,name:`${e}:description`,...t})},Ri=i.ikp("button",{_id:"aiChatFeedbackForm__SubmitButton",children:"Submit",type:"submit"}),Do=i.ikp("div",{_id:"aiChatForm__Wrapper"}),qi=t=>{const{form:e}=_.useChatForm();return e?n.jsx(Do,{...t}):null},Oo=i.ikp("form",{_id:"aiChatForm"}),Wi=t=>{const{onSubmit:e,...a}=t,{handleSubmit:o,isSuccess:r}=_.useChatForm();return r?null:n.jsx(Oo,{onSubmit:C.composeEventHandlers(e,o),...a})},Ro=i.ikp("button",{_id:"aiChatForm__Close",children:n.jsx(A.CustomIcon,{iconKey:"close"})}),Ni=t=>{const{onClick:e,...a}=t,{closeForm:o}=_.useChatForm();return n.jsx(Ro,{onClick:C.composeEventHandlers(e,o),...a})},Vi=i.ikp("div",{_id:"aiChatForm__Header"}),qo=i.ikp("h2",{_id:"aiChatForm__Heading"}),Qi=t=>{const{form:e}=_.useChatForm();return e?.heading?n.jsx(qo,{children:e.heading,...t}):null},Wo=i.ikp(K.Markdown,{_id:"aiChatForm__Description"}),$i=t=>{const{form:e}=_.useChatForm();return e?.description?n.jsx(Wo,{shouldOpenLinksInNewTab:!0,children:e.description,...t}):null},No=i.ikp("div",{_id:"aiChatForm__Content"}),Ui=t=>{const{children:e,...a}=t,{fields:o=[]}=_.useChatForm();return n.jsx(No,{children:h.maybeRender(e,o),...a})},Vo=i.ikp("div",{_id:"aiChatForm__Field"}),Ki=t=>{const{field:e,autoFocus:a,...o}=t,{control:r,errors:s}=_.useChatForm();return n.jsx(Wa.Controller,{name:e.name,control:r,rules:{required:e.isRequired?`${e.label} is required.`:void 0},render:({field:d})=>{const m=d.value!==void 0||e.inputType==="file";return n.jsx(x.FormFieldProvider,{"data-invalid":h.dataAttr(!!s[e.name]),field:e,fieldProps:d,autoFocus:a,children:m&&n.jsx(Vo,{"data-input-type":e.inputType,"data-hidden":h.dataAttr(e.isHidden),...o})})}})},Qo=i.ikp("label",{_id:"aiChatForm__FieldLabel"}),zi=t=>{const{field:e}=x.useFormField();return n.jsx(Qo,{"data-required":h.dataAttr(e.isRequired),htmlFor:e.name,children:e.label,...t})},$o=i.ikp("input",{_id:"aiChatForm__FieldText",type:"text"}),J=t=>{const{field:e,error:a,fieldProps:{onChange:o,onBlur:r,...s},autoFocus:d}=x.useFormField(),{onChange:m,onBlur:c,...l}=t;return n.jsx($o,{id:e.name,autoFocus:d,placeholder:"placeholder"in e?e.placeholder:void 0,"data-invalid":h.dataAttr(!!a),onChange:C.composeEventHandlers(m,o),onBlur:C.composeEventHandlers(c,r),...s,...l})},Gi=i.ikp(J,{_id:"aiChatForm__FieldEmail",type:"email"}),Uo=i.ikp("input",{_id:"aiChatForm__FieldFile",type:"file",multiple:!0}),Yi=t=>{const{field:e,error:a,fieldProps:{value:o,onChange:r,onBlur:s,...d},autoFocus:m}=x.useFormField(),{onChange:c,onBlur:l,...u}=t,v=k=>{const H=k.target.files;r(H)};return n.jsx(Uo,{id:e.name,autoFocus:m,"data-value":o,"data-invalid":h.dataAttr(!!a),...u,...d,onChange:C.composeEventHandlers(c,v),onBlur:C.composeEventHandlers(l,s)})},Ji=i.ikp(J,{_id:"aiChatForm__FieldTextArea",type:"textarea",asChild:!0,children:n.jsx(ne,{maxRows:8})}),Ko=i.ikp(G.Root,{_id:"aiChatForm__FieldCheckbox"}),Xi=t=>{const{field:e,error:a,fieldProps:o,autoFocus:r}=x.useFormField(),{onCheckedChange:s,...d}=t;return n.jsx(Ko,{id:e.name,name:e.name,autoFocus:r,"data-invalid":h.dataAttr(!!a),checked:o.value,onCheckedChange:C.composeEventHandlers(s,o.onChange),...d})},Zi=i.ikp(G.Indicator,{_id:"aiChatForm__FieldCheckboxIndicator",children:n.jsx(ge.CheckboxIcon,{})}),zo=i.ikp(S.Root,{_id:"aiChatForm__FieldSelect"}),ea=t=>{const{field:e,error:a,fieldProps:o}=x.useFormField(),{onValueChange:r,...s}=t;return n.jsx(zo,{name:e.name,"data-invalid":h.dataAttr(!!a),value:o.value,onValueChange:C.composeEventHandlers(r,o.onChange),...s})},ta=i.ikp(S.Trigger,{_id:"aiChatForm__FieldSelect__Trigger"}),Go=i.ikp(S.Value,{_id:"aiChatForm__FieldSelect__Value"}),ia=t=>{const{field:e}=x.useFormField();return n.jsx(Go,{placeholder:"placeholder"in e?e.placeholder:void 0,...t})},aa=i.ikp(S.Icon,{_id:"aiChatForm__FieldSelect__Icon",asChild:!0,children:n.jsx(M.BuiltInIconRenderer,{iconSettings:{builtIn:"LuChevronDown"}})}),na=i.ikp(S.Content,{_id:"aiChatForm__FieldSelect__Content",position:"popper"}),oa=i.ikp(S.Viewport,{_id:"aiChatForm__FieldSelect__Viewport"}),ra=i.ikp(S.Item,{_id:"aiChatForm__FieldSelect__Item"}),sa=i.ikp(S.ItemText,{_id:"aiChatForm__FieldSelect__ItemText"}),da=i.ikp(S.ItemIndicator,{_id:"aiChatForm__FieldSelect__ItemIndicator",asChild:!0,children:n.jsx(M.BuiltInIconRenderer,{iconSettings:{builtIn:"LuCheck"}})}),ma=t=>{const{field:e,error:a,fieldProps:o,autoFocus:r}=x.useFormField(),s=Ya.useShadow();if(e.inputType!=="combobox")return null;const{onValueChange:d,children:m,...c}=t,l=s?.shadowHost?()=>s.shadowHost.shadowRoot??document:void 0;return n.jsx(I.ComboboxRoot,{...c,id:e.name,name:e.name,items:e.items??[],defaultValue:e.defaultValue,onValueChange:C.composeEventHandlers(d,o.onChange),multiple:e.multiple,placeholder:"placeholder"in e?e.placeholder:void 0,invalid:!!a,autoFocus:r,getRootNode:l,children:m})},ca=i.ikp(I.ComboboxControl,{_id:"aiChatForm__FieldCombobox__Control"}),la=i.ikp(I.ComboboxInput,{_id:"aiChatForm__FieldCombobox__Input"}),ha=i.ikp(I.ComboboxTrigger,{_id:"aiChatForm__FieldCombobox__Trigger",children:n.jsx(M.BuiltInIconRenderer,{iconSettings:{builtIn:"LuChevronDown"}})}),Ca=i.ikp(I.ComboboxPositioner,{_id:"aiChatForm__FieldCombobox__Positioner"}),ua=i.ikp(I.ComboboxContent,{_id:"aiChatForm__FieldCombobox__Content"}),pa=i.ikp(I.ComboboxItem,{_id:"aiChatForm__FieldCombobox__Item"}),ba=i.ikp(I.ComboboxItemText,{_id:"aiChatForm__FieldCombobox__ItemText"}),va=i.ikp(I.ComboboxSelectedTags,{_id:"aiChatForm__FieldCombobox__SelectedTags"}),ga=i.ikp(I.ComboboxItemIndicator,{_id:"aiChatForm__FieldCombobox__ItemIndicator",children:n.jsx(M.BuiltInIconRenderer,{iconSettings:{builtIn:"LuCheck"}})}),Yo=i.ikp("p",{_id:"aiChatForm__FieldDescription"}),Pa=t=>{const{field:e}=x.useFormField();return e.description?n.jsx(Yo,{children:e.description,...t}):null},Jo=i.ikp("span",{_id:"aiChatForm__FieldError"}),Fa=t=>{const{error:e}=x.useFormField();return e?n.jsx(Jo,{children:e.message?.toString(),...t}):null},Xo=i.ikp("span",{_id:"aiChatForm__Error"}),_a=t=>{const{formError:e}=_.useChatForm();return e?n.jsx(Xo,{children:e.message,...t}):null},Aa=i.ikp("div",{_id:"aiChatForm__Footer"}),Zo=i.ikp("button",{_id:"aiChatForm__Cancel",children:"Cancel",type:"button"}),Ea=t=>{const{onClick:e,...a}=t,{closeForm:o}=_.useChatForm();return n.jsx(Zo,{onClick:C.composeEventHandlers(e,o),...a})},er=i.ikp("button",{_id:"aiChatForm__Submit",children:"Submit",type:"submit"}),ka=t=>{const{onClick:e,...a}=t,{isSubmitting:o,form:r}=_.useChatForm(),s=r?.buttons.submit.label||"Submit";return n.jsx(er,{disabled:o,...a,children:s})},tr=i.ikp("div",{_id:"aiChatForm__Success"}),Ia=t=>{const{isSuccess:e}=_.useChatForm();return e?n.jsx(tr,{...t}):null},ir=i.ikp("h2",{_id:"aiChatForm__SuccessHeading"}),Ma=t=>{const{form:e}=_.useChatForm();return n.jsx(ir,{children:e?.successView?.heading,...t})},ar=i.ikp(K.Markdown,{_id:"aiChatForm__SuccessMessage"}),xa=t=>{const{form:e}=_.useChatForm();return n.jsx(ar,{shouldOpenLinksInNewTab:!0,children:e?.successView?.message,...t})},nr=i.ikp("button",{_id:"aiChatForm__SuccessButton"}),Sa=t=>{const{onClick:e,...a}=t,{form:o,closeForm:r}=_.useChatForm(),s=o?.successView?.doneButton;if(!s)return null;const d=s.icon&&n.jsx(M.BuiltInIconRenderer,{iconSettings:s.icon}),m=s.label;return n.jsx(nr,{onClick:C.composeEventHandlers(e,r),children:n.jsxs(n.Fragment,{children:[d,m]}),...a})};exports.Provider=b.ChatProvider;exports.ActionBar=Ci;exports.Actions=ui;exports.AttachmentsBar=Lt;exports.AttachmentsBarActions=Nt;exports.AttachmentsBarAttachment=Ot;exports.AttachmentsBarAttachmentDelete=Wt;exports.AttachmentsBarAttachmentIcon=Rt;exports.AttachmentsBarAttachmentTitle=qt;exports.AttachmentsBarForm=ai;exports.AttachmentsBarFormContent=di;exports.AttachmentsBarFormContentError=li;exports.AttachmentsBarFormContentInput=ci;exports.AttachmentsBarFormContentLabel=mi;exports.AttachmentsBarFormSubmitButton=hi;exports.AttachmentsBarFormTitle=ni;exports.AttachmentsBarFormTitleError=si;exports.AttachmentsBarFormTitleInput=ri;exports.AttachmentsBarFormTitleLabel=oi;exports.AttachmentsBarInfoTip=Vt;exports.AttachmentsBarInfoTipArrow=le;exports.AttachmentsBarInfoTipIcon=Qt;exports.AttachmentsBarInfoTipText=$t;exports.AttachmentsBarInput=Kt;exports.AttachmentsBarInputs=Ut;exports.AttachmentsBarList=Dt;exports.AttachmentsBarModal=zt;exports.AttachmentsBarModalBody=ii;exports.AttachmentsBarModalClose=ti;exports.AttachmentsBarModalContent=Yt;exports.AttachmentsBarModalDescription=Zt;exports.AttachmentsBarModalHeader=Jt;exports.AttachmentsBarModalHeading=Xt;exports.AttachmentsBarModalHelp=ei;exports.AttachmentsBarModalOverlay=Gt;exports.ChatAction=Y;exports.ChatActionFeedback=Pi;exports.ChatActionLabel=he;exports.ChatHelpAction=_i;exports.Content=Ie;exports.ContentScrollArea=Me;exports.ContentScrollAreaCorner=Be;exports.ContentScrollAreaScrollbar=Se;exports.ContentScrollAreaThumb=fe;exports.ContentScrollAreaViewport=xe;exports.ConversationLoading=Fe;exports.Disclaimer=je;exports.DisclaimerArrow=De;exports.DisclaimerContent=we;exports.DisclaimerLabel=ye;exports.DisclaimerText=Le;exports.DisclaimerTrigger=He;exports.EmbeddedChatPrimitiveActionBar=Ci;exports.EmbeddedChatPrimitiveActions=ui;exports.EmbeddedChatPrimitiveAttachmentsBar=Lt;exports.EmbeddedChatPrimitiveAttachmentsBarActions=Nt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachment=Ot;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentDelete=Wt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentIcon=Rt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentTitle=qt;exports.EmbeddedChatPrimitiveAttachmentsBarForm=ai;exports.EmbeddedChatPrimitiveAttachmentsBarFormContent=di;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentError=li;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentInput=ci;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentLabel=mi;exports.EmbeddedChatPrimitiveAttachmentsBarFormSubmitButton=hi;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitle=ni;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleError=si;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleInput=ri;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleLabel=oi;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTip=Vt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipArrow=le;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipIcon=Qt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipText=$t;exports.EmbeddedChatPrimitiveAttachmentsBarInput=Kt;exports.EmbeddedChatPrimitiveAttachmentsBarInputs=Ut;exports.EmbeddedChatPrimitiveAttachmentsBarList=Dt;exports.EmbeddedChatPrimitiveAttachmentsBarModal=zt;exports.EmbeddedChatPrimitiveAttachmentsBarModalBody=ii;exports.EmbeddedChatPrimitiveAttachmentsBarModalClose=ti;exports.EmbeddedChatPrimitiveAttachmentsBarModalContent=Yt;exports.EmbeddedChatPrimitiveAttachmentsBarModalDescription=Zt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeader=Jt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeading=Xt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHelp=ei;exports.EmbeddedChatPrimitiveAttachmentsBarModalOverlay=Gt;exports.EmbeddedChatPrimitiveChatAction=Y;exports.EmbeddedChatPrimitiveChatActionFeedback=Pi;exports.EmbeddedChatPrimitiveChatActionLabel=he;exports.EmbeddedChatPrimitiveChatHelpAction=_i;exports.EmbeddedChatPrimitiveContent=Ie;exports.EmbeddedChatPrimitiveContentScrollArea=Me;exports.EmbeddedChatPrimitiveContentScrollAreaCorner=Be;exports.EmbeddedChatPrimitiveContentScrollAreaScrollbar=Se;exports.EmbeddedChatPrimitiveContentScrollAreaThumb=fe;exports.EmbeddedChatPrimitiveContentScrollAreaViewport=xe;exports.EmbeddedChatPrimitiveConversationLoading=Fe;exports.EmbeddedChatPrimitiveDisclaimer=je;exports.EmbeddedChatPrimitiveDisclaimerArrow=De;exports.EmbeddedChatPrimitiveDisclaimerContent=we;exports.EmbeddedChatPrimitiveDisclaimerLabel=ye;exports.EmbeddedChatPrimitiveDisclaimerText=Le;exports.EmbeddedChatPrimitiveDisclaimerTrigger=He;exports.EmbeddedChatPrimitiveExampleQuestion=We;exports.EmbeddedChatPrimitiveExampleQuestionButton=Ne;exports.EmbeddedChatPrimitiveExampleQuestions=Oe;exports.EmbeddedChatPrimitiveExampleQuestionsLabel=Re;exports.EmbeddedChatPrimitiveExampleQuestionsList=qe;exports.EmbeddedChatPrimitiveFeedbackForm=yi;exports.EmbeddedChatPrimitiveFeedbackItem=Hi;exports.EmbeddedChatPrimitiveFeedbackItemCheckbox=wi;exports.EmbeddedChatPrimitiveFeedbackItemCheckboxIndicator=Li;exports.EmbeddedChatPrimitiveFeedbackItemDescription=Oi;exports.EmbeddedChatPrimitiveFeedbackItemLabel=Di;exports.EmbeddedChatPrimitiveFeedbackModal=xi;exports.EmbeddedChatPrimitiveFeedbackModalBody=ji;exports.EmbeddedChatPrimitiveFeedbackModalClose=Ti;exports.EmbeddedChatPrimitiveFeedbackModalContent=fi;exports.EmbeddedChatPrimitiveFeedbackModalHeader=Bi;exports.EmbeddedChatPrimitiveFeedbackModalOverlay=Si;exports.EmbeddedChatPrimitiveFeedbackSubmitButton=Ri;exports.EmbeddedChatPrimitiveFooter=Bt;exports.EmbeddedChatPrimitiveForm=Wi;exports.EmbeddedChatPrimitiveFormCancel=Ea;exports.EmbeddedChatPrimitiveFormClose=Ni;exports.EmbeddedChatPrimitiveFormContent=Ui;exports.EmbeddedChatPrimitiveFormDescription=$i;exports.EmbeddedChatPrimitiveFormError=_a;exports.EmbeddedChatPrimitiveFormField=Ki;exports.EmbeddedChatPrimitiveFormFieldCheckbox=Xi;exports.EmbeddedChatPrimitiveFormFieldCheckboxIndicator=Zi;exports.EmbeddedChatPrimitiveFormFieldCombobox=ma;exports.EmbeddedChatPrimitiveFormFieldComboboxContent=ua;exports.EmbeddedChatPrimitiveFormFieldComboboxControl=ca;exports.EmbeddedChatPrimitiveFormFieldComboboxInput=la;exports.EmbeddedChatPrimitiveFormFieldComboboxItem=pa;exports.EmbeddedChatPrimitiveFormFieldComboboxItemIndicator=ga;exports.EmbeddedChatPrimitiveFormFieldComboboxItemText=ba;exports.EmbeddedChatPrimitiveFormFieldComboboxPositioner=Ca;exports.EmbeddedChatPrimitiveFormFieldComboboxSelectedTags=va;exports.EmbeddedChatPrimitiveFormFieldComboboxTrigger=ha;exports.EmbeddedChatPrimitiveFormFieldDescription=Pa;exports.EmbeddedChatPrimitiveFormFieldEmail=Gi;exports.EmbeddedChatPrimitiveFormFieldError=Fa;exports.EmbeddedChatPrimitiveFormFieldFile=Yi;exports.EmbeddedChatPrimitiveFormFieldLabel=zi;exports.EmbeddedChatPrimitiveFormFieldSelect=ea;exports.EmbeddedChatPrimitiveFormFieldSelectContent=na;exports.EmbeddedChatPrimitiveFormFieldSelectIcon=aa;exports.EmbeddedChatPrimitiveFormFieldSelectItem=ra;exports.EmbeddedChatPrimitiveFormFieldSelectItemIndicator=da;exports.EmbeddedChatPrimitiveFormFieldSelectItemText=sa;exports.EmbeddedChatPrimitiveFormFieldSelectTrigger=ta;exports.EmbeddedChatPrimitiveFormFieldSelectValue=ia;exports.EmbeddedChatPrimitiveFormFieldSelectViewport=oa;exports.EmbeddedChatPrimitiveFormFieldText=J;exports.EmbeddedChatPrimitiveFormFieldTextArea=Ji;exports.EmbeddedChatPrimitiveFormFooter=Aa;exports.EmbeddedChatPrimitiveFormHeader=Vi;exports.EmbeddedChatPrimitiveFormHeading=Qi;exports.EmbeddedChatPrimitiveFormSubmit=ka;exports.EmbeddedChatPrimitiveFormSuccess=Ia;exports.EmbeddedChatPrimitiveFormSuccessButton=Sa;exports.EmbeddedChatPrimitiveFormSuccessHeading=Ma;exports.EmbeddedChatPrimitiveFormSuccessMessage=xa;exports.EmbeddedChatPrimitiveFormWrapper=qi;exports.EmbeddedChatPrimitiveHeaderToolbar=Ae;exports.EmbeddedChatPrimitiveHelpActions=Fi;exports.EmbeddedChatPrimitiveHelpActionsMenu=Ei;exports.EmbeddedChatPrimitiveHelpActionsMenuArrow=ki;exports.EmbeddedChatPrimitiveHelpActionsMenuItem=Ii;exports.EmbeddedChatPrimitiveHelpActionsMenuItemIcon=Mi;exports.EmbeddedChatPrimitiveHelpActionsTrigger=Ai;exports.EmbeddedChatPrimitiveInput=yt;exports.EmbeddedChatPrimitiveInputFieldset=Tt;exports.EmbeddedChatPrimitiveInputGroup=jt;exports.EmbeddedChatPrimitiveIntroMessageWrapper=Ke;exports.EmbeddedChatPrimitiveMessage=ut;exports.EmbeddedChatPrimitiveMessageAction=gt;exports.EmbeddedChatPrimitiveMessageAttachments=at;exports.EmbeddedChatPrimitiveMessageAttachmentsItem=ot;exports.EmbeddedChatPrimitiveMessageAttachmentsItemIcon=rt;exports.EmbeddedChatPrimitiveMessageAttachmentsItemTitle=st;exports.EmbeddedChatPrimitiveMessageAttachmentsList=nt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreview=dt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewBody=Ct;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewClose=ht;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewContent=ct;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewHeader=lt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewOverlay=mt;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=At;exports.EmbeddedChatPrimitiveMessageSourceItemBreadcrumbs=Et;exports.EmbeddedChatPrimitiveMessageSourceItemDescription=xt;exports.EmbeddedChatPrimitiveMessageSourceItemDescriptionPart=St;exports.EmbeddedChatPrimitiveMessageSourceItemIcon=kt;exports.EmbeddedChatPrimitiveMessageSourceItemIndicator=ft;exports.EmbeddedChatPrimitiveMessageSourceItemTag=Mt;exports.EmbeddedChatPrimitiveMessageSourceItemTitle=It;exports.EmbeddedChatPrimitiveMessageSources=Pt;exports.EmbeddedChatPrimitiveMessageSourcesHeader=Ft;exports.EmbeddedChatPrimitiveMessageSourcesList=_t;exports.EmbeddedChatPrimitiveMessageToolAction=vt;exports.EmbeddedChatPrimitiveMessageToolActions=bt;exports.EmbeddedChatPrimitiveMessageToolbar=pt;exports.EmbeddedChatPrimitiveMessageWrapper=ce;exports.EmbeddedChatPrimitiveMessages=Te;exports.EmbeddedChatPrimitiveRoot=_e;exports.EmbeddedChatPrimitiveSendButton=Ht;exports.EmbeddedChatPrimitiveSendButtonIcon=wt;exports.EmbeddedChatPrimitiveTaglineBrandName=gi;exports.EmbeddedChatPrimitiveTaglineContainer=pi;exports.EmbeddedChatPrimitiveTaglineLogo=vi;exports.EmbeddedChatPrimitiveTaglineText=bi;exports.EmbeddedChatPrimitiveToolbarHeader=ke;exports.EmbeddedChatPrimitiveToolbarHeaderWrapper=Ee;exports.EmbeddedChatPrimitiveWorkflow=Ue;exports.EmbeddedChatPrimitiveWorkflows=Ve;exports.EmbeddedChatPrimitiveWorkflowsLabel=Qe;exports.EmbeddedChatPrimitiveWorkflowsList=$e;exports.EmbeddedChatPrimitiveWrapper=Pe;exports.ExampleQuestion=We;exports.ExampleQuestionButton=Ne;exports.ExampleQuestions=Oe;exports.ExampleQuestionsLabel=Re;exports.ExampleQuestionsList=qe;exports.FeedbackForm=yi;exports.FeedbackItem=Hi;exports.FeedbackItemCheckbox=wi;exports.FeedbackItemCheckboxIndicator=Li;exports.FeedbackItemDescription=Oi;exports.FeedbackItemLabel=Di;exports.FeedbackModal=xi;exports.FeedbackModalBody=ji;exports.FeedbackModalClose=Ti;exports.FeedbackModalContent=fi;exports.FeedbackModalHeader=Bi;exports.FeedbackModalOverlay=Si;exports.FeedbackSubmitButton=Ri;exports.Footer=Bt;exports.Form=Wi;exports.FormCancel=Ea;exports.FormClose=Ni;exports.FormContent=Ui;exports.FormDescription=$i;exports.FormError=_a;exports.FormField=Ki;exports.FormFieldCheckbox=Xi;exports.FormFieldCheckboxIndicator=Zi;exports.FormFieldCombobox=ma;exports.FormFieldComboboxContent=ua;exports.FormFieldComboboxControl=ca;exports.FormFieldComboboxInput=la;exports.FormFieldComboboxItem=pa;exports.FormFieldComboboxItemIndicator=ga;exports.FormFieldComboboxItemText=ba;exports.FormFieldComboboxPositioner=Ca;exports.FormFieldComboboxSelectedTags=va;exports.FormFieldComboboxTrigger=ha;exports.FormFieldDescription=Pa;exports.FormFieldEmail=Gi;exports.FormFieldError=Fa;exports.FormFieldFile=Yi;exports.FormFieldLabel=zi;exports.FormFieldSelect=ea;exports.FormFieldSelectContent=na;exports.FormFieldSelectIcon=aa;exports.FormFieldSelectItem=ra;exports.FormFieldSelectItemIndicator=da;exports.FormFieldSelectItemText=sa;exports.FormFieldSelectTrigger=ta;exports.FormFieldSelectValue=ia;exports.FormFieldSelectViewport=oa;exports.FormFieldText=J;exports.FormFieldTextArea=Ji;exports.FormFooter=Aa;exports.FormHeader=Vi;exports.FormHeading=Qi;exports.FormSubmit=ka;exports.FormSuccess=Ia;exports.FormSuccessButton=Sa;exports.FormSuccessHeading=Ma;exports.FormSuccessMessage=xa;exports.FormWrapper=qi;exports.Header=tn;exports.HeaderToolbar=Ae;exports.HeaderToolbarWrapper=Ee;exports.HelpActions=Fi;exports.HelpActionsMenu=Ei;exports.HelpActionsMenuArrow=ki;exports.HelpActionsMenuItem=Ii;exports.HelpActionsMenuItemIcon=Mi;exports.HelpActionsTrigger=Ai;exports.Input=yt;exports.InputFieldset=Tt;exports.InputGroup=jt;exports.IntroMessageWrapper=Ke;exports.Message=ut;exports.MessageAction=gt;exports.MessageAttachments=at;exports.MessageAttachmentsItem=ot;exports.MessageAttachmentsItemIcon=rt;exports.MessageAttachmentsItemTitle=st;exports.MessageAttachmentsList=nt;exports.MessageAttachmentsPreview=dt;exports.MessageAttachmentsPreviewBody=Ct;exports.MessageAttachmentsPreviewClose=ht;exports.MessageAttachmentsPreviewContent=ct;exports.MessageAttachmentsPreviewHeader=lt;exports.MessageAttachmentsPreviewOverlay=mt;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=At;exports.MessageSourceItemBreadcrumbIcon=Kn;exports.MessageSourceItemBreadcrumbs=Et;exports.MessageSourceItemDescription=xt;exports.MessageSourceItemDescriptionPart=St;exports.MessageSourceItemIcon=kt;exports.MessageSourceItemIndicator=ft;exports.MessageSourceItemTag=Mt;exports.MessageSourceItemTitle=It;exports.MessageSources=Pt;exports.MessageSourcesHeader=Ft;exports.MessageSourcesList=_t;exports.MessageToolAction=vt;exports.MessageToolActions=bt;exports.MessageToolbar=pt;exports.MessageWrapper=ce;exports.Messages=Te;exports.Root=_e;exports.SendButton=Ht;exports.SendButtonIcon=wt;exports.TaglineBrandName=gi;exports.TaglineContainer=pi;exports.TaglineLogo=vi;exports.TaglineText=bi;exports.ToolbarHeader=ke;exports.Workflow=Ue;exports.Workflows=Ve;exports.WorkflowsLabel=Qe;exports.WorkflowsList=$e;exports.Wrapper=Pe;
|
|
17
|
+
`);X($)},share:async()=>{const $={visibility:"public",tags:[],userProperties:{},messages:u.messages.map(B=>({...B,createdAt:void 0,updatedAt:void 0,id:Date.now().toString()+B.id,conversationId:void 0}))},{apiKey:w,analyticsApiBaseUrl:O}=k,f=await Ua.logConversation("",$,w,O);if(f){const U=`${v.shareChatUrlBasePath}?${D.SHARE_QUERY_PARAM}=${f?.id}`;Z(U),H({eventName:"chat_share_button_clicked",properties:{sharedConversationId:f?.id,originalConversationId:u.id,sharedChatUrl:U,conversation:f}})}},clear:s,stop:d},pe={copy:V,share:Q};return o.jsx(y.Tooltip,{delayDuration:0,open:pe[e],children:o.jsx(An,{"data-type":e,"data-copied":h.dataAttr(V||Q),className:`${n} ${e}`,children:o.jsx(he,{action:e}),onClick:C.composeEventHandlers(a,te[e]),...r})})},En=i.ikp("span",{_id:"aiChat__ChatActionLabel"}),he=t=>{const{action:e,...a}=t,{aiChatSettings:n}=p.useInkeepConfig(),r=n.toolbarButtonLabels??{},s={help:r.getHelp??"Get Help",copy:r.copyChat??"Copy",share:r.share??"Share",clear:r.clear??"Clear",stop:r.stop??"Stop"};return o.jsx(En,{children:s[e],...a})},kn=i.ikp(y.TooltipContent,{_id:"aiChat__ChatActionFeeback"}),Pi=t=>{const{action:e,children:a,...n}=t,r={copy:"Copied!",share:"Link copied!"};return o.jsxs(kn,{sideOffset:5,...n,children:[o.jsx(y.Arrow,{}),a||r[e]]})},In=i.ikp(j.Root,{_id:"aiChatHelpActions"}),Fi=t=>{const{children:e,...a}=t,{aiChatSettings:n}=p.useInkeepConfig(),{getHelpOptions:r}=n;if(!r||(r??[]).length===0)return null;const{_pinned:s,_unpinned:d}=r.reduce((u,v)=>{const k=v.isPinnedToToolbar?"_pinned":"_unpinned";return{...u,[k]:[...u[k],v]}},{_pinned:[],_unpinned:[]}),c=d.length===1?[...s,d[0]]:s,m=d.length===1?[]:d,l=ae.useHelpMenuState();return o.jsx(ae.HelpMenuProvider,{value:l,children:o.jsx(In,{open:l.open,onOpenChange:l.setOpen,children:h.maybeRender(e,{pinned:c,unpinned:m}),...a})})},Mn=i.ikp(Y,{_id:"aiChatHelpAction",action:"help"}),xn=i.ikp("a",{_id:"aiChatHelpAction",target:"_blank",rel:"noreferrer"}),_i=t=>{const{action:e,onClick:a,...n}=t,{handleAction:r,logHelpAction:s}=re.useChatAction(e),d=e.action.type,c={"aria-label":e.name,"data-name":e.name,children:e.name,onClick:C.composeEventHandlers(a,()=>{r(),s()}),...n};return d==="open_link"?o.jsx(xn,{href:e.action.url,...c}):o.jsx(Mn,{...c})},Sn=i.ikp(j.Trigger,{_id:"aiChatHelpActions__Trigger"}),Ai=g.memo(t=>{const{aiChatSettings:e}=p.useInkeepConfig();return o.jsx(Y,{action:"help",...t,asChild:!0,children:o.jsx(Sn,{children:e.toolbarButtonLabels?.getHelp??"Get Help"})})}),fn=i.ikp(j.Content,{_id:"aiChatHelpActions__Menu"}),Ei=t=>o.jsx(fn,{side:"top",sideOffset:8,align:"center",alignOffset:-10,...t}),ki=i.ikp(j.Arrow,{_id:"aiChatHelpActions__MenuArrow"}),Ii=t=>{const{action:e,onClick:a,...n}=t,{handleAction:r,logHelpAction:s}=re.useChatAction(e),{setOpen:d}=ae.useHelpMenu(),c=()=>{r({onOpenForm:()=>d(!1)}),s()},m=e.action.type,l=i.ikp(m==="open_link"?"a":"button",{_id:"aiChatHelpActions__MenuItem",children:e.name,"aria-label":e.name,"data-name":e.name,"data-type":e.action.type,...m==="open_link"&&{href:e.action.url,target:"_blank",rel:"noopener"},onClick:C.composeEventHandlers(a,c)});return o.jsx(l,{...n})},Bn=i.ikp(M.BuiltInIconRenderer,{_id:"aiChatHelpActions_MenuItemIcon"}),Mi=t=>{const{action:e,...a}=t;return e.icon?o.jsx(Bn,{iconSettings:e.icon,...a}):null},Tn=i.ikp(F.Root,{_id:"aiChatFeedbackModal"}),xi=t=>{const{onOpenChange:e,...a}=t,{currentFeedback:n,setCurrentFeedback:r}=ne.useMessageFeedback();return o.jsx(Tn,{open:n!==null,onOpenChange:C.composeEventHandlers(e,()=>r(null)),...a})},Si=i.ikp(F.Overlay,{_id:"aiChatFeedbackModal__Overlay"}),fi=i.ikp(F.Content,{_id:"aiChatFeedbackModal__Content","aria-describedby":void 0}),Bi=i.ikp(F.Title,{_id:"aiChatFeedbackModal__Header",children:"Help improve my answers!"}),Ti=i.ikp(F.Close,{_id:"aiChatFeedbackModal__Close",children:o.jsx(A.CustomIcon,{iconKey:"close"})}),ji=i.ikp("div",{_id:"aiChatFeedbackModal__Body"}),jn=i.ikp("form",{_id:"aiChatFeedbackForm"}),yi=t=>{const{onSubmit:e,...a}=t,{submitNegativeFeedback:n,currentFeedback:r,setCurrentFeedback:s}=ne.useMessageFeedback(),d=c=>{c.preventDefault();const m=c.target,l=new FormData(m),u=Object.fromEntries(l.entries());r&&(n(r,u),s(null))};return o.jsx(jn,{onSubmit:C.composeEventHandlers(e,d),...a})},yn=i.ikp("div",{_id:"aiChatFeedbackItem"}),Hi=t=>{const{name:e,...a}=t;return o.jsx(z.FeedbackItemProvider,{name:e,children:o.jsx(yn,{...a})})},Hn=i.ikp(G.Root,{_id:"aiChatFeedbackItem__Checkbox"}),wi=t=>{const{name:e,focusItem:a}=z.useFeedbackItem(),{onCheckedChange:n,...r}=t,s=d=>{d&&a?.current?.focus()};return o.jsx(Hn,{id:`feedback-${e}`,name:e,onCheckedChange:C.composeEventHandlers(n,s),...r})},Li=i.ikp(G.Indicator,{_id:"aiChatFeedbackItem__CheckboxIndicator",children:o.jsx(ge.CheckboxIcon,{})}),wn=i.ikp("label",{_id:"aiChatFeedbackItem__Label"}),Di=t=>{const{name:e}=z.useFeedbackItem(),a={unrelated_response:"Didn't answer my question",inaccurate_statement:"Inaccurate statement",inaccurate_code_snippet:"Inaccurate code snippet",irrelevant_citations:"Irrelevant citations"};return o.jsx(wn,{htmlFor:`feedback-${e}`,children:a[e],...t})},Ln=i.ikp("textarea",{_id:"aiChatFeedbackItem__Description",placeholder:"Please describe"}),Oi=t=>{const{name:e,focusItem:a}=z.useFeedbackItem();return o.jsx(Ln,{ref:a,name:`${e}:description`,...t})},Ri=i.ikp("button",{_id:"aiChatFeedbackForm__SubmitButton",children:"Submit",type:"submit"}),Dn=i.ikp("div",{_id:"aiChatForm__Wrapper"}),qi=t=>{const{form:e}=_.useChatForm();return e?o.jsx(Dn,{...t}):null},On=i.ikp("form",{_id:"aiChatForm"}),Wi=t=>{const{onSubmit:e,...a}=t,{handleSubmit:n,isSuccess:r}=_.useChatForm();return r?null:o.jsx(On,{onSubmit:C.composeEventHandlers(e,n),...a})},Rn=i.ikp("button",{_id:"aiChatForm__Close",children:o.jsx(A.CustomIcon,{iconKey:"close"})}),Ni=t=>{const{onClick:e,...a}=t,{closeForm:n}=_.useChatForm();return o.jsx(Rn,{onClick:C.composeEventHandlers(e,n),...a})},Vi=i.ikp("div",{_id:"aiChatForm__Header"}),qn=i.ikp("h2",{_id:"aiChatForm__Heading"}),Qi=t=>{const{form:e}=_.useChatForm();return e?.heading?o.jsx(qn,{children:e.heading,...t}):null},Wn=i.ikp(K.Markdown,{_id:"aiChatForm__Description"}),$i=t=>{const{form:e}=_.useChatForm();return e?.description?o.jsx(Wn,{shouldOpenLinksInNewTab:!0,children:e.description,...t}):null},Nn=i.ikp("div",{_id:"aiChatForm__Content"}),Ui=t=>{const{children:e,...a}=t,{fields:n=[]}=_.useChatForm();return o.jsx(Nn,{children:h.maybeRender(e,n),...a})},Vn=i.ikp("div",{_id:"aiChatForm__Field"}),Ki=t=>{const{field:e,autoFocus:a,...n}=t,{control:r,errors:s}=_.useChatForm();return o.jsx(Wa.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 o.jsx(x.FormFieldProvider,{"data-invalid":h.dataAttr(!!s[e.name]),field:e,fieldProps:d,autoFocus:a,children:c&&o.jsx(Vn,{"data-input-type":e.inputType,"data-hidden":h.dataAttr(e.isHidden),...n})})}})},Qn=i.ikp("label",{_id:"aiChatForm__FieldLabel"}),zi=t=>{const{field:e}=x.useFormField();return o.jsx(Qn,{"data-required":h.dataAttr(e.isRequired),htmlFor:e.name,children:e.label,...t})},$n=i.ikp("input",{_id:"aiChatForm__FieldText",type:"text"}),J=t=>{const{field:e,error:a,fieldProps:{onChange:n,onBlur:r,...s},autoFocus:d}=x.useFormField(),{onChange:c,onBlur:m,...l}=t;return o.jsx($n,{id:e.name,autoFocus:d,placeholder:"placeholder"in e?e.placeholder:void 0,"data-invalid":h.dataAttr(!!a),onChange:C.composeEventHandlers(c,n),onBlur:C.composeEventHandlers(m,r),...s,...l})},Gi=i.ikp(J,{_id:"aiChatForm__FieldEmail",type:"email"}),Un=i.ikp("input",{_id:"aiChatForm__FieldFile",type:"file",multiple:!0}),Yi=t=>{const{field:e,error:a,fieldProps:{value:n,onChange:r,onBlur:s,...d},autoFocus:c}=x.useFormField(),{onChange:m,onBlur:l,...u}=t,v=k=>{const H=k.target.files;r(H)};return o.jsx(Un,{id:e.name,autoFocus:c,"data-value":n,"data-invalid":h.dataAttr(!!a),...u,...d,onChange:C.composeEventHandlers(m,v),onBlur:C.composeEventHandlers(l,s)})},Ji=i.ikp(J,{_id:"aiChatForm__FieldTextArea",type:"textarea",asChild:!0,children:o.jsx(oe,{maxRows:8})}),Kn=i.ikp(G.Root,{_id:"aiChatForm__FieldCheckbox"}),Xi=t=>{const{field:e,error:a,fieldProps:n,autoFocus:r}=x.useFormField(),{onCheckedChange:s,...d}=t;return o.jsx(Kn,{id:e.name,name:e.name,autoFocus:r,"data-invalid":h.dataAttr(!!a),checked:n.value,onCheckedChange:C.composeEventHandlers(s,n.onChange),...d})},Zi=i.ikp(G.Indicator,{_id:"aiChatForm__FieldCheckboxIndicator",children:o.jsx(ge.CheckboxIcon,{})}),zn=i.ikp(S.Root,{_id:"aiChatForm__FieldSelect"}),ea=t=>{const{field:e,error:a,fieldProps:n}=x.useFormField(),{onValueChange:r,...s}=t;return o.jsx(zn,{name:e.name,"data-invalid":h.dataAttr(!!a),value:n.value,onValueChange:C.composeEventHandlers(r,n.onChange),...s})},ta=i.ikp(S.Trigger,{_id:"aiChatForm__FieldSelect__Trigger"}),Gn=i.ikp(S.Value,{_id:"aiChatForm__FieldSelect__Value"}),ia=t=>{const{field:e}=x.useFormField();return o.jsx(Gn,{placeholder:"placeholder"in e?e.placeholder:void 0,...t})},aa=i.ikp(S.Icon,{_id:"aiChatForm__FieldSelect__Icon",asChild:!0,children:o.jsx(M.BuiltInIconRenderer,{iconSettings:{builtIn:"LuChevronDown"}})}),oa=i.ikp(S.Content,{_id:"aiChatForm__FieldSelect__Content",position:"popper"}),na=i.ikp(S.Viewport,{_id:"aiChatForm__FieldSelect__Viewport"}),ra=i.ikp(S.Item,{_id:"aiChatForm__FieldSelect__Item"}),sa=i.ikp(S.ItemText,{_id:"aiChatForm__FieldSelect__ItemText"}),da=i.ikp(S.ItemIndicator,{_id:"aiChatForm__FieldSelect__ItemIndicator",asChild:!0,children:o.jsx(M.BuiltInIconRenderer,{iconSettings:{builtIn:"LuCheck"}})}),ca=t=>{const{field:e,error:a,fieldProps:n,autoFocus:r}=x.useFormField(),s=Ya.useShadow();if(e.inputType!=="combobox")return null;const{onValueChange:d,children:c,...m}=t,l=s?.shadowHost?()=>s.shadowHost.shadowRoot??document:void 0;return o.jsx(I.ComboboxRoot,{...m,id:e.name,name:e.name,items:e.items??[],defaultValue:e.defaultValue,onValueChange:C.composeEventHandlers(d,n.onChange),multiple:e.multiple,placeholder:"placeholder"in e?e.placeholder:void 0,invalid:!!a,autoFocus:r,getRootNode:l,children:c})},ma=i.ikp(I.ComboboxControl,{_id:"aiChatForm__FieldCombobox__Control"}),la=i.ikp(I.ComboboxInput,{_id:"aiChatForm__FieldCombobox__Input"}),ha=i.ikp(I.ComboboxTrigger,{_id:"aiChatForm__FieldCombobox__Trigger",children:o.jsx(M.BuiltInIconRenderer,{iconSettings:{builtIn:"LuChevronDown"}})}),Ca=i.ikp(I.ComboboxPositioner,{_id:"aiChatForm__FieldCombobox__Positioner"}),ua=i.ikp(I.ComboboxContent,{_id:"aiChatForm__FieldCombobox__Content"}),pa=i.ikp(I.ComboboxItem,{_id:"aiChatForm__FieldCombobox__Item"}),ba=i.ikp(I.ComboboxItemText,{_id:"aiChatForm__FieldCombobox__ItemText"}),va=i.ikp(I.ComboboxSelectedTags,{_id:"aiChatForm__FieldCombobox__SelectedTags"}),ga=i.ikp(I.ComboboxItemIndicator,{_id:"aiChatForm__FieldCombobox__ItemIndicator",children:o.jsx(M.BuiltInIconRenderer,{iconSettings:{builtIn:"LuCheck"}})}),Yn=i.ikp("p",{_id:"aiChatForm__FieldDescription"}),Pa=t=>{const{field:e}=x.useFormField();return e.description?o.jsx(Yn,{children:e.description,...t}):null},Jn=i.ikp("span",{_id:"aiChatForm__FieldError"}),Fa=t=>{const{error:e}=x.useFormField();return e?o.jsx(Jn,{children:e.message?.toString(),...t}):null},Xn=i.ikp("span",{_id:"aiChatForm__Error"}),_a=t=>{const{formError:e}=_.useChatForm();return e?o.jsx(Xn,{children:e.message,...t}):null},Aa=i.ikp("div",{_id:"aiChatForm__Footer"}),Zn=i.ikp("button",{_id:"aiChatForm__Cancel",children:"Cancel",type:"button"}),Ea=t=>{const{onClick:e,...a}=t,{closeForm:n}=_.useChatForm();return o.jsx(Zn,{onClick:C.composeEventHandlers(e,n),...a})},er=i.ikp("button",{_id:"aiChatForm__Submit",children:"Submit",type:"submit"}),ka=t=>{const{onClick:e,...a}=t,{isSubmitting:n,form:r}=_.useChatForm(),s=r?.buttons.submit.label||"Submit";return o.jsx(er,{disabled:n,...a,children:s})},tr=i.ikp("div",{_id:"aiChatForm__Success"}),Ia=t=>{const{isSuccess:e}=_.useChatForm();return e?o.jsx(tr,{...t}):null},ir=i.ikp("h2",{_id:"aiChatForm__SuccessHeading"}),Ma=t=>{const{form:e}=_.useChatForm();return o.jsx(ir,{children:e?.successView?.heading,...t})},ar=i.ikp(K.Markdown,{_id:"aiChatForm__SuccessMessage"}),xa=t=>{const{form:e}=_.useChatForm();return o.jsx(ar,{shouldOpenLinksInNewTab:!0,children:e?.successView?.message,...t})},or=i.ikp("button",{_id:"aiChatForm__SuccessButton"}),Sa=t=>{const{onClick:e,...a}=t,{form:n,closeForm:r}=_.useChatForm(),s=n?.successView?.doneButton;if(!s)return null;const d=s.icon&&o.jsx(M.BuiltInIconRenderer,{iconSettings:s.icon}),c=s.label;return o.jsx(or,{onClick:C.composeEventHandlers(e,r),children:o.jsxs(o.Fragment,{children:[d,c]}),...a})};exports.Provider=b.ChatProvider;exports.ActionBar=Ci;exports.Actions=ui;exports.AttachmentsBar=Lt;exports.AttachmentsBarActions=Nt;exports.AttachmentsBarAttachment=Ot;exports.AttachmentsBarAttachmentDelete=Wt;exports.AttachmentsBarAttachmentIcon=Rt;exports.AttachmentsBarAttachmentTitle=qt;exports.AttachmentsBarForm=ai;exports.AttachmentsBarFormContent=di;exports.AttachmentsBarFormContentError=li;exports.AttachmentsBarFormContentInput=mi;exports.AttachmentsBarFormContentLabel=ci;exports.AttachmentsBarFormSubmitButton=hi;exports.AttachmentsBarFormTitle=oi;exports.AttachmentsBarFormTitleError=si;exports.AttachmentsBarFormTitleInput=ri;exports.AttachmentsBarFormTitleLabel=ni;exports.AttachmentsBarInfoTip=Vt;exports.AttachmentsBarInfoTipArrow=le;exports.AttachmentsBarInfoTipIcon=Qt;exports.AttachmentsBarInfoTipText=$t;exports.AttachmentsBarInput=Kt;exports.AttachmentsBarInputs=Ut;exports.AttachmentsBarList=Dt;exports.AttachmentsBarModal=zt;exports.AttachmentsBarModalBody=ii;exports.AttachmentsBarModalClose=ti;exports.AttachmentsBarModalContent=Yt;exports.AttachmentsBarModalDescription=Zt;exports.AttachmentsBarModalHeader=Jt;exports.AttachmentsBarModalHeading=Xt;exports.AttachmentsBarModalHelp=ei;exports.AttachmentsBarModalOverlay=Gt;exports.ChatAction=Y;exports.ChatActionFeedback=Pi;exports.ChatActionLabel=he;exports.ChatHelpAction=_i;exports.Content=Ie;exports.ContentScrollArea=Me;exports.ContentScrollAreaCorner=Be;exports.ContentScrollAreaScrollbar=Se;exports.ContentScrollAreaThumb=fe;exports.ContentScrollAreaViewport=xe;exports.ConversationLoading=Fe;exports.Disclaimer=je;exports.DisclaimerArrow=De;exports.DisclaimerContent=we;exports.DisclaimerLabel=ye;exports.DisclaimerText=Le;exports.DisclaimerTrigger=He;exports.EmbeddedChatPrimitiveActionBar=Ci;exports.EmbeddedChatPrimitiveActions=ui;exports.EmbeddedChatPrimitiveAttachmentsBar=Lt;exports.EmbeddedChatPrimitiveAttachmentsBarActions=Nt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachment=Ot;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentDelete=Wt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentIcon=Rt;exports.EmbeddedChatPrimitiveAttachmentsBarAttachmentTitle=qt;exports.EmbeddedChatPrimitiveAttachmentsBarForm=ai;exports.EmbeddedChatPrimitiveAttachmentsBarFormContent=di;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentError=li;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentInput=mi;exports.EmbeddedChatPrimitiveAttachmentsBarFormContentLabel=ci;exports.EmbeddedChatPrimitiveAttachmentsBarFormSubmitButton=hi;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitle=oi;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleError=si;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleInput=ri;exports.EmbeddedChatPrimitiveAttachmentsBarFormTitleLabel=ni;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTip=Vt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipArrow=le;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipIcon=Qt;exports.EmbeddedChatPrimitiveAttachmentsBarInfoTipText=$t;exports.EmbeddedChatPrimitiveAttachmentsBarInput=Kt;exports.EmbeddedChatPrimitiveAttachmentsBarInputs=Ut;exports.EmbeddedChatPrimitiveAttachmentsBarList=Dt;exports.EmbeddedChatPrimitiveAttachmentsBarModal=zt;exports.EmbeddedChatPrimitiveAttachmentsBarModalBody=ii;exports.EmbeddedChatPrimitiveAttachmentsBarModalClose=ti;exports.EmbeddedChatPrimitiveAttachmentsBarModalContent=Yt;exports.EmbeddedChatPrimitiveAttachmentsBarModalDescription=Zt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeader=Jt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHeading=Xt;exports.EmbeddedChatPrimitiveAttachmentsBarModalHelp=ei;exports.EmbeddedChatPrimitiveAttachmentsBarModalOverlay=Gt;exports.EmbeddedChatPrimitiveChatAction=Y;exports.EmbeddedChatPrimitiveChatActionFeedback=Pi;exports.EmbeddedChatPrimitiveChatActionLabel=he;exports.EmbeddedChatPrimitiveChatHelpAction=_i;exports.EmbeddedChatPrimitiveContent=Ie;exports.EmbeddedChatPrimitiveContentScrollArea=Me;exports.EmbeddedChatPrimitiveContentScrollAreaCorner=Be;exports.EmbeddedChatPrimitiveContentScrollAreaScrollbar=Se;exports.EmbeddedChatPrimitiveContentScrollAreaThumb=fe;exports.EmbeddedChatPrimitiveContentScrollAreaViewport=xe;exports.EmbeddedChatPrimitiveConversationLoading=Fe;exports.EmbeddedChatPrimitiveDisclaimer=je;exports.EmbeddedChatPrimitiveDisclaimerArrow=De;exports.EmbeddedChatPrimitiveDisclaimerContent=we;exports.EmbeddedChatPrimitiveDisclaimerLabel=ye;exports.EmbeddedChatPrimitiveDisclaimerText=Le;exports.EmbeddedChatPrimitiveDisclaimerTrigger=He;exports.EmbeddedChatPrimitiveExampleQuestion=We;exports.EmbeddedChatPrimitiveExampleQuestionButton=Ne;exports.EmbeddedChatPrimitiveExampleQuestions=Oe;exports.EmbeddedChatPrimitiveExampleQuestionsLabel=Re;exports.EmbeddedChatPrimitiveExampleQuestionsList=qe;exports.EmbeddedChatPrimitiveFeedbackForm=yi;exports.EmbeddedChatPrimitiveFeedbackItem=Hi;exports.EmbeddedChatPrimitiveFeedbackItemCheckbox=wi;exports.EmbeddedChatPrimitiveFeedbackItemCheckboxIndicator=Li;exports.EmbeddedChatPrimitiveFeedbackItemDescription=Oi;exports.EmbeddedChatPrimitiveFeedbackItemLabel=Di;exports.EmbeddedChatPrimitiveFeedbackModal=xi;exports.EmbeddedChatPrimitiveFeedbackModalBody=ji;exports.EmbeddedChatPrimitiveFeedbackModalClose=Ti;exports.EmbeddedChatPrimitiveFeedbackModalContent=fi;exports.EmbeddedChatPrimitiveFeedbackModalHeader=Bi;exports.EmbeddedChatPrimitiveFeedbackModalOverlay=Si;exports.EmbeddedChatPrimitiveFeedbackSubmitButton=Ri;exports.EmbeddedChatPrimitiveFooter=Bt;exports.EmbeddedChatPrimitiveForm=Wi;exports.EmbeddedChatPrimitiveFormCancel=Ea;exports.EmbeddedChatPrimitiveFormClose=Ni;exports.EmbeddedChatPrimitiveFormContent=Ui;exports.EmbeddedChatPrimitiveFormDescription=$i;exports.EmbeddedChatPrimitiveFormError=_a;exports.EmbeddedChatPrimitiveFormField=Ki;exports.EmbeddedChatPrimitiveFormFieldCheckbox=Xi;exports.EmbeddedChatPrimitiveFormFieldCheckboxIndicator=Zi;exports.EmbeddedChatPrimitiveFormFieldCombobox=ca;exports.EmbeddedChatPrimitiveFormFieldComboboxContent=ua;exports.EmbeddedChatPrimitiveFormFieldComboboxControl=ma;exports.EmbeddedChatPrimitiveFormFieldComboboxInput=la;exports.EmbeddedChatPrimitiveFormFieldComboboxItem=pa;exports.EmbeddedChatPrimitiveFormFieldComboboxItemIndicator=ga;exports.EmbeddedChatPrimitiveFormFieldComboboxItemText=ba;exports.EmbeddedChatPrimitiveFormFieldComboboxPositioner=Ca;exports.EmbeddedChatPrimitiveFormFieldComboboxSelectedTags=va;exports.EmbeddedChatPrimitiveFormFieldComboboxTrigger=ha;exports.EmbeddedChatPrimitiveFormFieldDescription=Pa;exports.EmbeddedChatPrimitiveFormFieldEmail=Gi;exports.EmbeddedChatPrimitiveFormFieldError=Fa;exports.EmbeddedChatPrimitiveFormFieldFile=Yi;exports.EmbeddedChatPrimitiveFormFieldLabel=zi;exports.EmbeddedChatPrimitiveFormFieldSelect=ea;exports.EmbeddedChatPrimitiveFormFieldSelectContent=oa;exports.EmbeddedChatPrimitiveFormFieldSelectIcon=aa;exports.EmbeddedChatPrimitiveFormFieldSelectItem=ra;exports.EmbeddedChatPrimitiveFormFieldSelectItemIndicator=da;exports.EmbeddedChatPrimitiveFormFieldSelectItemText=sa;exports.EmbeddedChatPrimitiveFormFieldSelectTrigger=ta;exports.EmbeddedChatPrimitiveFormFieldSelectValue=ia;exports.EmbeddedChatPrimitiveFormFieldSelectViewport=na;exports.EmbeddedChatPrimitiveFormFieldText=J;exports.EmbeddedChatPrimitiveFormFieldTextArea=Ji;exports.EmbeddedChatPrimitiveFormFooter=Aa;exports.EmbeddedChatPrimitiveFormHeader=Vi;exports.EmbeddedChatPrimitiveFormHeading=Qi;exports.EmbeddedChatPrimitiveFormSubmit=ka;exports.EmbeddedChatPrimitiveFormSuccess=Ia;exports.EmbeddedChatPrimitiveFormSuccessButton=Sa;exports.EmbeddedChatPrimitiveFormSuccessHeading=Ma;exports.EmbeddedChatPrimitiveFormSuccessMessage=xa;exports.EmbeddedChatPrimitiveFormWrapper=qi;exports.EmbeddedChatPrimitiveHeaderToolbar=Ae;exports.EmbeddedChatPrimitiveHelpActions=Fi;exports.EmbeddedChatPrimitiveHelpActionsMenu=Ei;exports.EmbeddedChatPrimitiveHelpActionsMenuArrow=ki;exports.EmbeddedChatPrimitiveHelpActionsMenuItem=Ii;exports.EmbeddedChatPrimitiveHelpActionsMenuItemIcon=Mi;exports.EmbeddedChatPrimitiveHelpActionsTrigger=Ai;exports.EmbeddedChatPrimitiveInput=yt;exports.EmbeddedChatPrimitiveInputFieldset=Tt;exports.EmbeddedChatPrimitiveInputGroup=jt;exports.EmbeddedChatPrimitiveIntroMessageWrapper=Ke;exports.EmbeddedChatPrimitiveMessage=ut;exports.EmbeddedChatPrimitiveMessageAction=gt;exports.EmbeddedChatPrimitiveMessageAttachments=at;exports.EmbeddedChatPrimitiveMessageAttachmentsItem=nt;exports.EmbeddedChatPrimitiveMessageAttachmentsItemIcon=rt;exports.EmbeddedChatPrimitiveMessageAttachmentsItemTitle=st;exports.EmbeddedChatPrimitiveMessageAttachmentsList=ot;exports.EmbeddedChatPrimitiveMessageAttachmentsPreview=dt;exports.EmbeddedChatPrimitiveMessageAttachmentsPreviewBody=Ct;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=At;exports.EmbeddedChatPrimitiveMessageSourceItemBreadcrumbs=Et;exports.EmbeddedChatPrimitiveMessageSourceItemDescription=xt;exports.EmbeddedChatPrimitiveMessageSourceItemDescriptionPart=St;exports.EmbeddedChatPrimitiveMessageSourceItemIcon=kt;exports.EmbeddedChatPrimitiveMessageSourceItemIndicator=ft;exports.EmbeddedChatPrimitiveMessageSourceItemTag=Mt;exports.EmbeddedChatPrimitiveMessageSourceItemTitle=It;exports.EmbeddedChatPrimitiveMessageSources=Pt;exports.EmbeddedChatPrimitiveMessageSourcesHeader=Ft;exports.EmbeddedChatPrimitiveMessageSourcesList=_t;exports.EmbeddedChatPrimitiveMessageToolAction=vt;exports.EmbeddedChatPrimitiveMessageToolActions=bt;exports.EmbeddedChatPrimitiveMessageToolbar=pt;exports.EmbeddedChatPrimitiveMessageWrapper=me;exports.EmbeddedChatPrimitiveMessages=Te;exports.EmbeddedChatPrimitiveRoot=_e;exports.EmbeddedChatPrimitiveSendButton=Ht;exports.EmbeddedChatPrimitiveSendButtonIcon=wt;exports.EmbeddedChatPrimitiveTaglineContainer=pi;exports.EmbeddedChatPrimitiveTaglineLogo=vi;exports.EmbeddedChatPrimitiveTaglineLogoIcon=gi;exports.EmbeddedChatPrimitiveTaglineText=bi;exports.EmbeddedChatPrimitiveToolbarHeader=ke;exports.EmbeddedChatPrimitiveToolbarHeaderWrapper=Ee;exports.EmbeddedChatPrimitiveWorkflow=Ue;exports.EmbeddedChatPrimitiveWorkflows=Ve;exports.EmbeddedChatPrimitiveWorkflowsLabel=Qe;exports.EmbeddedChatPrimitiveWorkflowsList=$e;exports.EmbeddedChatPrimitiveWrapper=Pe;exports.ExampleQuestion=We;exports.ExampleQuestionButton=Ne;exports.ExampleQuestions=Oe;exports.ExampleQuestionsLabel=Re;exports.ExampleQuestionsList=qe;exports.FeedbackForm=yi;exports.FeedbackItem=Hi;exports.FeedbackItemCheckbox=wi;exports.FeedbackItemCheckboxIndicator=Li;exports.FeedbackItemDescription=Oi;exports.FeedbackItemLabel=Di;exports.FeedbackModal=xi;exports.FeedbackModalBody=ji;exports.FeedbackModalClose=Ti;exports.FeedbackModalContent=fi;exports.FeedbackModalHeader=Bi;exports.FeedbackModalOverlay=Si;exports.FeedbackSubmitButton=Ri;exports.Footer=Bt;exports.Form=Wi;exports.FormCancel=Ea;exports.FormClose=Ni;exports.FormContent=Ui;exports.FormDescription=$i;exports.FormError=_a;exports.FormField=Ki;exports.FormFieldCheckbox=Xi;exports.FormFieldCheckboxIndicator=Zi;exports.FormFieldCombobox=ca;exports.FormFieldComboboxContent=ua;exports.FormFieldComboboxControl=ma;exports.FormFieldComboboxInput=la;exports.FormFieldComboboxItem=pa;exports.FormFieldComboboxItemIndicator=ga;exports.FormFieldComboboxItemText=ba;exports.FormFieldComboboxPositioner=Ca;exports.FormFieldComboboxSelectedTags=va;exports.FormFieldComboboxTrigger=ha;exports.FormFieldDescription=Pa;exports.FormFieldEmail=Gi;exports.FormFieldError=Fa;exports.FormFieldFile=Yi;exports.FormFieldLabel=zi;exports.FormFieldSelect=ea;exports.FormFieldSelectContent=oa;exports.FormFieldSelectIcon=aa;exports.FormFieldSelectItem=ra;exports.FormFieldSelectItemIndicator=da;exports.FormFieldSelectItemText=sa;exports.FormFieldSelectTrigger=ta;exports.FormFieldSelectValue=ia;exports.FormFieldSelectViewport=na;exports.FormFieldText=J;exports.FormFieldTextArea=Ji;exports.FormFooter=Aa;exports.FormHeader=Vi;exports.FormHeading=Qi;exports.FormSubmit=ka;exports.FormSuccess=Ia;exports.FormSuccessButton=Sa;exports.FormSuccessHeading=Ma;exports.FormSuccessMessage=xa;exports.FormWrapper=qi;exports.Header=to;exports.HeaderToolbar=Ae;exports.HeaderToolbarWrapper=Ee;exports.HelpActions=Fi;exports.HelpActionsMenu=Ei;exports.HelpActionsMenuArrow=ki;exports.HelpActionsMenuItem=Ii;exports.HelpActionsMenuItemIcon=Mi;exports.HelpActionsTrigger=Ai;exports.Input=yt;exports.InputFieldset=Tt;exports.InputGroup=jt;exports.IntroMessageWrapper=Ke;exports.Message=ut;exports.MessageAction=gt;exports.MessageAttachments=at;exports.MessageAttachmentsItem=nt;exports.MessageAttachmentsItemIcon=rt;exports.MessageAttachmentsItemTitle=st;exports.MessageAttachmentsList=ot;exports.MessageAttachmentsPreview=dt;exports.MessageAttachmentsPreviewBody=Ct;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=At;exports.MessageSourceItemBreadcrumbIcon=Ko;exports.MessageSourceItemBreadcrumbs=Et;exports.MessageSourceItemDescription=xt;exports.MessageSourceItemDescriptionPart=St;exports.MessageSourceItemIcon=kt;exports.MessageSourceItemIndicator=ft;exports.MessageSourceItemTag=Mt;exports.MessageSourceItemTitle=It;exports.MessageSources=Pt;exports.MessageSourcesHeader=Ft;exports.MessageSourcesList=_t;exports.MessageToolAction=vt;exports.MessageToolActions=bt;exports.MessageToolbar=pt;exports.MessageWrapper=me;exports.Messages=Te;exports.Root=_e;exports.SendButton=Ht;exports.SendButtonIcon=wt;exports.TaglineContainer=pi;exports.TaglineLogo=vi;exports.TaglineLogoIcon=gi;exports.TaglineText=bi;exports.ToolbarHeader=ke;exports.Workflow=Ue;exports.Workflows=Ve;exports.WorkflowsLabel=Qe;exports.WorkflowsList=$e;exports.Wrapper=Pe;
|
|
@@ -8,7 +8,7 @@ import * as B from "@radix-ui/react-popover";
|
|
|
8
8
|
import * as T from "@radix-ui/react-tooltip";
|
|
9
9
|
import * as H from "@radix-ui/react-scroll-area";
|
|
10
10
|
import { Trigger as fe, Icon as Ee, Content as Se, Viewport as ke, Item as Be, ItemText as Te, ItemIndicator as ye, Root as we, Value as xe } from "../atoms/select.js";
|
|
11
|
-
import { ComboboxRoot as Le, ComboboxControl as He, ComboboxInput as De, ComboboxTrigger as Oe, ComboboxPositioner as
|
|
11
|
+
import { ComboboxRoot as Le, ComboboxControl as He, ComboboxInput as De, ComboboxTrigger as Oe, ComboboxPositioner as We, ComboboxContent as Ne, ComboboxItem as Re, ComboboxItemText as $e, ComboboxSelectedTags as Ve, ComboboxItemIndicator as Qe } from "../atoms/combobox.js";
|
|
12
12
|
import { Overlay as ie, Content as ae, Close as ne, Title as oe, Root as se } from "../atoms/dialog.js";
|
|
13
13
|
import Ue from "../atoms/avatars/ai.js";
|
|
14
14
|
import Ke from "../atoms/avatars/user.js";
|
|
@@ -21,7 +21,7 @@ import { AttachmentsBarProvider as je, useAttachmentsBar as A } from "../provide
|
|
|
21
21
|
import { SourceItemProvider as Ge, useSourceItem as x } from "../providers/source-item-provider.js";
|
|
22
22
|
import { useInkeepConfig as C } from "../providers/config-provider.js";
|
|
23
23
|
import { useInkeepConversation as O, SHARE_QUERY_PARAM as ze } from "../providers/conversation-provider.js";
|
|
24
|
-
import { useChatEvents as
|
|
24
|
+
import { useChatEvents as W } from "../providers/chat-events-provider.js";
|
|
25
25
|
import { useMessageFeedback as re } from "../providers/feedback-provider.js";
|
|
26
26
|
import { MessageAttachmentsProvider as Ye, useMessageAttachments as j } from "../providers/message-attachments-provider.js";
|
|
27
27
|
import { MessageProvider as Je, useMessage as _ } from "../providers/message-provider.js";
|
|
@@ -31,9 +31,9 @@ import { FeedbackItemProvider as Xe, useFeedbackItem as ce } from "../providers/
|
|
|
31
31
|
import { stringifyAttachments as Ze } from "../utils/get-message-metadata.js";
|
|
32
32
|
import { dataAttr as p, maybeRender as M, getInitials as et, getMessageContent as de } from "../utils/misc.js";
|
|
33
33
|
import { ikp as i } from "./factory.js";
|
|
34
|
+
import tt from "./tagline-logo-icon.js";
|
|
34
35
|
import { useChat as v } from "./embedded-chat/chat-provider.js";
|
|
35
36
|
import { ChatProvider as Dr } from "./embedded-chat/chat-provider.js";
|
|
36
|
-
import tt from "./tagline-logo-icon.js";
|
|
37
37
|
import { useSettleAction as it } from "../hooks/use-settle-action.js";
|
|
38
38
|
import { useContainerSize as at } from "../hooks/use-container-size.js";
|
|
39
39
|
import { useChatAction as me } from "./embedded-chat/use-chat-action.js";
|
|
@@ -158,7 +158,7 @@ const gt = "__intro__", Ft = i("div", {
|
|
|
158
158
|
}
|
|
159
159
|
), Bt = i(B.Content, {
|
|
160
160
|
_id: "aiChatDisclaimerContent"
|
|
161
|
-
}),
|
|
161
|
+
}), Wn = (t) => {
|
|
162
162
|
const { setOpen: e } = Fe();
|
|
163
163
|
return /* @__PURE__ */ n(
|
|
164
164
|
Bt,
|
|
@@ -174,7 +174,7 @@ const gt = "__intro__", Ft = i("div", {
|
|
|
174
174
|
);
|
|
175
175
|
}, Tt = i(q, {
|
|
176
176
|
_id: "aiChatDisclaimerText"
|
|
177
|
-
}),
|
|
177
|
+
}), Nn = P(
|
|
178
178
|
(t) => {
|
|
179
179
|
const { aiChatSettings: e } = C(), a = e.aiAssistantName, s = e.disclaimerSettings?.tooltip || `Information provided by ${a || "this AI assistant"} is not guaranteed to be accurate or comprehensive.`;
|
|
180
180
|
return /* @__PURE__ */ n(Tt, { shouldOpenLinksInNewTab: !0, children: s, ...t });
|
|
@@ -227,19 +227,19 @@ const gt = "__intro__", Ft = i("div", {
|
|
|
227
227
|
}), jn = P((t) => {
|
|
228
228
|
const { aiChatSettings: e } = C();
|
|
229
229
|
return /* @__PURE__ */ n(Ot, { children: e.workflowsHeader, ...t });
|
|
230
|
-
}),
|
|
230
|
+
}), Wt = i("div", {
|
|
231
231
|
_id: "aiChatWorkflowsList"
|
|
232
232
|
}), Gn = P(
|
|
233
233
|
(t) => {
|
|
234
234
|
const { aiChatSettings: e } = C(), a = e.workflows, { children: o, ...s } = t;
|
|
235
|
-
return /* @__PURE__ */ n(
|
|
235
|
+
return /* @__PURE__ */ n(Wt, { children: M(o, a), ...s });
|
|
236
236
|
}
|
|
237
|
-
),
|
|
237
|
+
), Nt = i("button", {
|
|
238
238
|
_id: "aiChatWorkflow"
|
|
239
239
|
}), zn = (t) => {
|
|
240
240
|
const { workflow: e, onClick: a, ...o } = t, { handleWorkflow: s } = v();
|
|
241
241
|
return /* @__PURE__ */ n(
|
|
242
|
-
|
|
242
|
+
Nt,
|
|
243
243
|
{
|
|
244
244
|
onClick: h(a, () => s(e)),
|
|
245
245
|
children: e.displayName,
|
|
@@ -464,7 +464,7 @@ const gt = "__intro__", Ft = i("div", {
|
|
|
464
464
|
}, be = i("div", {
|
|
465
465
|
_id: "aiChatMessage"
|
|
466
466
|
}), _o = (t) => {
|
|
467
|
-
const { aiChatSettings: e } = C(), { componentStyles: a, ...o } = t, { message: s } = _(), { logEvent: r } =
|
|
467
|
+
const { aiChatSettings: e } = C(), { componentStyles: a, ...o } = t, { message: s } = _(), { logEvent: r } = W(), c = de(s), { conversation: d } = O();
|
|
468
468
|
return s.role === "user" ? /* @__PURE__ */ n(be, { "data-role": s.role, children: c, ...o }) : /* @__PURE__ */ n(be, { "data-role": s.role, ...o, children: /* @__PURE__ */ n(
|
|
469
469
|
q,
|
|
470
470
|
{
|
|
@@ -507,7 +507,7 @@ const gt = "__intro__", Ft = i("div", {
|
|
|
507
507
|
}), ri = i("button", {
|
|
508
508
|
_id: "aiChatMessageToolAction"
|
|
509
509
|
}), Po = (t) => {
|
|
510
|
-
const { onClick: e, action: a, ...o } = t, { handleAction: s } = me(a), { logEvent: r } =
|
|
510
|
+
const { onClick: e, action: a, ...o } = t, { handleAction: s } = me(a), { logEvent: r } = W(), { conversation: c } = O(), d = () => {
|
|
511
511
|
s(), r({
|
|
512
512
|
eventName: "tool_call_action_clicked",
|
|
513
513
|
properties: {
|
|
@@ -547,7 +547,7 @@ const gt = "__intro__", Ft = i("div", {
|
|
|
547
547
|
}, ci = i("button", {
|
|
548
548
|
_id: "aiChatMessageAction"
|
|
549
549
|
}), Ao = (t) => {
|
|
550
|
-
const { action: e, onClick: a, className: o, ...s } = t, { conversation: r } = O(), { message: c } = _(), { isStreaming: d, messages: m } = v(), [l, u] = X(), { feedback: b, submitPositiveFeedback: I, setCurrentFeedback: y, currentFeedback:
|
|
550
|
+
const { action: e, onClick: a, className: o, ...s } = t, { conversation: r } = O(), { message: c } = _(), { isStreaming: d, messages: m } = v(), [l, u] = X(), { feedback: b, submitPositiveFeedback: I, setCurrentFeedback: y, currentFeedback: N } = re(), { logEvent: G } = W(), [R, z] = it(), {
|
|
551
551
|
baseSettings: { privacyPreferences: he }
|
|
552
552
|
} = C(), { optOutAllAnalytics: Y } = he, ue = m.at(-1)?.id === c?.id, J = c.role === "assistant";
|
|
553
553
|
if (ue && d || !J || {
|
|
@@ -587,7 +587,7 @@ const gt = "__intro__", Ft = i("div", {
|
|
|
587
587
|
},
|
|
588
588
|
downvote: {
|
|
589
589
|
"data-downvoted": p(b[c.id]?.type === "negative"),
|
|
590
|
-
"data-state":
|
|
590
|
+
"data-state": N === null ? "closed" : "open"
|
|
591
591
|
}
|
|
592
592
|
};
|
|
593
593
|
return /* @__PURE__ */ n(
|
|
@@ -630,7 +630,7 @@ const gt = "__intro__", Ft = i("div", {
|
|
|
630
630
|
}, hi = i(qe, {
|
|
631
631
|
_id: "aiChatMessageSourceItem"
|
|
632
632
|
}), Eo = (t) => {
|
|
633
|
-
const { source: e, onClick: a, ...o } = t, { logEvent: s } =
|
|
633
|
+
const { source: e, onClick: a, ...o } = t, { logEvent: s } = W(), { conversation: r } = O(), c = () => {
|
|
634
634
|
s({
|
|
635
635
|
eventName: "assistant_source_item_clicked",
|
|
636
636
|
properties: {
|
|
@@ -717,7 +717,7 @@ const gt = "__intro__", Ft = i("div", {
|
|
|
717
717
|
_id: "aiChatInput__Group"
|
|
718
718
|
}), Fi = i("textarea", {
|
|
719
719
|
_id: "aiChatInput"
|
|
720
|
-
}),
|
|
720
|
+
}), Wo = U(({ onChange: t, onKeyDown: e, ...a }, o) => {
|
|
721
721
|
const { handleInputChange: s, handleInputKeyDown: r, input: c, error: d, shouldAutoFocusInput: m, inputRef: l } = v(), { aiChatSettings: u } = C(), b = le(
|
|
722
722
|
o,
|
|
723
723
|
l
|
|
@@ -739,7 +739,7 @@ const gt = "__intro__", Ft = i("div", {
|
|
|
739
739
|
);
|
|
740
740
|
}), Pi = i("button", {
|
|
741
741
|
_id: "aiChatInput__SendButton"
|
|
742
|
-
}),
|
|
742
|
+
}), No = (t) => {
|
|
743
743
|
const { handleSubmit: e, isSubmitDisabled: a, error: o } = v(), { aiChatSettings: s } = C(), { onClick: r, ...c } = t;
|
|
744
744
|
return /* @__PURE__ */ n(
|
|
745
745
|
Pi,
|
|
@@ -922,12 +922,12 @@ const gt = "__intro__", Ft = i("div", {
|
|
|
922
922
|
...a
|
|
923
923
|
}
|
|
924
924
|
);
|
|
925
|
-
},
|
|
925
|
+
}, Wi = i("span", {
|
|
926
926
|
_id: "aiChatAttachmentsBar__FormTitleError"
|
|
927
927
|
}), hs = (t) => {
|
|
928
928
|
const { form: e } = A();
|
|
929
929
|
return e.errors.title ? /* @__PURE__ */ n(
|
|
930
|
-
|
|
930
|
+
Wi,
|
|
931
931
|
{
|
|
932
932
|
"aria-live": "polite",
|
|
933
933
|
children: e.errors.title,
|
|
@@ -937,12 +937,12 @@ const gt = "__intro__", Ft = i("div", {
|
|
|
937
937
|
}, us = i("div", {
|
|
938
938
|
_id: "aiChatAttachmentsBar__FormTitle",
|
|
939
939
|
role: "group"
|
|
940
|
-
}),
|
|
940
|
+
}), Ni = i("label", {
|
|
941
941
|
_id: "aiChatAttachmentsBar__FormContentLabel"
|
|
942
942
|
}), Cs = (t) => {
|
|
943
943
|
const { form: e, selectedInput: a } = A();
|
|
944
944
|
return /* @__PURE__ */ n(
|
|
945
|
-
|
|
945
|
+
Ni,
|
|
946
946
|
{
|
|
947
947
|
htmlFor: `${a?.id}-content`,
|
|
948
948
|
children: e.labels.content,
|
|
@@ -993,18 +993,18 @@ const gt = "__intro__", Ft = i("div", {
|
|
|
993
993
|
}), Ps = i("span", {
|
|
994
994
|
_id: "aiChatTagline__Text",
|
|
995
995
|
children: "Powered by"
|
|
996
|
-
}), As = i(
|
|
997
|
-
_id: "aiChatTagline__Logo"
|
|
998
|
-
}), Ms = i("a", {
|
|
999
|
-
_id: "aiChatTagline__BrandName",
|
|
1000
|
-
children: "inkeep",
|
|
996
|
+
}), As = i("a", {
|
|
997
|
+
_id: "aiChatTagline__Logo",
|
|
1001
998
|
href: "https://www.inkeep.com/",
|
|
1002
999
|
target: "_blank",
|
|
1003
|
-
rel: "noopener noreferrer"
|
|
1000
|
+
rel: "noopener noreferrer",
|
|
1001
|
+
"aria-label": "Inkeep"
|
|
1002
|
+
}), Ms = i(tt, {
|
|
1003
|
+
_id: "aiChatTagline__LogoIcon"
|
|
1004
1004
|
}), Vi = i(T.Trigger, {
|
|
1005
1005
|
_id: "aiChat__ChatAction"
|
|
1006
1006
|
}), Pe = (t) => {
|
|
1007
|
-
const { action: e, onClick: a, className: o, ...s } = t, { clear: r, stop: c, isLoading: d, messages: m, selectedWorkflow: l } = v(), { conversation: u } = O(), { aiChatSettings: b, baseSettings: I } = C(), { logEvent: y } =
|
|
1007
|
+
const { action: e, onClick: a, className: o, ...s } = t, { clear: r, stop: c, isLoading: d, messages: m, selectedWorkflow: l } = v(), { conversation: u } = O(), { aiChatSettings: b, baseSettings: I } = C(), { logEvent: y } = W(), [N, G] = X(), [R, z] = X();
|
|
1008
1008
|
if ({
|
|
1009
1009
|
help: !1,
|
|
1010
1010
|
copy: m.length === 0 || !b.isCopyChatButtonVisible || d,
|
|
@@ -1067,14 +1067,14 @@ ${S}${V}`;
|
|
|
1067
1067
|
clear: r,
|
|
1068
1068
|
stop: c
|
|
1069
1069
|
}, Ce = {
|
|
1070
|
-
copy:
|
|
1070
|
+
copy: N,
|
|
1071
1071
|
share: R
|
|
1072
1072
|
};
|
|
1073
1073
|
return /* @__PURE__ */ n(T.Tooltip, { delayDuration: 0, open: Ce[e], children: /* @__PURE__ */ n(
|
|
1074
1074
|
Vi,
|
|
1075
1075
|
{
|
|
1076
1076
|
"data-type": e,
|
|
1077
|
-
"data-copied": p(
|
|
1077
|
+
"data-copied": p(N || R),
|
|
1078
1078
|
className: `${o} ${e}`,
|
|
1079
1079
|
children: /* @__PURE__ */ n(Ui, { action: e }),
|
|
1080
1080
|
onClick: h(a, J[e]),
|
|
@@ -1215,7 +1215,7 @@ ${S}${V}`;
|
|
|
1215
1215
|
_id: "aiChatFeedbackModal__Body"
|
|
1216
1216
|
}), Zi = i("form", {
|
|
1217
1217
|
_id: "aiChatFeedbackForm"
|
|
1218
|
-
}),
|
|
1218
|
+
}), Ws = (t) => {
|
|
1219
1219
|
const { onSubmit: e, ...a } = t, { submitNegativeFeedback: o, currentFeedback: s, setCurrentFeedback: r } = re();
|
|
1220
1220
|
return /* @__PURE__ */ n(Zi, { onSubmit: h(e, (d) => {
|
|
1221
1221
|
d.preventDefault();
|
|
@@ -1224,7 +1224,7 @@ ${S}${V}`;
|
|
|
1224
1224
|
}), ...a });
|
|
1225
1225
|
}, ea = i("div", {
|
|
1226
1226
|
_id: "aiChatFeedbackItem"
|
|
1227
|
-
}),
|
|
1227
|
+
}), Ns = (t) => {
|
|
1228
1228
|
const { name: e, ...a } = t;
|
|
1229
1229
|
return /* @__PURE__ */ n(Xe, { name: e, children: /* @__PURE__ */ n(ea, { ...a }) });
|
|
1230
1230
|
}, ta = i(K.Root, {
|
|
@@ -1502,9 +1502,9 @@ ${S}${V}`;
|
|
|
1502
1502
|
}), vr = i(Oe, {
|
|
1503
1503
|
_id: "aiChatForm__FieldCombobox__Trigger",
|
|
1504
1504
|
children: /* @__PURE__ */ n(f, { iconSettings: { builtIn: "LuChevronDown" } })
|
|
1505
|
-
}), _r = i(
|
|
1505
|
+
}), _r = i(We, {
|
|
1506
1506
|
_id: "aiChatForm__FieldCombobox__Positioner"
|
|
1507
|
-
}), gr = i(
|
|
1507
|
+
}), gr = i(Ne, {
|
|
1508
1508
|
_id: "aiChatForm__FieldCombobox__Content"
|
|
1509
1509
|
}), Fr = i(Re, {
|
|
1510
1510
|
_id: "aiChatForm__FieldCombobox__Item"
|
|
@@ -1627,9 +1627,9 @@ export {
|
|
|
1627
1627
|
An as ConversationLoading,
|
|
1628
1628
|
Hn as Disclaimer,
|
|
1629
1629
|
Rn as DisclaimerArrow,
|
|
1630
|
-
|
|
1630
|
+
Wn as DisclaimerContent,
|
|
1631
1631
|
Dn as DisclaimerLabel,
|
|
1632
|
-
|
|
1632
|
+
Nn as DisclaimerText,
|
|
1633
1633
|
On as DisclaimerTrigger,
|
|
1634
1634
|
_s as EmbeddedChatPrimitiveActionBar,
|
|
1635
1635
|
gs as EmbeddedChatPrimitiveActions,
|
|
@@ -1678,17 +1678,17 @@ export {
|
|
|
1678
1678
|
An as EmbeddedChatPrimitiveConversationLoading,
|
|
1679
1679
|
Hn as EmbeddedChatPrimitiveDisclaimer,
|
|
1680
1680
|
Rn as EmbeddedChatPrimitiveDisclaimerArrow,
|
|
1681
|
-
|
|
1681
|
+
Wn as EmbeddedChatPrimitiveDisclaimerContent,
|
|
1682
1682
|
Dn as EmbeddedChatPrimitiveDisclaimerLabel,
|
|
1683
|
-
|
|
1683
|
+
Nn as EmbeddedChatPrimitiveDisclaimerText,
|
|
1684
1684
|
On as EmbeddedChatPrimitiveDisclaimerTrigger,
|
|
1685
1685
|
Un as EmbeddedChatPrimitiveExampleQuestion,
|
|
1686
1686
|
Kn as EmbeddedChatPrimitiveExampleQuestionButton,
|
|
1687
1687
|
$n as EmbeddedChatPrimitiveExampleQuestions,
|
|
1688
1688
|
Vn as EmbeddedChatPrimitiveExampleQuestionsLabel,
|
|
1689
1689
|
Qn as EmbeddedChatPrimitiveExampleQuestionsList,
|
|
1690
|
-
|
|
1691
|
-
|
|
1690
|
+
Ws as EmbeddedChatPrimitiveFeedbackForm,
|
|
1691
|
+
Ns as EmbeddedChatPrimitiveFeedbackItem,
|
|
1692
1692
|
Rs as EmbeddedChatPrimitiveFeedbackItemCheckbox,
|
|
1693
1693
|
$s as EmbeddedChatPrimitiveFeedbackItemCheckboxIndicator,
|
|
1694
1694
|
Qs as EmbeddedChatPrimitiveFeedbackItemDescription,
|
|
@@ -1752,7 +1752,7 @@ export {
|
|
|
1752
1752
|
Ts as EmbeddedChatPrimitiveHelpActionsMenuItem,
|
|
1753
1753
|
ys as EmbeddedChatPrimitiveHelpActionsMenuItemIcon,
|
|
1754
1754
|
Ss as EmbeddedChatPrimitiveHelpActionsTrigger,
|
|
1755
|
-
|
|
1755
|
+
Wo as EmbeddedChatPrimitiveInput,
|
|
1756
1756
|
Do as EmbeddedChatPrimitiveInputFieldset,
|
|
1757
1757
|
Oo as EmbeddedChatPrimitiveInputGroup,
|
|
1758
1758
|
Yn as EmbeddedChatPrimitiveIntroMessageWrapper,
|
|
@@ -1795,11 +1795,11 @@ export {
|
|
|
1795
1795
|
$t as EmbeddedChatPrimitiveMessageWrapper,
|
|
1796
1796
|
Ln as EmbeddedChatPrimitiveMessages,
|
|
1797
1797
|
Mn as EmbeddedChatPrimitiveRoot,
|
|
1798
|
-
|
|
1798
|
+
No as EmbeddedChatPrimitiveSendButton,
|
|
1799
1799
|
Ro as EmbeddedChatPrimitiveSendButtonIcon,
|
|
1800
|
-
Ms as EmbeddedChatPrimitiveTaglineBrandName,
|
|
1801
1800
|
Fs as EmbeddedChatPrimitiveTaglineContainer,
|
|
1802
1801
|
As as EmbeddedChatPrimitiveTaglineLogo,
|
|
1802
|
+
Ms as EmbeddedChatPrimitiveTaglineLogoIcon,
|
|
1803
1803
|
Ps as EmbeddedChatPrimitiveTaglineText,
|
|
1804
1804
|
Sn as EmbeddedChatPrimitiveToolbarHeader,
|
|
1805
1805
|
En as EmbeddedChatPrimitiveToolbarHeaderWrapper,
|
|
@@ -1813,8 +1813,8 @@ export {
|
|
|
1813
1813
|
$n as ExampleQuestions,
|
|
1814
1814
|
Vn as ExampleQuestionsLabel,
|
|
1815
1815
|
Qn as ExampleQuestionsList,
|
|
1816
|
-
|
|
1817
|
-
|
|
1816
|
+
Ws as FeedbackForm,
|
|
1817
|
+
Ns as FeedbackItem,
|
|
1818
1818
|
Rs as FeedbackItemCheckbox,
|
|
1819
1819
|
$s as FeedbackItemCheckboxIndicator,
|
|
1820
1820
|
Qs as FeedbackItemDescription,
|
|
@@ -1880,7 +1880,7 @@ export {
|
|
|
1880
1880
|
Ts as HelpActionsMenuItem,
|
|
1881
1881
|
ys as HelpActionsMenuItemIcon,
|
|
1882
1882
|
Ss as HelpActionsTrigger,
|
|
1883
|
-
|
|
1883
|
+
Wo as Input,
|
|
1884
1884
|
Do as InputFieldset,
|
|
1885
1885
|
Oo as InputGroup,
|
|
1886
1886
|
Yn as IntroMessageWrapper,
|
|
@@ -1925,11 +1925,11 @@ export {
|
|
|
1925
1925
|
Ln as Messages,
|
|
1926
1926
|
Dr as Provider,
|
|
1927
1927
|
Mn as Root,
|
|
1928
|
-
|
|
1928
|
+
No as SendButton,
|
|
1929
1929
|
Ro as SendButtonIcon,
|
|
1930
|
-
Ms as TaglineBrandName,
|
|
1931
1930
|
Fs as TaglineContainer,
|
|
1932
1931
|
As as TaglineLogo,
|
|
1932
|
+
Ms as TaglineLogoIcon,
|
|
1933
1933
|
Ps as TaglineText,
|
|
1934
1934
|
Sn as ToolbarHeader,
|
|
1935
1935
|
zn as Workflow,
|