@inkeep/agents-ui 0.16.0 → 0.16.2
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/color-mode/index.js +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +167 -161
- package/dist/node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +9 -0
- package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +2 -2
- package/dist/primitives/atoms/cmdk/index.cjs +1 -1
- package/dist/primitives/atoms/cmdk/index.js +14 -2
- package/dist/primitives/atoms/combobox.d.ts +104 -0
- package/dist/primitives/atoms/icons/built-in-icons.cjs +1 -1
- package/dist/primitives/atoms/icons/built-in-icons.d.ts +4 -1
- package/dist/primitives/atoms/icons/built-in-icons.js +94 -91
- package/dist/primitives/atoms/icons/collections/pi.cjs +1 -1
- package/dist/primitives/atoms/icons/collections/pi.d.ts +3 -0
- package/dist/primitives/atoms/icons/collections/pi.js +82 -37
- package/dist/primitives/atoms/icons/inkeep-default-icons.cjs +1 -1
- package/dist/primitives/atoms/icons/inkeep-default-icons.js +4 -1
- package/dist/primitives/atoms/portal.js +3 -3
- package/dist/primitives/atoms/select.cjs +1 -1
- package/dist/primitives/atoms/select.js +2 -2
- package/dist/primitives/atoms/shadow/context.js +4 -4
- package/dist/primitives/components/embedded-chat/chat-error-helpers.cjs +3 -0
- package/dist/primitives/components/embedded-chat/chat-error-helpers.d.ts +26 -0
- package/dist/primitives/components/embedded-chat/chat-error-helpers.js +32 -0
- package/dist/primitives/components/embedded-chat/file-upload-input.cjs +1 -1
- package/dist/primitives/components/embedded-chat/file-upload-input.d.ts +1 -2
- package/dist/primitives/components/embedded-chat/file-upload-input.js +359 -217
- package/dist/primitives/components/embedded-chat/image-preview-modal.js +3 -3
- package/dist/primitives/components/embedded-chat/use-chat-action.cjs +1 -1
- package/dist/primitives/components/embedded-chat/use-chat-action.js +16 -14
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +2 -4
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.d.ts +1 -2
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +312 -284
- package/dist/primitives/components/embedded-chat/use-stream-processor.cjs +1 -1
- package/dist/primitives/components/embedded-chat/use-stream-processor.js +1 -1
- package/dist/primitives/components/embedded-chat.cjs +3 -3
- package/dist/primitives/components/embedded-chat.d.ts +2 -3
- package/dist/primitives/components/embedded-chat.js +122 -114
- package/dist/primitives/components/embedded-search/search-provider.js +3 -3
- package/dist/primitives/components/embedded-search.cjs +1 -1
- package/dist/primitives/components/embedded-search.d.ts +1 -1
- package/dist/primitives/components/embedded-search.js +3 -3
- package/dist/primitives/components/modal/modal-provider.js +2 -2
- package/dist/primitives/components/modal.js +3 -3
- package/dist/primitives/components/sidebar-chat/index.js +1 -1
- package/dist/primitives/components/tagline-logo-icon.js +50 -9
- package/dist/primitives/hooks/use-events-api.cjs +1 -0
- package/dist/primitives/hooks/use-events-api.d.ts +29 -0
- package/dist/primitives/hooks/use-events-api.js +43 -0
- package/dist/primitives/hooks/use-initial-conversation.js +4 -1
- package/dist/primitives/hooks/use-input-notification.js +9 -9
- package/dist/primitives/index.cjs +1 -1
- package/dist/primitives/index.js +150 -144
- package/dist/primitives/providers/base-events-provider.cjs +1 -1
- package/dist/primitives/providers/base-events-provider.d.ts +2 -0
- package/dist/primitives/providers/base-events-provider.js +23 -22
- package/dist/primitives/providers/chat-auth-provider.cjs +1 -0
- package/dist/primitives/providers/chat-auth-provider.d.ts +27 -0
- package/dist/primitives/providers/chat-auth-provider.js +46 -0
- package/dist/primitives/providers/chat-base-events-provider.cjs +1 -0
- package/dist/primitives/providers/chat-base-events-provider.d.ts +12 -0
- package/dist/primitives/providers/chat-base-events-provider.js +73 -0
- package/dist/primitives/providers/chat-bubble-provider.js +1 -1
- package/dist/primitives/providers/chat-form-provider.d.ts +1 -1
- package/dist/primitives/providers/chat-form-provider.js +4 -4
- package/dist/primitives/providers/chat-history-provider.js +3 -3
- package/dist/primitives/providers/config-provider.js +3 -3
- package/dist/primitives/providers/feedback-provider.cjs +1 -1
- package/dist/primitives/providers/feedback-provider.js +37 -31
- package/dist/primitives/providers/form-field-provider.js +3 -3
- package/dist/primitives/providers/help-menu-provider.js +4 -4
- package/dist/primitives/providers/hover-popover-provider.js +3 -3
- package/dist/primitives/providers/image-preview-provider.js +5 -5
- package/dist/primitives/providers/index.cjs +1 -1
- package/dist/primitives/providers/index.d.ts +2 -0
- package/dist/primitives/providers/index.js +57 -51
- package/dist/primitives/providers/markdown-provider.js +2 -2
- package/dist/primitives/providers/message-provider.js +1 -1
- package/dist/primitives/providers/sidebar-chat-provider.js +3 -3
- package/dist/primitives/providers/source-item-provider.js +3 -3
- package/dist/primitives/providers/widget-provider.js +2 -2
- package/dist/primitives/utils/misc.cjs +1 -1
- package/dist/primitives/utils/misc.js +2 -2
- package/dist/react/chat-button.js +1 -1
- package/dist/react/embedded-chat.cjs +1 -1
- package/dist/react/embedded-chat.js +104 -102
- package/dist/react/embedded-search.cjs +1 -1
- package/dist/react/embedded-search.js +18 -18
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +167 -161
- package/dist/styled/components/chat-bubble.js +4 -4
- package/dist/styled/components/chat-button.cjs +1 -1
- package/dist/styled/components/chat-button.js +9 -9
- package/dist/styled/components/chat-history.cjs +1 -1
- package/dist/styled/components/chat-history.js +22 -22
- package/dist/styled/components/embedded-chat/file-upload-input.cjs +1 -1
- package/dist/styled/components/embedded-chat/file-upload-input.js +71 -72
- package/dist/styled/components/embedded-chat/image-preview-modal.js +14 -7
- package/dist/styled/components/embedded-chat.cjs +1 -1
- package/dist/styled/components/embedded-chat.js +211 -199
- package/dist/styled/components/embedded-search.cjs +1 -1
- package/dist/styled/components/embedded-search.js +72 -66
- package/dist/styled/components/loading-indicator.cjs +1 -1
- package/dist/styled/components/loading-indicator.js +1 -1
- package/dist/styled/components/message.cjs +1 -1
- package/dist/styled/components/message.js +142 -139
- package/dist/styled/components/modal.js +3 -3
- package/dist/styled/components/searchbar.js +8 -8
- package/dist/styled/components/sidebar-chat.cjs +1 -1
- package/dist/styled/components/sidebar-chat.js +5 -5
- package/dist/styled/index.cjs +1 -1
- package/dist/styled/index.js +155 -149
- package/dist/styled/inkeep.css.cjs +13 -3
- package/dist/styled/inkeep.css.js +13 -3
- package/dist/theme/utils/generate-theme-variables.js +6 -6
- package/dist/types/config/ai.d.ts +5 -0
- package/dist/types/events.d.ts +11 -0
- package/dist/types/icons/built-in.d.ts +1 -1
- package/dist/types/icons/custom.d.ts +3 -0
- package/package.json +2 -2
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +0 -9
- /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs +0 -0
- /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -0
- /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/shim/index.cjs +0 -0
- /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/shim/index.js +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as se } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useContext as re, useState as h, useRef as c, useEffect as H, useCallback as S, createContext as oe } from "react";
|
|
4
4
|
import { useChat as ie } from "../components/embedded-chat/chat-provider.js";
|
|
5
5
|
import { useInkeepConfig as ae } from "./config-provider.js";
|
|
6
6
|
import { useInkeepApiClient as ce } from "../hooks/use-inkeep-api-client.js";
|
|
7
|
-
const z =
|
|
7
|
+
const z = oe(void 0), q = 25;
|
|
8
8
|
function ue(e) {
|
|
9
9
|
const {
|
|
10
10
|
stop: u,
|
|
@@ -99,7 +99,7 @@ const ge = ({ layout: e, children: u }) => {
|
|
|
99
99
|
const f = ue(e);
|
|
100
100
|
return /* @__PURE__ */ se(z.Provider, { value: f, children: typeof u == "function" ? u(f) : u });
|
|
101
101
|
}, ve = () => {
|
|
102
|
-
const e =
|
|
102
|
+
const e = re(z);
|
|
103
103
|
if (!e)
|
|
104
104
|
throw new Error("useChatHistory must be used within a ChatHistoryProvider");
|
|
105
105
|
return e;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as C } from "react/jsx-runtime";
|
|
3
3
|
import { mergeAndCompare as g } from "merge-anything";
|
|
4
|
-
import { useMemo as m,
|
|
4
|
+
import { useMemo as m, useContext as S, createContext as u } from "react";
|
|
5
5
|
import { defaultInkeepSearchSettings as f, defaultInkeepBaseSettings as p, defaultInkeepAIChatSettings as b } from "../utils/default-settings.js";
|
|
6
6
|
import { useShadow as l } from "../atoms/shadow/context.js";
|
|
7
7
|
const I = {
|
|
@@ -19,7 +19,7 @@ const I = {
|
|
|
19
19
|
baseSettings: p,
|
|
20
20
|
searchSettings: f,
|
|
21
21
|
componentType: I.EmbeddedChat
|
|
22
|
-
}, o =
|
|
22
|
+
}, o = u(a), A = ({ children: t, value: n }) => {
|
|
23
23
|
const i = l(), s = (e, r, h) => ["baseSettings", "searchSettings", "aiChatSettings"].includes(h) && !r ? e : r, d = {
|
|
24
24
|
baseSettings: i ?? {}
|
|
25
25
|
}, c = m(() => {
|
|
@@ -28,7 +28,7 @@ const I = {
|
|
|
28
28
|
}, [n]);
|
|
29
29
|
return /* @__PURE__ */ C(o.Provider, { value: c, children: t });
|
|
30
30
|
}, T = () => {
|
|
31
|
-
const t =
|
|
31
|
+
const t = S(o);
|
|
32
32
|
if (!t)
|
|
33
33
|
throw new Error("useInkeepConfig must be used within a ConfigProvider");
|
|
34
34
|
return t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react/jsx-runtime"),a=require("react"),T=require("../components/embedded-chat/chat-provider.cjs"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react/jsx-runtime"),a=require("react"),T=require("../components/embedded-chat/chat-provider.cjs"),F=require("../utils/misc.cjs"),A=require("./config-provider.cjs"),E=require("./base-events-provider.cjs"),j=require("../hooks/use-feedback-api.cjs"),l=a.createContext(void 0);function y(){const{baseSettings:t,aiChatSettings:c}=A.useInkeepConfig(),[p,g]=a.useState(null),[f,C]=a.useState({}),{conversationId:o,messages:r,authToken:h,getCaptchaHeader:m,invalidateCaptcha:P,refreshSession:q}=T.useChat(),{analyticsProperties:d}=t,{logEvent:b}=E.useBaseEvents(),{submitFeedback:k}=j.useFeedbackApi({baseUrl:c.baseUrl,appId:c.appId,authToken:h,getCaptchaHeader:m,invalidateCaptcha:P,refreshSession:q}),i=a.useCallback(async(e,s,u)=>{C(n=>({...n,[e]:{type:s,messageId:e,details:u}})),t.onFeedback?t.onFeedback({type:s,messageId:e,details:u,properties:d}).catch(n=>console.warn("[feedback] onFeedback error:",n)):k({conversationId:o,messageId:e,type:s,details:u}).catch(n=>console.warn("[feedback] submitFeedbackToApi error:",n));const v=r.findIndex(n=>n.id===e),x=r[v],S={conversationId:o,question:F.getMessageContent(r[v-1]),answer:F.getMessageContent(x),messageId:e,details:u};b({eventName:s==="positive"?"assistant_positive_feedback_submitted":"assistant_negative_feedback_submitted",properties:S}),s==="negative"&&b({eventName:"user_escalation_indicated",properties:{escalationType:"downvote",conversationId:o,messageId:e}})},[r,o,d,t,b,k]),_=a.useCallback(async e=>{i(e,"positive")},[i]),w=a.useCallback(async(e,s)=>{i(e,"negative",s)},[i]);return{feedback:f,currentFeedback:p,setCurrentFeedback:g,submitPositiveFeedback:_,submitNegativeFeedback:w}}const N=({children:t})=>{const c=y();return M.jsx(l.Provider,{value:c,children:t})},R=()=>{const t=a.useContext(l);if(!t)throw new Error("useFeedback must be used within a FeedbackProvider");return t};exports.FeedbackProvider=N;exports.useMessageFeedback=R;
|
|
@@ -1,70 +1,76 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as E } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useContext as N, useState as m, useCallback as d, createContext as M } from "react";
|
|
4
4
|
import { useChat as U } from "../components/embedded-chat/chat-provider.js";
|
|
5
|
-
import { getMessageContent as
|
|
5
|
+
import { getMessageContent as v } from "../utils/misc.js";
|
|
6
6
|
import { useInkeepConfig as j } from "./config-provider.js";
|
|
7
7
|
import { useBaseEvents as q } from "./base-events-provider.js";
|
|
8
8
|
import { useFeedbackApi as y } from "../hooks/use-feedback-api.js";
|
|
9
|
-
const
|
|
9
|
+
const f = M(void 0);
|
|
10
10
|
function B() {
|
|
11
|
-
const { baseSettings: t, aiChatSettings: n } = j(), [
|
|
11
|
+
const { baseSettings: t, aiChatSettings: n } = j(), [F, l] = m(null), [C, h] = m({}), {
|
|
12
|
+
conversationId: a,
|
|
13
|
+
messages: c,
|
|
14
|
+
authToken: g,
|
|
15
|
+
getCaptchaHeader: _,
|
|
16
|
+
invalidateCaptcha: w,
|
|
17
|
+
refreshSession: x
|
|
18
|
+
} = U(), { analyticsProperties: u } = t, { logEvent: b } = q(), { submitFeedback: k } = y({
|
|
12
19
|
baseUrl: n.baseUrl,
|
|
13
20
|
appId: n.appId,
|
|
14
|
-
authToken:
|
|
15
|
-
getCaptchaHeader:
|
|
16
|
-
invalidateCaptcha:
|
|
17
|
-
refreshSession:
|
|
18
|
-
}), r =
|
|
19
|
-
async (e,
|
|
20
|
-
|
|
21
|
-
(
|
|
22
|
-
) : x({ conversationId: a, messageId: e, type: s, details: i }).catch(
|
|
23
|
-
(o) => console.warn("[feedback] submitFeedbackToApi error:", o)
|
|
21
|
+
authToken: g,
|
|
22
|
+
getCaptchaHeader: _,
|
|
23
|
+
invalidateCaptcha: w,
|
|
24
|
+
refreshSession: x
|
|
25
|
+
}), r = d(
|
|
26
|
+
async (e, o, i) => {
|
|
27
|
+
h((s) => ({ ...s, [e]: { type: o, messageId: e, details: i } })), t.onFeedback ? t.onFeedback({ type: o, messageId: e, details: i, properties: u }).catch((s) => console.warn("[feedback] onFeedback error:", s)) : k({ conversationId: a, messageId: e, type: o, details: i }).catch(
|
|
28
|
+
(s) => console.warn("[feedback] submitFeedbackToApi error:", s)
|
|
24
29
|
);
|
|
25
|
-
const
|
|
30
|
+
const p = c.findIndex((s) => s.id === e), T = c[p], A = {
|
|
26
31
|
conversationId: a,
|
|
27
|
-
question:
|
|
28
|
-
answer:
|
|
32
|
+
question: v(c[p - 1]),
|
|
33
|
+
answer: v(T),
|
|
29
34
|
messageId: e,
|
|
30
35
|
details: i
|
|
31
36
|
};
|
|
32
|
-
|
|
33
|
-
eventName:
|
|
37
|
+
b({
|
|
38
|
+
eventName: o === "positive" ? "assistant_positive_feedback_submitted" : "assistant_negative_feedback_submitted",
|
|
34
39
|
properties: A
|
|
35
|
-
}),
|
|
40
|
+
}), o === "negative" && b({
|
|
36
41
|
eventName: "user_escalation_indicated",
|
|
37
42
|
properties: {
|
|
38
43
|
escalationType: "downvote",
|
|
39
|
-
conversationId: a
|
|
44
|
+
conversationId: a,
|
|
45
|
+
messageId: e
|
|
40
46
|
}
|
|
41
47
|
});
|
|
42
48
|
},
|
|
43
|
-
[c, a]
|
|
44
|
-
), P =
|
|
49
|
+
[c, a, u, t, b, k]
|
|
50
|
+
), P = d(
|
|
45
51
|
async (e) => {
|
|
46
52
|
r(e, "positive");
|
|
47
53
|
},
|
|
48
54
|
[r]
|
|
49
|
-
), S =
|
|
50
|
-
async (e,
|
|
51
|
-
r(e, "negative",
|
|
55
|
+
), S = d(
|
|
56
|
+
async (e, o) => {
|
|
57
|
+
r(e, "negative", o);
|
|
52
58
|
},
|
|
53
59
|
[r]
|
|
54
60
|
);
|
|
55
61
|
return {
|
|
56
|
-
feedback:
|
|
57
|
-
currentFeedback:
|
|
58
|
-
setCurrentFeedback:
|
|
62
|
+
feedback: C,
|
|
63
|
+
currentFeedback: F,
|
|
64
|
+
setCurrentFeedback: l,
|
|
59
65
|
submitPositiveFeedback: P,
|
|
60
66
|
submitNegativeFeedback: S
|
|
61
67
|
};
|
|
62
68
|
}
|
|
63
69
|
const L = ({ children: t }) => {
|
|
64
70
|
const n = B();
|
|
65
|
-
return /* @__PURE__ */ E(
|
|
71
|
+
return /* @__PURE__ */ E(f.Provider, { value: n, children: t });
|
|
66
72
|
}, O = () => {
|
|
67
|
-
const t =
|
|
73
|
+
const t = N(f);
|
|
68
74
|
if (!t)
|
|
69
75
|
throw new Error("useFeedback must be used within a FeedbackProvider");
|
|
70
76
|
return t;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useContext as F, createContext as u } from "react";
|
|
4
4
|
import { useChatForm as c } from "./chat-form-provider.js";
|
|
5
|
-
const e =
|
|
5
|
+
const e = u(void 0), a = ({ children: r, field: o, fieldProps: t, autoFocus: n }) => {
|
|
6
6
|
const { errors: i } = c(), s = i[o.name];
|
|
7
7
|
return /* @__PURE__ */ m(e.Provider, { value: { field: o, fieldProps: t, error: s, autoFocus: n }, children: r });
|
|
8
8
|
}, v = () => {
|
|
9
|
-
const r =
|
|
9
|
+
const r = F(e);
|
|
10
10
|
if (!r)
|
|
11
11
|
throw new Error("useFormField must be used within a FormFieldProvider");
|
|
12
12
|
return r;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
const n =
|
|
3
|
+
import { useContext as r, useState as u, createContext as s } from "react";
|
|
4
|
+
const n = s(void 0);
|
|
5
5
|
function c() {
|
|
6
|
-
const [e, t] =
|
|
6
|
+
const [e, t] = u(!1);
|
|
7
7
|
return { open: e, setOpen: t };
|
|
8
8
|
}
|
|
9
9
|
const l = ({ children: e, value: t }) => /* @__PURE__ */ o(n.Provider, { value: t, children: e }), x = () => {
|
|
10
|
-
const e =
|
|
10
|
+
const e = r(n);
|
|
11
11
|
if (!e)
|
|
12
12
|
throw new Error("useHelpMenu must be used within a HelpMenuProvider");
|
|
13
13
|
return e;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as v } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
const e =
|
|
5
|
-
const o =
|
|
3
|
+
import { useContext as n, createContext as s } from "react";
|
|
4
|
+
const e = s(void 0), p = ({ children: o, open: r, setOpen: t }) => /* @__PURE__ */ v(e.Provider, { value: { open: r, setOpen: t }, children: o }), P = () => {
|
|
5
|
+
const o = n(e);
|
|
6
6
|
if (!o)
|
|
7
7
|
throw new Error("useHoverPopover must be used within a HoverPopoverProvider");
|
|
8
8
|
return o;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as u } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
const s =
|
|
5
|
-
const [r, t] =
|
|
3
|
+
import { useContext as v, useState as c, useCallback as i, useMemo as w, createContext as P } from "react";
|
|
4
|
+
const s = P(void 0), I = ({ children: e }) => {
|
|
5
|
+
const [r, t] = c(null), o = i((m) => {
|
|
6
6
|
t(m);
|
|
7
7
|
}, []), n = i(() => {
|
|
8
8
|
t(null);
|
|
9
|
-
}, []), a =
|
|
9
|
+
}, []), a = w(
|
|
10
10
|
() => ({ imagePreview: r, openImagePreview: o, closeImagePreview: n }),
|
|
11
11
|
[r, o, n]
|
|
12
12
|
);
|
|
13
13
|
return /* @__PURE__ */ u(s.Provider, { value: a, children: e });
|
|
14
14
|
}, x = () => {
|
|
15
|
-
const e =
|
|
15
|
+
const e = v(s);
|
|
16
16
|
if (!e)
|
|
17
17
|
throw new Error("useImagePreview must be used within an ImagePreviewProvider");
|
|
18
18
|
return e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./base-events-provider.cjs"),u=require("./chat-auth-provider.cjs"),b=require("./chat-base-events-provider.cjs"),o=require("./chat-form-provider.cjs"),d=require("./chat-history-provider.cjs"),i=require("./config-provider.cjs"),n=require("./feedback-provider.cjs"),v=require("./form-field-provider.cjs"),s=require("./help-menu-provider.cjs"),P=require("./markdown-provider.cjs"),a=require("./message-provider.cjs"),c=require("./root-provider.cjs"),h=require("./source-item-provider.cjs"),l=require("./theme-provider.cjs"),C=require("./widget-provider.cjs"),e=require("./sidebar-chat-provider.cjs"),r=require("./chat-bubble-provider.cjs");exports.BaseEventsContext=t.BaseEventsContext;exports.BaseEventsProvider=t.BaseEventsProvider;exports.useBaseEvents=t.useBaseEvents;exports.ChatAuthProvider=u.ChatAuthProvider;exports.useChatAuth=u.useChatAuth;exports.ChatBaseEventsProvider=b.ChatBaseEventsProvider;exports.ChatFormProvider=o.ChatFormProvider;exports.useChatForm=o.useChatForm;exports.useChatFormState=o.useChatFormState;exports.ChatHistoryProvider=d.ChatHistoryProvider;exports.useChatHistory=d.useChatHistory;exports.InkeepConfigProvider=i.InkeepConfigProvider;exports.WebWidgetInteractionType=i.WebWidgetInteractionType;exports.useInkeepConfig=i.useInkeepConfig;exports.FeedbackProvider=n.FeedbackProvider;exports.useMessageFeedback=n.useMessageFeedback;exports.FormFieldProvider=v.FormFieldProvider;exports.useFormField=v.useFormField;exports.HelpMenuProvider=s.HelpMenuProvider;exports.useHelpMenu=s.useHelpMenu;exports.useHelpMenuState=s.useHelpMenuState;exports.ChatMarkdownProvider=P.ChatMarkdownProvider;exports.useChatMarkdown=P.useChatMarkdown;exports.MessageProvider=a.MessageProvider;exports.useMessage=a.useMessage;exports.useOptionalMessage=a.useOptionalMessage;exports.RootProvider=c.RootProvider;exports.SourceItemProvider=h.SourceItemProvider;exports.useSourceItem=h.useSourceItem;exports.ThemeProvider=l.ThemeProvider;exports.WidgetProvider=C.WidgetProvider;exports.useWidget=C.useWidget;exports.SidebarChatProvider=e.SidebarChatProvider;exports.useInkeepSidebarChat=e.useInkeepSidebarChat;exports.useOptionalSidebarChat=e.useOptionalSidebarChat;exports.useSidebarChat=e.useSidebarChat;exports.ChatBubbleProvider=r.ChatBubbleProvider;exports.useChatBubble=r.useChatBubble;exports.useInkeepChatBubble=r.useInkeepChatBubble;exports.useOptionalChatBubble=r.useOptionalChatBubble;
|
|
@@ -1,53 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
1
|
+
import { BaseEventsContext as o, BaseEventsProvider as t, useBaseEvents as a } from "./base-events-provider.js";
|
|
2
|
+
import { ChatAuthProvider as i, useChatAuth as u } from "./chat-auth-provider.js";
|
|
3
|
+
import { ChatBaseEventsProvider as p } from "./chat-base-events-provider.js";
|
|
4
|
+
import { ChatFormProvider as h, useChatForm as n, useChatFormState as v } from "./chat-form-provider.js";
|
|
5
|
+
import { ChatHistoryProvider as f, useChatHistory as x } from "./chat-history-provider.js";
|
|
6
|
+
import { InkeepConfigProvider as b, WebWidgetInteractionType as l, useInkeepConfig as g } from "./config-provider.js";
|
|
7
|
+
import { FeedbackProvider as M, useMessageFeedback as k } from "./feedback-provider.js";
|
|
8
|
+
import { FormFieldProvider as S, useFormField as I } from "./form-field-provider.js";
|
|
9
|
+
import { HelpMenuProvider as H, useHelpMenu as E, useHelpMenuState as W } from "./help-menu-provider.js";
|
|
10
|
+
import { ChatMarkdownProvider as O, useChatMarkdown as w } from "./markdown-provider.js";
|
|
11
|
+
import { MessageProvider as T, useMessage as R, useOptionalMessage as j } from "./message-provider.js";
|
|
12
|
+
import { RootProvider as z } from "./root-provider.js";
|
|
13
|
+
import { SourceItemProvider as G, useSourceItem as J } from "./source-item-provider.js";
|
|
14
|
+
import { ThemeProvider as L } from "./theme-provider.js";
|
|
15
|
+
import { WidgetProvider as Q, useWidget as U } from "./widget-provider.js";
|
|
16
|
+
import { SidebarChatProvider as X, useInkeepSidebarChat as Y, useOptionalSidebarChat as Z, useSidebarChat as _ } from "./sidebar-chat-provider.js";
|
|
17
|
+
import { ChatBubbleProvider as ee, useChatBubble as re, useInkeepChatBubble as oe, useOptionalChatBubble as te } from "./chat-bubble-provider.js";
|
|
16
18
|
export {
|
|
17
|
-
o as
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
p as
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
z as
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
19
|
+
o as BaseEventsContext,
|
|
20
|
+
t as BaseEventsProvider,
|
|
21
|
+
i as ChatAuthProvider,
|
|
22
|
+
p as ChatBaseEventsProvider,
|
|
23
|
+
ee as ChatBubbleProvider,
|
|
24
|
+
h as ChatFormProvider,
|
|
25
|
+
f as ChatHistoryProvider,
|
|
26
|
+
O as ChatMarkdownProvider,
|
|
27
|
+
M as FeedbackProvider,
|
|
28
|
+
S as FormFieldProvider,
|
|
29
|
+
H as HelpMenuProvider,
|
|
30
|
+
b as InkeepConfigProvider,
|
|
31
|
+
T as MessageProvider,
|
|
32
|
+
z as RootProvider,
|
|
33
|
+
X as SidebarChatProvider,
|
|
34
|
+
G as SourceItemProvider,
|
|
35
|
+
L as ThemeProvider,
|
|
36
|
+
l as WebWidgetInteractionType,
|
|
37
|
+
Q as WidgetProvider,
|
|
38
|
+
a as useBaseEvents,
|
|
39
|
+
u as useChatAuth,
|
|
40
|
+
re as useChatBubble,
|
|
41
|
+
n as useChatForm,
|
|
42
|
+
v as useChatFormState,
|
|
43
|
+
x as useChatHistory,
|
|
44
|
+
w as useChatMarkdown,
|
|
45
|
+
I as useFormField,
|
|
46
|
+
E as useHelpMenu,
|
|
47
|
+
W as useHelpMenuState,
|
|
48
|
+
oe as useInkeepChatBubble,
|
|
49
|
+
g as useInkeepConfig,
|
|
50
|
+
Y as useInkeepSidebarChat,
|
|
51
|
+
R as useMessage,
|
|
52
|
+
k as useMessageFeedback,
|
|
53
|
+
te as useOptionalChatBubble,
|
|
54
|
+
j as useOptionalMessage,
|
|
55
|
+
Z as useOptionalSidebarChat,
|
|
56
|
+
_ as useSidebarChat,
|
|
57
|
+
J as useSourceItem,
|
|
58
|
+
U as useWidget
|
|
53
59
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
const o =
|
|
3
|
+
import { useContext as n, createContext as a } from "react";
|
|
4
|
+
const o = a(void 0), x = ({ children: t, componentStyles: e }) => /* @__PURE__ */ r(o.Provider, { value: { componentStyles: e }, children: t }), d = () => n(o);
|
|
5
5
|
export {
|
|
6
6
|
x as ChatMarkdownProvider,
|
|
7
7
|
d as useChatMarkdown
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useContext as s, createContext as n } from "react";
|
|
4
4
|
const t = n(void 0), u = ({ children: e, message: o }) => /* @__PURE__ */ r(t.Provider, { value: { message: o }, children: e }), a = () => {
|
|
5
5
|
const e = s(t);
|
|
6
6
|
if (!e)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as C } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useState as b, useContext as s, createContext as p } from "react";
|
|
4
4
|
import { useInkeepOpenState as S } from "../hooks/use-inkeep-open-state.js";
|
|
5
|
-
const r =
|
|
5
|
+
const r = p(void 0), v = ({ children: t, value: e }) => /* @__PURE__ */ C(r.Provider, { value: e, children: t }), g = () => {
|
|
6
6
|
const t = s(r);
|
|
7
7
|
if (!t)
|
|
8
8
|
throw new Error("useSidebarChat must be used within a SidebarChatProvider");
|
|
@@ -17,7 +17,7 @@ const r = b(void 0), v = ({ children: t, value: e }) => /* @__PURE__ */ C(r.Prov
|
|
|
17
17
|
const { autoCloseThreshold: i = 0.7 } = n ?? {}, { isOpen: c, setOpen: d } = S(n, {
|
|
18
18
|
eventNamePrefix: "sidebar_chat",
|
|
19
19
|
defaultTriggerSelector: "[data-inkeep-sidebar-chat-trigger]"
|
|
20
|
-
}), [h, u] =
|
|
20
|
+
}), [h, u] = b(Math.min(a, Math.floor((e + o) / 2)));
|
|
21
21
|
return {
|
|
22
22
|
width: h,
|
|
23
23
|
setWidth: u,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
const t =
|
|
5
|
-
const e =
|
|
3
|
+
import { useContext as u, createContext as n } from "react";
|
|
4
|
+
const t = n(void 0), i = ({ children: e, source: r }) => /* @__PURE__ */ o(t.Provider, { value: { source: r }, children: e }), m = () => {
|
|
5
|
+
const e = u(t);
|
|
6
6
|
if (!e)
|
|
7
7
|
throw new Error("useSourceItem must be used within a SourceItemProvider");
|
|
8
8
|
return e;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
const e =
|
|
3
|
+
import { useContext as n, createContext as i } from "react";
|
|
4
|
+
const e = i(void 0), x = ({ children: t, widget: o }) => /* @__PURE__ */ r(e.Provider, { value: o, children: t }), d = () => n(e);
|
|
5
5
|
export {
|
|
6
6
|
x as WidgetProvider,
|
|
7
7
|
d as useWidget
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=(...t)=>(...n)=>{for(const a of t)a?.(...n)},l=t=>typeof t=="string";function f(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").replace(/__/g,"__").toLowerCase()}const g=t=>t?"":void 0;function d(t){const n=t.split(" "),a=n[0]??"",o=n.length>1?n[n.length-1]:"";return a&&o?`${a.charAt(0)}${o.charAt(0)}`:a.charAt(0)}function m(t,n){return typeof t=="function"?t(n):t}function i(t){return t.type==="data-artifact"&&t.data?.type?.toLowerCase()==="citation"}const y=t=>{const n=e=>e.data?.artifactSummary?.title||e.data?.name||"Source",a=t.parts?.map(e=>{if(e.type==="text")return e.text;if(e.type==="data-component")return JSON.stringify(e.data);if(i(e)){const r=e.data?.artifactSummary?.url;return r?`[${n(e)}](${r})`:null}return null}).join("")??"",o=new Set,s=t.parts?.filter(i).filter(e=>{const r=e.data?.artifactSummary?.url;return!r||o.has(r)?!1:(o.add(r),!0)})??[];if(!s.length)return a;const c=`
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=((...t)=>(...n)=>{for(const a of t)a?.(...n)}),l=t=>typeof t=="string";function f(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").replace(/__/g,"__").toLowerCase()}const g=t=>t?"":void 0;function d(t){const n=t.split(" "),a=n[0]??"",o=n.length>1?n[n.length-1]:"";return a&&o?`${a.charAt(0)}${o.charAt(0)}`:a.charAt(0)}function m(t,n){return typeof t=="function"?t(n):t}function i(t){return t.type==="data-artifact"&&t.data?.type?.toLowerCase()==="citation"}const y=t=>{const n=e=>e.data?.artifactSummary?.title||e.data?.name||"Source",a=t.parts?.map(e=>{if(e.type==="text")return e.text;if(e.type==="data-component")return JSON.stringify(e.data);if(i(e)){const r=e.data?.artifactSummary?.url;return r?`[${n(e)}](${r})`:null}return null}).join("")??"",o=new Set,s=t.parts?.filter(i).filter(e=>{const r=e.data?.artifactSummary?.url;return!r||o.has(r)?!1:(o.add(r),!0)})??[];if(!s.length)return a;const c=`
|
|
2
2
|
|
|
3
3
|
**Sources:**
|
|
4
4
|
`+s.map(e=>{const r=e.data?.artifactSummary?.url;return`- [${n(e)}](${r})`}).join(`
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const c = (
|
|
3
3
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
4
|
-
(...t) => (...e) => {
|
|
4
|
+
((...t) => (...e) => {
|
|
5
5
|
for (const r of t)
|
|
6
6
|
r?.(...e);
|
|
7
|
-
}
|
|
7
|
+
})
|
|
8
8
|
), l = (t) => typeof t == "string";
|
|
9
9
|
function f(t) {
|
|
10
10
|
return t.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").replace(/__/g, "__").toLowerCase();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as t, jsxs as d, Fragment as f } from "react/jsx-runtime";
|
|
3
3
|
import { ChatHistoryTrigger as y } from "../styled/components/embedded-chat.js";
|
|
4
4
|
import { Root as I, Header as O, CloseButton as v } from "../styled/components/chat-bubble.js";
|
|
5
5
|
import { Container as S, ChatButton as A, ChatButtonText as H, ChatButtonAvatarContent as T, ChatButtonAvatarImage as k, ChatButtonCloseIcon as w } from "../styled/components/chat-button.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("react"),s=require("../styled/components/embedded-chat.cjs"),a=require("../styled/components/chat-history.cjs"),C=require("../styled/components/modal.cjs"),H=require("../styled/components/shadow.cjs"),I=require("../styled/components/message.cjs"),A=require("../primitives/providers/chat-history-provider.cjs"),b=require("../primitives/providers/config-provider.cjs"),w=require("../primitives/providers/root-provider.cjs"),k=require("../primitives/providers/widget-provider.cjs"),M=require("../primitives/components/embedded-chat/chat-provider.cjs"),f=require("../primitives/components/modal/modal-provider.cjs"),p=require("../primitives/utils/misc.cjs"),E=require("../primitives/atoms/portal-with-theme.cjs"),P=require("../primitives/atoms/error-boundary.cjs"),B=require("./modal.cjs"),L=require("../primitives/providers/image-preview-provider.cjs"),q=require("./widget-toggle.cjs"),y=require("../primitives/components/embedded-chat/file-upload-input.cjs"),i=require("../styled/components/embedded-chat/file-upload-input.cjs"),m=require("../styled/components/embedded-chat/image-preview-modal.cjs");function D(r){const{baseSettings:t,aiChatSettings:n}=r;return e.jsx(P.ErrorBoundary,{children:e.jsx(H.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(w.RootProvider,{config:{baseSettings:t,aiChatSettings:n},componentType:b.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(S,{...r})})})})}function T(r){const{children:t,onToggleView:n,isHidden:o,shouldAutoFocusInput:d=!n}=r;return e.jsx(s.Provider,{isHidden:o,shouldAutoFocusInput:d,children:t})}function S(r){return e.jsx(T,{...r,children:e.jsx(v,{...r})})}function v(r){const{onToggleView:t,variant:n,header:o=W}=r,d=f.useModal(),l=k.useWidget(),x=d&&!l?B.ModalContent:g.Fragment;return e.jsx(L.ImagePreviewProvider,{children:e.jsx(x,{children:e.jsxs(s.Wrapper,{variant:n??(t?"no-shadow":"container-with-shadow"),"data-composite":p.dataAttr(!!r.onToggleView||d?.isOpen),children:[e.jsx(Z,{}),e.jsxs(s.Root,{children:[o&&e.jsx(o,{...r}),e.jsx(N,{}),e.jsx(U,{})]}),e.jsx(z,{}),e.jsx(R,{}),e.jsx(J,{})]})})})}const W=r=>{const{onToggleView:t,askAILabel:n,searchLabel:o}=r,{aiChatSettings:d}=b.useInkeepConfig(),l=d.isChatHistoryButtonVisible,x=!!t||l;return e.jsx(s.Header,{"data-show-toolbar":p.dataAttr(x),children:x?e.jsxs(s.HeaderToolbar,{"data-show-widget-toggle":p.dataAttr(!!t),children:[e.jsx(s.HeaderToolbarWrapper,{children:l&&e.jsx(s.ChatHistoryTrigger,{})}),t&&e.jsx(q.WidgetToggle,{onToggleView:t,askAILabel:n,searchLabel:o,view:"chat"}),e.jsx(C.Close,{})]}):e.jsx(C.Close,{})})};function N(){const{isSessionLoading:r}=M.useChat();return e.jsx(s.Content,{children:e.jsxs(s.ContentScrollArea,{children:[e.jsx(s.ContentScrollAreaViewport,{children:r?e.jsx(s.MessagesSessionLoading,{}):e.jsx(V,{})}),e.jsx(s.ContentScrollAreaScrollbar,{children:e.jsx(s.ContentScrollAreaThumb,{})}),e.jsx(s.ContentScrollAreaCorner,{})]})})}function V(){const{aiChatSettings:{components:r}}=b.useInkeepConfig();return e.jsx(s.Messages,{children:({messages:t,isLoading:n,isStreaming:o})=>{const d=t.at(-1),l=(c,j)=>{const h=r?.[c];if(!h)return console.warn(`Component "${c}" not found in components config`),null;try{if(typeof h=="function"&&h.length<=1)return g.createElement(h,j);const u=h(j,document.createElement("div"),null);return g.isValidElement(u)||typeof u=="string"?u:null}catch(u){return console.error(`🔍 [renderComponent] Error rendering component "${c}":`,u),null}},x=c=>e.jsx(s.Markdown,{text:c});return e.jsxs(e.Fragment,{children:[e.jsx($,{}),t.map(c=>{const j=d?.id===c.id;return e.jsxs(s.MessageWrapper,{message:c,children:[e.jsx(F,{}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:r?.IkpMessage?e.jsx(s.DynamicComponent,{name:"IkpMessage",props:{message:c,renderComponent:l,renderMarkdown:x},componentDef:r.IkpMessage}):e.jsxs(e.Fragment,{children:[e.jsx(I.EmbeddedChatMessagePart,{isLast:j}),(!o||!j)&&e.jsx(O,{})]})}),e.jsx(_,{}),e.jsx(Q,{})]})]},c.id)}),n&&d?.role==="user"&&d?.parts.length&&e.jsxs(s.MessageWrapper,{message:{id:"___loader___",role:"assistant",parts:[{type:"text",text:"Thinking..."}]},children:[e.jsx(F,{}),e.jsx(s.MessageLoading,{})]})]})}})}function $(){return e.jsxs(s.IntroMessageWrapper,{children:[e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsx(s.MessageAvatarContent,{children:e.jsx(s.MessageAvatarImage,{})})}),e.jsx(s.MessageName,{})]}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:e.jsx(I.EmbeddedChatMessagePart,{isLast:!1})}),e.jsxs(s.Disclaimer,{children:[e.jsx(s.DisclaimerLabel,{}),e.jsx(s.DisclaimerTrigger,{}),e.jsxs(s.DisclaimerContent,{children:[e.jsx(s.DisclaimerText,{}),e.jsx(s.DisclaimerArrow,{})]})]}),e.jsxs(s.ExampleQuestions,{children:[e.jsx(s.ExampleQuestionsLabel,{}),e.jsx(s.ExampleQuestionsList,{children:r=>r.map(t=>e.jsx(s.ExampleQuestion,{children:e.jsx(s.ExampleQuestionButton,{question:t})},typeof t=="object"?t.label:t))})]})]})]})}function F(){return e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsx(s.MessageAvatarContent,{children:e.jsx(s.MessageAvatarImage,{})})}),e.jsx(s.MessageName,{})]})}function R(){return e.jsx(E.PortalWithTheme,{children:e.jsx(m.EmbeddedChatImagePreviewModal,{children:e.jsx(m.EmbeddedChatImagePreviewModalOverlay,{children:e.jsxs(m.EmbeddedChatImagePreviewModalContent,{children:[e.jsx(m.EmbeddedChatImagePreviewModalClose,{}),e.jsx(m.EmbeddedChatImagePreviewModalImage,{}),e.jsx(m.EmbeddedChatImagePreviewModalFooter,{children:e.jsx(m.EmbeddedChatImagePreviewModalFileName,{})})]})})})})}function _(){return e.jsx(i.EmbeddedChatMessageFiles,{children:r=>r.map((t,n)=>{const o=t.url,d=t.mediaType??"",l=d.split("/").pop(),x=t.filename??(l?`untitled.${l}`:"untitled"),c=y.isImageMimeType(d);return e.jsxs(i.EmbeddedChatMessageFile,{url:o,name:x,mediaType:d,children:[c?e.jsx(i.EmbeddedChatFileThumbnail,{}):e.jsx(i.EmbeddedChatFileTypeIcon,{}),e.jsx(i.EmbeddedChatFileName,{})]},o||n)})})}function Q(){return e.jsxs(s.MessageToolbar,{children:[e.jsx(s.MessageCustomActions,{children:r=>r.map((t,n)=>e.jsx(s.MessageCustomAction,{action:t},`action-${n}`))}),e.jsx(s.MessageAction,{action:"copy"}),e.jsx(s.MessageAction,{action:"upvote"}),e.jsx(s.MessageAction,{action:"downvote"})]})}function O(){return e.jsxs(s.MessageSources,{children:[e.jsx(s.MessageSourcesHeader,{}),e.jsx(s.MessageSourcesList,{children:r=>r.map((t,n)=>e.jsxs(s.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(s.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(o=>e.jsxs(g.Fragment,{children:[o,e.jsx(s.MessageSourceItemBreadcrumbIcon,{})]},o))}),e.jsx(s.MessageSourceItemIcon,{}),e.jsx(s.MessageSourceItemTitle,{}),e.jsx(s.MessageSourceItemTag,{}),e.jsx(s.MessageSourceItemDescription,{children:o=>o.map((d,l)=>e.jsx(s.MessageSourceItemDescriptionPart,{part:d},`part-${l}`))}),e.jsx(s.MessageSourceItemIndicator,{})]},n))})]})}function U(){return e.jsxs(s.Footer,{children:[e.jsx(i.EmbeddedChatInputNotification,{children:e.jsxs(i.EmbeddedChatInputNotificationContent,{children:[e.jsxs(i.EmbeddedChatInputNotificationHeader,{children:[e.jsx(i.EmbeddedChatInputNotificationTitle,{}),e.jsx(i.EmbeddedChatInputNotificationClose,{})]}),e.jsx(i.EmbeddedChatInputNotificationMessage,{})]})}),e.jsx(G,{}),e.jsx(K,{})]})}function G(){return e.jsxs(s.InputFieldset,{children:[e.jsx(i.EmbeddedChatFileInput,{}),e.jsx(i.EmbeddedChatDropZone,{children:"Drop files here to add to chat"}),e.jsx(i.EmbeddedChatFileList,{children:r=>r.map((t,n)=>{const o=y.isImageMimeType(t.type);return e.jsxs(i.EmbeddedChatFileItem,{file:t,children:[o?e.jsxs(i.EmbeddedChatFilePreviewTrigger,{children:[e.jsx(i.EmbeddedChatFileThumbnail,{}),e.jsx(i.EmbeddedChatFileName,{})]}):e.jsxs(i.EmbeddedChatFileContent,{children:[e.jsx(i.EmbeddedChatFileTypeIcon,{}),e.jsx(i.EmbeddedChatFileName,{})]}),e.jsx(i.EmbeddedChatFileRemove,{})]},`${t.name}-${t.lastModified}-${n}`)})}),e.jsxs(s.InputGroup,{children:[e.jsx(i.EmbeddedChatFileUploadButton,{}),e.jsx(s.Input,{}),e.jsx(s.SendButton,{children:e.jsx(s.SendButtonIcon,{})})]})]})}function K(){return e.jsxs(s.ActionBar,{children:[e.jsxs(s.TaglineContainer,{children:[e.jsx(s.TaglineText,{}),e.jsx(s.TaglineLogo,{})]}),e.jsxs(s.Actions,{children:[e.jsx(s.HelpActions,{children:({pinned:r,unpinned:t})=>e.jsxs(e.Fragment,{children:[r.map(n=>e.jsx(s.HelpAction,{action:n},n.name)),t.length>0&&e.jsx(s.HelpActionsTrigger,{}),e.jsxs(s.HelpActionsMenu,{children:[e.jsx(s.HelpActionsMenuArrow,{}),t.map(n=>e.jsxs(s.HelpActionsMenuItem,{action:n,children:[e.jsx(s.HelpActionsMenuItemIcon,{action:n}),n.name]},n.name))]})]})}),e.jsxs(s.ChatAction,{action:"copy",children:[e.jsx(s.ChatActionLabel,{action:"copy"}),e.jsx(s.ChatActionFeedback,{action:"copy"})]}),e.jsx(s.ChatAction,{action:"clear"}),e.jsx(s.ChatAction,{action:"stop"})]})]})}function Z(){const{sessions:r}=A.useChatHistory(),{conversationId:t}=M.useChat();return e.jsxs(a.EmbeddedChatHistoryRoot,{children:[e.jsxs(a.EmbeddedChatHistoryHeader,{children:[e.jsxs(a.EmbeddedChatHistoryBackButton,{children:[e.jsx(a.EmbeddedChatHistoryBackButtonIcon,{iconKey:"backToChat"}),"Back to chat"]}),e.jsx(a.EmbeddedChatHistoryTitle,{}),e.jsx(C.Close,{})]}),e.jsxs(a.EmbeddedChatHistoryList,{children:[r.map(n=>e.jsxs(a.EmbeddedChatHistoryItem,{sessionId:n.id,"data-active":p.dataAttr(n.id===t),children:[e.jsx(a.EmbeddedChatHistoryItemTitle,{children:n.title}),e.jsx(a.EmbeddedChatHistoryItemDate,{children:a.formatSessionDate(n.updatedAt)})]},n.id)),e.jsx(a.EmbeddedChatHistoryEmptyState,{}),e.jsx(a.EmbeddedChatHistoryLoadingState,{})]}),e.jsx(a.EmbeddedChatHistoryFooter,{children:e.jsx(a.EmbeddedChatHistoryNewConversationButton,{})})]})}function z(){return e.jsx(E.PortalWithTheme,{children:e.jsx(s.FeedbackModal,{children:e.jsx(s.FeedbackModalOverlay,{children:e.jsxs(s.FeedbackModalContent,{children:[e.jsx(s.FeedbackModalHeader,{}),e.jsx(s.FeedbackModalClose,{}),e.jsx(s.FeedbackModalBody,{children:e.jsxs(s.FeedbackForm,{children:[e.jsxs(s.FeedbackField,{children:[e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsx(s.FeedbackSubmitButton,{})]})})]})})})})}function J(){return e.jsxs(s.FormWrapper,{children:[e.jsx(s.FormClose,{}),e.jsxs(s.Form,{children:[e.jsxs(s.FormHeader,{children:[e.jsx(s.FormHeading,{}),e.jsx(s.FormDescription,{})]}),e.jsx(s.FormContent,{children:r=>e.jsxs(e.Fragment,{children:[r.map((t,n)=>e.jsxs(s.FormField,{field:t,autoFocus:n===0,children:[e.jsx(s.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(s.FormFieldText,{}),t.inputType==="email"&&e.jsx(s.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(s.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(s.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(s.FormFieldCheckbox,{children:e.jsx(s.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(s.FormFieldSelect,{children:[e.jsxs(s.FormFieldSelectTrigger,{children:[e.jsx(s.FormFieldSelectValue,{}),e.jsx(s.FormFieldSelectIcon,{})]}),e.jsx(s.FormFieldSelectContent,{children:e.jsx(s.FormFieldSelectViewport,{children:t.items.map(o=>e.jsxs(s.FormFieldSelectItem,{value:o.value,children:[e.jsx(s.FormFieldSelectItemText,{children:o.label}),e.jsx(s.FormFieldSelectItemIndicator,{})]},o.value))})})]}),t.inputType==="combobox"&&e.jsxs(s.FormFieldCombobox,{children:[e.jsxs(s.FormFieldComboboxControl,{children:["multiple"in t&&t.multiple&&e.jsx(s.FormFieldComboboxSelectedTags,{}),e.jsx(s.FormFieldComboboxInput,{}),e.jsx(s.FormFieldComboboxTrigger,{})]}),e.jsx(s.FormFieldComboboxPositioner,{children:e.jsx(s.FormFieldComboboxContent,{children:e.jsx(s.FormFieldComboboxList,{children:e.jsx(s.FormFieldComboboxListItems,{children:o=>o.length===0?e.jsx(s.FormFieldComboboxListEmpty,{}):o.map(d=>e.jsxs(s.FormFieldComboboxItem,{item:d,children:[e.jsx(s.FormFieldComboboxItemText,{children:d.label}),e.jsx(s.FormFieldComboboxItemIndicator,{})]},d.value))})})})})]}),e.jsx(s.FormFieldDescription,{}),e.jsx(s.FormFieldError,{})]},t.name)),e.jsx(s.FormError,{})]})}),e.jsxs(s.FormFooter,{children:[e.jsx(s.FormCancel,{}),e.jsx(s.FormSubmit,{})]})]}),e.jsxs(s.FormSuccess,{children:[e.jsx(s.FormSuccessHeading,{}),e.jsx(s.FormSuccessMessage,{}),e.jsx(s.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=D;exports.InkeepEmbeddedChatImpl=S;exports.InkeepEmbeddedChatImplContent=v;exports.InkeepEmbeddedChatProvider=T;
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("react"),s=require("../styled/components/embedded-chat.cjs"),a=require("../styled/components/chat-history.cjs"),C=require("../styled/components/modal.cjs"),A=require("../styled/components/shadow.cjs"),I=require("../styled/components/message.cjs"),H=require("../primitives/providers/chat-auth-provider.cjs"),w=require("../primitives/providers/chat-base-events-provider.cjs"),k=require("../primitives/providers/chat-history-provider.cjs"),b=require("../primitives/providers/config-provider.cjs"),P=require("../primitives/providers/root-provider.cjs"),f=require("../primitives/providers/widget-provider.cjs"),M=require("../primitives/components/embedded-chat/chat-provider.cjs"),B=require("../primitives/components/modal/modal-provider.cjs"),p=require("../primitives/utils/misc.cjs"),E=require("../primitives/atoms/portal-with-theme.cjs"),q=require("../primitives/atoms/error-boundary.cjs"),L=require("./modal.cjs"),D=require("../primitives/providers/image-preview-provider.cjs"),W=require("./widget-toggle.cjs"),y=require("../primitives/components/embedded-chat/file-upload-input.cjs"),i=require("../styled/components/embedded-chat/file-upload-input.cjs"),m=require("../styled/components/embedded-chat/image-preview-modal.cjs");function N(r){const{baseSettings:t,aiChatSettings:n}=r;return e.jsx(q.ErrorBoundary,{children:e.jsx(A.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(P.RootProvider,{config:{baseSettings:t,aiChatSettings:n},componentType:b.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(v,{...r})})})})}function T(r){const{children:t,onToggleView:n,isHidden:o,shouldAutoFocusInput:d=!n}=r;return e.jsx(H.ChatAuthProvider,{children:e.jsx(w.ChatBaseEventsProvider,{children:e.jsx(s.Provider,{isHidden:o,shouldAutoFocusInput:d,children:t})})})}function v(r){return e.jsx(T,{...r,children:e.jsx(S,{...r})})}function S(r){const{onToggleView:t,variant:n,header:o=V}=r,d=B.useModal(),l=f.useWidget(),x=d&&!l?L.ModalContent:g.Fragment;return e.jsx(D.ImagePreviewProvider,{children:e.jsx(x,{children:e.jsxs(s.Wrapper,{variant:n??(t?"no-shadow":"container-with-shadow"),"data-composite":p.dataAttr(!!r.onToggleView||d?.isOpen),children:[e.jsx(J,{}),e.jsxs(s.Root,{children:[o&&e.jsx(o,{...r}),e.jsx($,{}),e.jsx(K,{})]}),e.jsx(X,{}),e.jsx(Q,{}),e.jsx(Y,{})]})})})}const V=r=>{const{onToggleView:t,askAILabel:n,searchLabel:o}=r,{aiChatSettings:d}=b.useInkeepConfig(),l=d.isChatHistoryButtonVisible,x=!!t||l;return e.jsx(s.Header,{"data-show-toolbar":p.dataAttr(x),children:x?e.jsxs(s.HeaderToolbar,{"data-show-widget-toggle":p.dataAttr(!!t),children:[e.jsx(s.HeaderToolbarWrapper,{children:l&&e.jsx(s.ChatHistoryTrigger,{})}),t&&e.jsx(W.WidgetToggle,{onToggleView:t,askAILabel:n,searchLabel:o,view:"chat"}),e.jsx(C.Close,{})]}):e.jsx(C.Close,{})})};function $(){const{isSessionLoading:r}=M.useChat();return e.jsx(s.Content,{children:e.jsxs(s.ContentScrollArea,{children:[e.jsx(s.ContentScrollAreaViewport,{children:r?e.jsx(s.MessagesSessionLoading,{}):e.jsx(R,{})}),e.jsx(s.ContentScrollAreaScrollbar,{children:e.jsx(s.ContentScrollAreaThumb,{})}),e.jsx(s.ContentScrollAreaCorner,{})]})})}function R(){const{aiChatSettings:{components:r}}=b.useInkeepConfig();return e.jsx(s.Messages,{children:({messages:t,isLoading:n,isStreaming:o})=>{const d=t.at(-1),l=(c,h)=>{const j=r?.[c];if(!j)return console.warn(`Component "${c}" not found in components config`),null;try{if(typeof j=="function"&&j.length<=1)return g.createElement(j,h);const u=j(h,document.createElement("div"),null);return g.isValidElement(u)||typeof u=="string"?u:null}catch(u){return console.error(`🔍 [renderComponent] Error rendering component "${c}":`,u),null}},x=c=>e.jsx(s.Markdown,{text:c});return e.jsxs(e.Fragment,{children:[e.jsx(_,{}),t.map(c=>{const h=d?.id===c.id;return e.jsxs(s.MessageWrapper,{message:c,children:[e.jsx(F,{}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:r?.IkpMessage?e.jsx(s.DynamicComponent,{name:"IkpMessage",props:{message:c,renderComponent:l,renderMarkdown:x},componentDef:r.IkpMessage}):e.jsxs(e.Fragment,{children:[e.jsx(I.EmbeddedChatMessagePart,{isLast:h}),(!o||!h)&&e.jsx(G,{})]})}),e.jsx(O,{}),e.jsx(U,{})]})]},c.id)}),n&&d?.role==="user"&&d?.parts.length&&e.jsxs(s.MessageWrapper,{message:{id:"___loader___",role:"assistant",parts:[{type:"text",text:"Thinking..."}]},children:[e.jsx(F,{}),e.jsx(s.MessageLoading,{})]})]})}})}function _(){return e.jsxs(s.IntroMessageWrapper,{children:[e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsx(s.MessageAvatarContent,{children:e.jsx(s.MessageAvatarImage,{})})}),e.jsx(s.MessageName,{})]}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:e.jsx(I.EmbeddedChatMessagePart,{isLast:!1})}),e.jsxs(s.Disclaimer,{children:[e.jsx(s.DisclaimerLabel,{}),e.jsx(s.DisclaimerTrigger,{}),e.jsxs(s.DisclaimerContent,{children:[e.jsx(s.DisclaimerText,{}),e.jsx(s.DisclaimerArrow,{})]})]}),e.jsxs(s.ExampleQuestions,{children:[e.jsx(s.ExampleQuestionsLabel,{}),e.jsx(s.ExampleQuestionsList,{children:r=>r.map(t=>e.jsx(s.ExampleQuestion,{children:e.jsx(s.ExampleQuestionButton,{question:t})},typeof t=="object"?t.label:t))})]})]})]})}function F(){return e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsx(s.MessageAvatarContent,{children:e.jsx(s.MessageAvatarImage,{})})}),e.jsx(s.MessageName,{})]})}function Q(){return e.jsx(E.PortalWithTheme,{children:e.jsx(m.EmbeddedChatImagePreviewModal,{children:e.jsx(m.EmbeddedChatImagePreviewModalOverlay,{children:e.jsxs(m.EmbeddedChatImagePreviewModalContent,{children:[e.jsx(m.EmbeddedChatImagePreviewModalClose,{}),e.jsx(m.EmbeddedChatImagePreviewModalImage,{}),e.jsx(m.EmbeddedChatImagePreviewModalFooter,{children:e.jsx(m.EmbeddedChatImagePreviewModalFileName,{})})]})})})})}function O(){return e.jsx(i.EmbeddedChatMessageFiles,{children:r=>r.map((t,n)=>{const o=t.url,d=t.mediaType??"",l=d.split("/").pop(),x=t.filename??(l?`untitled.${l}`:"untitled"),c=y.isImageMimeType(d);return e.jsxs(i.EmbeddedChatMessageFile,{url:o,name:x,mediaType:d,children:[c?e.jsx(i.EmbeddedChatFileThumbnail,{}):e.jsx(i.EmbeddedChatFileTypeIcon,{}),e.jsx(i.EmbeddedChatFileName,{})]},o||n)})})}function U(){return e.jsxs(s.MessageToolbar,{children:[e.jsx(s.MessageCustomActions,{children:r=>r.map((t,n)=>e.jsx(s.MessageCustomAction,{action:t},`action-${n}`))}),e.jsx(s.MessageAction,{action:"copy"}),e.jsx(s.MessageAction,{action:"upvote"}),e.jsx(s.MessageAction,{action:"downvote"})]})}function G(){return e.jsxs(s.MessageSources,{children:[e.jsx(s.MessageSourcesHeader,{}),e.jsx(s.MessageSourcesList,{children:r=>r.map((t,n)=>e.jsxs(s.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(s.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(o=>e.jsxs(g.Fragment,{children:[o,e.jsx(s.MessageSourceItemBreadcrumbIcon,{})]},o))}),e.jsx(s.MessageSourceItemIcon,{}),e.jsx(s.MessageSourceItemTitle,{}),e.jsx(s.MessageSourceItemTag,{}),e.jsx(s.MessageSourceItemDescription,{children:o=>o.map((d,l)=>e.jsx(s.MessageSourceItemDescriptionPart,{descriptionPart:d},`part-${l}`))}),e.jsx(s.MessageSourceItemIndicator,{})]},n))})]})}function K(){return e.jsxs(s.Footer,{children:[e.jsx(i.EmbeddedChatInputNotification,{children:e.jsxs(i.EmbeddedChatInputNotificationContent,{children:[e.jsxs(i.EmbeddedChatInputNotificationHeader,{children:[e.jsx(i.EmbeddedChatInputNotificationTitle,{}),e.jsx(i.EmbeddedChatInputNotificationClose,{})]}),e.jsx(i.EmbeddedChatInputNotificationMessage,{})]})}),e.jsx(Z,{}),e.jsx(z,{})]})}function Z(){return e.jsxs(s.InputFieldset,{children:[e.jsx(i.EmbeddedChatFileInput,{}),e.jsx(i.EmbeddedChatDropZone,{children:"Drop files here to add to chat"}),e.jsx(i.EmbeddedChatFileList,{children:r=>r.map((t,n)=>{const o=y.isImageMimeType(t.type);return e.jsxs(i.EmbeddedChatFileItem,{file:t,children:[o?e.jsxs(i.EmbeddedChatFilePreviewTrigger,{children:[e.jsx(i.EmbeddedChatFileThumbnail,{}),e.jsx(i.EmbeddedChatFileName,{})]}):e.jsxs(i.EmbeddedChatFileContent,{children:[e.jsx(i.EmbeddedChatFileTypeIcon,{}),e.jsx(i.EmbeddedChatFileName,{})]}),e.jsx(i.EmbeddedChatFileRemove,{})]},`${t.name}-${t.lastModified}-${n}`)})}),e.jsxs(s.InputGroup,{children:[e.jsx(i.EmbeddedChatFileUploadButton,{}),e.jsx(s.Input,{}),e.jsx(s.SendButton,{children:e.jsx(s.SendButtonIcon,{})})]})]})}function z(){return e.jsxs(s.ActionBar,{children:[e.jsxs(s.TaglineContainer,{children:[e.jsx(s.TaglineText,{}),e.jsx(s.TaglineLogo,{})]}),e.jsxs(s.Actions,{children:[e.jsx(s.HelpActions,{children:({pinned:r,unpinned:t})=>e.jsxs(e.Fragment,{children:[r.map(n=>e.jsx(s.HelpAction,{action:n},n.name)),t.length>0&&e.jsx(s.HelpActionsTrigger,{}),e.jsxs(s.HelpActionsMenu,{children:[e.jsx(s.HelpActionsMenuArrow,{}),t.map(n=>e.jsxs(s.HelpActionsMenuItem,{action:n,children:[e.jsx(s.HelpActionsMenuItemIcon,{action:n}),n.name]},n.name))]})]})}),e.jsxs(s.ChatAction,{action:"copy",children:[e.jsx(s.ChatActionLabel,{action:"copy"}),e.jsx(s.ChatActionFeedback,{action:"copy"})]}),e.jsx(s.ChatAction,{action:"clear"}),e.jsx(s.ChatAction,{action:"stop"})]})]})}function J(){const{sessions:r}=k.useChatHistory(),{conversationId:t}=M.useChat();return e.jsxs(a.EmbeddedChatHistoryRoot,{children:[e.jsxs(a.EmbeddedChatHistoryHeader,{children:[e.jsxs(a.EmbeddedChatHistoryBackButton,{children:[e.jsx(a.EmbeddedChatHistoryBackButtonIcon,{iconKey:"backToChat"}),"Back to chat"]}),e.jsx(a.EmbeddedChatHistoryTitle,{}),e.jsx(C.Close,{})]}),e.jsxs(a.EmbeddedChatHistoryList,{children:[r.map(n=>e.jsxs(a.EmbeddedChatHistoryItem,{sessionId:n.id,"data-active":p.dataAttr(n.id===t),children:[e.jsx(a.EmbeddedChatHistoryItemTitle,{children:n.title}),e.jsx(a.EmbeddedChatHistoryItemDate,{children:a.formatSessionDate(n.updatedAt)})]},n.id)),e.jsx(a.EmbeddedChatHistoryEmptyState,{}),e.jsx(a.EmbeddedChatHistoryLoadingState,{})]}),e.jsx(a.EmbeddedChatHistoryFooter,{children:e.jsx(a.EmbeddedChatHistoryNewConversationButton,{})})]})}function X(){return e.jsx(E.PortalWithTheme,{children:e.jsx(s.FeedbackModal,{children:e.jsx(s.FeedbackModalOverlay,{children:e.jsxs(s.FeedbackModalContent,{children:[e.jsx(s.FeedbackModalHeader,{}),e.jsx(s.FeedbackModalClose,{}),e.jsx(s.FeedbackModalBody,{children:e.jsxs(s.FeedbackForm,{children:[e.jsxs(s.FeedbackField,{children:[e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsx(s.FeedbackSubmitButton,{})]})})]})})})})}function Y(){return e.jsxs(s.FormWrapper,{children:[e.jsx(s.FormClose,{}),e.jsxs(s.Form,{children:[e.jsxs(s.FormHeader,{children:[e.jsx(s.FormHeading,{}),e.jsx(s.FormDescription,{})]}),e.jsx(s.FormContent,{children:r=>e.jsxs(e.Fragment,{children:[r.map((t,n)=>e.jsxs(s.FormField,{field:t,autoFocus:n===0,children:[e.jsx(s.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(s.FormFieldText,{}),t.inputType==="email"&&e.jsx(s.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(s.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(s.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(s.FormFieldCheckbox,{children:e.jsx(s.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(s.FormFieldSelect,{children:[e.jsxs(s.FormFieldSelectTrigger,{children:[e.jsx(s.FormFieldSelectValue,{}),e.jsx(s.FormFieldSelectIcon,{})]}),e.jsx(s.FormFieldSelectContent,{children:e.jsx(s.FormFieldSelectViewport,{children:t.items.map(o=>e.jsxs(s.FormFieldSelectItem,{value:o.value,children:[e.jsx(s.FormFieldSelectItemText,{children:o.label}),e.jsx(s.FormFieldSelectItemIndicator,{})]},o.value))})})]}),t.inputType==="combobox"&&e.jsxs(s.FormFieldCombobox,{children:[e.jsxs(s.FormFieldComboboxControl,{children:["multiple"in t&&t.multiple&&e.jsx(s.FormFieldComboboxSelectedTags,{}),e.jsx(s.FormFieldComboboxInput,{}),e.jsx(s.FormFieldComboboxTrigger,{})]}),e.jsx(s.FormFieldComboboxPositioner,{children:e.jsx(s.FormFieldComboboxContent,{children:e.jsx(s.FormFieldComboboxList,{children:e.jsx(s.FormFieldComboboxListItems,{children:o=>o.length===0?e.jsx(s.FormFieldComboboxListEmpty,{}):o.map(d=>e.jsxs(s.FormFieldComboboxItem,{item:d,children:[e.jsx(s.FormFieldComboboxItemText,{children:d.label}),e.jsx(s.FormFieldComboboxItemIndicator,{})]},d.value))})})})})]}),e.jsx(s.FormFieldDescription,{}),e.jsx(s.FormFieldError,{})]},t.name)),e.jsx(s.FormError,{})]})}),e.jsxs(s.FormFooter,{children:[e.jsx(s.FormCancel,{}),e.jsx(s.FormSubmit,{})]})]}),e.jsxs(s.FormSuccess,{children:[e.jsx(s.FormSuccessHeading,{}),e.jsx(s.FormSuccessMessage,{}),e.jsx(s.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=N;exports.InkeepEmbeddedChatImpl=v;exports.InkeepEmbeddedChatImplContent=S;exports.InkeepEmbeddedChatProvider=T;
|