@copilotkit/react-ui 0.3.0 → 0.5.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.
Files changed (228) hide show
  1. package/.turbo/turbo-build.log +192 -13
  2. package/CHANGELOG.md +24 -0
  3. package/LICENSE +21 -0
  4. package/dist/chunk-46XC7ODX.mjs +72 -0
  5. package/dist/chunk-46XC7ODX.mjs.map +1 -0
  6. package/dist/chunk-4HK6C362.mjs +106 -0
  7. package/dist/chunk-4HK6C362.mjs.map +1 -0
  8. package/dist/chunk-6LAC5RA2.mjs +28 -0
  9. package/dist/chunk-6LAC5RA2.mjs.map +1 -0
  10. package/dist/chunk-6LRNF2VU.mjs +12 -0
  11. package/dist/chunk-6LRNF2VU.mjs.map +1 -0
  12. package/dist/chunk-7NSRDJ5C.mjs +3 -0
  13. package/dist/chunk-7NSRDJ5C.mjs.map +1 -0
  14. package/dist/chunk-BB6IP63P.mjs +29 -0
  15. package/dist/chunk-BB6IP63P.mjs.map +1 -0
  16. package/dist/chunk-BIPCPNHG.mjs +18 -0
  17. package/dist/chunk-BIPCPNHG.mjs.map +1 -0
  18. package/dist/chunk-BS6RR2DJ.mjs +25 -0
  19. package/dist/chunk-BS6RR2DJ.mjs.map +1 -0
  20. package/dist/chunk-DOMJCSI6.mjs +26 -0
  21. package/dist/chunk-DOMJCSI6.mjs.map +1 -0
  22. package/dist/chunk-E2YBQYWM.mjs +69 -0
  23. package/dist/chunk-E2YBQYWM.mjs.map +1 -0
  24. package/dist/chunk-E5BOIXYO.mjs +45 -0
  25. package/dist/chunk-E5BOIXYO.mjs.map +1 -0
  26. package/dist/chunk-H4VKQGVU.mjs +3 -0
  27. package/dist/chunk-H4VKQGVU.mjs.map +1 -0
  28. package/dist/chunk-I2AB5FK4.mjs +123 -0
  29. package/dist/chunk-I2AB5FK4.mjs.map +1 -0
  30. package/dist/chunk-IU3WTXLQ.mjs +3 -0
  31. package/dist/chunk-IU3WTXLQ.mjs.map +1 -0
  32. package/dist/chunk-KR7MH7XO.mjs +481 -0
  33. package/dist/chunk-KR7MH7XO.mjs.map +1 -0
  34. package/dist/chunk-KXJV37FS.mjs +33 -0
  35. package/dist/chunk-KXJV37FS.mjs.map +1 -0
  36. package/dist/chunk-MC6KTH4X.mjs +12 -0
  37. package/dist/chunk-MC6KTH4X.mjs.map +1 -0
  38. package/dist/chunk-MRXNTQOX.mjs +55 -0
  39. package/dist/chunk-MRXNTQOX.mjs.map +1 -0
  40. package/dist/chunk-N7KB3Z57.mjs +23 -0
  41. package/dist/chunk-N7KB3Z57.mjs.map +1 -0
  42. package/dist/chunk-QEXWZWJL.mjs +75 -0
  43. package/dist/chunk-QEXWZWJL.mjs.map +1 -0
  44. package/dist/chunk-RSONJDLO.mjs +28 -0
  45. package/dist/chunk-RSONJDLO.mjs.map +1 -0
  46. package/dist/chunk-SF56HSZW.mjs +48 -0
  47. package/dist/chunk-SF56HSZW.mjs.map +1 -0
  48. package/dist/chunk-TVTG3V4F.mjs +40 -0
  49. package/dist/chunk-TVTG3V4F.mjs.map +1 -0
  50. package/dist/chunk-U6NJWGTV.mjs +3 -0
  51. package/dist/chunk-U6NJWGTV.mjs.map +1 -0
  52. package/dist/chunk-V6QYUEJR.mjs +47 -0
  53. package/dist/chunk-V6QYUEJR.mjs.map +1 -0
  54. package/dist/chunk-VQNV2DHJ.mjs +142 -0
  55. package/dist/chunk-VQNV2DHJ.mjs.map +1 -0
  56. package/dist/chunk-VSNDSL6W.mjs +74 -0
  57. package/dist/chunk-VSNDSL6W.mjs.map +1 -0
  58. package/dist/chunk-XZFO2YEG.mjs +53 -0
  59. package/dist/chunk-XZFO2YEG.mjs.map +1 -0
  60. package/dist/components/chat-components/chat-list.d.ts +8 -0
  61. package/dist/components/chat-components/chat-list.mjs +13 -0
  62. package/dist/components/chat-components/chat-list.mjs.map +1 -0
  63. package/dist/components/chat-components/chat-message-actions.d.ts +8 -0
  64. package/dist/components/chat-components/chat-message-actions.mjs +8 -0
  65. package/dist/components/chat-components/chat-message-actions.mjs.map +1 -0
  66. package/dist/components/chat-components/chat-message.d.ts +8 -0
  67. package/dist/components/chat-components/chat-message.mjs +11 -0
  68. package/dist/components/chat-components/chat-message.mjs.map +1 -0
  69. package/dist/components/chat-components/chat-panel.d.ts +8 -0
  70. package/dist/components/chat-components/chat-panel.mjs +10 -0
  71. package/dist/components/chat-components/chat-panel.mjs.map +1 -0
  72. package/dist/components/chat-components/chat-scroll-anchor.d.ts +6 -0
  73. package/dist/components/chat-components/chat-scroll-anchor.mjs +5 -0
  74. package/dist/components/chat-components/chat-scroll-anchor.mjs.map +1 -0
  75. package/dist/components/chat-components/clear-history.d.ts +9 -0
  76. package/dist/components/chat-components/clear-history.mjs +81 -0
  77. package/dist/components/chat-components/clear-history.mjs.map +1 -0
  78. package/dist/components/chat-components/copilot-chat.d.ts +12 -0
  79. package/dist/components/chat-components/copilot-chat.mjs +22 -0
  80. package/dist/components/chat-components/copilot-chat.mjs.map +1 -0
  81. package/dist/components/chat-components/default-empty-screen.d.ts +8 -0
  82. package/dist/components/chat-components/default-empty-screen.mjs +8 -0
  83. package/dist/components/chat-components/default-empty-screen.mjs.map +1 -0
  84. package/dist/components/chat-components/external-link.d.ts +6 -0
  85. package/dist/components/chat-components/external-link.mjs +4 -0
  86. package/dist/components/chat-components/external-link.mjs.map +1 -0
  87. package/dist/components/chat-components/markdown.d.ts +6 -0
  88. package/dist/components/chat-components/markdown.mjs +4 -0
  89. package/dist/components/chat-components/markdown.mjs.map +1 -0
  90. package/dist/components/chat-components/prompt-form.d.ts +9 -0
  91. package/dist/components/chat-components/prompt-form.mjs +9 -0
  92. package/dist/components/chat-components/prompt-form.mjs.map +1 -0
  93. package/dist/components/chat-components/theme-toggle.d.ts +3 -0
  94. package/dist/components/chat-components/theme-toggle.mjs +36 -0
  95. package/dist/components/chat-components/theme-toggle.mjs.map +1 -0
  96. package/dist/components/chat-components/toaster.d.ts +1 -0
  97. package/dist/components/chat-components/toaster.mjs +4 -0
  98. package/dist/components/chat-components/toaster.mjs.map +1 -0
  99. package/dist/components/chat-components/ui/alert-dialog.d.ts +20 -0
  100. package/dist/components/chat-components/ui/alert-dialog.mjs +6 -0
  101. package/dist/components/chat-components/ui/alert-dialog.mjs.map +1 -0
  102. package/dist/components/chat-components/ui/badge.d.ts +12 -0
  103. package/dist/components/chat-components/ui/badge.mjs +31 -0
  104. package/dist/components/chat-components/ui/badge.mjs.map +1 -0
  105. package/dist/components/chat-components/ui/button.d.ts +14 -0
  106. package/dist/components/chat-components/ui/button.mjs +5 -0
  107. package/dist/components/chat-components/ui/button.mjs.map +1 -0
  108. package/dist/components/chat-components/ui/codeblock.d.ts +14 -0
  109. package/dist/components/chat-components/ui/codeblock.mjs +8 -0
  110. package/dist/components/chat-components/ui/codeblock.mjs.map +1 -0
  111. package/dist/components/chat-components/ui/dialog.d.ts +18 -0
  112. package/dist/components/chat-components/ui/dialog.mjs +119 -0
  113. package/dist/components/chat-components/ui/dialog.mjs.map +1 -0
  114. package/dist/components/chat-components/ui/dropdown-menu.d.ts +24 -0
  115. package/dist/components/chat-components/ui/dropdown-menu.mjs +84 -0
  116. package/dist/components/chat-components/ui/dropdown-menu.mjs.map +1 -0
  117. package/dist/components/chat-components/ui/icons.d.ts +33 -0
  118. package/dist/components/chat-components/ui/icons.mjs +5 -0
  119. package/dist/components/chat-components/ui/icons.mjs.map +1 -0
  120. package/dist/components/chat-components/ui/input.d.ts +7 -0
  121. package/dist/components/chat-components/ui/input.mjs +23 -0
  122. package/dist/components/chat-components/ui/input.mjs.map +1 -0
  123. package/dist/components/chat-components/ui/label.d.ts +8 -0
  124. package/dist/components/chat-components/ui/label.mjs +22 -0
  125. package/dist/components/chat-components/ui/label.mjs.map +1 -0
  126. package/dist/components/chat-components/ui/select.d.ts +13 -0
  127. package/dist/components/chat-components/ui/select.mjs +99 -0
  128. package/dist/components/chat-components/ui/select.mjs.map +1 -0
  129. package/dist/components/chat-components/ui/separator.d.ts +6 -0
  130. package/dist/components/chat-components/ui/separator.mjs +5 -0
  131. package/dist/components/chat-components/ui/separator.mjs.map +1 -0
  132. package/dist/components/chat-components/ui/sheet.d.ts +19 -0
  133. package/dist/components/chat-components/ui/sheet.mjs +109 -0
  134. package/dist/components/chat-components/ui/sheet.mjs.map +1 -0
  135. package/dist/components/chat-components/ui/switch.d.ts +6 -0
  136. package/dist/components/chat-components/ui/switch.mjs +27 -0
  137. package/dist/components/chat-components/ui/switch.mjs.map +1 -0
  138. package/dist/components/chat-components/ui/textarea.d.ts +7 -0
  139. package/dist/components/chat-components/ui/textarea.mjs +22 -0
  140. package/dist/components/chat-components/ui/textarea.mjs.map +1 -0
  141. package/dist/components/chat-components/ui/tooltip.d.ts +9 -0
  142. package/dist/components/chat-components/ui/tooltip.mjs +5 -0
  143. package/dist/components/chat-components/ui/tooltip.mjs.map +1 -0
  144. package/dist/components/index.d.ts +9 -0
  145. package/dist/components/index.mjs +26 -0
  146. package/dist/components/index.mjs.map +1 -0
  147. package/dist/components/sidebar/copilot-sidebar-ui-provider.d.ts +8 -0
  148. package/dist/components/sidebar/copilot-sidebar-ui-provider.mjs +25 -0
  149. package/dist/components/sidebar/copilot-sidebar-ui-provider.mjs.map +1 -0
  150. package/dist/components/sidebar/copilot-sidebar.d.ts +6 -0
  151. package/dist/components/sidebar/copilot-sidebar.mjs +23 -0
  152. package/dist/components/sidebar/copilot-sidebar.mjs.map +1 -0
  153. package/dist/components/sidebar/sidebar-context.d.ts +9 -0
  154. package/dist/components/sidebar/sidebar-context.mjs +4 -0
  155. package/dist/components/sidebar/sidebar-context.mjs.map +1 -0
  156. package/dist/context/index.d.ts +1 -0
  157. package/dist/context/index.mjs +3 -0
  158. package/dist/context/index.mjs.map +1 -0
  159. package/dist/hooks/index.d.ts +1 -0
  160. package/dist/hooks/index.mjs +3 -0
  161. package/dist/hooks/index.mjs.map +1 -0
  162. package/dist/hooks/use-at-bottom.d.ts +3 -0
  163. package/dist/hooks/use-at-bottom.mjs +4 -0
  164. package/dist/hooks/use-at-bottom.mjs.map +1 -0
  165. package/dist/hooks/use-copy-to-clipboard.d.ts +9 -0
  166. package/dist/hooks/use-copy-to-clipboard.mjs +4 -0
  167. package/dist/hooks/use-copy-to-clipboard.mjs.map +1 -0
  168. package/dist/hooks/use-enter-submit.d.ts +8 -0
  169. package/dist/hooks/use-enter-submit.mjs +4 -0
  170. package/dist/hooks/use-enter-submit.mjs.map +1 -0
  171. package/dist/index.css +1249 -1
  172. package/dist/index.css.map +1 -0
  173. package/dist/index.d.ts +9 -36
  174. package/dist/index.mjs +29 -26
  175. package/dist/index.mjs.map +1 -0
  176. package/dist/lib/utils.d.ts +8 -0
  177. package/dist/lib/utils.mjs +4 -0
  178. package/dist/lib/utils.mjs.map +1 -0
  179. package/dist/types/index.d.ts +1 -0
  180. package/dist/types/index.mjs +3 -0
  181. package/dist/types/index.mjs.map +1 -0
  182. package/dist/types/types.d.ts +16 -0
  183. package/dist/types/types.mjs +3 -0
  184. package/dist/types/types.mjs.map +1 -0
  185. package/package.json +7 -7
  186. package/src/components/chat-components/chat-list.tsx +8 -8
  187. package/src/components/chat-components/chat-message-actions.tsx +14 -14
  188. package/src/components/chat-components/chat-message.tsx +26 -26
  189. package/src/components/chat-components/chat-panel.tsx +18 -18
  190. package/src/components/chat-components/chat-scroll-anchor.tsx +12 -12
  191. package/src/components/chat-components/clear-history.tsx +22 -22
  192. package/src/components/chat-components/copilot-chat.tsx +45 -50
  193. package/src/components/chat-components/default-empty-screen.tsx +24 -22
  194. package/src/components/chat-components/external-link.tsx +4 -4
  195. package/src/components/chat-components/markdown.tsx +3 -3
  196. package/src/components/chat-components/prompt-form.tsx +27 -27
  197. package/src/components/chat-components/theme-toggle.tsx +11 -11
  198. package/src/components/chat-components/toaster.tsx +2 -2
  199. package/src/components/chat-components/ui/alert-dialog.tsx +35 -35
  200. package/src/components/chat-components/ui/badge.tsx +14 -14
  201. package/src/components/chat-components/ui/button.tsx +26 -26
  202. package/src/components/chat-components/ui/codeblock.tsx +70 -70
  203. package/src/components/chat-components/ui/dialog.tsx +29 -29
  204. package/src/components/chat-components/ui/dropdown-menu.tsx +35 -35
  205. package/src/components/chat-components/ui/icons.tsx +96 -96
  206. package/src/components/chat-components/ui/input.tsx +7 -7
  207. package/src/components/chat-components/ui/label.tsx +10 -10
  208. package/src/components/chat-components/ui/select.tsx +30 -30
  209. package/src/components/chat-components/ui/separator.tsx +10 -10
  210. package/src/components/chat-components/ui/sheet.tsx +31 -31
  211. package/src/components/chat-components/ui/switch.tsx +9 -9
  212. package/src/components/chat-components/ui/textarea.tsx +7 -7
  213. package/src/components/chat-components/ui/tooltip.tsx +11 -11
  214. package/src/components/index.ts +6 -6
  215. package/src/components/sidebar/copilot-sidebar-ui-provider.tsx +34 -31
  216. package/src/components/sidebar/copilot-sidebar.tsx +9 -9
  217. package/src/components/sidebar/sidebar-context.tsx +5 -5
  218. package/src/context/index.ts +1 -1
  219. package/src/hooks/index.ts +1 -1
  220. package/src/hooks/use-at-bottom.tsx +10 -10
  221. package/src/hooks/use-copy-to-clipboard.tsx +14 -14
  222. package/src/hooks/use-enter-submit.tsx +9 -9
  223. package/src/index.tsx +4 -4
  224. package/src/lib/utils.ts +20 -20
  225. package/src/types/index.ts +1 -1
  226. package/src/types/types.ts +10 -10
  227. package/tsup.config.ts +3 -4
  228. package/dist/index.js +0 -53
@@ -1,33 +1,33 @@
1
- 'use client'
1
+ "use client";
2
2
 
3
- import * as React from 'react'
3
+ import * as React from "react";
4
4
 
5
5
  export interface useCopyToClipboardProps {
6
- timeout?: number
6
+ timeout?: number;
7
7
  }
8
8
 
9
9
  export function useCopyToClipboard({
10
- timeout = 2000
10
+ timeout = 2000,
11
11
  }: useCopyToClipboardProps) {
12
- const [isCopied, setIsCopied] = React.useState<Boolean>(false)
12
+ const [isCopied, setIsCopied] = React.useState<Boolean>(false);
13
13
 
14
14
  const copyToClipboard = (value: string) => {
15
- if (typeof window === 'undefined' || !navigator.clipboard?.writeText) {
16
- return
15
+ if (typeof window === "undefined" || !navigator.clipboard?.writeText) {
16
+ return;
17
17
  }
18
18
 
19
19
  if (!value) {
20
- return
20
+ return;
21
21
  }
22
22
 
23
23
  navigator.clipboard.writeText(value).then(() => {
24
- setIsCopied(true)
24
+ setIsCopied(true);
25
25
 
26
26
  setTimeout(() => {
27
- setIsCopied(false)
28
- }, timeout)
29
- })
30
- }
27
+ setIsCopied(false);
28
+ }, timeout);
29
+ });
30
+ };
31
31
 
32
- return { isCopied, copyToClipboard }
32
+ return { isCopied, copyToClipboard };
33
33
  }
@@ -1,23 +1,23 @@
1
- import { useRef, type RefObject } from 'react'
1
+ import { useRef, type RefObject } from "react";
2
2
 
3
3
  export function useEnterSubmit(): {
4
- formRef: RefObject<HTMLFormElement>
5
- onKeyDown: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void
4
+ formRef: RefObject<HTMLFormElement>;
5
+ onKeyDown: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;
6
6
  } {
7
- const formRef = useRef<HTMLFormElement>(null)
7
+ const formRef = useRef<HTMLFormElement>(null);
8
8
 
9
9
  const handleKeyDown = (
10
10
  event: React.KeyboardEvent<HTMLTextAreaElement>
11
11
  ): void => {
12
12
  if (
13
- event.key === 'Enter' &&
13
+ event.key === "Enter" &&
14
14
  !event.shiftKey &&
15
15
  !event.nativeEvent.isComposing
16
16
  ) {
17
- formRef.current?.requestSubmit()
18
- event.preventDefault()
17
+ formRef.current?.requestSubmit();
18
+ event.preventDefault();
19
19
  }
20
- }
20
+ };
21
21
 
22
- return { formRef, onKeyDown: handleKeyDown }
22
+ return { formRef, onKeyDown: handleKeyDown };
23
23
  }
package/src/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  // styles
2
2
  import "./styles.css";
3
3
 
4
- export * from './components'
5
- export * from './context'
6
- export * from './hooks'
7
- export * from './types'
4
+ export * from "./components";
5
+ export * from "./context";
6
+ export * from "./hooks";
7
+ export * from "./types";
package/src/lib/utils.ts CHANGED
@@ -1,43 +1,43 @@
1
- import { clsx, type ClassValue } from 'clsx'
2
- import { customAlphabet } from 'nanoid'
3
- import { twMerge } from 'tailwind-merge'
1
+ import { clsx, type ClassValue } from "clsx";
2
+ import { customAlphabet } from "nanoid";
3
+ import { twMerge } from "tailwind-merge";
4
4
 
5
5
  export function cn(...inputs: ClassValue[]) {
6
- return twMerge(clsx(inputs))
6
+ return twMerge(clsx(inputs));
7
7
  }
8
8
 
9
9
  export const nanoid = customAlphabet(
10
- '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
10
+ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
11
11
  7
12
- ) // 7-character random string
12
+ ); // 7-character random string
13
13
 
14
14
  export async function fetcher<JSON = any>(
15
15
  input: RequestInfo,
16
16
  init?: RequestInit
17
17
  ): Promise<JSON> {
18
- const res = await fetch(input, init)
18
+ const res = await fetch(input, init);
19
19
 
20
20
  if (!res.ok) {
21
- const json = await res.json()
21
+ const json = await res.json();
22
22
  if (json.error) {
23
23
  const error = new Error(json.error) as Error & {
24
- status: number
25
- }
26
- error.status = res.status
27
- throw error
24
+ status: number;
25
+ };
26
+ error.status = res.status;
27
+ throw error;
28
28
  } else {
29
- throw new Error('An unexpected error occurred')
29
+ throw new Error("An unexpected error occurred");
30
30
  }
31
31
  }
32
32
 
33
- return res.json()
33
+ return res.json();
34
34
  }
35
35
 
36
36
  export function formatDate(input: string | number | Date): string {
37
- const date = new Date(input)
38
- return date.toLocaleDateString('en-US', {
39
- month: 'long',
40
- day: 'numeric',
41
- year: 'numeric'
42
- })
37
+ const date = new Date(input);
38
+ return date.toLocaleDateString("en-US", {
39
+ month: "long",
40
+ day: "numeric",
41
+ year: "numeric",
42
+ });
43
43
  }
@@ -1 +1 @@
1
- export {}
1
+ export {};
@@ -1,18 +1,18 @@
1
- import { type Message } from 'ai'
1
+ import { type Message } from "ai";
2
2
 
3
3
  export interface Chat extends Record<string, any> {
4
- id: string
5
- title: string
6
- createdAt: Date
7
- userId: string
8
- path: string
9
- messages: Message[]
10
- sharePath?: string
4
+ id: string;
5
+ title: string;
6
+ createdAt: Date;
7
+ userId: string;
8
+ path: string;
9
+ messages: Message[];
10
+ sharePath?: string;
11
11
  }
12
12
 
13
13
  export type ServerActionResult<Result> = Promise<
14
14
  | Result
15
15
  | {
16
- error: string
16
+ error: string;
17
17
  }
18
- >
18
+ >;
package/tsup.config.ts CHANGED
@@ -1,13 +1,12 @@
1
1
  import { defineConfig, Options } from "tsup";
2
2
 
3
3
  export default defineConfig((options: Options) => ({
4
- treeshake: true,
5
- splitting: true,
6
- entry: ["src/**/*.tsx"],
4
+ entry: ["src/**/*.{ts,tsx}"],
7
5
  format: ["esm"],
8
6
  dts: true,
9
- minify: true,
7
+ minify: false,
10
8
  clean: true,
11
9
  external: ["react"],
10
+ sourcemap: true,
12
11
  ...options,
13
12
  }));
package/dist/index.js DELETED
@@ -1,53 +0,0 @@
1
- 'use strict';
2
-
3
- var V = require('react');
4
- var O = require('@radix-ui/react-separator');
5
- var clsx = require('clsx');
6
- var nanoid = require('nanoid');
7
- var tailwindMerge = require('tailwind-merge');
8
- var jsxRuntime = require('react/jsx-runtime');
9
- var Ye = require('remark-gfm');
10
- var $e = require('remark-math');
11
- var reactSyntaxHighlighter = require('react-syntax-highlighter');
12
- var prism = require('react-syntax-highlighter/dist/cjs/styles/prism');
13
- var reactSlot = require('@radix-ui/react-slot');
14
- var classVarianceAuthority = require('class-variance-authority');
15
- var Ge = require('react-markdown');
16
- var Qe = require('react-textarea-autosize');
17
- var w = require('@radix-ui/react-tooltip');
18
- var eo = require('next/link');
19
- var reactIntersectionObserver = require('react-intersection-observer');
20
- var reactCore = require('@copilotkit/react-core');
21
- var outline = require('@heroicons/react/24/outline');
22
-
23
- function _interopNamespaceDefault(e) {
24
- var n = Object.create(null);
25
- if (e) {
26
- Object.keys(e).forEach(function (k) {
27
- if (k !== 'default') {
28
- var d = Object.getOwnPropertyDescriptor(e, k);
29
- Object.defineProperty(n, k, d.get ? d : {
30
- enumerable: true,
31
- get: function () { return e[k]; }
32
- });
33
- }
34
- });
35
- }
36
- n.default = e;
37
- return Object.freeze(n);
38
- }
39
-
40
- var V__namespace = /*#__PURE__*/_interopNamespaceDefault(V);
41
- var O__namespace = /*#__PURE__*/_interopNamespaceDefault(O);
42
- var w__namespace = /*#__PURE__*/_interopNamespaceDefault(w);
43
-
44
- var Se=Object.defineProperty,Me=Object.defineProperties;var Le=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var ee=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var Q=(e,o,r)=>o in e?Se(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,n=(e,o)=>{for(var r in o||(o={}))ee.call(o,r)&&Q(e,r,o[r]);if(I)for(var r of I(o))oe.call(o,r)&&Q(e,r,o[r]);return e},f=(e,o)=>Me(e,Le(o));var p=(e,o)=>{var r={};for(var t in e)ee.call(e,t)&&o.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&I)for(var t of I(e))o.indexOf(t)<0&&oe.call(e,t)&&(r[t]=e[t]);return r};var S=(e,o,r)=>new Promise((t,a)=>{var i=d=>{try{l(r.next(d));}catch(h){a(h);}},m=d=>{try{l(r.throw(d));}catch(h){a(h);}},l=d=>d.done?t(d.value):Promise.resolve(d.value).then(i,m);l((r=r.apply(e,o)).next());});function s(...e){return tailwindMerge.twMerge(clsx.clsx(e))}nanoid.customAlphabet("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);var U=V__namespace.forwardRef((i,a)=>{var m=i,{className:e,orientation:o="horizontal",decorative:r=!0}=m,t=p(m,["className","orientation","decorative"]);return jsxRuntime.jsx(O__namespace.Root,n({ref:a,decorative:r,orientation:o,className:s("shrink-0 bg-border",o==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e)},t))});U.displayName=O__namespace.Root.displayName;function T({timeout:e=2e3}){let[o,r]=V__namespace.useState(!1);return {isCopied:o,copyToClipboard:a=>{var i;typeof window=="undefined"||!((i=navigator.clipboard)!=null&&i.writeText)||!a||navigator.clipboard.writeText(a).then(()=>{r(!0),setTimeout(()=>{r(!1);},e);});}}}function ae(r){var t=r,{className:e}=t,o=p(t,["className"]);return jsxRuntime.jsxs("svg",f(n({fill:"currentColor",viewBox:"0 0 24 24",role:"img",xmlns:"http://www.w3.org/2000/svg",className:s("h-4 w-4",e)},o),{children:[jsxRuntime.jsx("title",{children:"OpenAI icon"}),jsxRuntime.jsx("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"})]}))}function ne(r){var t=r,{className:e}=t,o=p(t,["className"]);return jsxRuntime.jsx("svg",f(n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",className:s("h-4 w-4",e)},o),{children:jsxRuntime.jsx("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"})}))}function se(r){var t=r,{className:e}=t,o=p(t,["className"]);return jsxRuntime.jsx("svg",f(n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",className:s("h-4 w-4",e)},o),{children:jsxRuntime.jsx("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"})}))}function ie(r){var t=r,{className:e}=t,o=p(t,["className"]);return jsxRuntime.jsx("svg",f(n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",className:s("h-4 w-4",e)},o),{children:jsxRuntime.jsx("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"})}))}function le(r){var t=r,{className:e}=t,o=p(t,["className"]);return jsxRuntime.jsx("svg",f(n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",className:s("h-4 w-4",e)},o),{children:jsxRuntime.jsx("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"})}))}function pe(r){var t=r,{className:e}=t,o=p(t,["className"]);return jsxRuntime.jsx("svg",f(n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",className:s("h-4 w-4",e)},o),{children:jsxRuntime.jsx("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"})}))}function ce(r){var t=r,{className:e}=t,o=p(t,["className"]);return jsxRuntime.jsx("svg",f(n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",className:s("h-4 w-4",e)},o),{children:jsxRuntime.jsx("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"})}))}function B(r){var t=r,{className:e}=t,o=p(t,["className"]);return jsxRuntime.jsx("svg",f(n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",className:s("h-4 w-4",e)},o),{children:jsxRuntime.jsx("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"})}))}function Z(r){var t=r,{className:e}=t,o=p(t,["className"]);return jsxRuntime.jsx("svg",f(n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",className:s("h-4 w-4",e)},o),{children:jsxRuntime.jsx("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"})}))}function me(r){var t=r,{className:e}=t,o=p(t,["className"]);return jsxRuntime.jsx("svg",f(n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",className:s("h-4 w-4",e)},o),{children:jsxRuntime.jsx("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"})}))}var D=classVarianceAuthority.cva("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",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-md hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"shadow-none hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 shadow-none hover:underline"},size:{default:"h-8 px-4 py-2",sm:"h-8 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-8 w-8 p-0"}},defaultVariants:{variant:"default",size:"default"}}),u=V__namespace.forwardRef((m,i)=>{var l=m,{className:e,variant:o,size:r,asChild:t=!1}=l,a=p(l,["className","variant","size","asChild"]);return jsxRuntime.jsx(t?reactSlot.Slot:"button",n({className:s(D({variant:o,size:r,className:e})),ref:i},a))});u.displayName="Button";var Fe={javascript:".js",python:".py",java:".java",c:".c",cpp:".cpp","c++":".cpp","c#":".cs",ruby:".rb",php:".php",swift:".swift","objective-c":".m",kotlin:".kt",typescript:".ts",go:".go",perl:".pl",rust:".rs",scala:".scala",haskell:".hs",lua:".lua",shell:".sh",sql:".sql",html:".html",css:".css"},Ke=(e,o=!1)=>{let r="ABCDEFGHJKLMNPQRSTUVWXY3456789",t="";for(let a=0;a<e;a++)t+=r.charAt(Math.floor(Math.random()*r.length));return o?t.toLowerCase():t},F=V.memo(({language:e,value:o})=>{let{isCopied:r,copyToClipboard:t}=T({timeout:2e3});return jsxRuntime.jsxs("div",{className:"codeblock relative w-full bg-zinc-950 font-sans",children:[jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between bg-zinc-800 px-6 py-2 pr-4 text-zinc-100",children:[jsxRuntime.jsx("span",{className:"text-xs lowercase",children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsxs(u,{variant:"ghost",className:"hover:bg-zinc-800 focus-visible:ring-1 focus-visible:ring-slate-700 focus-visible:ring-offset-0",onClick:()=>{if(typeof window=="undefined")return;let m=Fe[e]||".file",l=`file-${Ke(3,!0)}${m}`,d=window.prompt("Enter file name",l);if(!d)return;let h=new Blob([o],{type:"text/plain"}),C=URL.createObjectURL(h),N=document.createElement("a");N.download=d,N.href=C,N.style.display="none",document.body.appendChild(N),N.click(),document.body.removeChild(N),URL.revokeObjectURL(C);},size:"icon",children:[jsxRuntime.jsx(me,{}),jsxRuntime.jsx("span",{className:"sr-only",children:"Download"})]}),jsxRuntime.jsxs(u,{variant:"ghost",size:"icon",className:"text-xs hover:bg-zinc-800 focus-visible:ring-1 focus-visible:ring-slate-700 focus-visible:ring-offset-0",onClick:()=>{r||t(o);},children:[r?jsxRuntime.jsx(Z,{}):jsxRuntime.jsx(B,{}),jsxRuntime.jsx("span",{className:"sr-only",children:"Copy code"})]})]})]}),jsxRuntime.jsx(reactSyntaxHighlighter.Prism,{language:e,style:prism.coldarkDark,PreTag:"div",showLineNumbers:!0,customStyle:{margin:0,width:"100%",background:"transparent",padding:"1.5rem 1rem"},codeTagProps:{style:{fontSize:"0.9rem",fontFamily:"var(--font-mono)"}},children:o})]})});F.displayName="CodeBlock";var fe=V.memo(Ge,(e,o)=>e.children===o.children&&e.className===o.className);function ue(t){var a=t,{message:e,className:o}=a,r=p(a,["message","className"]);let{isCopied:i,copyToClipboard:m}=T({timeout:2e3}),l=()=>{i||m(e.content);};return jsxRuntime.jsx("div",f(n({className:s("flex items-center justify-end transition-opacity group-hover:opacity-100 md:absolute md:-right-10 md:-top-2 md:opacity-0",o)},r),{children:jsxRuntime.jsxs(u,{variant:"ghost",size:"icon",onClick:l,children:[i?jsxRuntime.jsx(Z,{}):jsxRuntime.jsx(B,{}),jsxRuntime.jsx("span",{className:"sr-only",children:"Copy message"})]})}))}function he(r){var t=r,{message:e}=t,o=p(t,["message"]);return jsxRuntime.jsxs("div",f(n({className:s("group relative mb-4 flex items-start")},o),{children:[jsxRuntime.jsx("div",{className:s("flex h-8 w-8 shrink-0 select-none items-center justify-center rounded-md border shadow",e.role==="user"?"bg-background":"bg-primary text-primary-foreground"),children:e.role==="user"?jsxRuntime.jsx(se,{}):jsxRuntime.jsx(ae,{})}),jsxRuntime.jsxs("div",{className:"ml-4 flex-1 space-y-2 overflow-hidden px-1",children:[jsxRuntime.jsx(fe,{className:"prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 text-sm",remarkPlugins:[Ye,$e],components:{p({children:a}){return jsxRuntime.jsx("p",{className:"mb-2 last:mb-0",children:a})},code(d){var h=d,{children:a,className:i,inline:m}=h,l=p(h,["children","className","inline"]);if(a.length){if(a[0]=="\u258D")return jsxRuntime.jsx("span",{className:"mt-1 animate-pulse cursor-default",children:"\u258D"});a[0]=a[0].replace("`\u258D`","\u258D");}let C=/language-(\w+)/.exec(i||"");return m?jsxRuntime.jsx("code",f(n({className:i},l),{children:a})):jsxRuntime.jsx(F,n({language:C&&C[1]||"",value:String(a).replace(/\n$/,"")},l),Math.random())}},children:e.content}),jsxRuntime.jsx(ue,{message:e})]})]}))}function ve({messages:e}){let o=e.filter(r=>r.role!=="system");return o.length?jsxRuntime.jsx("div",{className:"relative mx-auto max-w-2xl px-0",children:o.map((r,t)=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(he,{message:r}),t<o.length-1&&jsxRuntime.jsx(U,{className:"my-4 md:my-4"})]},t))}):null}function we(){let e=V.useRef(null);return {formRef:e,onKeyDown:r=>{var t;r.key==="Enter"&&!r.shiftKey&&!r.nativeEvent.isComposing&&((t=e.current)==null||t.requestSubmit(),r.preventDefault());}}}var Xe=w__namespace.Provider,A=w__namespace.Root,j=w__namespace.Trigger,E=V__namespace.forwardRef((a,t)=>{var i=a,{className:e,sideOffset:o=4}=i,r=p(i,["className","sideOffset"]);return jsxRuntime.jsx(w__namespace.Content,n({ref:t,sideOffset:o,className:s("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",e)},r))});E.displayName=w__namespace.Content.displayName;function xe({onSubmit:e,input:o,setInput:r,isLoading:t}){let{formRef:a,onKeyDown:i}=we(),m=V__namespace.useRef(null);return V__namespace.useEffect(()=>{m.current&&m.current.focus();},[]),jsxRuntime.jsx("form",{onSubmit:l=>S(this,null,function*(){l.preventDefault(),o!=null&&o.trim()&&(r(""),yield e(o));}),ref:a,children:jsxRuntime.jsxs("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:[jsxRuntime.jsxs(A,{children:[jsxRuntime.jsx(j,{asChild:!0,children:jsxRuntime.jsxs(eo,{href:"/",className:s(D({size:"sm",variant:"outline"}),"absolute left-0 top-4 h-8 w-8 rounded-full bg-background p-0 sm:left-4"),children:[jsxRuntime.jsx(ie,{}),jsxRuntime.jsx("span",{className:"sr-only",children:"New Chat"})]})}),jsxRuntime.jsx(E,{children:"New Chat"})]}),jsxRuntime.jsx(Qe,{ref:m,tabIndex:0,onKeyDown:i,rows:1,value:o,onChange:l=>r(l.target.value),placeholder:"Send a message.",spellCheck:!1,className:"min-h-[60px] w-full resize-none bg-transparent px-4 py-[1.3rem] focus-within:outline-none sm:text-sm"}),jsxRuntime.jsx("div",{className:"absolute right-0 top-4 sm:right-4",children:jsxRuntime.jsxs(A,{children:[jsxRuntime.jsx(j,{asChild:!0,children:jsxRuntime.jsxs(u,{type:"submit",size:"icon",disabled:t||o==="",className:" bg-slate-300",children:[jsxRuntime.jsx(le,{}),jsxRuntime.jsx("span",{className:"sr-only",children:"Send message"})]})}),jsxRuntime.jsx(E,{children:"Send message"})]})})]})})}function be({id:e,isLoading:o,stop:r,append:t,reload:a,input:i,setInput:m,messages:l}){return jsxRuntime.jsx("div",{className:"inset-x-0 bottom-0 bg-gradient-to-b from-muted/10 from-10% to-muted/30 to-50% mt-4 mb-8",style:{width:"100%",overflow:"hidden",boxSizing:"border-box"},children:jsxRuntime.jsxs("div",{className:"mx-auto sm:max-w-2xl sm:px-4",children:[jsxRuntime.jsx("div",{className:"flex h-10 items-center justify-center mb-4",children:o?jsxRuntime.jsxs(u,{variant:"outline",onClick:()=>r(),className:"bg-background",children:[jsxRuntime.jsx(ce,{className:"mr-2"}),"Stop generating"]}):(l==null?void 0:l.length)>0&&jsxRuntime.jsxs(u,{variant:"outline",onClick:()=>a(),className:"bg-background",children:[jsxRuntime.jsx(pe,{className:"mr-2"}),"Regenerate response"]})}),jsxRuntime.jsx("div",{className:"space-y-4 border-2 bg-background px-4 py-2 shadow-lg sm:rounded-xl md:py-4",children:jsxRuntime.jsx(xe,{onSubmit:d=>S(this,null,function*(){yield t({id:e,content:d,role:"user"});}),input:i,setInput:m,isLoading:o})})]})})}function Y({href:e,children:o}){return jsxRuntime.jsxs("a",{href:e,target:"_blank",className:"inline-flex flex-1 justify-center gap-1 leading-4 hover:underline",children:[jsxRuntime.jsx("span",{children:o}),jsxRuntime.jsx("svg",{"aria-hidden":"true",height:"7",viewBox:"0 0 6 6",width:"7",className:"opacity-70",children:jsxRuntime.jsx("path",{d:"M1.25215 5.54731L0.622742 4.9179L3.78169 1.75597H1.3834L1.38936 0.890915H5.27615V4.78069H4.40513L4.41109 2.38538L1.25215 5.54731Z",fill:"currentColor"})})]})}var to=[{heading:"Explain technical concepts",message:'What is a "serverless function"?'},{heading:"Summarize an article",message:`Summarize the following article for a 2nd grader:
45
- `},{heading:"Draft an email",message:`Draft an email to my boss about the following:
46
- `}],ye=e=>jsxRuntime.jsx("div",{className:"mx-auto max-w-2xl px-4",children:jsxRuntime.jsxs("div",{className:"rounded-lg border bg-background p-8",children:[jsxRuntime.jsx("h1",{className:"mb-2 text-lg font-semibold",children:"Welcome to Copilot! \u{1F44B}"}),jsxRuntime.jsxs("p",{className:"mb-2 leading-normal text-muted-foreground",children:["This is a Copilot built with"," ",jsxRuntime.jsx(Y,{href:"https://recursively.ai",children:"recursively.ai's"})," ",jsxRuntime.jsx(Y,{href:"https://github.com/RecursivelyAI/CopilotKit",children:"CopilotKit"})," ","."]}),jsxRuntime.jsx("p",{className:"leading-normal text-muted-foreground",children:"You can start a conversation here or try the following examples:"}),jsxRuntime.jsx("div",{className:"mt-4 flex flex-col items-start space-y-2",children:to.map((o,r)=>jsxRuntime.jsxs(u,{variant:"link",className:"h-auto p-0 text-base",onClick:()=>e.setInput(o.message),children:[jsxRuntime.jsx(ne,{className:"mr-2 text-muted-foreground"}),o.heading]},r))})]})});function Ne(e=0){let[o,r]=V__namespace.useState(!1);return V__namespace.useEffect(()=>{let t=()=>{r(window.innerHeight+window.scrollY>=document.body.offsetHeight-e);};return window.addEventListener("scroll",t,{passive:!0}),t(),()=>{window.removeEventListener("scroll",t);}},[e]),o}function Pe({trackVisibility:e}){let o=Ne(),{ref:r,entry:t,inView:a}=reactIntersectionObserver.useInView({trackVisibility:e,delay:100,rootMargin:"0px 0px -150px 0px"});return V__namespace.useEffect(()=>{o&&e&&!a&&(t==null||t.target.scrollIntoView({block:"start"}));},[a,t,o,e]),jsxRuntime.jsx("div",{ref:r,className:"h-px w-full"})}function q({id:e,initialMessages:o,makeSystemMessage:r,EmptyScreen:t=ye}){let{visibleMessages:a,append:i,reload:m,stop:l,isLoading:d,input:h,setInput:C}=reactCore.useCopilotChat({id:e,initialMessages:o,makeSystemMessage:r});return jsxRuntime.jsxs("div",{className:"w-full h-full flex flex-col overflow-hidden box-border items-start",children:[jsxRuntime.jsx("div",{className:"pt-5 px-5 overflow-y-auto overflow-x-hidden w-full flex-grow",children:a.length?jsxRuntime.jsxs("div",{className:"pl-0 pr-6",children:[jsxRuntime.jsx(ve,{messages:a}),jsxRuntime.jsx(Pe,{trackVisibility:d})]}):jsxRuntime.jsx(t,{setInput:C})}),jsxRuntime.jsx("div",{className:"flex-shrink-0 w-full",children:jsxRuntime.jsx(be,{id:e,isLoading:d,stop:l,append:i,reload:m,messages:a,input:h,setInput:C})})]})}function X(e){return jsxRuntime.jsxs("div",{className:"shadow-lg bg-white flex flex-col",style:{width:"100%",height:"100%"},children:[jsxRuntime.jsx(io,n({},e)),jsxRuntime.jsx(q,{})]})}function io(e){return jsxRuntime.jsxs("div",{className:"py-6 bg-white flex items-center justify-between px-4",children:[jsxRuntime.jsx("h1",{className:"text-base font-semibold leading-6 text-gray-900",children:"Copilot Chat"}),jsxRuntime.jsx("div",{className:"ml-3 flex h-7 items-center",children:jsxRuntime.jsxs("button",{type:"button",className:"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",onClick:()=>e.setSidebarOpen(!1),children:[jsxRuntime.jsx("span",{className:"sr-only",children:"Close panel"}),jsxRuntime.jsx(outline.XMarkIcon,{className:"h-6 w-6","aria-hidden":"true"})]})})]})}var _=V.createContext({isSidebarOpen:!1,toggleSidebar:()=>{}});function mo({children:e}){let[o,r]=V.useState(!0),t=V.useCallback(()=>{r(a=>!a);},[]);return jsxRuntime.jsx(_.Provider,{value:{isSidebarOpen:o,toggleSidebar:t},children:jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{style:{height:"100vh",width:"100vw",position:"relative"},children:[jsxRuntime.jsx("div",{style:{overflowY:"auto",overflowX:"hidden",height:"100%",width:o?"calc(100% - 450px)":"100%",position:"absolute",transition:"width 0.5s ease-in-out"},children:jsxRuntime.jsx("main",{children:e})}),jsxRuntime.jsx("div",{style:{overflowY:"auto",height:"100%",width:"450px",position:"absolute",right:o?"0":"-450px",transition:"right 0.5s ease-in-out"},children:jsxRuntime.jsx(X,{setSidebarOpen:r})}),!o&&jsxRuntime.jsx("button",{onClick:t,style:{position:"absolute",top:"5%",right:"20px",transform:"translateY(-50%)",transition:"opacity 0.5s ease-in-out"},className:"bg-slate-100 ring-2 ring-slate-600 font-semibold text-black p-2 rounded-lg shadow-lg",children:"Open Copilot"})]})})})}
47
-
48
- exports.CopilotChat = q;
49
- exports.CopilotSidebar = X;
50
- exports.CopilotSidebarContext = _;
51
- exports.CopilotSidebarUIProvider = mo;
52
- exports.Tooltip = A;
53
- exports.TooltipProvider = Xe;