@inkeep/agents-ui 0.15.16 → 0.15.18

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.
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { jsx as tt } from "react/jsx-runtime";
3
- import { createContext as et, useContext as st, useState as u, useRef as d, useCallback as h, useEffect as G } from "react";
3
+ import { createContext as et, useContext as st, useState as f, useRef as d, useCallback as h, useEffect as W } from "react";
4
4
  import { useChat as nt } from "../components/embedded-chat/chat-provider.js";
5
5
  import { useInkeepConfig as rt } from "./config-provider.js";
6
6
  import { useInkeepApiClient as ot } from "../hooks/use-inkeep-api-client.js";
7
- const U = et(void 0), K = 25;
7
+ const K = et(void 0), G = 25;
8
8
  function it(t) {
9
9
  const {
10
10
  stop: i,
@@ -13,43 +13,43 @@ function it(t) {
13
13
  isStreaming: y,
14
14
  loadAndRestoreSession: P,
15
15
  sessionToken: p,
16
- refreshSession: Z,
17
- getCaptchaHeader: _,
18
- invalidateCaptcha: q
19
- } = nt(), { aiChatSettings: z } = rt(), { baseUrl: C, appId: k, apiKey: B } = z, n = !B && !!k, g = p, { fetchWithAuth: x } = ot({
16
+ refreshSession: U,
17
+ getCaptchaHeader: Z,
18
+ invalidateCaptcha: _
19
+ } = nt(), { aiChatSettings: q } = rt(), { baseUrl: C, appId: k, apiKey: z } = q, r = !z && !!k, g = p, { fetchWithAuth: x } = ot({
20
20
  appId: k,
21
21
  authToken: g,
22
- getCaptchaHeader: _,
23
- invalidateCaptcha: q,
24
- refreshSession: Z
25
- }), [w, m] = u(!1), [E, R] = u([]), [S, $] = u(!1), [L, J] = u(0), [v, Q] = u(!1), A = d(!1), M = d(null), j = d([]);
26
- j.current = E;
27
- const D = d(x);
28
- D.current = x;
29
- const r = h(
30
- async (e, o = !1) => {
31
- if (!(!C || !g || !n)) {
32
- $(!0);
22
+ getCaptchaHeader: Z,
23
+ invalidateCaptcha: _,
24
+ refreshSession: U
25
+ }), [w, m] = f(!1), [E, B] = f([]), [S, $] = f(!1), [L, J] = f(0), [v, Q] = f(!1), A = d(!1), M = d(null), R = d([]);
26
+ R.current = E;
27
+ const j = d(x);
28
+ j.current = x;
29
+ const o = h(
30
+ async (e, s = !1) => {
31
+ if (!(!C || !g || !r)) {
32
+ s || $(!0);
33
33
  try {
34
- const b = `${C}/run/v1/conversations?page=${e + 1}&limit=${K}`, H = await D.current(b);
34
+ const b = `${C}/run/v1/conversations?page=${e + 1}&limit=${G}`, H = await j.current(b);
35
35
  if (!H.ok) throw new Error(`Failed to fetch conversations: ${H.status}`);
36
- const O = await H.json(), l = (O.data ?? []).map((s) => ({
37
- id: s.id,
38
- title: s.title ?? "",
39
- createdAt: new Date(s.createdAt),
40
- updatedAt: new Date(s.updatedAt)
36
+ const F = await H.json(), l = (F.data ?? []).map((n) => ({
37
+ id: n.id,
38
+ title: n.title ?? "",
39
+ createdAt: new Date(n.createdAt),
40
+ updatedAt: new Date(n.updatedAt)
41
41
  }));
42
- R((s) => {
43
- if (e === 0 && !o) return l;
44
- if (e === 0 && o) {
45
- const f = new Set(l.map((I) => I.id));
46
- return [...l, ...s.slice(K).filter((I) => !f.has(I.id))];
42
+ B((n) => {
43
+ if (e === 0 && !s) return l;
44
+ if (e === 0 && s) {
45
+ const u = new Set(l.map((I) => I.id));
46
+ return [...l, ...n.slice(G).filter((I) => !u.has(I.id))];
47
47
  }
48
- const N = new Set(s.map((f) => f.id));
49
- return [...s, ...l.filter((f) => !N.has(f.id))];
48
+ const N = new Set(n.map((u) => u.id));
49
+ return [...n, ...l.filter((u) => !N.has(u.id))];
50
50
  });
51
- const { page: T, pages: W } = O.pagination ?? {};
52
- Q(T != null && W != null ? T < W : !1), o || J(e);
51
+ const { page: O, pages: T } = F.pagination ?? {};
52
+ Q(O != null && T != null ? O < T : !1), s || J(e);
53
53
  } catch (b) {
54
54
  console.error("[useChatHistory] Failed to load conversations:", b);
55
55
  } finally {
@@ -57,29 +57,29 @@ function it(t) {
57
57
  }
58
58
  }
59
59
  },
60
- [C, g, n]
60
+ [C, g, r]
61
61
  );
62
- G(() => {
63
- !w || !p || !n || (t === "stack" ? (R([]), r(0)) : A.current || (A.current = !0, r(0)));
64
- }, [w, p, n, t, r]);
65
- const F = d("");
66
- G(() => {
67
- n && t === "sidepane" && (!c || !y || A.current && F.current !== c && (j.current.some((e) => e.id === c) || (F.current = c, r(0, !0))));
68
- }, [c, n, t, r, y]);
62
+ W(() => {
63
+ !w || !p || !r || (t === "stack" ? o(0) : A.current || (A.current = !0, o(0)));
64
+ }, [w, p, r, t, o]);
65
+ const D = d("");
66
+ W(() => {
67
+ r && t === "sidepane" && (!c || !y || A.current && D.current !== c && (R.current.some((e) => e.id === c) || (D.current = c, o(0, !0))));
68
+ }, [c, r, t, o, y]);
69
69
  const V = h(() => {
70
- !S && v && r(L + 1);
71
- }, [S, v, L, r]), X = h(() => {
70
+ !S && v && o(L + 1);
71
+ }, [S, v, L, o]), X = h(() => {
72
72
  i(), a(), t !== "sidepane" && m(!1);
73
73
  }, [t, i, a]), Y = h(
74
74
  async (e) => {
75
75
  M.current?.abort();
76
- const o = new AbortController();
77
- M.current = o, await P(e, o.signal), !o.signal.aborted && t !== "sidepane" && m(!1);
76
+ const s = new AbortController();
77
+ M.current = s, await P(e, s.signal), !s.signal.aborted && t !== "sidepane" && m(!1);
78
78
  },
79
79
  [t, P]
80
80
  );
81
81
  return {
82
- isEnabled: n,
82
+ isEnabled: r,
83
83
  isOpen: w,
84
84
  setIsOpen: m,
85
85
  sessions: E,
@@ -92,9 +92,9 @@ function it(t) {
92
92
  }
93
93
  const ht = ({ layout: t, children: i }) => {
94
94
  const a = it(t);
95
- return /* @__PURE__ */ tt(U.Provider, { value: a, children: typeof i == "function" ? i(a) : i });
95
+ return /* @__PURE__ */ tt(K.Provider, { value: a, children: typeof i == "function" ? i(a) : i });
96
96
  }, pt = () => {
97
- const t = st(U);
97
+ const t = st(K);
98
98
  if (!t)
99
99
  throw new Error("useChatHistory must be used within a ChatHistoryProvider");
100
100
  return t;
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),f=require("merge-anything"),n=require("react"),t=require("../utils/default-settings.cjs"),m=require("../atoms/shadow/context.cjs"),s={ChatButton:"ChatButton",CustomTrigger:"CustomTrigger",SearchBar:"SearchBar",EmbeddedChat:"EmbeddedChat",EmbeddedSearch:"EmbeddedSearch",EmbeddedSearchAndChat:"EmbeddedSearchAndChat",SidebarChat:"SidebarChat"},a={prefix:"ikp",aiChatSettings:t.defaultInkeepAIChatSettings,baseSettings:t.defaultInkeepBaseSettings,searchSettings:t.defaultInkeepSearchSettings,componentType:s.EmbeddedChat},d=n.createContext(a),p=({children:e,value:r})=>{const c=m.useShadow(),u=(o,i,C)=>["baseSettings","searchSettings","aiChatSettings"].includes(C)&&!i?o:i,g={baseSettings:c??{}},h=n.useMemo(()=>f.mergeAndCompare(u,a,g,r??{}),[r]);return S.jsx(d.Provider,{value:h,children:e})},b=()=>{const e=n.useContext(d);if(!e)throw new Error("useInkeepConfig must be used within a ConfigProvider");return e};exports.InkeepConfigProvider=p;exports.WebWidgetInteractionType=s;exports.useInkeepConfig=b;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),b=require("merge-anything"),r=require("react"),n=require("../utils/default-settings.cjs"),f=require("../atoms/shadow/context.cjs"),s={ChatButton:"ChatButton",CustomTrigger:"CustomTrigger",SearchBar:"SearchBar",EmbeddedChat:"EmbeddedChat",EmbeddedSearch:"EmbeddedSearch",EmbeddedSearchAndChat:"EmbeddedSearchAndChat",SidebarChat:"SidebarChat"},o={prefix:"ikp",aiChatSettings:n.defaultInkeepAIChatSettings,baseSettings:n.defaultInkeepBaseSettings,searchSettings:n.defaultInkeepSearchSettings,componentType:s.EmbeddedChat},d=r.createContext(o),p=({children:t,value:i})=>{const c=f.useShadow(),g=(e,a,C)=>["baseSettings","searchSettings","aiChatSettings"].includes(C)&&!a?e:a,u={baseSettings:c??{}},h=r.useMemo(()=>{const e=b.mergeAndCompare(g,o,u,i??{});return e.aiChatSettings?.baseUrl&&(e.aiChatSettings.baseUrl=e.aiChatSettings.baseUrl.replace(/\/+$/,"")),e},[i]);return S.jsx(d.Provider,{value:h,children:t})},m=()=>{const t=r.useContext(d);if(!t)throw new Error("useInkeepConfig must be used within a ConfigProvider");return t};exports.InkeepConfigProvider=p;exports.WebWidgetInteractionType=s;exports.useInkeepConfig=m;
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import { jsx as m } from "react/jsx-runtime";
3
- import { mergeAndCompare as C } from "merge-anything";
4
- import { useMemo as g, createContext as u, useContext as f } from "react";
5
- import { defaultInkeepSearchSettings as p, defaultInkeepBaseSettings as S, defaultInkeepAIChatSettings as b } from "../utils/default-settings.js";
6
- import { useShadow as I } from "../atoms/shadow/context.js";
7
- const k = {
2
+ import { jsx as C } from "react/jsx-runtime";
3
+ import { mergeAndCompare as g } from "merge-anything";
4
+ import { useMemo as m, createContext as S, useContext as u } from "react";
5
+ import { defaultInkeepSearchSettings as f, defaultInkeepBaseSettings as p, defaultInkeepAIChatSettings as b } from "../utils/default-settings.js";
6
+ import { useShadow as l } from "../atoms/shadow/context.js";
7
+ const I = {
8
8
  ChatButton: "ChatButton",
9
9
  CustomTrigger: "CustomTrigger",
10
10
  SearchBar: "SearchBar",
@@ -12,26 +12,29 @@ const k = {
12
12
  EmbeddedSearch: "EmbeddedSearch",
13
13
  EmbeddedSearchAndChat: "EmbeddedSearchAndChat",
14
14
  SidebarChat: "SidebarChat"
15
- }, o = {
15
+ }, a = {
16
16
  prefix: "ikp",
17
17
  // Default prefix
18
18
  aiChatSettings: b,
19
- baseSettings: S,
20
- searchSettings: p,
21
- componentType: k.EmbeddedChat
22
- }, a = u(o), A = ({ children: e, value: t }) => {
23
- const i = I(), s = (n, r, h) => ["baseSettings", "searchSettings", "aiChatSettings"].includes(h) && !r ? n : r, d = {
19
+ baseSettings: p,
20
+ searchSettings: f,
21
+ componentType: I.EmbeddedChat
22
+ }, o = S(a), A = ({ children: t, value: n }) => {
23
+ const i = l(), s = (e, r, h) => ["baseSettings", "searchSettings", "aiChatSettings"].includes(h) && !r ? e : r, d = {
24
24
  baseSettings: i ?? {}
25
- }, c = g(() => C(s, o, d, t ?? {}), [t]);
26
- return /* @__PURE__ */ m(a.Provider, { value: c, children: e });
25
+ }, c = m(() => {
26
+ const e = g(s, a, d, n ?? {});
27
+ return e.aiChatSettings?.baseUrl && (e.aiChatSettings.baseUrl = e.aiChatSettings.baseUrl.replace(/\/+$/, "")), e;
28
+ }, [n]);
29
+ return /* @__PURE__ */ C(o.Provider, { value: c, children: t });
27
30
  }, T = () => {
28
- const e = f(a);
29
- if (!e)
31
+ const t = u(o);
32
+ if (!t)
30
33
  throw new Error("useInkeepConfig must be used within a ConfigProvider");
31
- return e;
34
+ return t;
32
35
  };
33
36
  export {
34
37
  A as InkeepConfigProvider,
35
- k as WebWidgetInteractionType,
38
+ I as WebWidgetInteractionType,
36
39
  T as useInkeepConfig
37
40
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),t=require("../styled/components/embedded-chat.cjs"),c=require("../styled/components/chat-history.cjs"),j=require("../styled/components/modal.cjs"),k=require("../styled/components/shadow.cjs"),b=require("../styled/components/message.cjs"),T=require("../primitives/providers/chat-history-provider.cjs"),u=require("../primitives/providers/config-provider.cjs"),B=require("../primitives/providers/root-provider.cjs"),y=require("../primitives/providers/widget-provider.cjs"),C=require("../primitives/components/embedded-chat/chat-provider.cjs"),S=require("../primitives/components/modal/modal-provider.cjs"),h=require("../primitives/utils/misc.cjs"),F=require("../primitives/atoms/portal-with-theme.cjs"),H=require("../primitives/atoms/error-boundary.cjs"),E=require("./modal.cjs"),v=require("./widget-toggle.cjs");function w(r){const{baseSettings:s,aiChatSettings:n}=r;return e.jsx(H.ErrorBoundary,{children:e.jsx(k.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(B.RootProvider,{config:{baseSettings:s,aiChatSettings:n},componentType:u.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(A,{...r})})})})}function I(r){const{children:s,onToggleView:n,isHidden:o,shouldAutoFocusInput:i=!n}=r;return e.jsx(t.Provider,{isHidden:o,shouldAutoFocusInput:i,children:s})}function A(r){return e.jsx(I,{...r,children:e.jsx(M,{...r})})}function M(r){const{onToggleView:s,variant:n,header:o=f}=r,i=S.useModal(),d=y.useWidget(),a=i&&!d?E.ModalContent:m.Fragment;return e.jsx(a,{children:e.jsxs(t.Wrapper,{variant:n??(s?"no-shadow":"container-with-shadow"),"data-composite":h.dataAttr(!!r.onToggleView||i?.isOpen),children:[e.jsx(Q,{}),e.jsxs(t.Root,{children:[o&&e.jsx(o,{...r}),e.jsx(L,{}),e.jsx(V,{})]}),e.jsx(R,{}),e.jsx($,{})]})})}const f=r=>{const{onToggleView:s,askAILabel:n,searchLabel:o}=r,{aiChatSettings:i}=u.useInkeepConfig(),d=i.isChatHistoryButtonVisible,a=!!s||d;return e.jsx(t.Header,{"data-show-toolbar":h.dataAttr(a),children:a?e.jsxs(t.HeaderToolbar,{"data-show-widget-toggle":h.dataAttr(!!s),children:[e.jsx(t.HeaderToolbarWrapper,{children:d&&e.jsx(t.ChatHistoryTrigger,{})}),s&&e.jsx(v.WidgetToggle,{onToggleView:s,askAILabel:n,searchLabel:o,view:"chat"}),e.jsx(j.Close,{})]}):e.jsx(j.Close,{})})};function L(){const{isSessionLoading:r}=C.useChat();return e.jsx(t.Content,{children:e.jsxs(t.ContentScrollArea,{children:[e.jsx(t.ContentScrollAreaViewport,{children:r?e.jsx(t.MessagesSessionLoading,{}):e.jsx(P,{})}),e.jsx(t.ContentScrollAreaScrollbar,{children:e.jsx(t.ContentScrollAreaThumb,{})}),e.jsx(t.ContentScrollAreaCorner,{})]})})}function P(){const{aiChatSettings:{components:r}}=u.useInkeepConfig();return e.jsx(t.Messages,{children:({messages:s,isLoading:n})=>{const o=s.at(-1),i=(a,g)=>{const l=r?.[a];if(!l)return console.warn(`Component "${a}" not found in components config`),null;try{if(typeof l=="function"&&l.length<=1)return m.createElement(l,g);const x=l(g,document.createElement("div"),null);return m.isValidElement(x)||typeof x=="string"?x:null}catch(x){return console.error(`🔍 [renderComponent] Error rendering component "${a}":`,x),null}},d=a=>e.jsx(t.Markdown,{text:a});return e.jsxs(e.Fragment,{children:[e.jsx(D,{}),s.map(a=>e.jsxs(t.MessageWrapper,{message:a,children:[e.jsx(p,{}),e.jsxs(t.MessageContentWrapper,{children:[e.jsx(t.MessageContent,{children:r?.IkpMessage?e.jsx(t.DynamicComponent,{name:"IkpMessage",props:{message:a,renderComponent:i,renderMarkdown:d},componentDef:r.IkpMessage}):e.jsxs(e.Fragment,{children:[e.jsx(b.EmbeddedChatMessagePart,{isLast:o?.id===a.id}),e.jsx(_,{})]})}),e.jsx(W,{}),e.jsx(q,{})]})]},a.id)),n&&o?.parts.length&&e.jsxs(t.MessageWrapper,{message:{id:"___loader___",role:"assistant",parts:[{type:"text",text:"Thinking..."}]},children:[e.jsx(p,{}),e.jsx(t.MessageLoading,{})]})]})}})}function D(){return e.jsxs(t.IntroMessageWrapper,{children:[e.jsxs(t.MessageHeader,{children:[e.jsx(t.MessageAvatar,{children:e.jsx(t.MessageAvatarContent,{children:e.jsx(t.MessageAvatarImage,{})})}),e.jsx(t.MessageName,{})]}),e.jsxs(t.MessageContentWrapper,{children:[e.jsx(t.MessageContent,{children:e.jsx(b.EmbeddedChatMessagePart,{isLast:!1})}),e.jsxs(t.Disclaimer,{children:[e.jsx(t.DisclaimerLabel,{}),e.jsx(t.DisclaimerTrigger,{}),e.jsxs(t.DisclaimerContent,{children:[e.jsx(t.DisclaimerText,{}),e.jsx(t.DisclaimerArrow,{})]})]}),e.jsxs(t.ExampleQuestions,{children:[e.jsx(t.ExampleQuestionsLabel,{}),e.jsx(t.ExampleQuestionsList,{children:r=>r.map(s=>e.jsx(t.ExampleQuestion,{children:e.jsx(t.ExampleQuestionButton,{question:s})},typeof s=="object"?s.label:s))})]})]})]})}function p(){return e.jsxs(t.MessageHeader,{children:[e.jsx(t.MessageAvatar,{children:e.jsx(t.MessageAvatarContent,{children:e.jsx(t.MessageAvatarImage,{})})}),e.jsx(t.MessageName,{})]})}function W(){return e.jsxs(t.MessageAttachments,{children:[e.jsx(t.MessageAttachmentsList,{children:r=>r.map(s=>e.jsxs(t.MessageAttachmentsItem,{attachment:s,children:[e.jsx(t.MessageAttachmentsItemIcon,{}),e.jsx(t.MessageAttachmentsItemTitle,{})]},s.id))}),e.jsx(t.MessageAttachmentsPreview,{children:e.jsx(F.PortalWithTheme,{children:e.jsx(t.MessageAttachmentsPreviewOverlay,{children:e.jsxs(t.MessageAttachmentsPreviewContent,{children:[e.jsx(t.MessageAttachmentsPreviewHeader,{}),e.jsx(t.MessageAttachmentsPreviewClose,{}),e.jsx(t.MessageAttachmentsPreviewBody,{})]})})})})]})}function q(){return e.jsxs(t.MessageToolbar,{children:[e.jsx(t.MessageCustomActions,{children:r=>r.map((s,n)=>e.jsx(t.MessageCustomAction,{action:s},`action-${n}`))}),e.jsx(t.MessageAction,{action:"copy"}),e.jsx(t.MessageAction,{action:"upvote"}),e.jsx(t.MessageAction,{action:"downvote"})]})}function _(){return e.jsxs(t.MessageSources,{children:[e.jsx(t.MessageSourcesHeader,{}),e.jsx(t.MessageSourcesList,{children:r=>r.map((s,n)=>e.jsxs(t.MessageSourceItem,{href:s.url,source:s,children:[e.jsx(t.MessageSourceItemBreadcrumbs,{children:s.breadcrumbs?.map(o=>e.jsxs(m.Fragment,{children:[o,e.jsx(t.MessageSourceItemBreadcrumbIcon,{})]},o))}),e.jsx(t.MessageSourceItemIcon,{}),e.jsx(t.MessageSourceItemTitle,{}),e.jsx(t.MessageSourceItemTag,{}),e.jsx(t.MessageSourceItemDescription,{children:o=>o.map((i,d)=>e.jsx(t.MessageSourceItemDescriptionPart,{part:i},`part-${d}`))}),e.jsx(t.MessageSourceItemIndicator,{})]},n))})]})}function V(){return e.jsxs(t.Footer,{children:[e.jsx(N,{}),e.jsx(O,{})]})}function N(){return e.jsxs(t.InputFieldset,{children:[e.jsxs(t.InputGroup,{children:[e.jsx(t.Input,{}),e.jsx(t.SendButton,{children:e.jsx(t.SendButtonIcon,{})})]}),e.jsxs(t.AttachmentsBar,{children:[e.jsx(t.AttachmentsBarList,{children:r=>r.map(s=>e.jsxs(t.AttachmentsBarAttachment,{attachment:s,children:[e.jsx(t.AttachmentsBarAttachmentIcon,{}),e.jsx(t.AttachmentsBarAttachmentTitle,{}),e.jsx(t.AttachmentsBarAttachmentDelete,{})]},s.id))}),e.jsxs(t.AttachmentsBarActions,{children:[e.jsxs(t.AttachmentsBarInfoTip,{children:[e.jsx(t.AttachmentsBarInfoTipIcon,{}),e.jsx(t.AttachmentsBarInfoTipText,{})]}),e.jsx(t.AttachmentsBarInputs,{children:r=>r.map(s=>e.jsx(t.AttachmentsBarInput,{input:s,children:s.displayName},s.id))})]}),e.jsx(F.PortalWithTheme,{children:e.jsx(t.AttachmentsBarModal,{children:e.jsx(t.AttachmentsBarModalOverlay,{children:e.jsxs(t.AttachmentsBarModalContent,{children:[e.jsxs(t.AttachmentsBarModalHeader,{children:[e.jsx(t.AttachmentsBarModalHeading,{}),e.jsx(t.AttachmentsBarModalDescription,{}),e.jsx(t.AttachmentsBarModalHelp,{})]}),e.jsx(t.AttachmentsBarModalClose,{}),e.jsx(t.AttachmentsBarModalBody,{children:e.jsxs(t.AttachmentsBarForm,{children:[e.jsxs(t.AttachmentsBarFormTitle,{children:[e.jsx(t.AttachmentsBarFormTitleLabel,{}),e.jsx(t.AttachmentsBarFormTitleInput,{}),e.jsx(t.AttachmentsBarFormTitleError,{})]}),e.jsxs(t.AttachmentsBarFormContent,{children:[e.jsx(t.AttachmentsBarFormContentLabel,{}),e.jsx(t.AttachmentsBarFormContentInput,{}),e.jsx(t.AttachmentsBarFormContentError,{})]}),e.jsx(t.AttachmentsBarFormSubmitButton,{})]})})]})})})})]})]})}function O(){return e.jsxs(t.ActionBar,{children:[e.jsxs(t.TaglineContainer,{children:[e.jsx(t.TaglineText,{}),e.jsx(t.TaglineLogo,{}),e.jsx(t.TaglineBrandName,{})]}),e.jsxs(t.Actions,{children:[e.jsx(t.HelpActions,{children:({pinned:r,unpinned:s})=>e.jsxs(e.Fragment,{children:[r.map(n=>e.jsx(t.HelpAction,{action:n},n.name)),s.length>0&&e.jsx(t.HelpActionsTrigger,{}),e.jsxs(t.HelpActionsMenu,{children:[e.jsx(t.HelpActionsMenuArrow,{}),s.map(n=>e.jsxs(t.HelpActionsMenuItem,{action:n,children:[e.jsx(t.HelpActionsMenuItemIcon,{action:n}),n.name]},n.name))]})]})}),e.jsxs(t.ChatAction,{action:"copy",children:[e.jsx(t.ChatActionLabel,{action:"copy"}),e.jsx(t.ChatActionFeedback,{action:"copy"})]}),e.jsx(t.ChatAction,{action:"clear"}),e.jsx(t.ChatAction,{action:"stop"})]})]})}function Q(){const{sessions:r}=T.useChatHistory(),{conversationId:s}=C.useChat();return e.jsxs(c.EmbeddedChatHistoryRoot,{children:[e.jsxs(c.EmbeddedChatHistoryHeader,{children:[e.jsxs(c.EmbeddedChatHistoryBackButton,{children:[e.jsx(c.EmbeddedChatHistoryBackButtonIcon,{iconKey:"backToChat"}),"Back to chat"]}),e.jsx(c.EmbeddedChatHistoryTitle,{}),e.jsx(j.Close,{})]}),e.jsxs(c.EmbeddedChatHistoryList,{children:[r.map(n=>e.jsxs(c.EmbeddedChatHistoryItem,{sessionId:n.id,"data-active":h.dataAttr(n.id===s),children:[e.jsx(c.EmbeddedChatHistoryItemTitle,{children:n.title}),e.jsx(c.EmbeddedChatHistoryItemDate,{children:c.formatSessionDate(n.updatedAt)})]},n.id)),e.jsx(c.EmbeddedChatHistoryEmptyState,{}),e.jsx(c.EmbeddedChatHistoryLoadingState,{})]}),e.jsx(c.EmbeddedChatHistoryFooter,{children:e.jsx(c.EmbeddedChatHistoryNewConversationButton,{})})]})}function R(){return e.jsx(F.PortalWithTheme,{children:e.jsx(t.FeedbackModal,{children:e.jsx(t.FeedbackModalOverlay,{children:e.jsxs(t.FeedbackModalContent,{children:[e.jsx(t.FeedbackModalHeader,{}),e.jsx(t.FeedbackModalClose,{}),e.jsx(t.FeedbackModalBody,{children:e.jsxs(t.FeedbackForm,{children:[e.jsxs(t.FeedbackItem,{name:"unrelated_response",children:[e.jsx(t.FeedbackItemCheckbox,{children:e.jsx(t.FeedbackItemCheckboxIndicator,{})}),e.jsx(t.FeedbackItemLabel,{}),e.jsx(t.FeedbackItemDescription,{})]}),e.jsxs(t.FeedbackItem,{name:"inaccurate_statement",children:[e.jsx(t.FeedbackItemCheckbox,{children:e.jsx(t.FeedbackItemCheckboxIndicator,{})}),e.jsx(t.FeedbackItemLabel,{}),e.jsx(t.FeedbackItemDescription,{})]}),e.jsxs(t.FeedbackItem,{name:"inaccurate_code_snippet",children:[e.jsx(t.FeedbackItemCheckbox,{children:e.jsx(t.FeedbackItemCheckboxIndicator,{})}),e.jsx(t.FeedbackItemLabel,{}),e.jsx(t.FeedbackItemDescription,{})]}),e.jsxs(t.FeedbackItem,{name:"irrelevant_citations",children:[e.jsx(t.FeedbackItemCheckbox,{children:e.jsx(t.FeedbackItemCheckboxIndicator,{})}),e.jsx(t.FeedbackItemLabel,{})]}),e.jsx(t.FeedbackSubmitButton,{})]})})]})})})})}function $(){return e.jsxs(t.FormWrapper,{children:[e.jsx(t.FormClose,{}),e.jsxs(t.Form,{children:[e.jsxs(t.FormHeader,{children:[e.jsx(t.FormHeading,{}),e.jsx(t.FormDescription,{})]}),e.jsx(t.FormContent,{children:r=>e.jsxs(e.Fragment,{children:[r.map((s,n)=>e.jsxs(t.FormField,{field:s,autoFocus:n===0,children:[e.jsx(t.FormFieldLabel,{}),s.inputType==="text"&&e.jsx(t.FormFieldText,{}),s.inputType==="email"&&e.jsx(t.FormFieldEmail,{}),s.inputType==="file"&&e.jsx(t.FormFieldFile,{}),s.inputType==="textarea"&&e.jsx(t.FormFieldTextArea,{}),s.inputType==="checkbox"&&e.jsx(t.FormFieldCheckbox,{children:e.jsx(t.FormFieldCheckboxIndicator,{})}),s.inputType==="select"&&e.jsxs(t.FormFieldSelect,{children:[e.jsxs(t.FormFieldSelectTrigger,{children:[e.jsx(t.FormFieldSelectValue,{}),e.jsx(t.FormFieldSelectIcon,{})]}),e.jsx(t.FormFieldSelectContent,{children:e.jsx(t.FormFieldSelectViewport,{children:s.items.map(o=>e.jsxs(t.FormFieldSelectItem,{value:o.value,children:[e.jsx(t.FormFieldSelectItemText,{children:o.label}),e.jsx(t.FormFieldSelectItemIndicator,{})]},o.value))})})]}),s.inputType==="combobox"&&e.jsxs(t.FormFieldCombobox,{children:[e.jsxs(t.FormFieldComboboxControl,{children:["multiple"in s&&s.multiple&&e.jsx(t.FormFieldComboboxSelectedTags,{}),e.jsx(t.FormFieldComboboxInput,{}),e.jsx(t.FormFieldComboboxTrigger,{})]}),e.jsx(t.FormFieldComboboxPositioner,{children:e.jsx(t.FormFieldComboboxContent,{children:e.jsx(t.FormFieldComboboxList,{children:e.jsx(t.FormFieldComboboxListItems,{children:o=>o.length===0?e.jsx(t.FormFieldComboboxListEmpty,{}):o.map(i=>e.jsxs(t.FormFieldComboboxItem,{item:i,children:[e.jsx(t.FormFieldComboboxItemText,{children:i.label}),e.jsx(t.FormFieldComboboxItemIndicator,{})]},i.value))})})})})]}),e.jsx(t.FormFieldDescription,{}),e.jsx(t.FormFieldError,{})]},s.name)),e.jsx(t.FormError,{})]})}),e.jsxs(t.FormFooter,{children:[e.jsx(t.FormCancel,{}),e.jsx(t.FormSubmit,{})]})]}),e.jsxs(t.FormSuccess,{children:[e.jsx(t.FormSuccessHeading,{}),e.jsx(t.FormSuccessMessage,{}),e.jsx(t.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=w;exports.InkeepEmbeddedChatImpl=A;exports.InkeepEmbeddedChatImplContent=M;exports.InkeepEmbeddedChatProvider=I;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),t=require("../styled/components/embedded-chat.cjs"),i=require("../styled/components/chat-history.cjs"),F=require("../styled/components/modal.cjs"),T=require("../styled/components/shadow.cjs"),C=require("../styled/components/message.cjs"),B=require("../primitives/providers/chat-history-provider.cjs"),g=require("../primitives/providers/config-provider.cjs"),y=require("../primitives/providers/root-provider.cjs"),S=require("../primitives/providers/widget-provider.cjs"),I=require("../primitives/components/embedded-chat/chat-provider.cjs"),H=require("../primitives/components/modal/modal-provider.cjs"),u=require("../primitives/utils/misc.cjs"),p=require("../primitives/atoms/portal-with-theme.cjs"),E=require("../primitives/atoms/error-boundary.cjs"),v=require("./modal.cjs"),w=require("./widget-toggle.cjs");function f(r){const{baseSettings:s,aiChatSettings:n}=r;return e.jsx(E.ErrorBoundary,{children:e.jsx(T.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(y.RootProvider,{config:{baseSettings:s,aiChatSettings:n},componentType:g.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(M,{...r})})})})}function A(r){const{children:s,onToggleView:n,isHidden:o,shouldAutoFocusInput:a=!n}=r;return e.jsx(t.Provider,{isHidden:o,shouldAutoFocusInput:a,children:s})}function M(r){return e.jsx(A,{...r,children:e.jsx(k,{...r})})}function k(r){const{onToggleView:s,variant:n,header:o=L}=r,a=H.useModal(),d=S.useWidget(),l=a&&!d?v.ModalContent:j.Fragment;return e.jsx(l,{children:e.jsxs(t.Wrapper,{variant:n??(s?"no-shadow":"container-with-shadow"),"data-composite":u.dataAttr(!!r.onToggleView||a?.isOpen),children:[e.jsx(R,{}),e.jsxs(t.Root,{children:[o&&e.jsx(o,{...r}),e.jsx(P,{}),e.jsx(N,{})]}),e.jsx($,{}),e.jsx(G,{})]})})}const L=r=>{const{onToggleView:s,askAILabel:n,searchLabel:o}=r,{aiChatSettings:a}=g.useInkeepConfig(),d=a.isChatHistoryButtonVisible,l=!!s||d;return e.jsx(t.Header,{"data-show-toolbar":u.dataAttr(l),children:l?e.jsxs(t.HeaderToolbar,{"data-show-widget-toggle":u.dataAttr(!!s),children:[e.jsx(t.HeaderToolbarWrapper,{children:d&&e.jsx(t.ChatHistoryTrigger,{})}),s&&e.jsx(w.WidgetToggle,{onToggleView:s,askAILabel:n,searchLabel:o,view:"chat"}),e.jsx(F.Close,{})]}):e.jsx(F.Close,{})})};function P(){const{isSessionLoading:r}=I.useChat();return e.jsx(t.Content,{children:e.jsxs(t.ContentScrollArea,{children:[e.jsx(t.ContentScrollAreaViewport,{children:r?e.jsx(t.MessagesSessionLoading,{}):e.jsx(D,{})}),e.jsx(t.ContentScrollAreaScrollbar,{children:e.jsx(t.ContentScrollAreaThumb,{})}),e.jsx(t.ContentScrollAreaCorner,{})]})})}function D(){const{aiChatSettings:{components:r}}=g.useInkeepConfig();return e.jsx(t.Messages,{children:({messages:s,isLoading:n,isStreaming:o})=>{const a=s.at(-1),d=(c,x)=>{const m=r?.[c];if(!m)return console.warn(`Component "${c}" not found in components config`),null;try{if(typeof m=="function"&&m.length<=1)return j.createElement(m,x);const h=m(x,document.createElement("div"),null);return j.isValidElement(h)||typeof h=="string"?h:null}catch(h){return console.error(`🔍 [renderComponent] Error rendering component "${c}":`,h),null}},l=c=>e.jsx(t.Markdown,{text:c});return e.jsxs(e.Fragment,{children:[e.jsx(W,{}),s.map(c=>{const x=a?.id===c.id;return e.jsxs(t.MessageWrapper,{message:c,children:[e.jsx(b,{}),e.jsxs(t.MessageContentWrapper,{children:[e.jsx(t.MessageContent,{children:r?.IkpMessage?e.jsx(t.DynamicComponent,{name:"IkpMessage",props:{message:c,renderComponent:d,renderMarkdown:l},componentDef:r.IkpMessage}):e.jsxs(e.Fragment,{children:[e.jsx(C.EmbeddedChatMessagePart,{isLast:x}),(!o||!x)&&e.jsx(V,{})]})}),e.jsx(q,{}),e.jsx(_,{})]})]},c.id)}),n&&a?.parts.length&&e.jsxs(t.MessageWrapper,{message:{id:"___loader___",role:"assistant",parts:[{type:"text",text:"Thinking..."}]},children:[e.jsx(b,{}),e.jsx(t.MessageLoading,{})]})]})}})}function W(){return e.jsxs(t.IntroMessageWrapper,{children:[e.jsxs(t.MessageHeader,{children:[e.jsx(t.MessageAvatar,{children:e.jsx(t.MessageAvatarContent,{children:e.jsx(t.MessageAvatarImage,{})})}),e.jsx(t.MessageName,{})]}),e.jsxs(t.MessageContentWrapper,{children:[e.jsx(t.MessageContent,{children:e.jsx(C.EmbeddedChatMessagePart,{isLast:!1})}),e.jsxs(t.Disclaimer,{children:[e.jsx(t.DisclaimerLabel,{}),e.jsx(t.DisclaimerTrigger,{}),e.jsxs(t.DisclaimerContent,{children:[e.jsx(t.DisclaimerText,{}),e.jsx(t.DisclaimerArrow,{})]})]}),e.jsxs(t.ExampleQuestions,{children:[e.jsx(t.ExampleQuestionsLabel,{}),e.jsx(t.ExampleQuestionsList,{children:r=>r.map(s=>e.jsx(t.ExampleQuestion,{children:e.jsx(t.ExampleQuestionButton,{question:s})},typeof s=="object"?s.label:s))})]})]})]})}function b(){return e.jsxs(t.MessageHeader,{children:[e.jsx(t.MessageAvatar,{children:e.jsx(t.MessageAvatarContent,{children:e.jsx(t.MessageAvatarImage,{})})}),e.jsx(t.MessageName,{})]})}function q(){return e.jsxs(t.MessageAttachments,{children:[e.jsx(t.MessageAttachmentsList,{children:r=>r.map(s=>e.jsxs(t.MessageAttachmentsItem,{attachment:s,children:[e.jsx(t.MessageAttachmentsItemIcon,{}),e.jsx(t.MessageAttachmentsItemTitle,{})]},s.id))}),e.jsx(t.MessageAttachmentsPreview,{children:e.jsx(p.PortalWithTheme,{children:e.jsx(t.MessageAttachmentsPreviewOverlay,{children:e.jsxs(t.MessageAttachmentsPreviewContent,{children:[e.jsx(t.MessageAttachmentsPreviewHeader,{}),e.jsx(t.MessageAttachmentsPreviewClose,{}),e.jsx(t.MessageAttachmentsPreviewBody,{})]})})})})]})}function _(){return e.jsxs(t.MessageToolbar,{children:[e.jsx(t.MessageCustomActions,{children:r=>r.map((s,n)=>e.jsx(t.MessageCustomAction,{action:s},`action-${n}`))}),e.jsx(t.MessageAction,{action:"copy"}),e.jsx(t.MessageAction,{action:"upvote"}),e.jsx(t.MessageAction,{action:"downvote"})]})}function V(){return e.jsxs(t.MessageSources,{children:[e.jsx(t.MessageSourcesHeader,{}),e.jsx(t.MessageSourcesList,{children:r=>r.map((s,n)=>e.jsxs(t.MessageSourceItem,{href:s.url,source:s,children:[e.jsx(t.MessageSourceItemBreadcrumbs,{children:s.breadcrumbs?.map(o=>e.jsxs(j.Fragment,{children:[o,e.jsx(t.MessageSourceItemBreadcrumbIcon,{})]},o))}),e.jsx(t.MessageSourceItemIcon,{}),e.jsx(t.MessageSourceItemTitle,{}),e.jsx(t.MessageSourceItemTag,{}),e.jsx(t.MessageSourceItemDescription,{children:o=>o.map((a,d)=>e.jsx(t.MessageSourceItemDescriptionPart,{part:a},`part-${d}`))}),e.jsx(t.MessageSourceItemIndicator,{})]},n))})]})}function N(){return e.jsxs(t.Footer,{children:[e.jsx(O,{}),e.jsx(Q,{})]})}function O(){return e.jsxs(t.InputFieldset,{children:[e.jsxs(t.InputGroup,{children:[e.jsx(t.Input,{}),e.jsx(t.SendButton,{children:e.jsx(t.SendButtonIcon,{})})]}),e.jsxs(t.AttachmentsBar,{children:[e.jsx(t.AttachmentsBarList,{children:r=>r.map(s=>e.jsxs(t.AttachmentsBarAttachment,{attachment:s,children:[e.jsx(t.AttachmentsBarAttachmentIcon,{}),e.jsx(t.AttachmentsBarAttachmentTitle,{}),e.jsx(t.AttachmentsBarAttachmentDelete,{})]},s.id))}),e.jsxs(t.AttachmentsBarActions,{children:[e.jsxs(t.AttachmentsBarInfoTip,{children:[e.jsx(t.AttachmentsBarInfoTipIcon,{}),e.jsx(t.AttachmentsBarInfoTipText,{})]}),e.jsx(t.AttachmentsBarInputs,{children:r=>r.map(s=>e.jsx(t.AttachmentsBarInput,{input:s,children:s.displayName},s.id))})]}),e.jsx(p.PortalWithTheme,{children:e.jsx(t.AttachmentsBarModal,{children:e.jsx(t.AttachmentsBarModalOverlay,{children:e.jsxs(t.AttachmentsBarModalContent,{children:[e.jsxs(t.AttachmentsBarModalHeader,{children:[e.jsx(t.AttachmentsBarModalHeading,{}),e.jsx(t.AttachmentsBarModalDescription,{}),e.jsx(t.AttachmentsBarModalHelp,{})]}),e.jsx(t.AttachmentsBarModalClose,{}),e.jsx(t.AttachmentsBarModalBody,{children:e.jsxs(t.AttachmentsBarForm,{children:[e.jsxs(t.AttachmentsBarFormTitle,{children:[e.jsx(t.AttachmentsBarFormTitleLabel,{}),e.jsx(t.AttachmentsBarFormTitleInput,{}),e.jsx(t.AttachmentsBarFormTitleError,{})]}),e.jsxs(t.AttachmentsBarFormContent,{children:[e.jsx(t.AttachmentsBarFormContentLabel,{}),e.jsx(t.AttachmentsBarFormContentInput,{}),e.jsx(t.AttachmentsBarFormContentError,{})]}),e.jsx(t.AttachmentsBarFormSubmitButton,{})]})})]})})})})]})]})}function Q(){return e.jsxs(t.ActionBar,{children:[e.jsxs(t.TaglineContainer,{children:[e.jsx(t.TaglineText,{}),e.jsx(t.TaglineLogo,{}),e.jsx(t.TaglineBrandName,{})]}),e.jsxs(t.Actions,{children:[e.jsx(t.HelpActions,{children:({pinned:r,unpinned:s})=>e.jsxs(e.Fragment,{children:[r.map(n=>e.jsx(t.HelpAction,{action:n},n.name)),s.length>0&&e.jsx(t.HelpActionsTrigger,{}),e.jsxs(t.HelpActionsMenu,{children:[e.jsx(t.HelpActionsMenuArrow,{}),s.map(n=>e.jsxs(t.HelpActionsMenuItem,{action:n,children:[e.jsx(t.HelpActionsMenuItemIcon,{action:n}),n.name]},n.name))]})]})}),e.jsxs(t.ChatAction,{action:"copy",children:[e.jsx(t.ChatActionLabel,{action:"copy"}),e.jsx(t.ChatActionFeedback,{action:"copy"})]}),e.jsx(t.ChatAction,{action:"clear"}),e.jsx(t.ChatAction,{action:"stop"})]})]})}function R(){const{sessions:r}=B.useChatHistory(),{conversationId:s}=I.useChat();return e.jsxs(i.EmbeddedChatHistoryRoot,{children:[e.jsxs(i.EmbeddedChatHistoryHeader,{children:[e.jsxs(i.EmbeddedChatHistoryBackButton,{children:[e.jsx(i.EmbeddedChatHistoryBackButtonIcon,{iconKey:"backToChat"}),"Back to chat"]}),e.jsx(i.EmbeddedChatHistoryTitle,{}),e.jsx(F.Close,{})]}),e.jsxs(i.EmbeddedChatHistoryList,{children:[r.map(n=>e.jsxs(i.EmbeddedChatHistoryItem,{sessionId:n.id,"data-active":u.dataAttr(n.id===s),children:[e.jsx(i.EmbeddedChatHistoryItemTitle,{children:n.title}),e.jsx(i.EmbeddedChatHistoryItemDate,{children:i.formatSessionDate(n.updatedAt)})]},n.id)),e.jsx(i.EmbeddedChatHistoryEmptyState,{}),e.jsx(i.EmbeddedChatHistoryLoadingState,{})]}),e.jsx(i.EmbeddedChatHistoryFooter,{children:e.jsx(i.EmbeddedChatHistoryNewConversationButton,{})})]})}function $(){return e.jsx(p.PortalWithTheme,{children:e.jsx(t.FeedbackModal,{children:e.jsx(t.FeedbackModalOverlay,{children:e.jsxs(t.FeedbackModalContent,{children:[e.jsx(t.FeedbackModalHeader,{}),e.jsx(t.FeedbackModalClose,{}),e.jsx(t.FeedbackModalBody,{children:e.jsxs(t.FeedbackForm,{children:[e.jsxs(t.FeedbackItem,{name:"unrelated_response",children:[e.jsx(t.FeedbackItemCheckbox,{children:e.jsx(t.FeedbackItemCheckboxIndicator,{})}),e.jsx(t.FeedbackItemLabel,{}),e.jsx(t.FeedbackItemDescription,{})]}),e.jsxs(t.FeedbackItem,{name:"inaccurate_statement",children:[e.jsx(t.FeedbackItemCheckbox,{children:e.jsx(t.FeedbackItemCheckboxIndicator,{})}),e.jsx(t.FeedbackItemLabel,{}),e.jsx(t.FeedbackItemDescription,{})]}),e.jsxs(t.FeedbackItem,{name:"inaccurate_code_snippet",children:[e.jsx(t.FeedbackItemCheckbox,{children:e.jsx(t.FeedbackItemCheckboxIndicator,{})}),e.jsx(t.FeedbackItemLabel,{}),e.jsx(t.FeedbackItemDescription,{})]}),e.jsxs(t.FeedbackItem,{name:"irrelevant_citations",children:[e.jsx(t.FeedbackItemCheckbox,{children:e.jsx(t.FeedbackItemCheckboxIndicator,{})}),e.jsx(t.FeedbackItemLabel,{})]}),e.jsx(t.FeedbackSubmitButton,{})]})})]})})})})}function G(){return e.jsxs(t.FormWrapper,{children:[e.jsx(t.FormClose,{}),e.jsxs(t.Form,{children:[e.jsxs(t.FormHeader,{children:[e.jsx(t.FormHeading,{}),e.jsx(t.FormDescription,{})]}),e.jsx(t.FormContent,{children:r=>e.jsxs(e.Fragment,{children:[r.map((s,n)=>e.jsxs(t.FormField,{field:s,autoFocus:n===0,children:[e.jsx(t.FormFieldLabel,{}),s.inputType==="text"&&e.jsx(t.FormFieldText,{}),s.inputType==="email"&&e.jsx(t.FormFieldEmail,{}),s.inputType==="file"&&e.jsx(t.FormFieldFile,{}),s.inputType==="textarea"&&e.jsx(t.FormFieldTextArea,{}),s.inputType==="checkbox"&&e.jsx(t.FormFieldCheckbox,{children:e.jsx(t.FormFieldCheckboxIndicator,{})}),s.inputType==="select"&&e.jsxs(t.FormFieldSelect,{children:[e.jsxs(t.FormFieldSelectTrigger,{children:[e.jsx(t.FormFieldSelectValue,{}),e.jsx(t.FormFieldSelectIcon,{})]}),e.jsx(t.FormFieldSelectContent,{children:e.jsx(t.FormFieldSelectViewport,{children:s.items.map(o=>e.jsxs(t.FormFieldSelectItem,{value:o.value,children:[e.jsx(t.FormFieldSelectItemText,{children:o.label}),e.jsx(t.FormFieldSelectItemIndicator,{})]},o.value))})})]}),s.inputType==="combobox"&&e.jsxs(t.FormFieldCombobox,{children:[e.jsxs(t.FormFieldComboboxControl,{children:["multiple"in s&&s.multiple&&e.jsx(t.FormFieldComboboxSelectedTags,{}),e.jsx(t.FormFieldComboboxInput,{}),e.jsx(t.FormFieldComboboxTrigger,{})]}),e.jsx(t.FormFieldComboboxPositioner,{children:e.jsx(t.FormFieldComboboxContent,{children:e.jsx(t.FormFieldComboboxList,{children:e.jsx(t.FormFieldComboboxListItems,{children:o=>o.length===0?e.jsx(t.FormFieldComboboxListEmpty,{}):o.map(a=>e.jsxs(t.FormFieldComboboxItem,{item:a,children:[e.jsx(t.FormFieldComboboxItemText,{children:a.label}),e.jsx(t.FormFieldComboboxItemIndicator,{})]},a.value))})})})})]}),e.jsx(t.FormFieldDescription,{}),e.jsx(t.FormFieldError,{})]},s.name)),e.jsx(t.FormError,{})]})}),e.jsxs(t.FormFooter,{children:[e.jsx(t.FormCancel,{}),e.jsx(t.FormSubmit,{})]})]}),e.jsxs(t.FormSuccess,{children:[e.jsx(t.FormSuccessHeading,{}),e.jsx(t.FormSuccessMessage,{}),e.jsx(t.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=f;exports.InkeepEmbeddedChatImpl=M;exports.InkeepEmbeddedChatImplContent=k;exports.InkeepEmbeddedChatProvider=A;