@sampleapp.ai/sdk 1.0.27 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/chat-bar.js +1 -2
- package/dist/index.es.js +388 -614
- package/dist/index.standalone.js +0 -4
- package/dist/index.standalone.umd.js +14 -79
- package/dist/index.umd.js +86 -151
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { useState as
|
|
3
|
-
import * as
|
|
4
|
-
import { jsxs as
|
|
5
|
-
const ie = ({ settings:
|
|
6
|
-
const [
|
|
7
|
-
const
|
|
8
|
-
detail: { settings:
|
|
1
|
+
import * as M from "react";
|
|
2
|
+
import { useState as u, useEffect as E, forwardRef as oe, useRef as V, useMemo as ne } from "react";
|
|
3
|
+
import * as Z from "react-dom/client";
|
|
4
|
+
import { jsxs as g, jsx as o, Fragment as q } from "react/jsx-runtime";
|
|
5
|
+
const ie = ({ settings: e, onClick: i }) => {
|
|
6
|
+
const [n, d] = u(!1), s = () => {
|
|
7
|
+
const l = new CustomEvent("chatButtonClick", {
|
|
8
|
+
detail: { settings: e }
|
|
9
9
|
});
|
|
10
|
-
document.dispatchEvent(
|
|
10
|
+
document.dispatchEvent(l), i?.();
|
|
11
11
|
};
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ g(
|
|
13
13
|
"button",
|
|
14
14
|
{
|
|
15
15
|
style: {
|
|
@@ -19,7 +19,7 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
19
19
|
right: "20px",
|
|
20
20
|
zIndex: 1e3,
|
|
21
21
|
// Colors
|
|
22
|
-
backgroundColor:
|
|
22
|
+
backgroundColor: e.baseSettings.primaryBrandColor,
|
|
23
23
|
color: "white",
|
|
24
24
|
// Typography
|
|
25
25
|
fontSize: "14px",
|
|
@@ -31,11 +31,11 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
31
31
|
border: "none",
|
|
32
32
|
borderRadius: "50px",
|
|
33
33
|
// Visual Effects
|
|
34
|
-
boxShadow:
|
|
34
|
+
boxShadow: n ? "0 6px 20px rgba(0,0,0,0.2)" : "0 4px 12px rgba(0,0,0,0.15)",
|
|
35
35
|
cursor: "pointer",
|
|
36
36
|
// Animations
|
|
37
37
|
transition: "all 0.2s ease-in-out",
|
|
38
|
-
transform:
|
|
38
|
+
transform: n ? "scale(1.05)" : "scale(1)",
|
|
39
39
|
// Layout for icon + text
|
|
40
40
|
display: "flex",
|
|
41
41
|
alignItems: "center",
|
|
@@ -44,16 +44,16 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
44
44
|
outline: "none",
|
|
45
45
|
userSelect: "none"
|
|
46
46
|
},
|
|
47
|
-
onMouseEnter: () =>
|
|
48
|
-
onMouseLeave: () =>
|
|
47
|
+
onMouseEnter: () => d(!0),
|
|
48
|
+
onMouseLeave: () => d(!1),
|
|
49
49
|
onClick: s,
|
|
50
|
-
onFocus: () =>
|
|
51
|
-
onBlur: () =>
|
|
50
|
+
onFocus: () => d(!0),
|
|
51
|
+
onBlur: () => d(!1),
|
|
52
52
|
children: [
|
|
53
|
-
|
|
53
|
+
e.aiChatSettings?.aiAssistantAvatar && /* @__PURE__ */ o(
|
|
54
54
|
"img",
|
|
55
55
|
{
|
|
56
|
-
src:
|
|
56
|
+
src: e.aiChatSettings.aiAssistantAvatar,
|
|
57
57
|
alt: "AI Assistant",
|
|
58
58
|
style: {
|
|
59
59
|
width: "20px",
|
|
@@ -62,8 +62,8 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
62
62
|
objectFit: "cover",
|
|
63
63
|
flexShrink: 0
|
|
64
64
|
},
|
|
65
|
-
onError: (
|
|
66
|
-
|
|
65
|
+
onError: (l) => {
|
|
66
|
+
l.currentTarget.style.display = "none";
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
),
|
|
@@ -72,27 +72,27 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
72
72
|
}
|
|
73
73
|
);
|
|
74
74
|
}, se = ({
|
|
75
|
-
settings:
|
|
75
|
+
settings: e,
|
|
76
76
|
onClose: i
|
|
77
77
|
}) => {
|
|
78
|
-
const [
|
|
79
|
-
|
|
80
|
-
}, T = (
|
|
81
|
-
|
|
78
|
+
const [n, d] = u(!0), [s, l] = u(""), m = () => {
|
|
79
|
+
d(!1), i?.();
|
|
80
|
+
}, T = (r) => {
|
|
81
|
+
l(r);
|
|
82
82
|
};
|
|
83
|
-
return
|
|
84
|
-
const
|
|
85
|
-
|
|
83
|
+
return E(() => {
|
|
84
|
+
const r = (x) => {
|
|
85
|
+
x.key === "Escape" && m();
|
|
86
86
|
};
|
|
87
|
-
if (
|
|
88
|
-
return document.addEventListener("keydown",
|
|
89
|
-
}, [
|
|
90
|
-
if (
|
|
87
|
+
if (n)
|
|
88
|
+
return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
89
|
+
}, [n]), E(() => {
|
|
90
|
+
if (n)
|
|
91
91
|
return document.body.style.overflow = "hidden", () => {
|
|
92
92
|
document.body.style.overflow = "";
|
|
93
93
|
};
|
|
94
|
-
}, [
|
|
95
|
-
/* @__PURE__ */
|
|
94
|
+
}, [n]), n ? /* @__PURE__ */ g(q, { children: [
|
|
95
|
+
/* @__PURE__ */ o(
|
|
96
96
|
"div",
|
|
97
97
|
{
|
|
98
98
|
style: {
|
|
@@ -106,10 +106,10 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
106
106
|
zIndex: 999,
|
|
107
107
|
animation: "fadeIn 0.2s ease-out"
|
|
108
108
|
},
|
|
109
|
-
onClick:
|
|
109
|
+
onClick: m
|
|
110
110
|
}
|
|
111
111
|
),
|
|
112
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ g(
|
|
113
113
|
"div",
|
|
114
114
|
{
|
|
115
115
|
style: {
|
|
@@ -128,9 +128,9 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
128
128
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
129
129
|
animation: "slideIn 0.3s ease-out"
|
|
130
130
|
},
|
|
131
|
-
onClick: (
|
|
131
|
+
onClick: (r) => r.stopPropagation(),
|
|
132
132
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ g(
|
|
134
134
|
"div",
|
|
135
135
|
{
|
|
136
136
|
style: {
|
|
@@ -139,14 +139,14 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
139
139
|
display: "flex",
|
|
140
140
|
justifyContent: "space-between",
|
|
141
141
|
alignItems: "center",
|
|
142
|
-
background: `linear-gradient(135deg, ${
|
|
142
|
+
background: `linear-gradient(135deg, ${e.baseSettings.primaryBrandColor}10, ${e.baseSettings.primaryBrandColor}05)`
|
|
143
143
|
},
|
|
144
144
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
|
|
145
|
+
/* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
|
|
146
|
+
e.aiChatSettings?.aiAssistantAvatar && /* @__PURE__ */ o(
|
|
147
147
|
"img",
|
|
148
148
|
{
|
|
149
|
-
src:
|
|
149
|
+
src: e.aiChatSettings.aiAssistantAvatar,
|
|
150
150
|
alt: "AI Assistant",
|
|
151
151
|
style: {
|
|
152
152
|
width: "32px",
|
|
@@ -154,29 +154,29 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
154
154
|
borderRadius: "50%",
|
|
155
155
|
objectFit: "cover"
|
|
156
156
|
},
|
|
157
|
-
onError: (
|
|
158
|
-
|
|
157
|
+
onError: (r) => {
|
|
158
|
+
r.currentTarget.style.display = "none";
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
),
|
|
162
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ o(
|
|
163
163
|
"h3",
|
|
164
164
|
{
|
|
165
165
|
style: {
|
|
166
166
|
margin: 0,
|
|
167
|
-
color:
|
|
167
|
+
color: e.baseSettings.primaryBrandColor,
|
|
168
168
|
fontSize: "18px",
|
|
169
169
|
fontWeight: "600",
|
|
170
170
|
letterSpacing: "-0.025em"
|
|
171
171
|
},
|
|
172
|
-
children:
|
|
172
|
+
children: e.baseSettings.organizationDisplayName
|
|
173
173
|
}
|
|
174
174
|
)
|
|
175
175
|
] }),
|
|
176
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ o(
|
|
177
177
|
"button",
|
|
178
178
|
{
|
|
179
|
-
onClick:
|
|
179
|
+
onClick: m,
|
|
180
180
|
style: {
|
|
181
181
|
background: "none",
|
|
182
182
|
border: "none",
|
|
@@ -190,11 +190,11 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
190
190
|
justifyContent: "center",
|
|
191
191
|
transition: "all 0.15s ease"
|
|
192
192
|
},
|
|
193
|
-
onMouseEnter: (
|
|
194
|
-
|
|
193
|
+
onMouseEnter: (r) => {
|
|
194
|
+
r.currentTarget.style.backgroundColor = "#f1f5f9", r.currentTarget.style.color = "#334155";
|
|
195
195
|
},
|
|
196
|
-
onMouseLeave: (
|
|
197
|
-
|
|
196
|
+
onMouseLeave: (r) => {
|
|
197
|
+
r.currentTarget.style.backgroundColor = "transparent", r.currentTarget.style.color = "#64748b";
|
|
198
198
|
},
|
|
199
199
|
children: "×"
|
|
200
200
|
}
|
|
@@ -202,7 +202,7 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
202
202
|
]
|
|
203
203
|
}
|
|
204
204
|
),
|
|
205
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ g(
|
|
206
206
|
"div",
|
|
207
207
|
{
|
|
208
208
|
style: {
|
|
@@ -211,14 +211,14 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
211
211
|
overflowY: "auto"
|
|
212
212
|
},
|
|
213
213
|
children: [
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ g("div", { style: { position: "relative", marginBottom: "24px" }, children: [
|
|
215
|
+
/* @__PURE__ */ o(
|
|
216
216
|
"input",
|
|
217
217
|
{
|
|
218
218
|
type: "text",
|
|
219
219
|
placeholder: "Ask a question...",
|
|
220
220
|
value: s,
|
|
221
|
-
onChange: (
|
|
221
|
+
onChange: (r) => l(r.target.value),
|
|
222
222
|
style: {
|
|
223
223
|
width: "100%",
|
|
224
224
|
padding: "14px 16px",
|
|
@@ -231,16 +231,16 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
231
231
|
transition: "border-color 0.15s ease",
|
|
232
232
|
backgroundColor: "#fafafa"
|
|
233
233
|
},
|
|
234
|
-
onFocus: (
|
|
235
|
-
|
|
234
|
+
onFocus: (r) => {
|
|
235
|
+
r.currentTarget.style.borderColor = e.baseSettings.primaryBrandColor, r.currentTarget.style.backgroundColor = "white";
|
|
236
236
|
},
|
|
237
|
-
onBlur: (
|
|
238
|
-
|
|
237
|
+
onBlur: (r) => {
|
|
238
|
+
r.currentTarget.style.borderColor = "#e2e8f0", r.currentTarget.style.backgroundColor = "#fafafa";
|
|
239
239
|
},
|
|
240
240
|
autoFocus: !0
|
|
241
241
|
}
|
|
242
242
|
),
|
|
243
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ o(
|
|
244
244
|
"button",
|
|
245
245
|
{
|
|
246
246
|
style: {
|
|
@@ -248,7 +248,7 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
248
248
|
right: "8px",
|
|
249
249
|
top: "50%",
|
|
250
250
|
transform: "translateY(-50%)",
|
|
251
|
-
backgroundColor:
|
|
251
|
+
backgroundColor: e.baseSettings.primaryBrandColor,
|
|
252
252
|
color: "white",
|
|
253
253
|
border: "none",
|
|
254
254
|
borderRadius: "8px",
|
|
@@ -258,11 +258,11 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
258
258
|
fontWeight: "500",
|
|
259
259
|
transition: "opacity 0.15s ease"
|
|
260
260
|
},
|
|
261
|
-
onMouseEnter: (
|
|
262
|
-
|
|
261
|
+
onMouseEnter: (r) => {
|
|
262
|
+
r.currentTarget.style.opacity = "0.9";
|
|
263
263
|
},
|
|
264
|
-
onMouseLeave: (
|
|
265
|
-
|
|
264
|
+
onMouseLeave: (r) => {
|
|
265
|
+
r.currentTarget.style.opacity = "1";
|
|
266
266
|
},
|
|
267
267
|
onClick: () => {
|
|
268
268
|
console.log("Search for:", s);
|
|
@@ -271,8 +271,8 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
271
271
|
}
|
|
272
272
|
)
|
|
273
273
|
] }),
|
|
274
|
-
|
|
275
|
-
/* @__PURE__ */
|
|
274
|
+
e.aiChatSettings?.exampleQuestions && e.aiChatSettings.exampleQuestions.length > 0 && /* @__PURE__ */ g("div", { children: [
|
|
275
|
+
/* @__PURE__ */ o(
|
|
276
276
|
"p",
|
|
277
277
|
{
|
|
278
278
|
style: {
|
|
@@ -285,15 +285,15 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
285
285
|
children: "Popular questions:"
|
|
286
286
|
}
|
|
287
287
|
),
|
|
288
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ o(
|
|
289
289
|
"div",
|
|
290
290
|
{
|
|
291
291
|
style: { display: "flex", flexDirection: "column", gap: "8px" },
|
|
292
|
-
children:
|
|
293
|
-
(
|
|
292
|
+
children: e.aiChatSettings.exampleQuestions.map(
|
|
293
|
+
(r, x) => /* @__PURE__ */ o(
|
|
294
294
|
"button",
|
|
295
295
|
{
|
|
296
|
-
onClick: () => T(
|
|
296
|
+
onClick: () => T(r),
|
|
297
297
|
style: {
|
|
298
298
|
display: "block",
|
|
299
299
|
width: "100%",
|
|
@@ -309,15 +309,15 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
309
309
|
transition: "all 0.15s ease",
|
|
310
310
|
lineHeight: "1.4"
|
|
311
311
|
},
|
|
312
|
-
onMouseEnter: (
|
|
313
|
-
|
|
312
|
+
onMouseEnter: (c) => {
|
|
313
|
+
c.currentTarget.style.backgroundColor = "#f8fafc", c.currentTarget.style.borderColor = e.baseSettings.primaryBrandColor, c.currentTarget.style.transform = "translateY(-1px)", c.currentTarget.style.boxShadow = "0 4px 12px rgba(0,0,0,0.1)";
|
|
314
314
|
},
|
|
315
|
-
onMouseLeave: (
|
|
316
|
-
|
|
315
|
+
onMouseLeave: (c) => {
|
|
316
|
+
c.currentTarget.style.backgroundColor = "white", c.currentTarget.style.borderColor = "#e2e8f0", c.currentTarget.style.transform = "translateY(0)", c.currentTarget.style.boxShadow = "none";
|
|
317
317
|
},
|
|
318
|
-
children:
|
|
318
|
+
children: r
|
|
319
319
|
},
|
|
320
|
-
|
|
320
|
+
x
|
|
321
321
|
)
|
|
322
322
|
)
|
|
323
323
|
}
|
|
@@ -329,7 +329,7 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
329
329
|
]
|
|
330
330
|
}
|
|
331
331
|
),
|
|
332
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ o("style", { children: `
|
|
333
333
|
@keyframes fadeIn {
|
|
334
334
|
from { opacity: 0; }
|
|
335
335
|
to { opacity: 1; }
|
|
@@ -367,35 +367,35 @@ const ie = ({ settings: t, onClick: i }) => {
|
|
|
367
367
|
}, le = {
|
|
368
368
|
borderColor: "#0f172a",
|
|
369
369
|
boxShadow: "0 0 0 1px #0f172a"
|
|
370
|
-
}, ce = "#64748b", G =
|
|
371
|
-
({ style:
|
|
372
|
-
const [
|
|
370
|
+
}, ce = "#64748b", G = M.forwardRef(
|
|
371
|
+
({ style: e, onFocus: i, onBlur: n, ...d }, s) => {
|
|
372
|
+
const [l, m] = M.useState(!1), T = {
|
|
373
373
|
...de,
|
|
374
|
-
...
|
|
375
|
-
...
|
|
374
|
+
...l ? le : {},
|
|
375
|
+
...e,
|
|
376
376
|
// Handle placeholder color via CSS custom property
|
|
377
377
|
// @ts-ignore - CSS custom properties are valid
|
|
378
378
|
"--placeholder-color": ce
|
|
379
379
|
};
|
|
380
|
-
return
|
|
381
|
-
/* @__PURE__ */
|
|
380
|
+
return d.disabled && (T.cursor = "not-allowed", T.opacity = 0.5), /* @__PURE__ */ g(q, { children: [
|
|
381
|
+
/* @__PURE__ */ o("style", { children: `
|
|
382
382
|
.textarea-with-placeholder::placeholder {
|
|
383
383
|
color: var(--placeholder-color);
|
|
384
384
|
}
|
|
385
385
|
` }),
|
|
386
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ o(
|
|
387
387
|
"textarea",
|
|
388
388
|
{
|
|
389
389
|
className: "textarea-with-placeholder",
|
|
390
390
|
style: T,
|
|
391
391
|
ref: s,
|
|
392
|
-
onFocus: (
|
|
393
|
-
|
|
392
|
+
onFocus: (c) => {
|
|
393
|
+
m(!0), i?.(c);
|
|
394
394
|
},
|
|
395
|
-
onBlur: (
|
|
396
|
-
|
|
395
|
+
onBlur: (c) => {
|
|
396
|
+
m(!1), n?.(c);
|
|
397
397
|
},
|
|
398
|
-
...
|
|
398
|
+
...d
|
|
399
399
|
}
|
|
400
400
|
)
|
|
401
401
|
] });
|
|
@@ -481,8 +481,8 @@ const pe = {
|
|
|
481
481
|
width: "32px",
|
|
482
482
|
padding: "0"
|
|
483
483
|
}
|
|
484
|
-
},
|
|
485
|
-
switch (
|
|
484
|
+
}, ge = (e) => {
|
|
485
|
+
switch (e) {
|
|
486
486
|
case "default":
|
|
487
487
|
return { backgroundColor: "hsl(var(--sdk-primary, 240 5.9% 10%) / 0.9)" };
|
|
488
488
|
case "destructive":
|
|
@@ -513,12 +513,12 @@ const pe = {
|
|
|
513
513
|
default:
|
|
514
514
|
return {};
|
|
515
515
|
}
|
|
516
|
-
},
|
|
516
|
+
}, he = (e) => {
|
|
517
517
|
const i = {
|
|
518
518
|
outline: "1px solid hsl(var(--sdk-ring, 240 10% 3.9%))",
|
|
519
519
|
outlineOffset: "1px"
|
|
520
520
|
};
|
|
521
|
-
switch (
|
|
521
|
+
switch (e) {
|
|
522
522
|
case "outline":
|
|
523
523
|
return {
|
|
524
524
|
...i,
|
|
@@ -528,60 +528,60 @@ const pe = {
|
|
|
528
528
|
default:
|
|
529
529
|
return i;
|
|
530
530
|
}
|
|
531
|
-
},
|
|
531
|
+
}, te = M.forwardRef(
|
|
532
532
|
({
|
|
533
|
-
variant:
|
|
533
|
+
variant: e = "default",
|
|
534
534
|
size: i = "default",
|
|
535
|
-
asChild:
|
|
536
|
-
style:
|
|
535
|
+
asChild: n = !1,
|
|
536
|
+
style: d,
|
|
537
537
|
onMouseEnter: s,
|
|
538
|
-
onMouseLeave:
|
|
539
|
-
onFocus:
|
|
538
|
+
onMouseLeave: l,
|
|
539
|
+
onFocus: m,
|
|
540
540
|
onBlur: T,
|
|
541
|
-
onClick:
|
|
542
|
-
...
|
|
543
|
-
},
|
|
544
|
-
const [
|
|
541
|
+
onClick: r,
|
|
542
|
+
...x
|
|
543
|
+
}, c) => {
|
|
544
|
+
const [z, A] = M.useState(!1), [k, F] = M.useState(!1), w = {
|
|
545
545
|
...pe,
|
|
546
|
-
...ue[
|
|
546
|
+
...ue[e],
|
|
547
547
|
...fe[i],
|
|
548
|
-
...
|
|
549
|
-
...
|
|
550
|
-
...
|
|
548
|
+
...z ? ge(e) : {},
|
|
549
|
+
...k ? he(e) : {},
|
|
550
|
+
...d
|
|
551
551
|
// Allow style override
|
|
552
552
|
};
|
|
553
|
-
|
|
554
|
-
const I = (
|
|
555
|
-
A(!0), s?.(
|
|
556
|
-
}, R = (
|
|
557
|
-
A(!1),
|
|
558
|
-
},
|
|
559
|
-
F(!0),
|
|
560
|
-
}, D = (
|
|
561
|
-
F(!1), T?.(
|
|
562
|
-
},
|
|
553
|
+
x.disabled && (w.pointerEvents = "none", w.opacity = 0.5, w.cursor = "not-allowed");
|
|
554
|
+
const I = (p) => {
|
|
555
|
+
A(!0), s?.(p);
|
|
556
|
+
}, R = (p) => {
|
|
557
|
+
A(!1), l?.(p);
|
|
558
|
+
}, y = (p) => {
|
|
559
|
+
F(!0), m?.(p);
|
|
560
|
+
}, D = (p) => {
|
|
561
|
+
F(!1), T?.(p);
|
|
562
|
+
}, N = (p) => {
|
|
563
563
|
setTimeout(() => {
|
|
564
|
-
|
|
565
|
-
}, 150),
|
|
564
|
+
p.currentTarget && p.currentTarget.blur();
|
|
565
|
+
}, 150), r?.(p);
|
|
566
566
|
};
|
|
567
|
-
return
|
|
567
|
+
return n && console.warn(
|
|
568
568
|
"asChild prop is not supported in the inline CSS version of Button."
|
|
569
|
-
), /* @__PURE__ */
|
|
569
|
+
), /* @__PURE__ */ o(
|
|
570
570
|
"button",
|
|
571
571
|
{
|
|
572
|
-
style:
|
|
573
|
-
ref:
|
|
572
|
+
style: w,
|
|
573
|
+
ref: c,
|
|
574
574
|
onMouseEnter: I,
|
|
575
575
|
onMouseLeave: R,
|
|
576
|
-
onFocus:
|
|
576
|
+
onFocus: y,
|
|
577
577
|
onBlur: D,
|
|
578
|
-
onClick:
|
|
579
|
-
...
|
|
578
|
+
onClick: N,
|
|
579
|
+
...x
|
|
580
580
|
}
|
|
581
581
|
);
|
|
582
582
|
}
|
|
583
583
|
);
|
|
584
|
-
|
|
584
|
+
te.displayName = "Button";
|
|
585
585
|
const me = {
|
|
586
586
|
ocean: {
|
|
587
587
|
primary: "#1ca0fb",
|
|
@@ -835,23 +835,23 @@ const me = {
|
|
|
835
835
|
}
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
|
-
},
|
|
839
|
-
size:
|
|
838
|
+
}, ee = (e) => me[e || "ocean"], Ce = "ocean", be = ({
|
|
839
|
+
size: e = 20,
|
|
840
840
|
className: i = "",
|
|
841
|
-
style:
|
|
842
|
-
}) => /* @__PURE__ */
|
|
843
|
-
/* @__PURE__ */
|
|
841
|
+
style: n = {}
|
|
842
|
+
}) => /* @__PURE__ */ g(q, { children: [
|
|
843
|
+
/* @__PURE__ */ o("style", { children: `
|
|
844
844
|
@keyframes icon-spin {
|
|
845
845
|
from { transform: rotate(0deg); }
|
|
846
846
|
to { transform: rotate(360deg); }
|
|
847
847
|
}
|
|
848
848
|
` }),
|
|
849
|
-
/* @__PURE__ */
|
|
849
|
+
/* @__PURE__ */ o(
|
|
850
850
|
"svg",
|
|
851
851
|
{
|
|
852
852
|
xmlns: "http://www.w3.org/2000/svg",
|
|
853
|
-
width:
|
|
854
|
-
height:
|
|
853
|
+
width: e,
|
|
854
|
+
height: e,
|
|
855
855
|
viewBox: "0 0 24 24",
|
|
856
856
|
fill: "none",
|
|
857
857
|
stroke: "currentColor",
|
|
@@ -861,21 +861,21 @@ const me = {
|
|
|
861
861
|
className: `lucide lucide-loader-circle ${i}`,
|
|
862
862
|
style: {
|
|
863
863
|
animation: "icon-spin 1s linear infinite",
|
|
864
|
-
...
|
|
864
|
+
...n
|
|
865
865
|
},
|
|
866
|
-
children: /* @__PURE__ */
|
|
866
|
+
children: /* @__PURE__ */ o("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
867
867
|
}
|
|
868
868
|
)
|
|
869
|
-
] }),
|
|
870
|
-
size:
|
|
869
|
+
] }), xe = ({
|
|
870
|
+
size: e = 20,
|
|
871
871
|
className: i = "",
|
|
872
|
-
style:
|
|
873
|
-
}) => /* @__PURE__ */
|
|
872
|
+
style: n = {}
|
|
873
|
+
}) => /* @__PURE__ */ g(
|
|
874
874
|
"svg",
|
|
875
875
|
{
|
|
876
876
|
xmlns: "http://www.w3.org/2000/svg",
|
|
877
|
-
width:
|
|
878
|
-
height:
|
|
877
|
+
width: e,
|
|
878
|
+
height: e,
|
|
879
879
|
viewBox: "0 0 24 24",
|
|
880
880
|
fill: "none",
|
|
881
881
|
stroke: "currentColor",
|
|
@@ -884,256 +884,77 @@ const me = {
|
|
|
884
884
|
strokeLinejoin: "round",
|
|
885
885
|
className: `lucide lucide-arrow-up ${i}`,
|
|
886
886
|
style: {
|
|
887
|
-
...
|
|
887
|
+
...n
|
|
888
888
|
},
|
|
889
889
|
children: [
|
|
890
|
-
/* @__PURE__ */
|
|
891
|
-
/* @__PURE__ */
|
|
890
|
+
/* @__PURE__ */ o("path", { d: "m5 12 7-7 7 7" }),
|
|
891
|
+
/* @__PURE__ */ o("path", { d: "M12 19V5" })
|
|
892
892
|
]
|
|
893
893
|
}
|
|
894
|
-
),
|
|
895
|
-
isRecording: t = !1,
|
|
896
|
-
isTranscribing: i = !1,
|
|
897
|
-
size: r = 20,
|
|
898
|
-
style: l = {}
|
|
899
|
-
}) => {
|
|
900
|
-
const s = {
|
|
901
|
-
position: "relative",
|
|
902
|
-
width: `${r}px`,
|
|
903
|
-
height: `${Math.floor(r * 0.8)}px`,
|
|
904
|
-
display: "flex",
|
|
905
|
-
alignItems: "center",
|
|
906
|
-
justifyContent: "center",
|
|
907
|
-
...l
|
|
908
|
-
};
|
|
909
|
-
if (i)
|
|
910
|
-
return /* @__PURE__ */ c(z, { children: [
|
|
911
|
-
/* @__PURE__ */ e("style", { children: `
|
|
912
|
-
@keyframes icon-spin {
|
|
913
|
-
from { transform: rotate(0deg); }
|
|
914
|
-
to { transform: rotate(360deg); }
|
|
915
|
-
}
|
|
916
|
-
` }),
|
|
917
|
-
/* @__PURE__ */ e("div", { style: s, children: /* @__PURE__ */ e(
|
|
918
|
-
"div",
|
|
919
|
-
{
|
|
920
|
-
style: {
|
|
921
|
-
width: `${Math.floor(r * 0.6)}px`,
|
|
922
|
-
height: `${Math.floor(r * 0.6)}px`,
|
|
923
|
-
border: "2px solid currentColor",
|
|
924
|
-
borderTop: "2px solid transparent",
|
|
925
|
-
borderRadius: "50%",
|
|
926
|
-
animation: "icon-spin 1s linear infinite"
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
) })
|
|
930
|
-
] });
|
|
931
|
-
if (t)
|
|
932
|
-
return /* @__PURE__ */ c(z, { children: [
|
|
933
|
-
/* @__PURE__ */ e("style", { children: `
|
|
934
|
-
@keyframes icon-pulse {
|
|
935
|
-
0%, 100% { transform: scale(1); }
|
|
936
|
-
50% { transform: scale(0.95); }
|
|
937
|
-
}
|
|
938
|
-
` }),
|
|
939
|
-
/* @__PURE__ */ e("div", { style: s, children: /* @__PURE__ */ e(
|
|
940
|
-
"div",
|
|
941
|
-
{
|
|
942
|
-
style: {
|
|
943
|
-
width: `${Math.floor(r * 0.6)}px`,
|
|
944
|
-
height: `${Math.floor(r * 0.6)}px`,
|
|
945
|
-
backgroundColor: "currentColor",
|
|
946
|
-
borderRadius: "2px",
|
|
947
|
-
animation: "icon-pulse 1s ease-in-out infinite"
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
) })
|
|
951
|
-
] });
|
|
952
|
-
const d = Math.max(1, Math.floor(r * 0.075)), g = Math.max(1, Math.floor(r * 0.1));
|
|
953
|
-
return /* @__PURE__ */ c(z, { children: [
|
|
954
|
-
/* @__PURE__ */ e("style", { children: `
|
|
955
|
-
@keyframes wave1 {
|
|
956
|
-
0%, 100% {
|
|
957
|
-
transform: scaleY(0.4);
|
|
958
|
-
opacity: 0.6;
|
|
959
|
-
}
|
|
960
|
-
50% {
|
|
961
|
-
transform: scaleY(0.8);
|
|
962
|
-
opacity: 0.9;
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
@keyframes wave2 {
|
|
967
|
-
0%, 100% {
|
|
968
|
-
transform: scaleY(0.5);
|
|
969
|
-
opacity: 0.7;
|
|
970
|
-
}
|
|
971
|
-
50% {
|
|
972
|
-
transform: scaleY(1);
|
|
973
|
-
opacity: 1;
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
@keyframes wave3 {
|
|
978
|
-
0%, 100% {
|
|
979
|
-
transform: scaleY(0.6);
|
|
980
|
-
opacity: 0.8;
|
|
981
|
-
}
|
|
982
|
-
50% {
|
|
983
|
-
transform: scaleY(1);
|
|
984
|
-
opacity: 1;
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
@keyframes wave4 {
|
|
989
|
-
0%, 100% {
|
|
990
|
-
transform: scaleY(0.5);
|
|
991
|
-
opacity: 0.7;
|
|
992
|
-
}
|
|
993
|
-
50% {
|
|
994
|
-
transform: scaleY(0.9);
|
|
995
|
-
opacity: 1;
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
@keyframes wave5 {
|
|
1000
|
-
0%, 100% {
|
|
1001
|
-
transform: scaleY(0.4);
|
|
1002
|
-
opacity: 0.6;
|
|
1003
|
-
}
|
|
1004
|
-
50% {
|
|
1005
|
-
transform: scaleY(0.7);
|
|
1006
|
-
opacity: 0.9;
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
` }),
|
|
1010
|
-
/* @__PURE__ */ e("div", { style: s, children: /* @__PURE__ */ c("div", { style: { display: "flex", alignItems: "center", gap: `${g}px` }, children: [
|
|
1011
|
-
/* @__PURE__ */ e(
|
|
1012
|
-
"div",
|
|
1013
|
-
{
|
|
1014
|
-
style: {
|
|
1015
|
-
width: `${d}px`,
|
|
1016
|
-
height: `${Math.floor(r * 0.4)}px`,
|
|
1017
|
-
backgroundColor: "currentColor",
|
|
1018
|
-
borderRadius: "999px",
|
|
1019
|
-
animation: "wave1 1.8s ease-in-out infinite"
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
),
|
|
1023
|
-
/* @__PURE__ */ e(
|
|
1024
|
-
"div",
|
|
1025
|
-
{
|
|
1026
|
-
style: {
|
|
1027
|
-
width: `${d}px`,
|
|
1028
|
-
height: `${Math.floor(r * 0.6)}px`,
|
|
1029
|
-
backgroundColor: "currentColor",
|
|
1030
|
-
borderRadius: "999px",
|
|
1031
|
-
animation: "wave2 2.1s ease-in-out infinite"
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
),
|
|
1035
|
-
/* @__PURE__ */ e(
|
|
1036
|
-
"div",
|
|
1037
|
-
{
|
|
1038
|
-
style: {
|
|
1039
|
-
width: `${d}px`,
|
|
1040
|
-
height: `${Math.floor(r * 0.8)}px`,
|
|
1041
|
-
backgroundColor: "currentColor",
|
|
1042
|
-
borderRadius: "999px",
|
|
1043
|
-
animation: "wave3 1.6s ease-in-out infinite"
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
),
|
|
1047
|
-
/* @__PURE__ */ e(
|
|
1048
|
-
"div",
|
|
1049
|
-
{
|
|
1050
|
-
style: {
|
|
1051
|
-
width: `${d}px`,
|
|
1052
|
-
height: `${Math.floor(r * 0.6)}px`,
|
|
1053
|
-
backgroundColor: "currentColor",
|
|
1054
|
-
borderRadius: "999px",
|
|
1055
|
-
animation: "wave4 1.9s ease-in-out infinite"
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
),
|
|
1059
|
-
/* @__PURE__ */ e(
|
|
1060
|
-
"div",
|
|
1061
|
-
{
|
|
1062
|
-
style: {
|
|
1063
|
-
width: `${d}px`,
|
|
1064
|
-
height: `${Math.floor(r * 0.4)}px`,
|
|
1065
|
-
backgroundColor: "currentColor",
|
|
1066
|
-
borderRadius: "999px",
|
|
1067
|
-
animation: "wave5 2.2s ease-in-out infinite"
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
)
|
|
1071
|
-
] }) })
|
|
1072
|
-
] });
|
|
1073
|
-
}, re = oe(
|
|
894
|
+
), re = oe(
|
|
1074
895
|
({
|
|
1075
|
-
texts:
|
|
896
|
+
texts: e,
|
|
1076
897
|
typingSpeed: i = 30,
|
|
1077
|
-
deletingSpeed:
|
|
1078
|
-
delayAfterText:
|
|
898
|
+
deletingSpeed: n = 15,
|
|
899
|
+
delayAfterText: d = 800,
|
|
1079
900
|
onSubmit: s,
|
|
1080
|
-
isStreaming:
|
|
1081
|
-
className:
|
|
901
|
+
isStreaming: l = !1,
|
|
902
|
+
className: m = "",
|
|
1082
903
|
placeholderClassName: T = "",
|
|
1083
|
-
value:
|
|
1084
|
-
onChange:
|
|
1085
|
-
onFocus:
|
|
1086
|
-
onBlur:
|
|
904
|
+
value: r,
|
|
905
|
+
onChange: x,
|
|
906
|
+
onFocus: c,
|
|
907
|
+
onBlur: z,
|
|
1087
908
|
onKeyDown: A,
|
|
1088
|
-
onPaste:
|
|
909
|
+
onPaste: k,
|
|
1089
910
|
placeholder: F,
|
|
1090
|
-
rows:
|
|
911
|
+
rows: w = 1,
|
|
1091
912
|
...I
|
|
1092
913
|
}, R) => {
|
|
1093
|
-
const [
|
|
1094
|
-
|
|
1095
|
-
if (!
|
|
1096
|
-
let
|
|
1097
|
-
return
|
|
1098
|
-
|
|
1099
|
-
},
|
|
1100
|
-
|
|
1101
|
-
|
|
914
|
+
const [y, D] = u(""), [N, p] = u(!1), [S, P] = u(0), [b, C] = u(!1), [v, W] = u(!1), [O, H] = u(!1), [Q, K] = u(!1), Y = V(null), $ = R || Y, L = e[S], B = r === "" || r === void 0;
|
|
915
|
+
E(() => {
|
|
916
|
+
if (!B) return;
|
|
917
|
+
let a;
|
|
918
|
+
return b ? (a = setTimeout(() => {
|
|
919
|
+
C(!1), H(!0), W(!0), K(!0);
|
|
920
|
+
}, d), () => clearTimeout(a)) : O ? (a = setTimeout(() => {
|
|
921
|
+
K(!1), setTimeout(() => {
|
|
922
|
+
W(!1), H(!1), p(!0);
|
|
1102
923
|
}, 300);
|
|
1103
|
-
}, 3e3), () => clearTimeout(
|
|
1104
|
-
D((
|
|
1105
|
-
},
|
|
1106
|
-
D(
|
|
1107
|
-
}, i), () => clearTimeout(
|
|
924
|
+
}, 3e3), () => clearTimeout(a)) : (N ? y === "" ? (p(!1), P((h) => (h + 1) % e.length)) : a = setTimeout(() => {
|
|
925
|
+
D((h) => h.slice(0, -1));
|
|
926
|
+
}, n) : y === L ? C(!0) : a = setTimeout(() => {
|
|
927
|
+
D(L.slice(0, y.length + 1));
|
|
928
|
+
}, i), () => clearTimeout(a));
|
|
1108
929
|
}, [
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
930
|
+
y,
|
|
931
|
+
N,
|
|
932
|
+
S,
|
|
933
|
+
b,
|
|
934
|
+
O,
|
|
935
|
+
L,
|
|
936
|
+
e,
|
|
1116
937
|
i,
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
938
|
+
n,
|
|
939
|
+
d,
|
|
940
|
+
B
|
|
1120
941
|
]);
|
|
1121
|
-
const
|
|
1122
|
-
if (
|
|
1123
|
-
|
|
1124
|
-
target: { value:
|
|
942
|
+
const t = (a) => {
|
|
943
|
+
if (a.key === "Tab" && B) {
|
|
944
|
+
a.preventDefault(), x?.({
|
|
945
|
+
target: { value: L }
|
|
1125
946
|
});
|
|
1126
947
|
return;
|
|
1127
948
|
}
|
|
1128
|
-
if (
|
|
1129
|
-
if (
|
|
949
|
+
if (a.key === "Enter") {
|
|
950
|
+
if (a.shiftKey || (a.preventDefault(), l))
|
|
1130
951
|
return;
|
|
1131
|
-
s?.(
|
|
952
|
+
s?.(a);
|
|
1132
953
|
}
|
|
1133
|
-
A?.(
|
|
954
|
+
A?.(a);
|
|
1134
955
|
};
|
|
1135
|
-
return /* @__PURE__ */
|
|
1136
|
-
|
|
956
|
+
return /* @__PURE__ */ g("div", { style: { position: "relative", width: "100%" }, children: [
|
|
957
|
+
B && /* @__PURE__ */ o(
|
|
1137
958
|
"div",
|
|
1138
959
|
{
|
|
1139
960
|
style: {
|
|
@@ -1151,7 +972,7 @@ const me = {
|
|
|
1151
972
|
paddingBottom: "0",
|
|
1152
973
|
marginTop: "5px"
|
|
1153
974
|
},
|
|
1154
|
-
children: /* @__PURE__ */
|
|
975
|
+
children: /* @__PURE__ */ g(
|
|
1155
976
|
"p",
|
|
1156
977
|
{
|
|
1157
978
|
style: {
|
|
@@ -1161,8 +982,8 @@ const me = {
|
|
|
1161
982
|
...T ? {} : {}
|
|
1162
983
|
},
|
|
1163
984
|
children: [
|
|
1164
|
-
|
|
1165
|
-
/* @__PURE__ */
|
|
985
|
+
y,
|
|
986
|
+
/* @__PURE__ */ o(
|
|
1166
987
|
"span",
|
|
1167
988
|
{
|
|
1168
989
|
style: {
|
|
@@ -1179,8 +1000,8 @@ const me = {
|
|
|
1179
1000
|
marginLeft: "8px",
|
|
1180
1001
|
display: "inline-flex",
|
|
1181
1002
|
whiteSpace: "nowrap",
|
|
1182
|
-
opacity:
|
|
1183
|
-
transform:
|
|
1003
|
+
opacity: Q ? 1 : 0,
|
|
1004
|
+
transform: Q ? "scale(1)" : "scale(0.8)",
|
|
1184
1005
|
transition: "opacity 0.3s ease, transform 0.3s ease",
|
|
1185
1006
|
visibility: v ? "visible" : "hidden",
|
|
1186
1007
|
verticalAlign: "middle"
|
|
@@ -1193,19 +1014,19 @@ const me = {
|
|
|
1193
1014
|
)
|
|
1194
1015
|
}
|
|
1195
1016
|
),
|
|
1196
|
-
/* @__PURE__ */
|
|
1017
|
+
/* @__PURE__ */ o(
|
|
1197
1018
|
G,
|
|
1198
1019
|
{
|
|
1199
|
-
ref:
|
|
1020
|
+
ref: $,
|
|
1200
1021
|
placeholder: F,
|
|
1201
|
-
style:
|
|
1202
|
-
value:
|
|
1203
|
-
onFocus:
|
|
1204
|
-
onBlur:
|
|
1205
|
-
onChange:
|
|
1206
|
-
onKeyDown:
|
|
1207
|
-
onPaste:
|
|
1208
|
-
rows:
|
|
1022
|
+
style: m ? {} : {},
|
|
1023
|
+
value: r,
|
|
1024
|
+
onFocus: c,
|
|
1025
|
+
onBlur: z,
|
|
1026
|
+
onChange: x,
|
|
1027
|
+
onKeyDown: t,
|
|
1028
|
+
onPaste: k,
|
|
1029
|
+
rows: w,
|
|
1209
1030
|
...I
|
|
1210
1031
|
}
|
|
1211
1032
|
)
|
|
@@ -1213,59 +1034,22 @@ const me = {
|
|
|
1213
1034
|
}
|
|
1214
1035
|
);
|
|
1215
1036
|
re.displayName = "TypingTextarea";
|
|
1216
|
-
const
|
|
1217
|
-
isRecording: t,
|
|
1218
|
-
isTranscribing: i,
|
|
1219
|
-
onVoiceRecording: r
|
|
1220
|
-
}) => /* @__PURE__ */ e(
|
|
1221
|
-
J,
|
|
1222
|
-
{
|
|
1223
|
-
size: "icon",
|
|
1224
|
-
variant: "outline",
|
|
1225
|
-
style: {
|
|
1226
|
-
height: "32px",
|
|
1227
|
-
paddingLeft: "8px",
|
|
1228
|
-
paddingRight: "8px",
|
|
1229
|
-
fontSize: "12px",
|
|
1230
|
-
fontWeight: "500",
|
|
1231
|
-
transition: "all 0.2s ease-in-out",
|
|
1232
|
-
...t && {
|
|
1233
|
-
backgroundColor: "#ef4444",
|
|
1234
|
-
// red-500
|
|
1235
|
-
borderColor: "#ef4444",
|
|
1236
|
-
boxShadow: "0 10px 15px -3px rgba(239, 68, 68, 0.25)",
|
|
1237
|
-
color: "white"
|
|
1238
|
-
},
|
|
1239
|
-
...i && {
|
|
1240
|
-
backgroundColor: "#3b82f6",
|
|
1241
|
-
// blue-500
|
|
1242
|
-
borderColor: "#3b82f6",
|
|
1243
|
-
boxShadow: "0 10px 15px -3px rgba(59, 130, 246, 0.25)",
|
|
1244
|
-
color: "white"
|
|
1245
|
-
}
|
|
1246
|
-
},
|
|
1247
|
-
onClick: () => {
|
|
1248
|
-
r();
|
|
1249
|
-
},
|
|
1250
|
-
disabled: i,
|
|
1251
|
-
children: /* @__PURE__ */ e(ye, { isRecording: t, isTranscribing: i })
|
|
1252
|
-
}
|
|
1253
|
-
), Y = {
|
|
1037
|
+
const j = {
|
|
1254
1038
|
gradient: "linear-gradient(45deg, #3b82f6, #8b5cf6, #ec4899)",
|
|
1255
1039
|
shadow: {
|
|
1256
1040
|
dark: "rgba(0, 0, 0, 0.2)"
|
|
1257
1041
|
}
|
|
1258
|
-
},
|
|
1042
|
+
}, ye = (e, i) => {
|
|
1259
1043
|
try {
|
|
1260
|
-
return
|
|
1261
|
-
} catch (
|
|
1262
|
-
return console.warn("Theme system error, using fallback:",
|
|
1044
|
+
return e ? ee(e) || j : ee() || j;
|
|
1045
|
+
} catch (n) {
|
|
1046
|
+
return console.warn("Theme system error, using fallback:", n), j;
|
|
1263
1047
|
}
|
|
1264
|
-
},
|
|
1265
|
-
placeholder:
|
|
1048
|
+
}, Te = ({
|
|
1049
|
+
placeholder: e = "Ask anything...",
|
|
1266
1050
|
onSubmit: i,
|
|
1267
|
-
playgroundUid:
|
|
1268
|
-
isSubmitting:
|
|
1051
|
+
playgroundUid: n,
|
|
1052
|
+
isSubmitting: d,
|
|
1269
1053
|
typingTexts: s = [
|
|
1270
1054
|
"Build me an AI chatbot application using OpenAI API",
|
|
1271
1055
|
"Build me an ecommerce website using Stripe API",
|
|
@@ -1275,154 +1059,154 @@ const ke = ({
|
|
|
1275
1059
|
"Build me a SMS notification system using Twilio API",
|
|
1276
1060
|
"Build me a travel booking platform using Skyscanner API"
|
|
1277
1061
|
],
|
|
1278
|
-
shouldFocusOnMount:
|
|
1279
|
-
showModelSelector:
|
|
1062
|
+
shouldFocusOnMount: l = !0,
|
|
1063
|
+
showModelSelector: m = !0,
|
|
1280
1064
|
projectUid: T,
|
|
1281
|
-
theme:
|
|
1282
|
-
height:
|
|
1065
|
+
theme: r,
|
|
1066
|
+
height: x = "auto",
|
|
1283
1067
|
// Add default for required height prop
|
|
1284
|
-
deepgramApiKey:
|
|
1068
|
+
deepgramApiKey: c
|
|
1285
1069
|
}) => {
|
|
1286
|
-
const [
|
|
1070
|
+
const [z, A] = u(!0), [k, F] = u(!1), [w, I] = u(!1), [, R] = u(!1), [y, D] = u(null), [N, p] = u(
|
|
1287
1071
|
null
|
|
1288
|
-
), [
|
|
1072
|
+
), [S, P] = u(""), b = V(null), C = V([]), v = V(null), [W, O] = u(!1), H = ne(() => {
|
|
1289
1073
|
try {
|
|
1290
|
-
return
|
|
1291
|
-
} catch (
|
|
1292
|
-
return console.warn("Error getting color scheme:",
|
|
1074
|
+
return ye(r, n);
|
|
1075
|
+
} catch (t) {
|
|
1076
|
+
return console.warn("Error getting color scheme:", t), j;
|
|
1293
1077
|
}
|
|
1294
|
-
}, [
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
}, []),
|
|
1298
|
-
if (
|
|
1078
|
+
}, [r, n]);
|
|
1079
|
+
E(() => {
|
|
1080
|
+
O(!0);
|
|
1081
|
+
}, []), E(() => {
|
|
1082
|
+
if (l && v.current && W)
|
|
1299
1083
|
try {
|
|
1300
1084
|
v.current.focus(), v.current.select();
|
|
1301
|
-
} catch (
|
|
1302
|
-
console.warn("Focus error:",
|
|
1085
|
+
} catch (t) {
|
|
1086
|
+
console.warn("Focus error:", t);
|
|
1303
1087
|
}
|
|
1304
|
-
}, [
|
|
1305
|
-
const
|
|
1088
|
+
}, [W, l]);
|
|
1089
|
+
const Q = () => {
|
|
1306
1090
|
A(!0);
|
|
1307
|
-
},
|
|
1091
|
+
}, K = () => {
|
|
1308
1092
|
A(!0);
|
|
1309
|
-
},
|
|
1310
|
-
const
|
|
1311
|
-
if (
|
|
1093
|
+
}, Y = () => {
|
|
1094
|
+
const t = v.current;
|
|
1095
|
+
if (t)
|
|
1312
1096
|
try {
|
|
1313
|
-
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1316
|
-
} catch (
|
|
1317
|
-
console.warn("Textarea height adjustment error:",
|
|
1097
|
+
t.style.height = "auto";
|
|
1098
|
+
const a = Math.min(t.scrollHeight, 200);
|
|
1099
|
+
t.style.height = `${a}px`;
|
|
1100
|
+
} catch (a) {
|
|
1101
|
+
console.warn("Textarea height adjustment error:", a);
|
|
1318
1102
|
}
|
|
1319
1103
|
};
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
}, [
|
|
1323
|
-
const
|
|
1324
|
-
const
|
|
1325
|
-
|
|
1104
|
+
E(() => {
|
|
1105
|
+
Y();
|
|
1106
|
+
}, [S]), E(() => {
|
|
1107
|
+
const t = (a) => {
|
|
1108
|
+
const h = (a.metaKey || a.ctrlKey) && a.key === "/", f = (a.key === "Enter" || a.key === "Escape") && (k || w);
|
|
1109
|
+
h ? (a.preventDefault(), L()) : f && (a.preventDefault(), k && !w && L());
|
|
1326
1110
|
};
|
|
1327
|
-
return document.addEventListener("keydown",
|
|
1328
|
-
document.removeEventListener("keydown",
|
|
1111
|
+
return document.addEventListener("keydown", t), () => {
|
|
1112
|
+
document.removeEventListener("keydown", t);
|
|
1329
1113
|
};
|
|
1330
|
-
}, [
|
|
1331
|
-
|
|
1332
|
-
}, [
|
|
1333
|
-
const
|
|
1334
|
-
if (
|
|
1335
|
-
return F(!1), I(!0),
|
|
1336
|
-
if (
|
|
1337
|
-
let
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
},
|
|
1341
|
-
|
|
1114
|
+
}, [k, w]), E(() => () => {
|
|
1115
|
+
y && clearTimeout(y), b.current && k && b.current.stop(), R(!1);
|
|
1116
|
+
}, [y, k]);
|
|
1117
|
+
const $ = async () => {
|
|
1118
|
+
if (b.current && k)
|
|
1119
|
+
return F(!1), I(!0), y && (clearTimeout(y), D(null)), new Promise((t) => {
|
|
1120
|
+
if (b.current) {
|
|
1121
|
+
let a = !1, h;
|
|
1122
|
+
b.current.ondataavailable = (f) => {
|
|
1123
|
+
f.data.size > 0 && (a = !0, C.current.push(f.data));
|
|
1124
|
+
}, b.current.onstop = async () => {
|
|
1125
|
+
h && clearTimeout(h);
|
|
1342
1126
|
try {
|
|
1343
|
-
if (!
|
|
1127
|
+
if (!a || C.current.length === 0)
|
|
1344
1128
|
throw new Error("No audio data recorded");
|
|
1345
|
-
const
|
|
1129
|
+
const f = new Blob(C.current, {
|
|
1346
1130
|
type: "audio/wav"
|
|
1347
1131
|
});
|
|
1348
|
-
if (
|
|
1132
|
+
if (f.size < 1024)
|
|
1349
1133
|
throw new Error("Audio recording too short");
|
|
1350
|
-
const
|
|
1351
|
-
|
|
1352
|
-
const
|
|
1134
|
+
const _ = new FormData();
|
|
1135
|
+
_.append("audio", f, "recording.wav"), c && _.append("deepgramApiKey", c);
|
|
1136
|
+
const J = await fetch("/api/voice/transcribe", {
|
|
1353
1137
|
method: "POST",
|
|
1354
|
-
body:
|
|
1138
|
+
body: _
|
|
1355
1139
|
});
|
|
1356
|
-
if (
|
|
1357
|
-
const { transcription:
|
|
1358
|
-
if (
|
|
1359
|
-
const ae =
|
|
1360
|
-
|
|
1140
|
+
if (J.ok) {
|
|
1141
|
+
const { transcription: U } = await J.json();
|
|
1142
|
+
if (U && U.trim()) {
|
|
1143
|
+
const ae = S ? `${S} ${U}` : U;
|
|
1144
|
+
P(ae.trim()), setTimeout(() => {
|
|
1361
1145
|
if (v.current) {
|
|
1362
1146
|
v.current.focus();
|
|
1363
|
-
const
|
|
1364
|
-
v.current.setSelectionRange(
|
|
1147
|
+
const X = v.current.value.length;
|
|
1148
|
+
v.current.setSelectionRange(X, X);
|
|
1365
1149
|
}
|
|
1366
1150
|
}, 100);
|
|
1367
1151
|
}
|
|
1368
1152
|
} else
|
|
1369
1153
|
throw new Error("Transcription failed");
|
|
1370
|
-
} catch (
|
|
1371
|
-
console.error("Transcription error:",
|
|
1154
|
+
} catch (f) {
|
|
1155
|
+
console.error("Transcription error:", f), f instanceof Error && (f.message.includes("No audio data") || f.message.includes("too short"));
|
|
1372
1156
|
} finally {
|
|
1373
|
-
|
|
1157
|
+
C.current = [], b.current = null, p(null), I(!1), R(!1), t();
|
|
1374
1158
|
}
|
|
1375
|
-
},
|
|
1376
|
-
console.warn("MediaRecorder stop timeout, forcing cleanup"),
|
|
1159
|
+
}, h = setTimeout(() => {
|
|
1160
|
+
console.warn("MediaRecorder stop timeout, forcing cleanup"), C.current = [], b.current = null, p(null), I(!1), R(!1), t();
|
|
1377
1161
|
}, 5e3);
|
|
1378
1162
|
try {
|
|
1379
|
-
|
|
1380
|
-
} catch (
|
|
1381
|
-
console.error("Error stopping MediaRecorder:",
|
|
1163
|
+
b.current.stop();
|
|
1164
|
+
} catch (f) {
|
|
1165
|
+
console.error("Error stopping MediaRecorder:", f), h && clearTimeout(h), C.current = [], b.current = null, p(null), I(!1), R(!1), t();
|
|
1382
1166
|
}
|
|
1383
1167
|
} else
|
|
1384
|
-
|
|
1168
|
+
p(null), I(!1), R(!1), t();
|
|
1385
1169
|
});
|
|
1386
|
-
},
|
|
1387
|
-
if (!
|
|
1388
|
-
if (
|
|
1389
|
-
await
|
|
1170
|
+
}, L = async () => {
|
|
1171
|
+
if (!w)
|
|
1172
|
+
if (k)
|
|
1173
|
+
await $();
|
|
1390
1174
|
else
|
|
1391
1175
|
try {
|
|
1392
1176
|
if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia)
|
|
1393
1177
|
throw new Error("Browser doesn't support microphone access");
|
|
1394
|
-
const
|
|
1178
|
+
const t = await navigator.mediaDevices.getUserMedia({
|
|
1395
1179
|
audio: {
|
|
1396
1180
|
echoCancellation: !0,
|
|
1397
1181
|
noiseSuppression: !0,
|
|
1398
1182
|
sampleRate: 44100
|
|
1399
1183
|
}
|
|
1400
|
-
}),
|
|
1184
|
+
}), a = new MediaRecorder(t, {
|
|
1401
1185
|
mimeType: MediaRecorder.isTypeSupported("audio/webm") ? "audio/webm" : "audio/mp4"
|
|
1402
1186
|
});
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
},
|
|
1406
|
-
const
|
|
1407
|
-
await
|
|
1187
|
+
b.current = a, C.current = [], a.ondataavailable = (f) => {
|
|
1188
|
+
f.data.size > 0 && C.current.push(f.data);
|
|
1189
|
+
}, a.start(200), F(!0), p(Date.now()), R(!0);
|
|
1190
|
+
const h = setTimeout(async () => {
|
|
1191
|
+
await $();
|
|
1408
1192
|
}, 6e4);
|
|
1409
|
-
D(
|
|
1410
|
-
} catch (
|
|
1411
|
-
console.error("Microphone access error:",
|
|
1193
|
+
D(h);
|
|
1194
|
+
} catch (t) {
|
|
1195
|
+
console.error("Microphone access error:", t), t instanceof Error && (t.name === "NotAllowedError" || t.name === "NotFoundError" || t.name === "NotReadableError" || t.name);
|
|
1412
1196
|
}
|
|
1413
|
-
},
|
|
1414
|
-
if (
|
|
1197
|
+
}, B = (t) => {
|
|
1198
|
+
if (t.preventDefault(), !!S.trim())
|
|
1415
1199
|
try {
|
|
1416
|
-
if (
|
|
1417
|
-
const
|
|
1418
|
-
window.open(
|
|
1200
|
+
if (n) {
|
|
1201
|
+
const a = encodeURIComponent(S.trim()), h = `https://${n}.sampleapp.ai?q=${a}`;
|
|
1202
|
+
window.open(h, "_blank");
|
|
1419
1203
|
}
|
|
1420
|
-
i && i(
|
|
1421
|
-
} catch (
|
|
1422
|
-
console.error("Submit error:",
|
|
1204
|
+
i && i(t);
|
|
1205
|
+
} catch (a) {
|
|
1206
|
+
console.error("Submit error:", a);
|
|
1423
1207
|
}
|
|
1424
1208
|
};
|
|
1425
|
-
return /* @__PURE__ */
|
|
1209
|
+
return /* @__PURE__ */ o("div", { children: /* @__PURE__ */ g(
|
|
1426
1210
|
"div",
|
|
1427
1211
|
{
|
|
1428
1212
|
style: {
|
|
@@ -1434,11 +1218,11 @@ const ke = ({
|
|
|
1434
1218
|
marginRight: "auto"
|
|
1435
1219
|
},
|
|
1436
1220
|
children: [
|
|
1437
|
-
/* @__PURE__ */
|
|
1221
|
+
/* @__PURE__ */ o(
|
|
1438
1222
|
"div",
|
|
1439
1223
|
{
|
|
1440
1224
|
style: {
|
|
1441
|
-
backgroundColor:
|
|
1225
|
+
backgroundColor: H.shadow?.dark || "rgba(0, 0, 0, 0.2)",
|
|
1442
1226
|
position: "absolute",
|
|
1443
1227
|
top: "0",
|
|
1444
1228
|
right: "0",
|
|
@@ -1452,11 +1236,11 @@ const ke = ({
|
|
|
1452
1236
|
}
|
|
1453
1237
|
}
|
|
1454
1238
|
),
|
|
1455
|
-
/* @__PURE__ */
|
|
1239
|
+
/* @__PURE__ */ o(
|
|
1456
1240
|
"div",
|
|
1457
1241
|
{
|
|
1458
1242
|
style: {
|
|
1459
|
-
background:
|
|
1243
|
+
background: H.gradient || j.gradient,
|
|
1460
1244
|
backgroundSize: "400% 400%",
|
|
1461
1245
|
position: "absolute",
|
|
1462
1246
|
top: "0",
|
|
@@ -1468,16 +1252,16 @@ const ke = ({
|
|
|
1468
1252
|
filter: "blur(12px)",
|
|
1469
1253
|
transition: "opacity 0.3s ease-in-out",
|
|
1470
1254
|
pointerEvents: "none",
|
|
1471
|
-
opacity:
|
|
1255
|
+
opacity: z ? "0.8" : "0.4",
|
|
1472
1256
|
animation: "gradient-bg 5s ease infinite"
|
|
1473
1257
|
}
|
|
1474
1258
|
}
|
|
1475
1259
|
),
|
|
1476
|
-
/* @__PURE__ */
|
|
1260
|
+
/* @__PURE__ */ o(
|
|
1477
1261
|
"div",
|
|
1478
1262
|
{
|
|
1479
1263
|
style: {
|
|
1480
|
-
background:
|
|
1264
|
+
background: H.gradient || j.gradient,
|
|
1481
1265
|
backgroundSize: "400% 400%",
|
|
1482
1266
|
position: "absolute",
|
|
1483
1267
|
top: "0",
|
|
@@ -1488,12 +1272,12 @@ const ke = ({
|
|
|
1488
1272
|
zIndex: 1,
|
|
1489
1273
|
transition: "opacity 0.3s ease-in-out",
|
|
1490
1274
|
pointerEvents: "none",
|
|
1491
|
-
opacity:
|
|
1275
|
+
opacity: z ? "1" : "0.7",
|
|
1492
1276
|
animation: "gradient-bg 5s ease infinite"
|
|
1493
1277
|
}
|
|
1494
1278
|
}
|
|
1495
1279
|
),
|
|
1496
|
-
/* @__PURE__ */
|
|
1280
|
+
/* @__PURE__ */ o(
|
|
1497
1281
|
"div",
|
|
1498
1282
|
{
|
|
1499
1283
|
style: {
|
|
@@ -1508,8 +1292,8 @@ const ke = ({
|
|
|
1508
1292
|
paddingTop: "0.5rem",
|
|
1509
1293
|
paddingBottom: "0.5rem"
|
|
1510
1294
|
},
|
|
1511
|
-
children: /* @__PURE__ */
|
|
1512
|
-
/* @__PURE__ */
|
|
1295
|
+
children: /* @__PURE__ */ g("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
1296
|
+
/* @__PURE__ */ g(
|
|
1513
1297
|
"div",
|
|
1514
1298
|
{
|
|
1515
1299
|
style: {
|
|
@@ -1522,7 +1306,7 @@ const ke = ({
|
|
|
1522
1306
|
paddingBottom: "4px"
|
|
1523
1307
|
},
|
|
1524
1308
|
children: [
|
|
1525
|
-
s.length > 0 ? /* @__PURE__ */
|
|
1309
|
+
s.length > 0 ? /* @__PURE__ */ o(
|
|
1526
1310
|
re,
|
|
1527
1311
|
{
|
|
1528
1312
|
texts: s,
|
|
@@ -1548,26 +1332,26 @@ const ke = ({
|
|
|
1548
1332
|
marginTop: "4px",
|
|
1549
1333
|
color: "#f4f4f5",
|
|
1550
1334
|
fontFamily: "inherit",
|
|
1551
|
-
height:
|
|
1335
|
+
height: x
|
|
1552
1336
|
},
|
|
1553
|
-
value:
|
|
1554
|
-
onFocus:
|
|
1555
|
-
onBlur:
|
|
1556
|
-
onChange: (
|
|
1557
|
-
onSubmit: (
|
|
1558
|
-
if (
|
|
1559
|
-
|
|
1337
|
+
value: S,
|
|
1338
|
+
onFocus: Q,
|
|
1339
|
+
onBlur: K,
|
|
1340
|
+
onChange: (t) => P(t.target.value),
|
|
1341
|
+
onSubmit: (t) => {
|
|
1342
|
+
if (k || w) {
|
|
1343
|
+
t.preventDefault();
|
|
1560
1344
|
return;
|
|
1561
1345
|
}
|
|
1562
|
-
|
|
1346
|
+
B(t);
|
|
1563
1347
|
},
|
|
1564
1348
|
rows: 1
|
|
1565
1349
|
}
|
|
1566
|
-
) : /* @__PURE__ */
|
|
1350
|
+
) : /* @__PURE__ */ o(
|
|
1567
1351
|
G,
|
|
1568
1352
|
{
|
|
1569
1353
|
ref: v,
|
|
1570
|
-
placeholder:
|
|
1354
|
+
placeholder: e,
|
|
1571
1355
|
style: {
|
|
1572
1356
|
flex: 1,
|
|
1573
1357
|
width: "100%",
|
|
@@ -1589,56 +1373,46 @@ const ke = ({
|
|
|
1589
1373
|
marginTop: "4px",
|
|
1590
1374
|
color: "#f4f4f5",
|
|
1591
1375
|
fontFamily: "inherit",
|
|
1592
|
-
height:
|
|
1376
|
+
height: x
|
|
1593
1377
|
},
|
|
1594
|
-
value:
|
|
1595
|
-
onFocus:
|
|
1596
|
-
onBlur:
|
|
1597
|
-
onChange: (
|
|
1598
|
-
onKeyDown: (
|
|
1599
|
-
if (
|
|
1600
|
-
if (
|
|
1378
|
+
value: S,
|
|
1379
|
+
onFocus: Q,
|
|
1380
|
+
onBlur: K,
|
|
1381
|
+
onChange: (t) => P(t.target.value),
|
|
1382
|
+
onKeyDown: (t) => {
|
|
1383
|
+
if (t.key === "Enter") {
|
|
1384
|
+
if (t.shiftKey)
|
|
1601
1385
|
return;
|
|
1602
|
-
|
|
1386
|
+
t.preventDefault(), B(t);
|
|
1603
1387
|
}
|
|
1604
1388
|
},
|
|
1605
1389
|
rows: 1
|
|
1606
1390
|
}
|
|
1607
1391
|
),
|
|
1608
|
-
/* @__PURE__ */
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
{
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
children: l ? /* @__PURE__ */ e(
|
|
1629
|
-
xe,
|
|
1630
|
-
{
|
|
1631
|
-
size: 20,
|
|
1632
|
-
style: { animation: "spin 1s linear infinite" }
|
|
1633
|
-
}
|
|
1634
|
-
) : /* @__PURE__ */ e(be, { style: { width: "20px", height: "20px" } })
|
|
1635
|
-
}
|
|
1636
|
-
)
|
|
1637
|
-
] })
|
|
1392
|
+
/* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "row", gap: "4px" }, children: /* @__PURE__ */ o(
|
|
1393
|
+
te,
|
|
1394
|
+
{
|
|
1395
|
+
style: {
|
|
1396
|
+
height: "32px",
|
|
1397
|
+
width: "32px"
|
|
1398
|
+
},
|
|
1399
|
+
disabled: S.length === 0 || d,
|
|
1400
|
+
variant: "secondary",
|
|
1401
|
+
onClick: B,
|
|
1402
|
+
size: "icon",
|
|
1403
|
+
children: d ? /* @__PURE__ */ o(
|
|
1404
|
+
be,
|
|
1405
|
+
{
|
|
1406
|
+
size: 20,
|
|
1407
|
+
style: { animation: "spin 1s linear infinite" }
|
|
1408
|
+
}
|
|
1409
|
+
) : /* @__PURE__ */ o(xe, { style: { width: "20px", height: "20px" } })
|
|
1410
|
+
}
|
|
1411
|
+
) })
|
|
1638
1412
|
]
|
|
1639
1413
|
}
|
|
1640
1414
|
),
|
|
1641
|
-
/* @__PURE__ */
|
|
1415
|
+
/* @__PURE__ */ o(
|
|
1642
1416
|
"div",
|
|
1643
1417
|
{
|
|
1644
1418
|
style: {
|
|
@@ -1648,7 +1422,7 @@ const ke = ({
|
|
|
1648
1422
|
paddingLeft: "8px",
|
|
1649
1423
|
paddingRight: "8px"
|
|
1650
1424
|
},
|
|
1651
|
-
children: /* @__PURE__ */
|
|
1425
|
+
children: /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: m && /* @__PURE__ */ o(
|
|
1652
1426
|
"div",
|
|
1653
1427
|
{
|
|
1654
1428
|
style: { display: "flex", alignItems: "center", gap: "8px" }
|
|
@@ -1659,7 +1433,7 @@ const ke = ({
|
|
|
1659
1433
|
] })
|
|
1660
1434
|
}
|
|
1661
1435
|
),
|
|
1662
|
-
/* @__PURE__ */
|
|
1436
|
+
/* @__PURE__ */ o("style", { children: `
|
|
1663
1437
|
@keyframes gradient-bg {
|
|
1664
1438
|
0%,
|
|
1665
1439
|
100% {
|
|
@@ -1682,20 +1456,20 @@ const ke = ({
|
|
|
1682
1456
|
}
|
|
1683
1457
|
) });
|
|
1684
1458
|
};
|
|
1685
|
-
class
|
|
1459
|
+
class ke {
|
|
1686
1460
|
constructor() {
|
|
1687
|
-
this.ModalSearchAndChat = (i,
|
|
1688
|
-
const
|
|
1689
|
-
s.id = "sampleapp-modal-" + Date.now(),
|
|
1690
|
-
const
|
|
1461
|
+
this.ModalSearchAndChat = (i, n) => {
|
|
1462
|
+
const d = n || document.body, s = document.createElement("div");
|
|
1463
|
+
s.id = "sampleapp-modal-" + Date.now(), d.appendChild(s);
|
|
1464
|
+
const l = Z.createRoot(s), m = M.createElement(se, {
|
|
1691
1465
|
settings: i,
|
|
1692
1466
|
onClose: () => {
|
|
1693
|
-
|
|
1467
|
+
l.unmount(), s.remove();
|
|
1694
1468
|
}
|
|
1695
1469
|
});
|
|
1696
|
-
return
|
|
1470
|
+
return l.render(m), {
|
|
1697
1471
|
unmount: () => {
|
|
1698
|
-
|
|
1472
|
+
l.unmount(), s.remove();
|
|
1699
1473
|
},
|
|
1700
1474
|
show: () => {
|
|
1701
1475
|
s.style.display = "block";
|
|
@@ -1704,11 +1478,11 @@ class ve {
|
|
|
1704
1478
|
s.style.display = "none";
|
|
1705
1479
|
}
|
|
1706
1480
|
};
|
|
1707
|
-
}, this.ChatButton = (i,
|
|
1708
|
-
const
|
|
1709
|
-
return s.render(
|
|
1481
|
+
}, this.ChatButton = (i, n) => {
|
|
1482
|
+
const d = n || this.createButtonContainer(), s = Z.createRoot(d), l = M.createElement(ie, { settings: i });
|
|
1483
|
+
return s.render(l), {
|
|
1710
1484
|
unmount: () => {
|
|
1711
|
-
s.unmount(),
|
|
1485
|
+
s.unmount(), d.remove();
|
|
1712
1486
|
}
|
|
1713
1487
|
};
|
|
1714
1488
|
};
|
|
@@ -1718,14 +1492,14 @@ class ve {
|
|
|
1718
1492
|
return i.id = "sampleapp-button-" + Date.now(), document.body.appendChild(i), i;
|
|
1719
1493
|
}
|
|
1720
1494
|
}
|
|
1721
|
-
const
|
|
1722
|
-
typeof window < "u" && (window.SampleApp =
|
|
1495
|
+
const we = new ke();
|
|
1496
|
+
typeof window < "u" && (window.SampleApp = we);
|
|
1723
1497
|
export {
|
|
1724
|
-
|
|
1498
|
+
Te as ChatBar,
|
|
1725
1499
|
ie as ChatButton,
|
|
1726
|
-
|
|
1500
|
+
Ce as DEFAULT_THEME,
|
|
1727
1501
|
se as ModalSearchAndChat,
|
|
1728
|
-
|
|
1729
|
-
|
|
1502
|
+
we as default,
|
|
1503
|
+
ee as getTheme,
|
|
1730
1504
|
me as themes
|
|
1731
1505
|
};
|