@copilotkit/react-ui 0.14.0-alpha.5 → 0.14.1-alpha.0
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/.turbo/turbo-build.log +80 -80
- package/CHANGELOG.md +31 -0
- package/dist/chunk-2KAF7NKC.mjs +484 -0
- package/dist/chunk-2KAF7NKC.mjs.map +1 -0
- package/dist/chunk-5KEDV5VC.mjs +27 -0
- package/dist/chunk-5KEDV5VC.mjs.map +1 -0
- package/dist/chunk-6LAZQHEB.mjs +129 -0
- package/dist/chunk-6LAZQHEB.mjs.map +1 -0
- package/dist/chunk-7NSRDJ5C.mjs +3 -0
- package/dist/chunk-7NSRDJ5C.mjs.map +1 -0
- package/dist/chunk-C34L4AWW.mjs +39 -0
- package/dist/chunk-C34L4AWW.mjs.map +1 -0
- package/dist/chunk-CF3BK4OX.mjs +53 -0
- package/dist/chunk-CF3BK4OX.mjs.map +1 -0
- package/dist/chunk-CNQX2VY3.mjs +66 -0
- package/dist/chunk-CNQX2VY3.mjs.map +1 -0
- package/dist/chunk-GCOPYGHH.mjs +27 -0
- package/dist/chunk-GCOPYGHH.mjs.map +1 -0
- package/dist/chunk-H4VKQGVU.mjs +3 -0
- package/dist/chunk-H4VKQGVU.mjs.map +1 -0
- package/dist/chunk-IJLMKBSZ.mjs +25 -0
- package/dist/chunk-IJLMKBSZ.mjs.map +1 -0
- package/dist/chunk-INCNMGJ7.mjs +72 -0
- package/dist/chunk-INCNMGJ7.mjs.map +1 -0
- package/dist/chunk-IU3WTXLQ.mjs +3 -0
- package/dist/chunk-IU3WTXLQ.mjs.map +1 -0
- package/dist/chunk-M3CZWJI3.mjs +44 -0
- package/dist/chunk-M3CZWJI3.mjs.map +1 -0
- package/dist/chunk-MC6KTH4X.mjs +12 -0
- package/dist/chunk-MC6KTH4X.mjs.map +1 -0
- package/dist/chunk-MRXNTQOX.mjs +55 -0
- package/dist/chunk-MRXNTQOX.mjs.map +1 -0
- package/dist/chunk-OHWEJUCS.mjs +18 -0
- package/dist/chunk-OHWEJUCS.mjs.map +1 -0
- package/dist/chunk-OOBQC5H6.mjs +34 -0
- package/dist/chunk-OOBQC5H6.mjs.map +1 -0
- package/dist/chunk-POVINPXX.mjs +26 -0
- package/dist/chunk-POVINPXX.mjs.map +1 -0
- package/dist/chunk-Q6YO7LDK.mjs +40 -0
- package/dist/chunk-Q6YO7LDK.mjs.map +1 -0
- package/dist/chunk-RPTRCFSO.mjs +42 -0
- package/dist/chunk-RPTRCFSO.mjs.map +1 -0
- package/dist/chunk-SEH5PQVW.mjs +52 -0
- package/dist/chunk-SEH5PQVW.mjs.map +1 -0
- package/dist/chunk-SHOTWRKC.mjs +18 -0
- package/dist/chunk-SHOTWRKC.mjs.map +1 -0
- package/dist/chunk-SRBUGQTM.mjs +109 -0
- package/dist/chunk-SRBUGQTM.mjs.map +1 -0
- package/dist/chunk-TEYIQHMK.mjs +12 -0
- package/dist/chunk-TEYIQHMK.mjs.map +1 -0
- package/dist/chunk-U6NJWGTV.mjs +3 -0
- package/dist/chunk-U6NJWGTV.mjs.map +1 -0
- package/dist/chunk-VGX2W5ZB.mjs +28 -0
- package/dist/chunk-VGX2W5ZB.mjs.map +1 -0
- package/dist/chunk-XGUBRIUV.mjs +72 -0
- package/dist/chunk-XGUBRIUV.mjs.map +1 -0
- package/dist/chunk-ZYC5YVDO.mjs +21 -0
- package/dist/chunk-ZYC5YVDO.mjs.map +1 -0
- package/dist/components/chat-components/chat-list.mjs +12 -440
- package/dist/components/chat-components/chat-list.mjs.map +1 -1
- package/dist/components/chat-components/chat-message-actions.mjs +7 -168
- package/dist/components/chat-components/chat-message-actions.mjs.map +1 -1
- package/dist/components/chat-components/chat-message.mjs +10 -403
- package/dist/components/chat-components/chat-message.mjs.map +1 -1
- package/dist/components/chat-components/chat-panel.mjs +9 -301
- package/dist/components/chat-components/chat-panel.mjs.map +1 -1
- package/dist/components/chat-components/chat-scroll-anchor.mjs +4 -44
- package/dist/components/chat-components/chat-scroll-anchor.mjs.map +1 -1
- package/dist/components/chat-components/clear-history.mjs +25 -249
- package/dist/components/chat-components/clear-history.mjs.map +1 -1
- package/dist/components/chat-components/copilot-chat.mjs +21 -809
- package/dist/components/chat-components/copilot-chat.mjs.map +1 -1
- package/dist/components/chat-components/default-empty-screen.mjs +7 -175
- package/dist/components/chat-components/default-empty-screen.mjs.map +1 -1
- package/dist/components/chat-components/external-link.mjs +3 -25
- package/dist/components/chat-components/external-link.mjs.map +1 -1
- package/dist/components/chat-components/markdown.mjs +3 -10
- package/dist/components/chat-components/markdown.mjs.map +1 -1
- package/dist/components/chat-components/prompt-form.mjs +8 -227
- package/dist/components/chat-components/prompt-form.mjs.map +1 -1
- package/dist/components/chat-components/theme-toggle.mjs +14 -130
- package/dist/components/chat-components/theme-toggle.mjs.map +1 -1
- package/dist/components/chat-components/toaster.mjs +3 -7
- package/dist/components/chat-components/toaster.mjs.map +1 -1
- package/dist/components/chat-components/ui/alert-dialog.mjs +5 -199
- package/dist/components/chat-components/ui/alert-dialog.mjs.map +1 -1
- package/dist/components/chat-components/ui/badge.mjs +7 -49
- package/dist/components/chat-components/ui/badge.mjs.map +1 -1
- package/dist/components/chat-components/ui/button.mjs +4 -85
- package/dist/components/chat-components/ui/button.mjs.map +1 -1
- package/dist/components/chat-components/ui/codeblock.mjs +7 -283
- package/dist/components/chat-components/ui/codeblock.mjs.map +1 -1
- package/dist/components/chat-components/ui/dialog.mjs +25 -93
- package/dist/components/chat-components/ui/dialog.mjs.map +1 -1
- package/dist/components/chat-components/ui/dropdown-menu.mjs +8 -61
- package/dist/components/chat-components/ui/dropdown-menu.mjs.map +1 -1
- package/dist/components/chat-components/ui/icons.mjs +4 -554
- package/dist/components/chat-components/ui/icons.mjs.map +1 -1
- package/dist/components/chat-components/ui/input.mjs +7 -48
- package/dist/components/chat-components/ui/input.mjs.map +1 -1
- package/dist/components/chat-components/ui/label.mjs +9 -51
- package/dist/components/chat-components/ui/label.mjs.map +1 -1
- package/dist/components/chat-components/ui/select.mjs +23 -106
- package/dist/components/chat-components/ui/select.mjs.map +1 -1
- package/dist/components/chat-components/ui/separator.mjs +4 -68
- package/dist/components/chat-components/ui/separator.mjs.map +1 -1
- package/dist/components/chat-components/ui/sheet.mjs +23 -92
- package/dist/components/chat-components/ui/sheet.mjs.map +1 -1
- package/dist/components/chat-components/ui/switch.mjs +8 -53
- package/dist/components/chat-components/ui/switch.mjs.map +1 -1
- package/dist/components/chat-components/ui/textarea.mjs +7 -48
- package/dist/components/chat-components/ui/textarea.mjs.map +1 -1
- package/dist/components/chat-components/ui/tooltip.mjs +4 -72
- package/dist/components/chat-components/ui/tooltip.mjs.map +1 -1
- package/dist/components/index.mjs +25 -925
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/sidebar/copilot-sidebar-ui-provider.mjs +24 -920
- package/dist/components/sidebar/copilot-sidebar-ui-provider.mjs.map +1 -1
- package/dist/components/sidebar/copilot-sidebar.mjs +22 -842
- package/dist/components/sidebar/copilot-sidebar.mjs.map +1 -1
- package/dist/components/sidebar/sidebar-context.mjs +3 -10
- package/dist/components/sidebar/sidebar-context.mjs.map +1 -1
- package/dist/context/index.mjs +2 -0
- package/dist/context/index.mjs.map +1 -1
- package/dist/hooks/index.mjs +2 -0
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/use-at-bottom.mjs +3 -19
- package/dist/hooks/use-at-bottom.mjs.map +1 -1
- package/dist/hooks/use-copy-to-clipboard.mjs +3 -26
- package/dist/hooks/use-copy-to-clipboard.mjs.map +1 -1
- package/dist/hooks/use-enter-submit.mjs +3 -16
- package/dist/hooks/use-enter-submit.mjs.map +1 -1
- package/dist/index.mjs +28 -925
- package/dist/index.mjs.map +1 -1
- package/dist/lib/utils.mjs +3 -62
- package/dist/lib/utils.mjs.map +1 -1
- package/dist/lib/utils.test.mjs +1 -0
- package/dist/lib/utils.test.mjs.map +1 -1
- package/dist/types/index.mjs +2 -0
- package/dist/types/index.mjs.map +1 -1
- package/dist/types/types.mjs +2 -0
- package/dist/types/types.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -1,228 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
var __async = (__this, __arguments, generator) => {
|
|
33
|
-
return new Promise((resolve, reject) => {
|
|
34
|
-
var fulfilled = (value) => {
|
|
35
|
-
try {
|
|
36
|
-
step(generator.next(value));
|
|
37
|
-
} catch (e) {
|
|
38
|
-
reject(e);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var rejected = (value) => {
|
|
42
|
-
try {
|
|
43
|
-
step(generator.throw(value));
|
|
44
|
-
} catch (e) {
|
|
45
|
-
reject(e);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
// src/components/chat-components/prompt-form.tsx
|
|
54
|
-
import * as React4 from "react";
|
|
55
|
-
import TextareaAutosize from "react-textarea-autosize";
|
|
56
|
-
|
|
57
|
-
// src/hooks/use-enter-submit.tsx
|
|
58
|
-
import { useRef } from "react";
|
|
59
|
-
function useEnterSubmit() {
|
|
60
|
-
const formRef = useRef(null);
|
|
61
|
-
const handleKeyDown = (event) => {
|
|
62
|
-
var _a;
|
|
63
|
-
if (event.key === "Enter" && !event.shiftKey && !event.nativeEvent.isComposing) {
|
|
64
|
-
(_a = formRef.current) == null ? void 0 : _a.requestSubmit();
|
|
65
|
-
event.preventDefault();
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
return { formRef, onKeyDown: handleKeyDown };
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// src/components/chat-components/ui/button.tsx
|
|
72
|
-
import * as React from "react";
|
|
73
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
74
|
-
import { cva } from "class-variance-authority";
|
|
75
|
-
|
|
76
|
-
// src/lib/utils.ts
|
|
77
|
-
import { clsx } from "clsx";
|
|
78
|
-
import { customAlphabet } from "nanoid";
|
|
79
|
-
import { twMerge } from "tailwind-merge";
|
|
80
|
-
function cn(...inputs) {
|
|
81
|
-
return twMerge(clsx(inputs));
|
|
82
|
-
}
|
|
83
|
-
var nanoid = customAlphabet(
|
|
84
|
-
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
85
|
-
7
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
// src/components/chat-components/ui/button.tsx
|
|
89
|
-
import { jsx } from "react/jsx-runtime";
|
|
90
|
-
var buttonVariants = cva(
|
|
91
|
-
"inline-flex items-center justify-center rounded-md text-sm font-medium shadow ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
92
|
-
{
|
|
93
|
-
variants: {
|
|
94
|
-
variant: {
|
|
95
|
-
default: "bg-primary text-primary-foreground shadow-md hover:bg-primary/90",
|
|
96
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
97
|
-
outline: "border border-input hover:bg-accent hover:text-accent-foreground",
|
|
98
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
99
|
-
ghost: "shadow-none hover:bg-accent hover:text-accent-foreground",
|
|
100
|
-
link: "text-primary underline-offset-4 shadow-none hover:underline"
|
|
101
|
-
},
|
|
102
|
-
size: {
|
|
103
|
-
default: "h-8 px-4 py-2",
|
|
104
|
-
sm: "h-8 rounded-md px-3",
|
|
105
|
-
lg: "h-11 rounded-md px-8",
|
|
106
|
-
icon: "h-8 w-8 p-0"
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
defaultVariants: {
|
|
110
|
-
variant: "default",
|
|
111
|
-
size: "default"
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
var Button = React.forwardRef(
|
|
116
|
-
(_a, ref) => {
|
|
117
|
-
var _b = _a, { className, variant, size, asChild = false } = _b, props = __objRest(_b, ["className", "variant", "size", "asChild"]);
|
|
118
|
-
const Comp = asChild ? Slot : "button";
|
|
119
|
-
return /* @__PURE__ */ jsx(Comp, __spreadValues({ className: cn(buttonVariants({ variant, size, className })), ref }, props));
|
|
120
|
-
}
|
|
121
|
-
);
|
|
122
|
-
Button.displayName = "Button";
|
|
123
|
-
|
|
124
|
-
// src/components/chat-components/ui/tooltip.tsx
|
|
125
|
-
import * as React2 from "react";
|
|
126
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
127
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
128
|
-
var Tooltip = TooltipPrimitive.Root;
|
|
129
|
-
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
130
|
-
var TooltipContent = React2.forwardRef((_a, ref) => {
|
|
131
|
-
var _b = _a, { className, sideOffset = 4 } = _b, props = __objRest(_b, ["className", "sideOffset"]);
|
|
132
|
-
return /* @__PURE__ */ jsx2(
|
|
133
|
-
TooltipPrimitive.Content,
|
|
134
|
-
__spreadValues({
|
|
135
|
-
ref,
|
|
136
|
-
sideOffset,
|
|
137
|
-
className: cn(
|
|
138
|
-
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-xs font-medium text-popover-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",
|
|
139
|
-
className
|
|
140
|
-
)
|
|
141
|
-
}, props)
|
|
142
|
-
);
|
|
143
|
-
});
|
|
144
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
145
|
-
|
|
146
|
-
// src/components/chat-components/ui/icons.tsx
|
|
147
|
-
import * as React3 from "react";
|
|
148
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
149
|
-
function IconArrowElbow(_a) {
|
|
150
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
151
|
-
return /* @__PURE__ */ jsx3(
|
|
152
|
-
"svg",
|
|
153
|
-
__spreadProps(__spreadValues({
|
|
154
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
155
|
-
viewBox: "0 0 256 256",
|
|
156
|
-
fill: "currentColor",
|
|
157
|
-
className: cn("h-4 w-4", className)
|
|
158
|
-
}, props), {
|
|
159
|
-
children: /* @__PURE__ */ jsx3("path", { d: "M200 32v144a8 8 0 0 1-8 8H67.31l34.35 34.34a8 8 0 0 1-11.32 11.32l-48-48a8 8 0 0 1 0-11.32l48-48a8 8 0 0 1 11.32 11.32L67.31 168H184V32a8 8 0 0 1 16 0Z" })
|
|
160
|
-
})
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// src/components/chat-components/prompt-form.tsx
|
|
165
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
166
|
-
function PromptForm({ onSubmit, input, setInput, isLoading }) {
|
|
167
|
-
const { formRef, onKeyDown } = useEnterSubmit();
|
|
168
|
-
const inputRef = React4.useRef(null);
|
|
169
|
-
React4.useEffect(() => {
|
|
170
|
-
if (inputRef.current) {
|
|
171
|
-
inputRef.current.focus();
|
|
172
|
-
}
|
|
173
|
-
}, []);
|
|
174
|
-
return /* @__PURE__ */ jsx4(
|
|
175
|
-
"form",
|
|
176
|
-
{
|
|
177
|
-
onSubmit: (e) => __async(this, null, function* () {
|
|
178
|
-
e.preventDefault();
|
|
179
|
-
if (!(input == null ? void 0 : input.trim())) {
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
setInput("");
|
|
183
|
-
yield onSubmit(input);
|
|
184
|
-
}),
|
|
185
|
-
ref: formRef,
|
|
186
|
-
children: /* @__PURE__ */ jsxs2("div", { className: "relative flex max-h-60 w-full grow flex-col overflow-hidden bg-background px-8 sm:rounded-md border sm:px-12", children: [
|
|
187
|
-
/* @__PURE__ */ jsxs2(Tooltip, { children: [
|
|
188
|
-
/* @__PURE__ */ jsx4(TooltipTrigger, { asChild: true }),
|
|
189
|
-
/* @__PURE__ */ jsx4(TooltipContent, { children: "New Chat" })
|
|
190
|
-
] }),
|
|
191
|
-
/* @__PURE__ */ jsx4(
|
|
192
|
-
TextareaAutosize,
|
|
193
|
-
{
|
|
194
|
-
ref: inputRef,
|
|
195
|
-
tabIndex: 0,
|
|
196
|
-
onKeyDown,
|
|
197
|
-
rows: 1,
|
|
198
|
-
value: input,
|
|
199
|
-
onChange: (e) => setInput(e.target.value),
|
|
200
|
-
placeholder: "Send a message.",
|
|
201
|
-
spellCheck: false,
|
|
202
|
-
className: "min-h-[60px] w-full resize-none bg-transparent px-4 py-[1.3rem] focus-within:outline-none sm:text-sm"
|
|
203
|
-
}
|
|
204
|
-
),
|
|
205
|
-
/* @__PURE__ */ jsx4("div", { className: "absolute right-0 top-4 sm:right-4", children: /* @__PURE__ */ jsxs2(Tooltip, { children: [
|
|
206
|
-
/* @__PURE__ */ jsx4(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs2(
|
|
207
|
-
Button,
|
|
208
|
-
{
|
|
209
|
-
type: "submit",
|
|
210
|
-
size: "icon",
|
|
211
|
-
disabled: isLoading || input === "",
|
|
212
|
-
className: " bg-slate-300",
|
|
213
|
-
children: [
|
|
214
|
-
/* @__PURE__ */ jsx4(IconArrowElbow, {}),
|
|
215
|
-
/* @__PURE__ */ jsx4("span", { className: "sr-only", children: "Send message" })
|
|
216
|
-
]
|
|
217
|
-
}
|
|
218
|
-
) }),
|
|
219
|
-
/* @__PURE__ */ jsx4(TooltipContent, { children: "Send message" })
|
|
220
|
-
] }) })
|
|
221
|
-
] })
|
|
222
|
-
}
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
export {
|
|
226
|
-
PromptForm
|
|
227
|
-
};
|
|
1
|
+
export { PromptForm } from '../../chunk-INCNMGJ7.mjs';
|
|
2
|
+
import '../../chunk-VGX2W5ZB.mjs';
|
|
3
|
+
import '../../chunk-M3CZWJI3.mjs';
|
|
4
|
+
import '../../chunk-2KAF7NKC.mjs';
|
|
5
|
+
import '../../chunk-Q6YO7LDK.mjs';
|
|
6
|
+
import '../../chunk-OHWEJUCS.mjs';
|
|
7
|
+
import '../../chunk-MRXNTQOX.mjs';
|
|
8
|
+
//# sourceMappingURL=out.js.map
|
|
228
9
|
//# sourceMappingURL=prompt-form.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/chat-components/prompt-form.tsx","../../../src/hooks/use-enter-submit.tsx","../../../src/components/chat-components/ui/button.tsx","../../../src/lib/utils.ts","../../../src/components/chat-components/ui/tooltip.tsx","../../../src/components/chat-components/ui/icons.tsx"],"sourcesContent":["import * as React from \"react\";\nimport TextareaAutosize from \"react-textarea-autosize\";\nimport { UseChatHelpers } from \"@copilotkit/react-core\";\n\nimport { useEnterSubmit } from \"../../hooks/use-enter-submit\";\nimport { cn } from \"../../lib/utils\";\nimport { Button, buttonVariants } from \"./ui/button\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"./ui/tooltip\";\nimport { IconArrowElbow, IconPlus } from \"./ui/icons\";\n// import Link from \"next/link\";\n\nexport interface PromptProps extends Pick<UseChatHelpers, \"input\" | \"setInput\"> {\n onSubmit: (value: string) => Promise<void>;\n isLoading: boolean;\n}\n\nexport function PromptForm({ onSubmit, input, setInput, isLoading }: PromptProps) {\n const { formRef, onKeyDown } = useEnterSubmit();\n const inputRef = React.useRef<HTMLTextAreaElement>(null);\n\n React.useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n }, []);\n\n return (\n <form\n onSubmit={async (e) => {\n e.preventDefault();\n if (!input?.trim()) {\n return;\n }\n setInput(\"\");\n await onSubmit(input);\n }}\n ref={formRef}\n >\n <div className=\"relative flex max-h-60 w-full grow flex-col overflow-hidden bg-background px-8 sm:rounded-md border sm:px-12\">\n <Tooltip>\n <TooltipTrigger asChild>\n {/* <Link\n href=\"/\"\n className={cn(\n buttonVariants({ size: \"sm\", variant: \"outline\" }),\n \"absolute left-0 top-4 h-8 w-8 rounded-full bg-background p-0 sm:left-4\"\n )}\n >\n <IconPlus />\n <span className=\"sr-only\">New Chat</span>\n </Link> */}\n </TooltipTrigger>\n <TooltipContent>New Chat</TooltipContent>\n </Tooltip>\n <TextareaAutosize\n ref={inputRef}\n tabIndex={0}\n onKeyDown={onKeyDown}\n rows={1}\n value={input}\n onChange={(e) => setInput(e.target.value)}\n placeholder=\"Send a message.\"\n spellCheck={false}\n className=\"min-h-[60px] w-full resize-none bg-transparent px-4 py-[1.3rem] focus-within:outline-none sm:text-sm\"\n />\n <div className=\"absolute right-0 top-4 sm:right-4\">\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"submit\"\n size=\"icon\"\n disabled={isLoading || input === \"\"}\n className=\" bg-slate-300\"\n >\n <IconArrowElbow />\n <span className=\"sr-only\">Send message</span>\n </Button>\n </TooltipTrigger>\n <TooltipContent>Send message</TooltipContent>\n </Tooltip>\n </div>\n </div>\n </form>\n );\n}\n","import { useRef, type RefObject } from \"react\";\n\nexport function useEnterSubmit(): {\n formRef: RefObject<HTMLFormElement>;\n onKeyDown: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;\n} {\n const formRef = useRef<HTMLFormElement>(null);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>): void => {\n if (event.key === \"Enter\" && !event.shiftKey && !event.nativeEvent.isComposing) {\n formRef.current?.requestSubmit();\n event.preventDefault();\n }\n };\n\n return { formRef, onKeyDown: handleKeyDown };\n}\n","import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium shadow ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow-md hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline: \"border border-input hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"shadow-none hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 shadow-none hover:underline\",\n },\n size: {\n default: \"h-8 px-4 py-2\",\n sm: \"h-8 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-8 w-8 p-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { customAlphabet } from \"nanoid\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const nanoid = customAlphabet(\n \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n 7,\n); // 7-character random string\n\nexport async function fetcher<JSON = any>(input: RequestInfo, init?: RequestInit): Promise<JSON> {\n const res = await fetch(input, init);\n\n if (!res.ok) {\n const json = await res.json();\n if (json.error) {\n const error = new Error(json.error) as Error & {\n status: number;\n };\n error.status = res.status;\n throw error;\n } else {\n throw new Error(\"An unexpected error occurred\");\n }\n }\n\n return res.json();\n}\n\nexport function formatDate(input: string | number | Date): string {\n const date = new Date(input);\n return date.toLocaleDateString(\"en-US\", {\n month: \"long\",\n day: \"numeric\",\n year: \"numeric\",\n });\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst TooltipProvider = TooltipPrimitive.Provider;\n\nconst Tooltip = TooltipPrimitive.Root;\n\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-xs font-medium text-popover-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1\",\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nfunction IconNextChat({\n className,\n inverted,\n ...props\n}: React.ComponentProps<\"svg\"> & { inverted?: boolean }) {\n const id = React.useId();\n\n return (\n <svg\n viewBox=\"0 0 17 17\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <defs>\n <linearGradient\n id={`gradient-${id}-1`}\n x1=\"10.6889\"\n y1=\"10.3556\"\n x2=\"13.8445\"\n y2=\"14.2667\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor={inverted ? \"white\" : \"black\"} />\n <stop offset={1} stopColor={inverted ? \"white\" : \"black\"} stopOpacity={0} />\n </linearGradient>\n <linearGradient\n id={`gradient-${id}-2`}\n x1=\"11.7555\"\n y1=\"4.8\"\n x2=\"11.7376\"\n y2=\"9.50002\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor={inverted ? \"white\" : \"black\"} />\n <stop offset={1} stopColor={inverted ? \"white\" : \"black\"} stopOpacity={0} />\n </linearGradient>\n </defs>\n <path\n d=\"M1 16L2.58314 11.2506C1.83084 9.74642 1.63835 8.02363 2.04013 6.39052C2.4419 4.75741 3.41171 3.32057 4.776 2.33712C6.1403 1.35367 7.81003 0.887808 9.4864 1.02289C11.1628 1.15798 12.7364 1.8852 13.9256 3.07442C15.1148 4.26363 15.842 5.83723 15.9771 7.5136C16.1122 9.18997 15.6463 10.8597 14.6629 12.224C13.6794 13.5883 12.2426 14.5581 10.6095 14.9599C8.97637 15.3616 7.25358 15.1692 5.74942 14.4169L1 16Z\"\n fill={inverted ? \"black\" : \"white\"}\n stroke={inverted ? \"black\" : \"white\"}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <mask\n id=\"mask0_91_2047\"\n style={{ maskType: \"alpha\" }}\n maskUnits=\"userSpaceOnUse\"\n x={1}\n y={0}\n width={16}\n height={16}\n >\n <circle cx={9} cy={8} r={8} fill={inverted ? \"black\" : \"white\"} />\n </mask>\n <g mask=\"url(#mask0_91_2047)\">\n <circle cx={9} cy={8} r={8} fill={inverted ? \"black\" : \"white\"} />\n <path\n d=\"M14.2896 14.0018L7.146 4.8H5.80005V11.1973H6.87681V6.16743L13.4444 14.6529C13.7407 14.4545 14.0231 14.2369 14.2896 14.0018Z\"\n fill={`url(#gradient-${id}-1)`}\n />\n <rect x=\"11.2222\" y=\"4.8\" width=\"1.06667\" height=\"6.4\" fill={`url(#gradient-${id}-2)`} />\n </g>\n </svg>\n );\n}\n\nfunction IconOpenAI({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n role=\"img\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <title>OpenAI icon</title>\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n );\n}\n\nfunction IconVercel({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n aria-label=\"Vercel logomark\"\n role=\"img\"\n viewBox=\"0 0 74 64\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M37.5896 0.25L74.5396 64.25H0.639648L37.5896 0.25Z\" fill=\"currentColor\"></path>\n </svg>\n );\n}\n\nfunction IconGitHub({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n role=\"img\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <title>GitHub</title>\n <path d=\"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12\" />\n </svg>\n );\n}\n\nfunction IconSeparator({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n fill=\"none\"\n shapeRendering=\"geometricPrecision\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M16.88 3.549L7.12 20.451\"></path>\n </svg>\n );\n}\n\nfunction IconArrowDown({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"m205.66 149.66-72 72a8 8 0 0 1-11.32 0l-72-72a8 8 0 0 1 11.32-11.32L120 196.69V40a8 8 0 0 1 16 0v156.69l58.34-58.35a8 8 0 0 1 11.32 11.32Z\" />\n </svg>\n );\n}\n\nfunction IconArrowRight({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"m221.66 133.66-72 72a8 8 0 0 1-11.32-11.32L196.69 136H40a8 8 0 0 1 0-16h156.69l-58.35-58.34a8 8 0 0 1 11.32-11.32l72 72a8 8 0 0 1 0 11.32Z\" />\n </svg>\n );\n}\n\nfunction IconUser({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M230.92 212c-15.23-26.33-38.7-45.21-66.09-54.16a72 72 0 1 0-73.66 0c-27.39 8.94-50.86 27.82-66.09 54.16a8 8 0 1 0 13.85 8c18.84-32.56 52.14-52 89.07-52s70.23 19.44 89.07 52a8 8 0 1 0 13.85-8ZM72 96a56 56 0 1 1 56 56 56.06 56.06 0 0 1-56-56Z\" />\n </svg>\n );\n}\n\nfunction IconPlus({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M224 128a8 8 0 0 1-8 8h-80v80a8 8 0 0 1-16 0v-80H40a8 8 0 0 1 0-16h80V40a8 8 0 0 1 16 0v80h80a8 8 0 0 1 8 8Z\" />\n </svg>\n );\n}\n\nfunction IconArrowElbow({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M200 32v144a8 8 0 0 1-8 8H67.31l34.35 34.34a8 8 0 0 1-11.32 11.32l-48-48a8 8 0 0 1 0-11.32l48-48a8 8 0 0 1 11.32 11.32L67.31 168H184V32a8 8 0 0 1 16 0Z\" />\n </svg>\n );\n}\n\nfunction IconSpinner({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4 animate-spin\", className)}\n {...props}\n >\n <path d=\"M232 128a104 104 0 0 1-208 0c0-41 23.81-78.36 60.66-95.27a8 8 0 0 1 6.68 14.54C60.15 61.59 40 93.27 40 128a88 88 0 0 0 176 0c0-34.73-20.15-66.41-51.34-80.73a8 8 0 0 1 6.68-14.54C208.19 49.64 232 87 232 128Z\" />\n </svg>\n );\n}\n\nfunction IconMessage({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M216 48H40a16 16 0 0 0-16 16v160a15.84 15.84 0 0 0 9.25 14.5A16.05 16.05 0 0 0 40 240a15.89 15.89 0 0 0 10.25-3.78.69.69 0 0 0 .13-.11L82.5 208H216a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16ZM40 224Zm176-32H82.5a16 16 0 0 0-10.3 3.75l-.12.11L40 224V64h176Z\" />\n </svg>\n );\n}\n\nfunction IconTrash({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M216 48h-40v-8a24 24 0 0 0-24-24h-48a24 24 0 0 0-24 24v8H40a8 8 0 0 0 0 16h8v144a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16V64h8a8 8 0 0 0 0-16ZM96 40a8 8 0 0 1 8-8h48a8 8 0 0 1 8 8v8H96Zm96 168H64V64h128Zm-80-104v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Zm48 0v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Z\" />\n </svg>\n );\n}\n\nfunction IconRefresh({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M197.67 186.37a8 8 0 0 1 0 11.29C196.58 198.73 170.82 224 128 224c-37.39 0-64.53-22.4-80-39.85V208a8 8 0 0 1-16 0v-48a8 8 0 0 1 8-8h48a8 8 0 0 1 0 16H55.44C67.76 183.35 93 208 128 208c36 0 58.14-21.46 58.36-21.68a8 8 0 0 1 11.31.05ZM216 40a8 8 0 0 0-8 8v23.85C192.53 54.4 165.39 32 128 32c-42.82 0-68.58 25.27-69.66 26.34a8 8 0 0 0 11.3 11.34C69.86 69.46 92 48 128 48c35 0 60.24 24.65 72.56 40H168a8 8 0 0 0 0 16h48a8 8 0 0 0 8-8V48a8 8 0 0 0-8-8Z\" />\n </svg>\n );\n}\n\nfunction IconStop({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm24-120h-48a8 8 0 0 0-8 8v48a8 8 0 0 0 8 8h48a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8Zm-8 48h-32v-32h32Z\" />\n </svg>\n );\n}\n\nfunction IconSidebar({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M216 40H40a16 16 0 0 0-16 16v144a16 16 0 0 0 16 16h176a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16ZM40 56h40v144H40Zm176 144H96V56h120v144Z\" />\n </svg>\n );\n}\n\nfunction IconMoon({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M233.54 142.23a8 8 0 0 0-8-2 88.08 88.08 0 0 1-109.8-109.8 8 8 0 0 0-10-10 104.84 104.84 0 0 0-52.91 37A104 104 0 0 0 136 224a103.09 103.09 0 0 0 62.52-20.88 104.84 104.84 0 0 0 37-52.91 8 8 0 0 0-1.98-7.98Zm-44.64 48.11A88 88 0 0 1 65.66 67.11a89 89 0 0 1 31.4-26A106 106 0 0 0 96 56a104.11 104.11 0 0 0 104 104 106 106 0 0 0 14.92-1.06 89 89 0 0 1-26.02 31.4Z\" />\n </svg>\n );\n}\n\nfunction IconSun({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M120 40V16a8 8 0 0 1 16 0v24a8 8 0 0 1-16 0Zm72 88a64 64 0 1 1-64-64 64.07 64.07 0 0 1 64 64Zm-16 0a48 48 0 1 0-48 48 48.05 48.05 0 0 0 48-48ZM58.34 69.66a8 8 0 0 0 11.32-11.32l-16-16a8 8 0 0 0-11.32 11.32Zm0 116.68-16 16a8 8 0 0 0 11.32 11.32l16-16a8 8 0 0 0-11.32-11.32ZM192 72a8 8 0 0 0 5.66-2.34l16-16a8 8 0 0 0-11.32-11.32l-16 16A8 8 0 0 0 192 72Zm5.66 114.34a8 8 0 0 0-11.32 11.32l16 16a8 8 0 0 0 11.32-11.32ZM48 128a8 8 0 0 0-8-8H16a8 8 0 0 0 0 16h24a8 8 0 0 0 8-8Zm80 80a8 8 0 0 0-8 8v24a8 8 0 0 0 16 0v-24a8 8 0 0 0-8-8Zm112-88h-24a8 8 0 0 0 0 16h24a8 8 0 0 0 0-16Z\" />\n </svg>\n );\n}\n\nfunction IconCopy({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M216 32H88a8 8 0 0 0-8 8v40H40a8 8 0 0 0-8 8v128a8 8 0 0 0 8 8h128a8 8 0 0 0 8-8v-40h40a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8Zm-56 176H48V96h112Zm48-48h-32V88a8 8 0 0 0-8-8H96V48h112Z\" />\n </svg>\n );\n}\n\nfunction IconCheck({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"m229.66 77.66-128 128a8 8 0 0 1-11.32 0l-56-56a8 8 0 0 1 11.32-11.32L96 188.69 218.34 66.34a8 8 0 0 1 11.32 11.32Z\" />\n </svg>\n );\n}\n\nfunction IconDownload({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M224 152v56a16 16 0 0 1-16 16H48a16 16 0 0 1-16-16v-56a8 8 0 0 1 16 0v56h160v-56a8 8 0 0 1 16 0Zm-101.66 5.66a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0-11.32-11.32L136 132.69V40a8 8 0 0 0-16 0v92.69l-26.34-26.35a8 8 0 0 0-11.32 11.32Z\" />\n </svg>\n );\n}\n\nfunction IconClose({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M205.66 194.34a8 8 0 0 1-11.32 11.32L128 139.31l-66.34 66.35a8 8 0 0 1-11.32-11.32L116.69 128 50.34 61.66a8 8 0 0 1 11.32-11.32L128 116.69l66.34-66.35a8 8 0 0 1 11.32 11.32L139.31 128Z\" />\n </svg>\n );\n}\n\nfunction IconEdit({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth={1.5}\n stroke=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10\"\n />\n </svg>\n );\n}\n\nfunction IconShare({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n viewBox=\"0 0 256 256\"\n {...props}\n >\n <path d=\"m237.66 106.35-80-80A8 8 0 0 0 144 32v40.35c-25.94 2.22-54.59 14.92-78.16 34.91-28.38 24.08-46.05 55.11-49.76 87.37a12 12 0 0 0 20.68 9.58c11-11.71 50.14-48.74 107.24-52V192a8 8 0 0 0 13.66 5.65l80-80a8 8 0 0 0 0-11.3ZM160 172.69V144a8 8 0 0 0-8-8c-28.08 0-55.43 7.33-81.29 21.8a196.17 196.17 0 0 0-36.57 26.52c5.8-23.84 20.42-46.51 42.05-64.86C99.41 99.77 127.75 88 152 88a8 8 0 0 0 8-8V51.32L220.69 112Z\" />\n </svg>\n );\n}\n\nfunction IconUsers({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n viewBox=\"0 0 256 256\"\n {...props}\n >\n <path d=\"M117.25 157.92a60 60 0 1 0-66.5 0 95.83 95.83 0 0 0-47.22 37.71 8 8 0 1 0 13.4 8.74 80 80 0 0 1 134.14 0 8 8 0 0 0 13.4-8.74 95.83 95.83 0 0 0-47.22-37.71ZM40 108a44 44 0 1 1 44 44 44.05 44.05 0 0 1-44-44Zm210.14 98.7a8 8 0 0 1-11.07-2.33A79.83 79.83 0 0 0 172 168a8 8 0 0 1 0-16 44 44 0 1 0-16.34-84.87 8 8 0 1 1-5.94-14.85 60 60 0 0 1 55.53 105.64 95.83 95.83 0 0 1 47.22 37.71 8 8 0 0 1-2.33 11.07Z\" />\n </svg>\n );\n}\n\nfunction IconExternalLink({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n viewBox=\"0 0 256 256\"\n {...props}\n >\n <path d=\"M224 104a8 8 0 0 1-16 0V59.32l-66.33 66.34a8 8 0 0 1-11.32-11.32L196.68 48H152a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8Zm-40 24a8 8 0 0 0-8 8v72H48V80h72a8 8 0 0 0 0-16H48a16 16 0 0 0-16 16v128a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-72a8 8 0 0 0-8-8Z\" />\n </svg>\n );\n}\n\nfunction IconChevronUpDown({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n viewBox=\"0 0 256 256\"\n {...props}\n >\n <path d=\"M181.66 170.34a8 8 0 0 1 0 11.32l-48 48a8 8 0 0 1-11.32 0l-48-48a8 8 0 0 1 11.32-11.32L128 212.69l42.34-42.35a8 8 0 0 1 11.32 0Zm-96-84.68L128 43.31l42.34 42.35a8 8 0 0 0 11.32-11.32l-48-48a8 8 0 0 0-11.32 0l-48 48a8 8 0 0 0 11.32 11.32Z\" />\n </svg>\n );\n}\n\nexport {\n IconEdit,\n IconNextChat,\n IconOpenAI,\n IconVercel,\n IconGitHub,\n IconSeparator,\n IconArrowDown,\n IconArrowRight,\n IconUser,\n IconPlus,\n IconArrowElbow,\n IconSpinner,\n IconMessage,\n IconTrash,\n IconRefresh,\n IconStop,\n IconSidebar,\n IconMoon,\n IconSun,\n IconCopy,\n IconCheck,\n IconDownload,\n IconClose,\n IconShare,\n IconUsers,\n IconExternalLink,\n IconChevronUpDown,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAYA,YAAW;AACvB,OAAO,sBAAsB;;;ACD7B,SAAS,cAA8B;AAEhC,SAAS,iBAGd;AACA,QAAM,UAAU,OAAwB,IAAI;AAE5C,QAAM,gBAAgB,CAAC,UAA0D;AARnF;AASI,QAAI,MAAM,QAAQ,WAAW,CAAC,MAAM,YAAY,CAAC,MAAM,YAAY,aAAa;AAC9E,oBAAQ,YAAR,mBAAiB;AACjB,YAAM,eAAe;AAAA,IACvB;AAAA,EACF;AAEA,SAAO,EAAE,SAAS,WAAW,cAAc;AAC7C;;;AChBA,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;;;ACFvC,SAAS,YAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;AAEO,IAAM,SAAS;AAAA,EACpB;AAAA,EACA;AACF;;;AD+BM;AApCN,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aAAa;AAAA,QACb,SAAS;AAAA,QACT,WAAW;AAAA,QACX,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAQA,IAAM,SAAe;AAAA,EACnB,CAAC,IAAyD,QAAQ;AAAjE,iBAAE,aAAW,SAAS,MAAM,UAAU,MAvCzC,IAuCG,IAAgD,kBAAhD,IAAgD,CAA9C,aAAW,WAAS,QAAM;AAC3B,UAAM,OAAO,UAAU,OAAO;AAC9B,WACE,oBAAC,uBAAK,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC,GAAG,OAAc,MAAO;AAAA,EAE5F;AACF;AACA,OAAO,cAAc;;;AE5CrB,YAAYC,YAAW;AACvB,YAAY,sBAAsB;AAchC,gBAAAC,YAAA;AARF,IAAM,UAA2B;AAEjC,IAAM,iBAAkC;AAExC,IAAM,iBAAuB,kBAG3B,CAAC,IAAyC,QAAK;AAA9C,eAAE,aAAW,aAAa,EAhB7B,IAgBG,IAAgC,kBAAhC,IAAgC,CAA9B,aAAW;AACd,yBAAAC;AAAA,IAAkB;AAAA,IAAjB;AAAA,MACC;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,OACI;AAAA,EACN;AAAA,CACD;AACD,eAAe,cAA+B,yBAAQ;;;ACzBtD,YAAYC,YAAW;AAoBf,SAQE,OAAAC,MARF;AA+KR,SAAS,eAAe,IAAsD;AAAtD,eAAE,YArM1B,IAqMwB,IAAgB,kBAAhB,IAAgB,CAAd;AACxB,SACE,gBAAAC;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,WAAW,GAAG,WAAW,SAAS;AAAA,OAC9B,QALL;AAAA,MAOC,0BAAAA,KAAC,UAAK,GAAE,2JAA0J;AAAA;AAAA,EACpK;AAEJ;;;AL1KQ,SACE,OAAAC,MADF,QAAAC,aAAA;AAvBD,SAAS,WAAW,EAAE,UAAU,OAAO,UAAU,UAAU,GAAgB;AAChF,QAAM,EAAE,SAAS,UAAU,IAAI,eAAe;AAC9C,QAAM,WAAiB,cAA4B,IAAI;AAEvD,EAAM,iBAAU,MAAM;AACpB,QAAI,SAAS,SAAS;AACpB,eAAS,QAAQ,MAAM;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SACE,gBAAAD;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,CAAO,MAAM;AACrB,UAAE,eAAe;AACjB,YAAI,EAAC,+BAAO,SAAQ;AAClB;AAAA,QACF;AACA,iBAAS,EAAE;AACX,cAAM,SAAS,KAAK;AAAA,MACtB;AAAA,MACA,KAAK;AAAA,MAEL,0BAAAC,MAAC,SAAI,WAAU,gHACb;AAAA,wBAAAA,MAAC,WACC;AAAA,0BAAAD,KAAC,kBAAe,SAAO,MAWvB;AAAA,UACA,gBAAAA,KAAC,kBAAe,sBAAQ;AAAA,WAC1B;AAAA,QACA,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,KAAK;AAAA,YACL,UAAU;AAAA,YACV;AAAA,YACA,MAAM;AAAA,YACN,OAAO;AAAA,YACP,UAAU,CAAC,MAAM,SAAS,EAAE,OAAO,KAAK;AAAA,YACxC,aAAY;AAAA,YACZ,YAAY;AAAA,YACZ,WAAU;AAAA;AAAA,QACZ;AAAA,QACA,gBAAAA,KAAC,SAAI,WAAU,qCACb,0BAAAC,MAAC,WACC;AAAA,0BAAAD,KAAC,kBAAe,SAAO,MACrB,0BAAAC;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,MAAK;AAAA,cACL,UAAU,aAAa,UAAU;AAAA,cACjC,WAAU;AAAA,cAEV;AAAA,gCAAAD,KAAC,kBAAe;AAAA,gBAChB,gBAAAA,KAAC,UAAK,WAAU,WAAU,0BAAY;AAAA;AAAA;AAAA,UACxC,GACF;AAAA,UACA,gBAAAA,KAAC,kBAAe,0BAAY;AAAA,WAC9B,GACF;AAAA,SACF;AAAA;AAAA,EACF;AAEJ;","names":["React","React","jsx","jsx","React","jsx","jsx","jsx","jsxs"]}
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1,131 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
-
var __objRest = (source, exclude) => {
|
|
22
|
-
var target = {};
|
|
23
|
-
for (var prop in source)
|
|
24
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
-
target[prop] = source[prop];
|
|
26
|
-
if (source != null && __getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// src/components/chat-components/theme-toggle.tsx
|
|
35
|
-
import * as React3 from "react";
|
|
36
|
-
import { useTheme } from "next-themes";
|
|
37
|
-
|
|
38
|
-
// src/components/chat-components/ui/button.tsx
|
|
39
|
-
import * as React from "react";
|
|
40
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
41
|
-
import { cva } from "class-variance-authority";
|
|
1
|
+
import { Button } from '../../chunk-M3CZWJI3.mjs';
|
|
2
|
+
import { IconMoon, IconSun } from '../../chunk-2KAF7NKC.mjs';
|
|
3
|
+
import '../../chunk-Q6YO7LDK.mjs';
|
|
4
|
+
import '../../chunk-MRXNTQOX.mjs';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { useTheme } from 'next-themes';
|
|
7
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
42
8
|
|
|
43
|
-
// src/lib/utils.ts
|
|
44
|
-
import { clsx } from "clsx";
|
|
45
|
-
import { customAlphabet } from "nanoid";
|
|
46
|
-
import { twMerge } from "tailwind-merge";
|
|
47
|
-
function cn(...inputs) {
|
|
48
|
-
return twMerge(clsx(inputs));
|
|
49
|
-
}
|
|
50
|
-
var nanoid = customAlphabet(
|
|
51
|
-
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
52
|
-
7
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
// src/components/chat-components/ui/button.tsx
|
|
56
|
-
import { jsx } from "react/jsx-runtime";
|
|
57
|
-
var buttonVariants = cva(
|
|
58
|
-
"inline-flex items-center justify-center rounded-md text-sm font-medium shadow ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
59
|
-
{
|
|
60
|
-
variants: {
|
|
61
|
-
variant: {
|
|
62
|
-
default: "bg-primary text-primary-foreground shadow-md hover:bg-primary/90",
|
|
63
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
64
|
-
outline: "border border-input hover:bg-accent hover:text-accent-foreground",
|
|
65
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
66
|
-
ghost: "shadow-none hover:bg-accent hover:text-accent-foreground",
|
|
67
|
-
link: "text-primary underline-offset-4 shadow-none hover:underline"
|
|
68
|
-
},
|
|
69
|
-
size: {
|
|
70
|
-
default: "h-8 px-4 py-2",
|
|
71
|
-
sm: "h-8 rounded-md px-3",
|
|
72
|
-
lg: "h-11 rounded-md px-8",
|
|
73
|
-
icon: "h-8 w-8 p-0"
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
defaultVariants: {
|
|
77
|
-
variant: "default",
|
|
78
|
-
size: "default"
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
var Button = React.forwardRef(
|
|
83
|
-
(_a, ref) => {
|
|
84
|
-
var _b = _a, { className, variant, size, asChild = false } = _b, props = __objRest(_b, ["className", "variant", "size", "asChild"]);
|
|
85
|
-
const Comp = asChild ? Slot : "button";
|
|
86
|
-
return /* @__PURE__ */ jsx(Comp, __spreadValues({ className: cn(buttonVariants({ variant, size, className })), ref }, props));
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
Button.displayName = "Button";
|
|
90
|
-
|
|
91
|
-
// src/components/chat-components/ui/icons.tsx
|
|
92
|
-
import * as React2 from "react";
|
|
93
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
94
|
-
function IconMoon(_a) {
|
|
95
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
96
|
-
return /* @__PURE__ */ jsx2(
|
|
97
|
-
"svg",
|
|
98
|
-
__spreadProps(__spreadValues({
|
|
99
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
100
|
-
viewBox: "0 0 256 256",
|
|
101
|
-
fill: "currentColor",
|
|
102
|
-
className: cn("h-4 w-4", className)
|
|
103
|
-
}, props), {
|
|
104
|
-
children: /* @__PURE__ */ jsx2("path", { d: "M233.54 142.23a8 8 0 0 0-8-2 88.08 88.08 0 0 1-109.8-109.8 8 8 0 0 0-10-10 104.84 104.84 0 0 0-52.91 37A104 104 0 0 0 136 224a103.09 103.09 0 0 0 62.52-20.88 104.84 104.84 0 0 0 37-52.91 8 8 0 0 0-1.98-7.98Zm-44.64 48.11A88 88 0 0 1 65.66 67.11a89 89 0 0 1 31.4-26A106 106 0 0 0 96 56a104.11 104.11 0 0 0 104 104 106 106 0 0 0 14.92-1.06 89 89 0 0 1-26.02 31.4Z" })
|
|
105
|
-
})
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
function IconSun(_a) {
|
|
109
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
110
|
-
return /* @__PURE__ */ jsx2(
|
|
111
|
-
"svg",
|
|
112
|
-
__spreadProps(__spreadValues({
|
|
113
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
114
|
-
viewBox: "0 0 256 256",
|
|
115
|
-
fill: "currentColor",
|
|
116
|
-
className: cn("h-4 w-4", className)
|
|
117
|
-
}, props), {
|
|
118
|
-
children: /* @__PURE__ */ jsx2("path", { d: "M120 40V16a8 8 0 0 1 16 0v24a8 8 0 0 1-16 0Zm72 88a64 64 0 1 1-64-64 64.07 64.07 0 0 1 64 64Zm-16 0a48 48 0 1 0-48 48 48.05 48.05 0 0 0 48-48ZM58.34 69.66a8 8 0 0 0 11.32-11.32l-16-16a8 8 0 0 0-11.32 11.32Zm0 116.68-16 16a8 8 0 0 0 11.32 11.32l16-16a8 8 0 0 0-11.32-11.32ZM192 72a8 8 0 0 0 5.66-2.34l16-16a8 8 0 0 0-11.32-11.32l-16 16A8 8 0 0 0 192 72Zm5.66 114.34a8 8 0 0 0-11.32 11.32l16 16a8 8 0 0 0 11.32-11.32ZM48 128a8 8 0 0 0-8-8H16a8 8 0 0 0 0 16h24a8 8 0 0 0 8-8Zm80 80a8 8 0 0 0-8 8v24a8 8 0 0 0 16 0v-24a8 8 0 0 0-8-8Zm112-88h-24a8 8 0 0 0 0 16h24a8 8 0 0 0 0-16Z" })
|
|
119
|
-
})
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// src/components/chat-components/theme-toggle.tsx
|
|
124
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
125
9
|
function ThemeToggle() {
|
|
126
10
|
const { setTheme, theme } = useTheme();
|
|
127
|
-
const [_, startTransition] =
|
|
128
|
-
return /* @__PURE__ */
|
|
11
|
+
const [_, startTransition] = React.useTransition();
|
|
12
|
+
return /* @__PURE__ */ jsxs(
|
|
129
13
|
Button,
|
|
130
14
|
{
|
|
131
15
|
variant: "ghost",
|
|
@@ -136,13 +20,13 @@ function ThemeToggle() {
|
|
|
136
20
|
});
|
|
137
21
|
},
|
|
138
22
|
children: [
|
|
139
|
-
!theme ? null : theme === "dark" ? /* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
23
|
+
!theme ? null : theme === "dark" ? /* @__PURE__ */ jsx(IconMoon, { className: "transition-all" }) : /* @__PURE__ */ jsx(IconSun, { className: "transition-all" }),
|
|
24
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle theme" })
|
|
141
25
|
]
|
|
142
26
|
}
|
|
143
27
|
);
|
|
144
28
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
29
|
+
|
|
30
|
+
export { ThemeToggle };
|
|
31
|
+
//# sourceMappingURL=out.js.map
|
|
148
32
|
//# sourceMappingURL=theme-toggle.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/chat-components/theme-toggle.tsx","../../../src/components/chat-components/ui/button.tsx","../../../src/lib/utils.ts","../../../src/components/chat-components/ui/icons.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { useTheme } from \"next-themes\";\n\nimport { Button } from \"./ui/button\";\nimport { IconMoon, IconSun } from \"./ui/icons\";\n\nexport function ThemeToggle() {\n const { setTheme, theme } = useTheme();\n const [_, startTransition] = React.useTransition();\n\n return (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => {\n startTransition(() => {\n setTheme(theme === \"light\" ? \"dark\" : \"light\");\n });\n }}\n >\n {!theme ? null : theme === \"dark\" ? (\n <IconMoon className=\"transition-all\" />\n ) : (\n <IconSun className=\"transition-all\" />\n )}\n <span className=\"sr-only\">Toggle theme</span>\n </Button>\n );\n}\n","import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium shadow ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow-md hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline: \"border border-input hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"shadow-none hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 shadow-none hover:underline\",\n },\n size: {\n default: \"h-8 px-4 py-2\",\n sm: \"h-8 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-8 w-8 p-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { customAlphabet } from \"nanoid\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const nanoid = customAlphabet(\n \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n 7,\n); // 7-character random string\n\nexport async function fetcher<JSON = any>(input: RequestInfo, init?: RequestInit): Promise<JSON> {\n const res = await fetch(input, init);\n\n if (!res.ok) {\n const json = await res.json();\n if (json.error) {\n const error = new Error(json.error) as Error & {\n status: number;\n };\n error.status = res.status;\n throw error;\n } else {\n throw new Error(\"An unexpected error occurred\");\n }\n }\n\n return res.json();\n}\n\nexport function formatDate(input: string | number | Date): string {\n const date = new Date(input);\n return date.toLocaleDateString(\"en-US\", {\n month: \"long\",\n day: \"numeric\",\n year: \"numeric\",\n });\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nfunction IconNextChat({\n className,\n inverted,\n ...props\n}: React.ComponentProps<\"svg\"> & { inverted?: boolean }) {\n const id = React.useId();\n\n return (\n <svg\n viewBox=\"0 0 17 17\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <defs>\n <linearGradient\n id={`gradient-${id}-1`}\n x1=\"10.6889\"\n y1=\"10.3556\"\n x2=\"13.8445\"\n y2=\"14.2667\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor={inverted ? \"white\" : \"black\"} />\n <stop offset={1} stopColor={inverted ? \"white\" : \"black\"} stopOpacity={0} />\n </linearGradient>\n <linearGradient\n id={`gradient-${id}-2`}\n x1=\"11.7555\"\n y1=\"4.8\"\n x2=\"11.7376\"\n y2=\"9.50002\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor={inverted ? \"white\" : \"black\"} />\n <stop offset={1} stopColor={inverted ? \"white\" : \"black\"} stopOpacity={0} />\n </linearGradient>\n </defs>\n <path\n d=\"M1 16L2.58314 11.2506C1.83084 9.74642 1.63835 8.02363 2.04013 6.39052C2.4419 4.75741 3.41171 3.32057 4.776 2.33712C6.1403 1.35367 7.81003 0.887808 9.4864 1.02289C11.1628 1.15798 12.7364 1.8852 13.9256 3.07442C15.1148 4.26363 15.842 5.83723 15.9771 7.5136C16.1122 9.18997 15.6463 10.8597 14.6629 12.224C13.6794 13.5883 12.2426 14.5581 10.6095 14.9599C8.97637 15.3616 7.25358 15.1692 5.74942 14.4169L1 16Z\"\n fill={inverted ? \"black\" : \"white\"}\n stroke={inverted ? \"black\" : \"white\"}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <mask\n id=\"mask0_91_2047\"\n style={{ maskType: \"alpha\" }}\n maskUnits=\"userSpaceOnUse\"\n x={1}\n y={0}\n width={16}\n height={16}\n >\n <circle cx={9} cy={8} r={8} fill={inverted ? \"black\" : \"white\"} />\n </mask>\n <g mask=\"url(#mask0_91_2047)\">\n <circle cx={9} cy={8} r={8} fill={inverted ? \"black\" : \"white\"} />\n <path\n d=\"M14.2896 14.0018L7.146 4.8H5.80005V11.1973H6.87681V6.16743L13.4444 14.6529C13.7407 14.4545 14.0231 14.2369 14.2896 14.0018Z\"\n fill={`url(#gradient-${id}-1)`}\n />\n <rect x=\"11.2222\" y=\"4.8\" width=\"1.06667\" height=\"6.4\" fill={`url(#gradient-${id}-2)`} />\n </g>\n </svg>\n );\n}\n\nfunction IconOpenAI({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n role=\"img\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <title>OpenAI icon</title>\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n );\n}\n\nfunction IconVercel({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n aria-label=\"Vercel logomark\"\n role=\"img\"\n viewBox=\"0 0 74 64\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M37.5896 0.25L74.5396 64.25H0.639648L37.5896 0.25Z\" fill=\"currentColor\"></path>\n </svg>\n );\n}\n\nfunction IconGitHub({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n role=\"img\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <title>GitHub</title>\n <path d=\"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12\" />\n </svg>\n );\n}\n\nfunction IconSeparator({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n fill=\"none\"\n shapeRendering=\"geometricPrecision\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"1\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M16.88 3.549L7.12 20.451\"></path>\n </svg>\n );\n}\n\nfunction IconArrowDown({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"m205.66 149.66-72 72a8 8 0 0 1-11.32 0l-72-72a8 8 0 0 1 11.32-11.32L120 196.69V40a8 8 0 0 1 16 0v156.69l58.34-58.35a8 8 0 0 1 11.32 11.32Z\" />\n </svg>\n );\n}\n\nfunction IconArrowRight({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"m221.66 133.66-72 72a8 8 0 0 1-11.32-11.32L196.69 136H40a8 8 0 0 1 0-16h156.69l-58.35-58.34a8 8 0 0 1 11.32-11.32l72 72a8 8 0 0 1 0 11.32Z\" />\n </svg>\n );\n}\n\nfunction IconUser({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M230.92 212c-15.23-26.33-38.7-45.21-66.09-54.16a72 72 0 1 0-73.66 0c-27.39 8.94-50.86 27.82-66.09 54.16a8 8 0 1 0 13.85 8c18.84-32.56 52.14-52 89.07-52s70.23 19.44 89.07 52a8 8 0 1 0 13.85-8ZM72 96a56 56 0 1 1 56 56 56.06 56.06 0 0 1-56-56Z\" />\n </svg>\n );\n}\n\nfunction IconPlus({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M224 128a8 8 0 0 1-8 8h-80v80a8 8 0 0 1-16 0v-80H40a8 8 0 0 1 0-16h80V40a8 8 0 0 1 16 0v80h80a8 8 0 0 1 8 8Z\" />\n </svg>\n );\n}\n\nfunction IconArrowElbow({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M200 32v144a8 8 0 0 1-8 8H67.31l34.35 34.34a8 8 0 0 1-11.32 11.32l-48-48a8 8 0 0 1 0-11.32l48-48a8 8 0 0 1 11.32 11.32L67.31 168H184V32a8 8 0 0 1 16 0Z\" />\n </svg>\n );\n}\n\nfunction IconSpinner({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4 animate-spin\", className)}\n {...props}\n >\n <path d=\"M232 128a104 104 0 0 1-208 0c0-41 23.81-78.36 60.66-95.27a8 8 0 0 1 6.68 14.54C60.15 61.59 40 93.27 40 128a88 88 0 0 0 176 0c0-34.73-20.15-66.41-51.34-80.73a8 8 0 0 1 6.68-14.54C208.19 49.64 232 87 232 128Z\" />\n </svg>\n );\n}\n\nfunction IconMessage({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M216 48H40a16 16 0 0 0-16 16v160a15.84 15.84 0 0 0 9.25 14.5A16.05 16.05 0 0 0 40 240a15.89 15.89 0 0 0 10.25-3.78.69.69 0 0 0 .13-.11L82.5 208H216a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16ZM40 224Zm176-32H82.5a16 16 0 0 0-10.3 3.75l-.12.11L40 224V64h176Z\" />\n </svg>\n );\n}\n\nfunction IconTrash({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M216 48h-40v-8a24 24 0 0 0-24-24h-48a24 24 0 0 0-24 24v8H40a8 8 0 0 0 0 16h8v144a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16V64h8a8 8 0 0 0 0-16ZM96 40a8 8 0 0 1 8-8h48a8 8 0 0 1 8 8v8H96Zm96 168H64V64h128Zm-80-104v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Zm48 0v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Z\" />\n </svg>\n );\n}\n\nfunction IconRefresh({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M197.67 186.37a8 8 0 0 1 0 11.29C196.58 198.73 170.82 224 128 224c-37.39 0-64.53-22.4-80-39.85V208a8 8 0 0 1-16 0v-48a8 8 0 0 1 8-8h48a8 8 0 0 1 0 16H55.44C67.76 183.35 93 208 128 208c36 0 58.14-21.46 58.36-21.68a8 8 0 0 1 11.31.05ZM216 40a8 8 0 0 0-8 8v23.85C192.53 54.4 165.39 32 128 32c-42.82 0-68.58 25.27-69.66 26.34a8 8 0 0 0 11.3 11.34C69.86 69.46 92 48 128 48c35 0 60.24 24.65 72.56 40H168a8 8 0 0 0 0 16h48a8 8 0 0 0 8-8V48a8 8 0 0 0-8-8Z\" />\n </svg>\n );\n}\n\nfunction IconStop({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm24-120h-48a8 8 0 0 0-8 8v48a8 8 0 0 0 8 8h48a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8Zm-8 48h-32v-32h32Z\" />\n </svg>\n );\n}\n\nfunction IconSidebar({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M216 40H40a16 16 0 0 0-16 16v144a16 16 0 0 0 16 16h176a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16ZM40 56h40v144H40Zm176 144H96V56h120v144Z\" />\n </svg>\n );\n}\n\nfunction IconMoon({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M233.54 142.23a8 8 0 0 0-8-2 88.08 88.08 0 0 1-109.8-109.8 8 8 0 0 0-10-10 104.84 104.84 0 0 0-52.91 37A104 104 0 0 0 136 224a103.09 103.09 0 0 0 62.52-20.88 104.84 104.84 0 0 0 37-52.91 8 8 0 0 0-1.98-7.98Zm-44.64 48.11A88 88 0 0 1 65.66 67.11a89 89 0 0 1 31.4-26A106 106 0 0 0 96 56a104.11 104.11 0 0 0 104 104 106 106 0 0 0 14.92-1.06 89 89 0 0 1-26.02 31.4Z\" />\n </svg>\n );\n}\n\nfunction IconSun({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M120 40V16a8 8 0 0 1 16 0v24a8 8 0 0 1-16 0Zm72 88a64 64 0 1 1-64-64 64.07 64.07 0 0 1 64 64Zm-16 0a48 48 0 1 0-48 48 48.05 48.05 0 0 0 48-48ZM58.34 69.66a8 8 0 0 0 11.32-11.32l-16-16a8 8 0 0 0-11.32 11.32Zm0 116.68-16 16a8 8 0 0 0 11.32 11.32l16-16a8 8 0 0 0-11.32-11.32ZM192 72a8 8 0 0 0 5.66-2.34l16-16a8 8 0 0 0-11.32-11.32l-16 16A8 8 0 0 0 192 72Zm5.66 114.34a8 8 0 0 0-11.32 11.32l16 16a8 8 0 0 0 11.32-11.32ZM48 128a8 8 0 0 0-8-8H16a8 8 0 0 0 0 16h24a8 8 0 0 0 8-8Zm80 80a8 8 0 0 0-8 8v24a8 8 0 0 0 16 0v-24a8 8 0 0 0-8-8Zm112-88h-24a8 8 0 0 0 0 16h24a8 8 0 0 0 0-16Z\" />\n </svg>\n );\n}\n\nfunction IconCopy({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M216 32H88a8 8 0 0 0-8 8v40H40a8 8 0 0 0-8 8v128a8 8 0 0 0 8 8h128a8 8 0 0 0 8-8v-40h40a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8Zm-56 176H48V96h112Zm48-48h-32V88a8 8 0 0 0-8-8H96V48h112Z\" />\n </svg>\n );\n}\n\nfunction IconCheck({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"m229.66 77.66-128 128a8 8 0 0 1-11.32 0l-56-56a8 8 0 0 1 11.32-11.32L96 188.69 218.34 66.34a8 8 0 0 1 11.32 11.32Z\" />\n </svg>\n );\n}\n\nfunction IconDownload({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M224 152v56a16 16 0 0 1-16 16H48a16 16 0 0 1-16-16v-56a8 8 0 0 1 16 0v56h160v-56a8 8 0 0 1 16 0Zm-101.66 5.66a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0-11.32-11.32L136 132.69V40a8 8 0 0 0-16 0v92.69l-26.34-26.35a8 8 0 0 0-11.32 11.32Z\" />\n </svg>\n );\n}\n\nfunction IconClose({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path d=\"M205.66 194.34a8 8 0 0 1-11.32 11.32L128 139.31l-66.34 66.35a8 8 0 0 1-11.32-11.32L116.69 128 50.34 61.66a8 8 0 0 1 11.32-11.32L128 116.69l66.34-66.35a8 8 0 0 1 11.32 11.32L139.31 128Z\" />\n </svg>\n );\n}\n\nfunction IconEdit({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth={1.5}\n stroke=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n {...props}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10\"\n />\n </svg>\n );\n}\n\nfunction IconShare({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n viewBox=\"0 0 256 256\"\n {...props}\n >\n <path d=\"m237.66 106.35-80-80A8 8 0 0 0 144 32v40.35c-25.94 2.22-54.59 14.92-78.16 34.91-28.38 24.08-46.05 55.11-49.76 87.37a12 12 0 0 0 20.68 9.58c11-11.71 50.14-48.74 107.24-52V192a8 8 0 0 0 13.66 5.65l80-80a8 8 0 0 0 0-11.3ZM160 172.69V144a8 8 0 0 0-8-8c-28.08 0-55.43 7.33-81.29 21.8a196.17 196.17 0 0 0-36.57 26.52c5.8-23.84 20.42-46.51 42.05-64.86C99.41 99.77 127.75 88 152 88a8 8 0 0 0 8-8V51.32L220.69 112Z\" />\n </svg>\n );\n}\n\nfunction IconUsers({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n viewBox=\"0 0 256 256\"\n {...props}\n >\n <path d=\"M117.25 157.92a60 60 0 1 0-66.5 0 95.83 95.83 0 0 0-47.22 37.71 8 8 0 1 0 13.4 8.74 80 80 0 0 1 134.14 0 8 8 0 0 0 13.4-8.74 95.83 95.83 0 0 0-47.22-37.71ZM40 108a44 44 0 1 1 44 44 44.05 44.05 0 0 1-44-44Zm210.14 98.7a8 8 0 0 1-11.07-2.33A79.83 79.83 0 0 0 172 168a8 8 0 0 1 0-16 44 44 0 1 0-16.34-84.87 8 8 0 1 1-5.94-14.85 60 60 0 0 1 55.53 105.64 95.83 95.83 0 0 1 47.22 37.71 8 8 0 0 1-2.33 11.07Z\" />\n </svg>\n );\n}\n\nfunction IconExternalLink({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n viewBox=\"0 0 256 256\"\n {...props}\n >\n <path d=\"M224 104a8 8 0 0 1-16 0V59.32l-66.33 66.34a8 8 0 0 1-11.32-11.32L196.68 48H152a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8Zm-40 24a8 8 0 0 0-8 8v72H48V80h72a8 8 0 0 0 0-16H48a16 16 0 0 0-16 16v128a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-72a8 8 0 0 0-8-8Z\" />\n </svg>\n );\n}\n\nfunction IconChevronUpDown({ className, ...props }: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n className={cn(\"h-4 w-4\", className)}\n viewBox=\"0 0 256 256\"\n {...props}\n >\n <path d=\"M181.66 170.34a8 8 0 0 1 0 11.32l-48 48a8 8 0 0 1-11.32 0l-48-48a8 8 0 0 1 11.32-11.32L128 212.69l42.34-42.35a8 8 0 0 1 11.32 0Zm-96-84.68L128 43.31l42.34 42.35a8 8 0 0 0 11.32-11.32l-48-48a8 8 0 0 0-11.32 0l-48 48a8 8 0 0 0 11.32 11.32Z\" />\n </svg>\n );\n}\n\nexport {\n IconEdit,\n IconNextChat,\n IconOpenAI,\n IconVercel,\n IconGitHub,\n IconSeparator,\n IconArrowDown,\n IconArrowRight,\n IconUser,\n IconPlus,\n IconArrowElbow,\n IconSpinner,\n IconMessage,\n IconTrash,\n IconRefresh,\n IconStop,\n IconSidebar,\n IconMoon,\n IconSun,\n IconCopy,\n IconCheck,\n IconDownload,\n IconClose,\n IconShare,\n IconUsers,\n IconExternalLink,\n IconChevronUpDown,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,YAAYA,YAAW;AACvB,SAAS,gBAAgB;;;ACHzB,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;;;ACFvC,SAAS,YAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;AAEO,IAAM,SAAS;AAAA,EACpB;AAAA,EACA;AACF;;;AD+BM;AApCN,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aAAa;AAAA,QACb,SAAS;AAAA,QACT,WAAW;AAAA,QACX,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAQA,IAAM,SAAe;AAAA,EACnB,CAAC,IAAyD,QAAQ;AAAjE,iBAAE,aAAW,SAAS,MAAM,UAAU,MAvCzC,IAuCG,IAAgD,kBAAhD,IAAgD,CAA9C,aAAW,WAAS,QAAM;AAC3B,UAAM,OAAO,UAAU,OAAO;AAC9B,WACE,oBAAC,uBAAK,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC,GAAG,OAAc,MAAO;AAAA,EAE5F;AACF;AACA,OAAO,cAAc;;;AE5CrB,YAAYC,YAAW;AAoBf,SAQE,OAAAC,MARF;AAiRR,SAAS,SAAS,IAAsD;AAAtD,eAAE,YAvSpB,IAuSkB,IAAgB,kBAAhB,IAAgB,CAAd;AAClB,SACE,gBAAAC;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,WAAW,GAAG,WAAW,SAAS;AAAA,OAC9B,QALL;AAAA,MAOC,0BAAAA,KAAC,UAAK,GAAE,6WAA4W;AAAA;AAAA,EACtX;AAEJ;AAEA,SAAS,QAAQ,IAAsD;AAAtD,eAAE,YArTnB,IAqTiB,IAAgB,kBAAhB,IAAgB,CAAd;AACjB,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,WAAW,GAAG,WAAW,SAAS;AAAA,OAC9B,QALL;AAAA,MAOC,0BAAAA,KAAC,UAAK,GAAE,kkBAAikB;AAAA;AAAA,EAC3kB;AAEJ;;;AHpTI,SAUI,OAAAC,MAVJ,QAAAC,aAAA;AALG,SAAS,cAAc;AAC5B,QAAM,EAAE,UAAU,MAAM,IAAI,SAAS;AACrC,QAAM,CAAC,GAAG,eAAe,IAAU,qBAAc;AAEjD,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,SAAS,MAAM;AACb,wBAAgB,MAAM;AACpB,mBAAS,UAAU,UAAU,SAAS,OAAO;AAAA,QAC/C,CAAC;AAAA,MACH;AAAA,MAEC;AAAA,SAAC,QAAQ,OAAO,UAAU,SACzB,gBAAAD,KAAC,YAAS,WAAU,kBAAiB,IAErC,gBAAAA,KAAC,WAAQ,WAAU,kBAAiB;AAAA,QAEtC,gBAAAA,KAAC,UAAK,WAAU,WAAU,0BAAY;AAAA;AAAA;AAAA,EACxC;AAEJ;","names":["React","React","jsx","jsx","jsx","jsxs"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/chat-components/theme-toggle.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,gBAAgB;AAUrB,SAUI,KAVJ;AALG,SAAS,cAAc;AAC5B,QAAM,EAAE,UAAU,MAAM,IAAI,SAAS;AACrC,QAAM,CAAC,GAAG,eAAe,IAAU,oBAAc;AAEjD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,SAAS,MAAM;AACb,wBAAgB,MAAM;AACpB,mBAAS,UAAU,UAAU,SAAS,OAAO;AAAA,QAC/C,CAAC;AAAA,MACH;AAAA,MAEC;AAAA,SAAC,QAAQ,OAAO,UAAU,SACzB,oBAAC,YAAS,WAAU,kBAAiB,IAErC,oBAAC,WAAQ,WAAU,kBAAiB;AAAA,QAEtC,oBAAC,UAAK,WAAU,WAAU,0BAAY;AAAA;AAAA;AAAA,EACxC;AAEJ","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { useTheme } from \"next-themes\";\n\nimport { Button } from \"./ui/button\";\nimport { IconMoon, IconSun } from \"./ui/icons\";\n\nexport function ThemeToggle() {\n const { setTheme, theme } = useTheme();\n const [_, startTransition] = React.useTransition();\n\n return (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => {\n startTransition(() => {\n setTheme(theme === \"light\" ? \"dark\" : \"light\");\n });\n }}\n >\n {!theme ? null : theme === \"dark\" ? (\n <IconMoon className=\"transition-all\" />\n ) : (\n <IconSun className=\"transition-all\" />\n )}\n <span className=\"sr-only\">Toggle theme</span>\n </Button>\n );\n}\n"]}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { Toaster } from "react-hot-toast";
|
|
5
|
-
export {
|
|
6
|
-
Toaster
|
|
7
|
-
};
|
|
1
|
+
import '../../chunk-MRXNTQOX.mjs';
|
|
2
|
+
export { Toaster } from 'react-hot-toast';
|
|
3
|
+
//# sourceMappingURL=out.js.map
|
|
8
4
|
//# sourceMappingURL=toaster.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/chat-components/toaster.tsx"],"sourcesContent":["\"use client\";\n\nexport { Toaster } from \"react-hot-toast\";\n"]
|
|
1
|
+
{"version":3,"sources":["../../../src/components/chat-components/toaster.tsx"],"names":[],"mappings":";;;;AAEA,SAAS,eAAe","sourcesContent":["\"use client\";\n\nexport { Toaster } from \"react-hot-toast\";\n"]}
|