khoj 1.36.6.dev4__py3-none-any.whl → 1.36.6.dev5__py3-none-any.whl
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.
- khoj/interface/compiled/404/index.html +2 -2
- khoj/interface/compiled/_next/static/chunks/{4986-fde2ef8d6b568939.js → 4986-d19b9ab0079521d7.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/agents/{page-2f55f9d0da49bf31.js → page-fbe2c1c661cd14ac.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/automations/{page-d0a630a2b4ecc41d.js → page-ad620b194fd508fe.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/chat/{page-9c0a2df3e33c029b.js → page-4108f46796c1c606.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/{page-642bd02fc4f16606.js → page-f91e6a6a849baf5e.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/search/{layout-ff081947c70ea9b7.js → layout-ab5dbb69fb914900.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/search/{page-7c80e369ee1cdfad.js → page-30e231665f1f3796.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/settings/{page-9939a20613b25901.js → page-924a7308250ed0eb.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/{layout-94a33aa0eae034fc.js → layout-2ce0cb95b1219d97.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-6253896a84300e9b.js → page-ffcb3ce5c6af9988.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/{webpack-63715907cbdf16c6.js → webpack-79b7e98c584222f7.js} +1 -1
- khoj/interface/compiled/_next/static/css/{804ceddd6c935d4a.css → 8051073dc55b92b3.css} +1 -1
- khoj/interface/compiled/_next/static/css/f29752d6e1be7624.css +1 -0
- khoj/interface/compiled/agents/index.html +2 -2
- khoj/interface/compiled/agents/index.txt +2 -2
- khoj/interface/compiled/automations/index.html +2 -2
- khoj/interface/compiled/automations/index.txt +3 -3
- khoj/interface/compiled/chat/index.html +2 -2
- khoj/interface/compiled/chat/index.txt +2 -2
- khoj/interface/compiled/index.html +2 -2
- khoj/interface/compiled/index.txt +2 -2
- khoj/interface/compiled/search/index.html +2 -2
- khoj/interface/compiled/search/index.txt +3 -3
- khoj/interface/compiled/settings/index.html +2 -2
- khoj/interface/compiled/settings/index.txt +5 -5
- khoj/interface/compiled/share/chat/index.html +2 -2
- khoj/interface/compiled/share/chat/index.txt +3 -3
- {khoj-1.36.6.dev4.dist-info → khoj-1.36.6.dev5.dist-info}/METADATA +1 -1
- {khoj-1.36.6.dev4.dist-info → khoj-1.36.6.dev5.dist-info}/RECORD +41 -41
- khoj/interface/compiled/_next/static/css/55d4a822f8d94b67.css +0 -1
- /khoj/interface/compiled/_next/static/chunks/{1915-233ac8a122732d6b.js → 1915-4b7980a58fb630d6.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{2117-ce1f0a4598f5e4fe.js → 2117-f99825f0a867a42d.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{4363-9870bda67c2cf031.js → 4363-ac51bce40b6fc313.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{4447-6e47461d1100c3cc.js → 4447-30959771ff58d99d.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{8667-8136f74e9a086fca.js → 8667-adbe6017a66cef10.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{9259-fa40e7cf2ca28e04.js → 9259-5be50737cfe989bc.js} +0 -0
- /khoj/interface/compiled/_next/static/{xF7GE1UTN2UBkRDAbvano → mj3LRaTV49NoToQFKNZbZ}/_buildManifest.js +0 -0
- /khoj/interface/compiled/_next/static/{xF7GE1UTN2UBkRDAbvano → mj3LRaTV49NoToQFKNZbZ}/_ssgManifest.js +0 -0
- {khoj-1.36.6.dev4.dist-info → khoj-1.36.6.dev5.dist-info}/WHEEL +0 -0
- {khoj-1.36.6.dev4.dist-info → khoj-1.36.6.dev5.dist-info}/entry_points.txt +0 -0
- {khoj-1.36.6.dev4.dist-info → khoj-1.36.6.dev5.dist-info}/licenses/LICENSE +0 -0
@@ -1,8 +1,8 @@
|
|
1
|
-
<!DOCTYPE html><html lang="en" class="__variable_f36179 __variable_702545"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/1d8a05b60287ae6c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/77c207b095007c34-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/82ef96de0e8f4d8c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/a6ecd16fa044d500-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/c4250770ab8708b6-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/e098aaaecc9cfbb2-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/089de1d8526b96e9.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/a3411982c232c7be.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-
|
1
|
+
<!DOCTYPE html><html lang="en" class="__variable_f36179 __variable_702545"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/1d8a05b60287ae6c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/77c207b095007c34-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/82ef96de0e8f4d8c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/a6ecd16fa044d500-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/c4250770ab8708b6-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/e098aaaecc9cfbb2-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/089de1d8526b96e9.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/a3411982c232c7be.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-79b7e98c584222f7.js"/><script src="/_next/static/chunks/fd9d1056-7454f5bbfcf5bd5b.js" async=""></script><script src="/_next/static/chunks/2117-f99825f0a867a42d.js" async=""></script><script src="/_next/static/chunks/main-app-de1f09df97a3cfc7.js" async=""></script><script src="/_next/static/chunks/3861-8662fce65c02717d.js" async=""></script><script src="/_next/static/chunks/app/layout-26139159e500852a.js" async=""></script><meta name="robots" content="noindex"/><meta http-equiv="Content-Security-Policy" content="default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';"/><title>404: This page could not be found.</title><title>Khoj AI - Ask Anything</title><meta name="description" content="Khoj is a personal research assistant. It helps you understand better and create faster."/><link rel="manifest" href="/static/khoj.webmanifest" crossorigin="use-credentials"/><meta name="keywords" content="research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant"/><meta property="og:title" content="Khoj AI"/><meta property="og:description" content="Khoj is a personal research assistant. It helps you understand better and create faster."/><meta property="og:url" content="https://app.khoj.dev/"/><meta property="og:site_name" content="Khoj AI"/><meta property="og:image" content="https://assets.khoj.dev/khoj_hero.png"/><meta property="og:image:width" content="940"/><meta property="og:image:height" content="525"/><meta property="og:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta property="og:image:width" content="256"/><meta property="og:image:height" content="256"/><meta property="og:image" content="https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"/><meta property="og:image:width" content="1200"/><meta property="og:image:height" content="630"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="Khoj AI"/><meta name="twitter:description" content="Khoj is a personal research assistant. It helps you understand better and create faster."/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_hero.png"/><meta name="twitter:image:width" content="940"/><meta name="twitter:image:height" content="525"/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta name="twitter:image:width" content="256"/><meta name="twitter:image:height" content="256"/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"/><meta name="twitter:image:width" content="1200"/><meta name="twitter:image:height" content="630"/><link rel="icon" href="/static/assets/icons/khoj_lantern.ico"/><link rel="apple-touch-icon" href="/static/assets/icons/khoj_lantern_256x256.png"/><meta name="next-size-adjust"/><script>
|
2
2
|
try {
|
3
3
|
if (localStorage.getItem('theme') === 'dark' ||
|
4
4
|
(!localStorage.getItem('theme') && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
5
5
|
document.documentElement.classList.add('dark');
|
6
6
|
}
|
7
7
|
} catch (e) {}
|
8
|
-
</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-63715907cbdf16c6.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/1d8a05b60287ae6c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/77c207b095007c34-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/82ef96de0e8f4d8c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/media/a6ecd16fa044d500-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n5:HL[\"/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n6:HL[\"/_next/static/media/c4250770ab8708b6-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n7:HL[\"/_next/static/media/e098aaaecc9cfbb2-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n8:HL[\"/_next/static/css/089de1d8526b96e9.css\",\"style\"]\n9:HL[\"/_next/static/css/a3411982c232c7be.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"a:I[12846,[],\"\"]\nc:I[4707,[],\"\"]\nd:I[36423,[],\"\"]\ne:I[85147,[\"3861\",\"static/chunks/3861-8662fce65c02717d.js\",\"3185\",\"static/chunks/app/layout-26139159e500852a.js\"],\"ThemeProvider\"]\n14:I[61060,[],\"\"]\nf:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n10:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n11:{\"display\":\"inline-block\"}\n12:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\n15:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$La\",null,{\"buildId\":\"xF7GE1UTN2UBkRDAbvano\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\",\"\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$Lb\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Ld\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/089de1d8526b96e9.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/a3411982c232c7be.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_f36179 __variable_702545\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n try {\\n if (localStorage.getItem('theme') === 'dark' ||\\n (!localStorage.getItem('theme') \u0026\u0026 window.matchMedia('(prefers-color-scheme: dark)').matches)) {\\n document.documentElement.classList.add('dark');\\n }\\n } catch (e) {}\\n \"}}]}],[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';\"}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$Le\",null,{\"children\":[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Ld\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$f\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$10\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$11\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$12\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$L13\"],\"globalErrorComponent\":\"$14\",\"missingSlots\":\"$W15\"}]\n"])</script><script>self.__next_f.push([1,"13:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Ask Anything\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Khoj is a personal research assistant. It helps you understand better and create faster.\"}],[\"$\",\"link\",\"4\",{\"rel\":\"manifest\",\"href\":\"/static/khoj.webmanifest\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"5\",{\"name\":\"keywords\",\"content\":\"research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:title\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:description\",\"content\":\"Khoj is a personal research assistant. It helps you understand better and create faster.\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:url\",\"content\":\"https://app.khoj.dev/\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:site_name\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"17\",{\"property\":\"og:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"18\",{\"property\":\"og:image:height\",\"content\":\"630\"}],[\"$\",\"meta\",\"19\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:title\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"22\",{\"name\":\"twitter:description\",\"content\":\"Khoj is a personal research assistant. It helps you understand better and create faster.\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"25\",{\"name\":\"twitter:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"26\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"27\",{\"name\":\"twitter:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"28\",{\"name\":\"twitter:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"29\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"30\",{\"name\":\"twitter:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"31\",{\"name\":\"twitter:image:height\",\"content\":\"630\"}],[\"$\",\"link\",\"32\",{\"rel\":\"icon\",\"href\":\"/static/assets/icons/khoj_lantern.ico\"}],[\"$\",\"link\",\"33\",{\"rel\":\"apple-touch-icon\",\"href\":\"/static/assets/icons/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"34\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"b:null\n"])</script></body></html>
|
8
|
+
</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-79b7e98c584222f7.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/1d8a05b60287ae6c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/77c207b095007c34-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/82ef96de0e8f4d8c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/media/a6ecd16fa044d500-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n5:HL[\"/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n6:HL[\"/_next/static/media/c4250770ab8708b6-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n7:HL[\"/_next/static/media/e098aaaecc9cfbb2-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n8:HL[\"/_next/static/css/089de1d8526b96e9.css\",\"style\"]\n9:HL[\"/_next/static/css/a3411982c232c7be.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"a:I[12846,[],\"\"]\nc:I[4707,[],\"\"]\nd:I[36423,[],\"\"]\ne:I[85147,[\"3861\",\"static/chunks/3861-8662fce65c02717d.js\",\"3185\",\"static/chunks/app/layout-26139159e500852a.js\"],\"ThemeProvider\"]\n14:I[61060,[],\"\"]\nf:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n10:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n11:{\"display\":\"inline-block\"}\n12:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\n15:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$La\",null,{\"buildId\":\"mj3LRaTV49NoToQFKNZbZ\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\",\"\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$Lb\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Ld\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/089de1d8526b96e9.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/a3411982c232c7be.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_f36179 __variable_702545\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n try {\\n if (localStorage.getItem('theme') === 'dark' ||\\n (!localStorage.getItem('theme') \u0026\u0026 window.matchMedia('(prefers-color-scheme: dark)').matches)) {\\n document.documentElement.classList.add('dark');\\n }\\n } catch (e) {}\\n \"}}]}],[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';\"}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$Le\",null,{\"children\":[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Ld\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$f\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$10\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$11\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$12\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$L13\"],\"globalErrorComponent\":\"$14\",\"missingSlots\":\"$W15\"}]\n"])</script><script>self.__next_f.push([1,"13:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Ask Anything\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Khoj is a personal research assistant. It helps you understand better and create faster.\"}],[\"$\",\"link\",\"4\",{\"rel\":\"manifest\",\"href\":\"/static/khoj.webmanifest\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"5\",{\"name\":\"keywords\",\"content\":\"research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:title\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:description\",\"content\":\"Khoj is a personal research assistant. It helps you understand better and create faster.\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:url\",\"content\":\"https://app.khoj.dev/\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:site_name\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"17\",{\"property\":\"og:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"18\",{\"property\":\"og:image:height\",\"content\":\"630\"}],[\"$\",\"meta\",\"19\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:title\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"22\",{\"name\":\"twitter:description\",\"content\":\"Khoj is a personal research assistant. It helps you understand better and create faster.\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"25\",{\"name\":\"twitter:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"26\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"27\",{\"name\":\"twitter:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"28\",{\"name\":\"twitter:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"29\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"30\",{\"name\":\"twitter:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"31\",{\"name\":\"twitter:image:height\",\"content\":\"630\"}],[\"$\",\"link\",\"32\",{\"rel\":\"icon\",\"href\":\"/static/assets/icons/khoj_lantern.ico\"}],[\"$\",\"link\",\"33\",{\"rel\":\"apple-touch-icon\",\"href\":\"/static/assets/icons/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"34\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"b:null\n"])</script></body></html>
|
khoj/interface/compiled/_next/static/chunks/{4986-fde2ef8d6b568939.js → 4986-d19b9ab0079521d7.js}
RENAMED
@@ -1 +1 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4986],{74986:function(e,t,a){"use strict";a.d(t,{Z:function(){return ey}});var n=a(57437),s=a(42501),o=a.n(s),l=a(2265),r=a(48614),c=a(40521),i=a(91499),d=a.n(i),h=a(19983),u=a(13506),m=a.n(u),g=a(34040);a(2446);var f=a(5147),p=a(86018),x=a(38525),v=a(45178),j=a(66070),w=a(69304),b=a(57054),y=a(18848),C=a(42225),M=a(27648);let N=new h.Z({html:!0,linkify:!0,typographer:!0});function k(e){let t=(0,C.Le)(e.title||".txt","w-6 h-6 text-muted-foreground inline-flex mr-2"),a=e.title.split("/").pop()||e.title,s=function(e){let t=["org","md","markdown"].includes(e.title.split(".").pop()||"")?e.content.split("\n").slice(1).join("\n"):e.content;return e.showFullContent?y.Z.sanitize(N.render(t)):y.Z.sanitize(t)}(e),[o,r]=(0,l.useState)(!1);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(b.J2,{open:o&&!e.showFullContent,onOpenChange:r,children:[(0,n.jsx)(b.xo,{asChild:!0,children:(0,n.jsx)(j.Zb,{onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),className:"".concat(e.showFullContent?"w-auto bg-muted":"w-auto"," overflow-hidden break-words text-balance rounded-lg border-none p-2 shadow-none"),children:e.showFullContent?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("h3",{className:"".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground}"),children:[t,e.showFullContent?e.title:a]}),(0,n.jsx)("p",{className:"text-sm overflow-x-auto block",dangerouslySetInnerHTML:{__html:s}})]}):(0,n.jsx)(E,{type:"notes"},"".concat(e.title))})}),(0,n.jsx)(b.yk,{className:"w-[400px] mx-2",children:(0,n.jsxs)(j.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none p-2",children:[(0,n.jsxs)("h3",{className:"line-clamp-2 text-muted-foreground}",children:[t,e.title]}),(0,n.jsx)("p",{className:"border-t mt-1 pt-1 text-sm overflow-hidden line-clamp-5",dangerouslySetInnerHTML:{__html:s}})]})})]})})}function _(e){var t,a,s,o,r,c;let i=(0,C.Le)(".py","!w-4 h-4 text-muted-foreground flex-shrink-0"),d=y.Z.sanitize(e.code),[h,u]=(0,l.useState)(!1),[m,g]=(0,l.useState)(!1),p=e=>{let t="text/plain",a=e.b64_data;e.filename.match(/\.(png|jpg|jpeg|webp)$/)?(t="image/".concat(e.filename.split(".").pop()),a=atob(e.b64_data)):e.filename.endsWith(".json")?t="application/json":e.filename.endsWith(".csv")&&(t="text/csv");let n=new ArrayBuffer(a.length),s=new Uint8Array(n);for(let e=0;e<a.length;e++)s[e]=a.charCodeAt(e);let o=new Blob([n],{type:t}),l=URL.createObjectURL(o),r=document.createElement("a");r.href=l,r.download=e.filename,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(l)},x=(t,a)=>(null==t?void 0:t.length)==0?null:(0,n.jsx)("div",{className:"".concat(a||e.showFullContent?"border-t mt-1 pt-1":void 0),children:t.slice(0,e.showFullContent?void 0:1).map((t,s)=>(0,n.jsxs)("div",{children:[(0,n.jsxs)("h4",{className:"text-sm text-muted-foreground flex items-center",children:[(0,n.jsx)("span",{className:"overflow-hidden mr-2 font-bold ".concat(e.showFullContent?void 0:"line-clamp-1"),children:t.filename}),(0,n.jsx)("button",{className:"".concat(a?"hidden":void 0),onClick:e=>{e.preventDefault(),p(t)},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),title:"Download file: ".concat(t.filename),children:(0,n.jsx)(f.b,{className:"w-4 h-4",weight:m?"fill":"regular"})})]}),t.filename.match(/\.(txt|org|md|csv|json)$/)?(0,n.jsx)("pre",{className:"".concat(e.showFullContent?"block":"line-clamp-2"," text-sm mt-1 p-1 bg-background rounded overflow-x-auto"),children:t.b64_data}):t.filename.match(/\.(png|jpg|jpeg|webp)$/)?(0,n.jsx)("img",{src:"data:image/".concat(t.filename.split(".").pop(),";base64,").concat(t.b64_data),alt:t.filename,className:"mt-1 max-h-32 rounded"}):null]},"".concat(t.filename,"-").concat(s)))});return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(b.J2,{open:h&&!e.showFullContent,onOpenChange:u,children:[(0,n.jsx)(b.xo,{asChild:!0,children:(0,n.jsx)(j.Zb,{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:"".concat(e.showFullContent?"w-auto bg-muted":"w-auto"," overflow-hidden break-words text-balance rounded-lg border-none p-2 shadow-none"),children:e.showFullContent?(0,n.jsxs)("div",{className:"flex flex-col px-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[i,(0,n.jsxs)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:["code ",(null===(t=e.output_files)||void 0===t?void 0:t.length)>0?"artifacts":""]})]}),(0,n.jsx)("pre",{className:"text-xs pb-2 ".concat(e.showFullContent?"block overflow-x-auto":(null===(a=e.output_files)||void 0===a?void 0:a.length)>0?"hidden":"overflow-hidden line-clamp-3"),children:d}),(null===(s=e.output_files)||void 0===s?void 0:s.length)>0&&x(e.output_files,!1)]}):(0,n.jsx)(E,{type:"code"},"code-".concat(e.code))})}),(0,n.jsx)(b.yk,{className:"w-[400px] mx-2",children:(0,n.jsxs)(j.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none p-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[i,(0,n.jsxs)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:["code ",(null===(o=e.output_files)||void 0===o?void 0:o.length)>0?"artifact":""]})]}),(null===(r=e.output_files)||void 0===r?void 0:r.length)>0&&x(null===(c=e.output_files)||void 0===c?void 0:c.slice(0,1),!0)||(0,n.jsx)("pre",{className:"text-xs border-t mt-1 pt-1 overflow-hidden line-clamp-10",children:d})]})})]})})}function R(e){let[t,a]=(0,l.useState)(!1);if(!e.link||e.link.split(" ").length>1)return null;let s="https://www.google.com/s2/favicons?domain=globe",o="unknown";try{o=new URL(e.link).hostname,s="https://www.google.com/s2/favicons?domain=".concat(o)}catch(t){return console.warn("Error parsing domain from link: ".concat(e.link)),null}return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(b.J2,{open:t&&!e.showFullContent,onOpenChange:a,children:[(0,n.jsx)(b.xo,{asChild:!0,children:(0,n.jsx)(j.Zb,{onMouseEnter:()=>{a(!0)},onMouseLeave:()=>{a(!1)},className:"".concat(e.showFullContent?"w-auto bg-muted":"w-auto"," overflow-hidden break-words text-balance rounded-lg border-none p-2 shadow-none"),children:e.showFullContent?(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)(M.default,{href:e.link,children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("img",{src:s,alt:"",className:"!w-4 h-4 flex-shrink-0"}),(0,n.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:o})]})}),(0,n.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," font-bold"),children:e.title}),(0,n.jsx)("p",{className:"overflow-hidden text-sm ".concat(e.showFullContent?"block":"line-clamp-2"),children:e.description})]}):(0,n.jsx)(E,{type:"online",link:e.link},e.title)})}),(0,n.jsx)(b.yk,{className:"w-[400px] mx-2",children:(0,n.jsx)(j.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none",children:(0,n.jsx)("div",{className:"flex flex-col",children:(0,n.jsxs)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:"!no-underline px-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("img",{src:s,alt:"",className:"!w-4 h-4 flex-shrink-0"}),(0,n.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," text-muted-foreground flex-grow"),children:o})]}),(0,n.jsx)("h3",{className:"border-t mt-1 pt-1 overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," font-bold"),children:e.title}),(0,n.jsx)("p",{className:"overflow-hidden text-sm ".concat(e.showFullContent?"block":"line-clamp-5"),children:e.description})]})})})})]})})}function E(e){let t="",a="unknown";if(e.link)try{a=new URL(e.link).hostname,t="https://www.google.com/s2/favicons?domain=".concat(a)}catch(t){return console.warn("Error parsing domain from link: ".concat(e.link)),null}let s=null,o="!w-4 !h-4 text-muted-foreground inline-flex mr-2 rounded-lg";switch(e.type){case"code":s=(0,n.jsx)(p.E,{className:"".concat(o)});break;case"online":s=(0,n.jsx)("img",{src:t,alt:"",className:"".concat(o)});break;case"notes":s=(0,n.jsx)(x.j,{className:"".concat(o)});break;default:s=null}return s?(0,n.jsx)("div",{className:"flex items-center gap-2",children:s}):null}function I(e){let t=e.notesReferenceCardData.length>0||e.codeReferenceCardData.length>0||e.onlineReferenceCardData.length>0,a=e.notesReferenceCardData.length+e.codeReferenceCardData.length+e.onlineReferenceCardData.length;return 0===a?null:(0,n.jsx)("div",{className:"pt-0 px-4 pb-4",children:(0,n.jsxs)("h3",{className:"inline-flex items-center",children:[(0,n.jsxs)("div",{className:"text-gray-400 m-2",children:[a," sources"]}),(0,n.jsx)("div",{className:"flex flex-wrap gap-2 w-auto m-2",children:t&&(0,n.jsx)(S,{notesReferenceCardData:e.notesReferenceCardData,onlineReferenceCardData:e.onlineReferenceCardData,codeReferenceCardData:e.codeReferenceCardData,isMobileWidth:e.isMobileWidth})})]})})}function S(e){let[t,a]=(0,l.useState)(3);if((0,l.useEffect)(()=>{a(e.isMobileWidth?1:3)},[e.isMobileWidth]),!e.notesReferenceCardData&&!e.onlineReferenceCardData)return null;let s=e.codeReferenceCardData.slice(0,t),o=e.notesReferenceCardData.slice(0,t-s.length),r=o.length+s.length<t?e.onlineReferenceCardData.filter(e=>e.link).slice(0,t-s.length-o.length):[];return(0,n.jsxs)(w.yo,{children:[(0,n.jsxs)(w.aM,{className:"text-balance w-auto justify-start overflow-hidden break-words p-0 bg-transparent border-none text-gray-400 align-middle items-center m-0 inline-flex",children:[s.map((e,t)=>(0,l.createElement)(_,{showFullContent:!1,...e,key:"code-".concat(t)})),o.map((e,t)=>(0,l.createElement)(k,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),r.map((e,t)=>(0,l.createElement)(R,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),(0,n.jsx)(v.o,{className:"m-0"})]}),(0,n.jsxs)(w.ue,{className:"overflow-y-scroll",children:[(0,n.jsxs)(w.Tu,{children:[(0,n.jsx)(w.bC,{children:"References"}),(0,n.jsx)(w.Ei,{children:"View all references for this response"})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 w-auto mt-2",children:[e.codeReferenceCardData.map((e,t)=>(0,l.createElement)(_,{showFullContent:!0,...e,key:"code-".concat(t)})),e.notesReferenceCardData.map((e,t)=>(0,l.createElement)(k,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)})),e.onlineReferenceCardData.map((e,t)=>(0,l.createElement)(R,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)}))]})]})]})}var T=a(59199),F=a(62467),L=a(93893),D=a(2452),O=a(22105),B=a(52938),U=a(68950),q=a(63329),A=a(35099),z=a(46561),Z=a(33758),H=a(58717),W=a(51059),P=a(38513),G=a(46732),$=a(47924),J=a(19841),Q=a(88435),V=a(14308),K=a(84671),Y=a(36663);let X=(0,a(30166).default)(()=>Promise.all([a.e(6555),a.e(7293),a.e(3727),a.e(9597)]).then(a.bind(a,99597)).then(e=>e.default),{loadableGenerated:{webpack:()=>[99597]},ssr:!1});function ee(e){return(0,n.jsx)(l.Suspense,{fallback:(0,n.jsx)(V.Z,{}),children:(0,n.jsx)(X,{data:e.data})})}var et=a(26110),ea=a(49027),en=a(7436),es=a(19378),eo=a(50656),el=a(75419),er=a(41648),ec=a(62869),ei=e=>{let{chart:t}=e,[a,s]=(0,l.useState)(null),[o]=(0,l.useState)("mermaid-chart-".concat(Math.random().toString(12).substring(7))),r=(0,l.useRef)(null);(0,l.useEffect)(()=>{eo.Z.initialize({startOnLoad:!1}),eo.Z.parseError=e=>{let t;console.error("Mermaid errors:",e);try{t="string"==typeof e?JSON.parse(e):e}catch(a){t=(null==e?void 0:e.toString())||"Unknown error"}console.log("Mermaid error message:",t),"element is null"!==t.str?s("Something went wrong while rendering the diagram. Please try again later or downvote the message if the issue persists."):s(null)},eo.Z.contentLoaded()},[]);let c=async()=>{if(r.current)try{var e;let t=r.current.querySelector("svg");if(!t)throw Error("No SVG found");let[,,a,n]=(null===(e=t.getAttribute("viewBox"))||void 0===e?void 0:e.split(" ").map(Number))||[0,0,0,0],s=document.createElement("canvas");s.width=2*a,s.height=2*n;let o=s.getContext("2d");if(!o)throw Error("Failed to get canvas context");let l=new XMLSerializer().serializeToString(t),c=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(c),d=new Image;d.src=i,await new Promise((e,t)=>{d.onload=()=>{o.scale(2,2),o.drawImage(d,0,0,a,n),s.toBlob(a=>{if(!a){t(Error("Failed to create blob"));return}let n=URL.createObjectURL(a),s=document.createElement("a");s.href=n,s.download="mermaid-diagram-".concat(Date.now(),".png"),s.click(),URL.revokeObjectURL(n),URL.revokeObjectURL(i),e(!0)},"image/png")},d.onerror=()=>t(Error("Failed to load SVG"))})}catch(e){console.error("Error exporting diagram:",e),s("Failed to export diagram")}};return(0,l.useEffect)(()=>{r.current&&(r.current.removeAttribute("data-processed"),eo.Z.run({nodes:[r.current]}).then(()=>{s(null)}).catch(e=>{let t;try{t="string"==typeof e?JSON.parse(e):e}catch(a){t=(null==e?void 0:e.toString())||"Unknown error"}console.log("Mermaid error message:",t),"element is null"!==t.str?s("Something went wrong while rendering the diagram. Please try again later or downvote the message if the issue persists."):s(null)}))},[t]),(0,n.jsxs)("div",{children:[a?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 bg-red-100 border border-red-500 rounded-md p-1 mt-3 text-red-900 text-sm",children:[(0,n.jsx)(el.k,{className:"w-12 h-12"}),(0,n.jsx)("span",{children:a})]}),(0,n.jsx)("code",{className:"block bg-secondary text-secondary-foreground p-4 mt-3 rounded-lg font-mono text-sm whitespace-pre-wrap overflow-x-auto max-h-[400px] border border-gray-200",children:t})]}):(0,n.jsx)("div",{id:o,ref:r,className:"mermaid",style:{width:"auto",height:"auto",boxSizing:"border-box",overflow:"auto"},children:t}),!a&&(0,n.jsxs)(ec.z,{onClick:c,variant:"secondary",className:"mt-3",children:[(0,n.jsx)(er.U,{className:"w-5 h-5"}),"Export as PNG"]})]})};let ed=new h.Z({html:!0,linkify:!0,typographer:!0});function eh(e,t,a){fetch("/api/chat/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uquery:e,kquery:t,sentiment:a})})}function eu(e){let{uquery:t,kquery:a}=e,[s,o]=(0,l.useState)(null);return(0,l.useEffect)(()=>{null!==s&&setTimeout(()=>{o(null)},2e3)},[s]),(0,n.jsxs)("div",{className:"".concat(d().feedbackButtons," flex align-middle justify-center items-center"),children:[(0,n.jsx)("button",{title:"Like",className:d().thumbsUpButton,disabled:null!==s,onClick:()=>{eh(t,a,"positive"),o(!0)},children:!0===s?(0,n.jsx)(F.V,{alt:"Liked Message",className:"text-green-500",weight:"fill"}):(0,n.jsx)(F.V,{alt:"Like Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),(0,n.jsx)("button",{title:"Dislike",className:d().thumbsDownButton,disabled:null!==s,onClick:()=>{eh(t,a,"negative"),o(!1)},children:!1===s?(0,n.jsx)(L.L,{alt:"Disliked Message",className:"text-red-500",weight:"fill"}):(0,n.jsx)(L.L,{alt:"Dislike Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})})]})}function em(e){let t=e.message.match(/\*\*(.*)\*\*/),a=function(e,t){let a=e.toLowerCase(),s="inline mt-1 mr-2 ".concat(t," h-4 w-4");return a.includes("understanding")?(0,n.jsx)(D.a,{className:"".concat(s)}):a.includes("generating")?(0,n.jsx)(O.Z,{className:"".concat(s)}):a.includes("tools")?(0,n.jsx)(B.v,{className:"".concat(s)}):a.includes("notes")?(0,n.jsx)(U.g,{className:"".concat(s)}):a.includes("read")?(0,n.jsx)(q.f,{className:"".concat(s)}):a.includes("search")?(0,n.jsx)(A.Y,{className:"".concat(s)}):a.includes("summary")||a.includes("summarize")||a.includes("enhanc")?(0,n.jsx)(z.u,{className:"".concat(s)}):a.includes("diagram")?(0,n.jsx)(Z.j,{className:"".concat(s)}):a.includes("paint")?(0,n.jsx)(H.Y,{className:"".concat(s)}):a.includes("code")?(0,n.jsx)(p.E,{className:"".concat(s)}):(0,n.jsx)(D.a,{className:"".concat(s)})}(t?t[1]:"",e.primary?(0,K.oz)(e.agentColor):"text-gray-500"),s=y.Z.sanitize(ed.render(e.message));return s=s.replace(/<h[1-6].*?<\/h[1-6]>/g,""),(0,n.jsxs)("div",{className:"".concat(d().trainOfThoughtElement," break-words items-center ").concat(e.primary?"text-gray-400":"text-gray-300"," ").concat(d().trainOfThought," ").concat(e.primary?d().primary:""),children:[a,(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:s},className:"break-words"})]})}ed.use(m(),{inline:!0,code:!0});let eg=(0,l.forwardRef)((e,t)=>{var a,s;let o,r,c,i,h;let[u,m]=(0,l.useState)(!1),[f,p]=(0,l.useState)(!1),[x,v]=(0,l.useState)(""),[j,w]=(0,l.useState)(""),[b,M]=(0,l.useState)(!1),[N,k]=(0,l.useState)(!1),[_,R]=(0,l.useState)(""),[E,S]=(0,l.useState)(""),F=(0,l.useRef)(!1),L=(0,l.useRef)(null);async function D(){let t=e.chatMessage.message.match(/[^.!?]+[.!?]*/g)||[];if(!t||0===t.length||!t[0])return;M(!0);let a=O(t[0]);for(let e=0;e<t.length&&!F.current;e++){let n=a;e<t.length-1&&(a=O(t[e+1]));try{let e=await n,t=URL.createObjectURL(e);await function(e){return new Promise((t,a)=>{let n=new Audio(e);n.onended=t,n.onerror=a,n.play()})}(t)}catch(e){console.error("Error:",e);break}}M(!1),k(!1)}async function O(e){let t=await fetch("/api/chat/speech?text=".concat(encodeURIComponent(e)),{method:"POST",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("Network response was not ok");return await t.blob()}(0,l.useEffect)(()=>{F.current=N},[N]),(0,l.useEffect)(()=>{let e=new MutationObserver((e,t)=>{if(L.current)for(let t of e)"childList"===t.type&&t.addedNodes.length>0&&(0,Y.Z)(L.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}]})});return L.current&&e.observe(L.current,{childList:!0}),()=>e.disconnect()},[L.current]),(0,l.useEffect)(()=>{let t=e.chatMessage.message;e.chatMessage.excalidrawDiagram&&R(e.chatMessage.excalidrawDiagram),e.chatMessage.mermaidjsDiagram&&S(e.chatMessage.mermaidjsDiagram),t=t.replace(/\\\(/g,"LEFTPAREN").replace(/\\\)/g,"RIGHTPAREN").replace(/\\\[/g,"LEFTBRACKET").replace(/\\\]/g,"RIGHTBRACKET"),t=(0,T.AQ)(t,e.chatMessage.codeContext),e.chatMessage.codeContext&&Object.entries(e.chatMessage.codeContext).forEach(e=>{var a;let[n,s]=e;null===(a=s.results.output_files)||void 0===a||a.forEach(e=>{(e.filename.endsWith(".png")||e.filename.endsWith(".jpg"))&&!t.includes(")&&(t+="\n\n.concat(e.b64_data,")"))})});let a=t,n=t;if(e.chatMessage.images&&e.chatMessage.images.length>0){let t=e.chatMessage.images.map(e=>{let t=e.startsWith("data%3Aimage")?decodeURIComponent(e):e;return y.Z.sanitize(t)}),s=t.map((e,t)=>".concat(e,")")).join("\n"),o=t.map((e,t)=>'<div class="'.concat(d().imageWrapper,'"><img src="').concat(e,'" alt="uploaded image ').concat(t+1,'" /></div>')).join(""),l='<div class="'.concat(d().imagesContainer,'">').concat(o,"</div>");a="".concat(s,"\n\n").concat(a),n="".concat(l).concat(n)}v(a);let s=ed.render(n);s=s.replace(/LEFTPAREN/g,"\\(").replace(/RIGHTPAREN/g,"\\)").replace(/LEFTBRACKET/g,"\\[").replace(/RIGHTBRACKET/g,"\\]"),w(y.Z.sanitize(s))},[e.chatMessage.message,e.chatMessage.images,e.chatMessage.intent]),(0,l.useEffect)(()=>{u&&setTimeout(()=>{m(!1)},2e3)},[u]),(0,l.useEffect)(()=>{L.current&&(L.current.querySelectorAll("pre > .hljs").forEach(e=>{if(!e.querySelector("".concat(d().codeCopyButton))){let t=document.createElement("button"),a=(0,n.jsx)(W.w,{size:24});(0,g.createRoot)(t).render(a),t.className="hljs ".concat(d().codeCopyButton),t.addEventListener("click",()=>{let a=e.textContent||"";a=(a=(a=a.replace(/^\$+/,"")).replace(/^Copy/,"")).trim(),navigator.clipboard.writeText(a);let s=(0,n.jsx)(P.J,{size:24});(0,g.createRoot)(t).render(s)}),e.prepend(t)}}),(0,Y.Z)(L.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}]}))},[j,f,L]);let B=async t=>{let a=t.turnId||e.turnId;(await fetch("/api/chat/conversation/message",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversation_id:e.conversationId,turn_id:a})})).ok?e.onDeleteMessage(a):console.error("Failed to delete message")},U=function(e,t,a){let n=[],s=[],o=[];if(a)for(let[e,t]of Object.entries(a))t.results&&o.push({code:t.code,output:t.results.std_out,output_files:t.results.output_files,error:t.results.std_err});if(t){let e=[];for(let[a,n]of Object.entries(t)){if(n.answerBox&&e.push({title:n.answerBox.title,description:n.answerBox.answer,link:n.answerBox.source}),n.knowledgeGraph&&e.push({title:n.knowledgeGraph.title,description:n.knowledgeGraph.description,link:n.knowledgeGraph.descriptionLink}),n.webpages){if(n.webpages instanceof Array){let t=n.webpages.map(e=>({title:e.query,description:e.snippet,link:e.link}));e.push(...t)}else{let t=n.webpages;e.push({title:t.query,description:t.snippet,link:t.link})}}if(n.organic){let t=n.organic.map(e=>({title:e.title,description:e.snippet,link:e.link}));e.push(...t)}}n.push(...e)}if(e){let t=e.map(e=>e.compiled?{title:e.file,content:e.compiled}:{title:e.split("\n")[0],content:e.split("\n").slice(1).join("\n")});s.push(...t)}return{notesReferenceCardData:s,onlineReferenceCardData:n,codeReferenceCardData:o}}(e.chatMessage.context,e.chatMessage.onlineContext,e.chatMessage.codeContext);return(0,n.jsxs)("div",{ref:t,className:(a=e.chatMessage,o=[d().chatMessageContainer],"khoj"===a.by&&o.push("shadow-md"),o.push(d()[a.by]),a.message||o.push(d().emptyChatMessage),e.customClassName&&o.push(d()["".concat(a.by).concat(e.customClassName)]),o.join(" ")),onMouseLeave:e=>p(!1),onMouseEnter:e=>p(!0),children:[(0,n.jsxs)("div",{className:(s=e.chatMessage,(r=[d().chatMessageWrapper]).push(d()[s.by]),"khoj"===s.by&&r.push("border-l-4 border-opacity-50 ".concat("border-l-"+e.borderLeftColor)),r.join(" ")),children:[e.chatMessage.queryFiles&&e.chatMessage.queryFiles.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap flex-col mb-2 max-w-full",children:e.chatMessage.queryFiles.map((e,t)=>(0,n.jsxs)(et.Vq,{children:[(0,n.jsx)(et.hg,{asChild:!0,children:(0,n.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer bg-gray-500 bg-opacity-25 rounded-lg p-2 w-full ",children:[(0,n.jsx)("div",{className:"flex-shrink-0",children:(0,C.Le)(e.file_type)}),(0,n.jsx)("span",{className:"truncate flex-1 min-w-0 max-w-[200px]",children:e.name}),e.size&&(0,n.jsxs)("span",{className:"text-gray-400 flex-shrink-0",children:["(",(0,en.xq)(e.size),")"]})]})}),(0,n.jsxs)(et.cZ,{children:[(0,n.jsx)(et.fK,{children:(0,n.jsx)(ea.$N,{children:(0,n.jsx)("div",{className:"truncate min-w-0 break-words break-all text-wrap max-w-full whitespace-normal",children:e.name})})}),(0,n.jsx)(et.Be,{children:(0,n.jsx)(es.x,{className:"h-72 w-full rounded-md break-words break-all text-wrap",children:e.content})})]})]},t))}),(0,n.jsx)("div",{ref:L,className:d().chatMessage,dangerouslySetInnerHTML:{__html:j}}),_&&(0,n.jsx)(ee,{data:_}),E&&(0,n.jsx)(ei,{chart:E})]}),(0,n.jsx)("div",{className:d().teaserReferencesContainer,children:(0,n.jsx)(I,{isMobileWidth:e.isMobileWidth,notesReferenceCardData:U.notesReferenceCardData,onlineReferenceCardData:U.onlineReferenceCardData,codeReferenceCardData:U.codeReferenceCardData})}),(0,n.jsx)("div",{className:d().chatFooter,children:(f||e.isMobileWidth||e.isLastMessage||b)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{title:(i=(c=new Date(e.chatMessage.created+"Z")).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}).toUpperCase(),h=c.toLocaleString("en-US",{year:"numeric",month:"short",day:"2-digit"}).replaceAll("-"," "),"".concat(i," on ").concat(h)),className:"text-gray-400 relative top-0 left-4",children:function(e){e.endsWith("Z")||(e+="Z");let t=new Date(e),a=new Date().getTime()-t.getTime();return a<6e4?"Just now":a<36e5?"".concat(Math.round(a/6e4),"m ago"):a<864e5?"".concat(Math.round(a/36e5),"h ago"):"".concat(Math.round(a/864e5),"d ago")}(e.chatMessage.created)}),(0,n.jsxs)("div",{className:"".concat(d().chatButtons," shadow-sm"),children:["khoj"===e.chatMessage.by&&(b?N?(0,n.jsx)(V.l,{iconClassName:"p-0",className:"m-0"}):(0,n.jsx)("button",{title:"Pause Speech",onClick:e=>k(!0),children:(0,n.jsx)(G.d,{alt:"Pause Message",className:"hsl(var(--muted-foreground))"})}):(0,n.jsx)("button",{title:"Speak",onClick:e=>D(),children:(0,n.jsx)($.j,{alt:"Speak Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})})),e.chatMessage.turnId&&(0,n.jsx)("button",{title:"Delete",className:"".concat(d().deleteButton),onClick:()=>B(e.chatMessage),children:(0,n.jsx)(J.r,{alt:"Delete Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})}),(0,n.jsx)("button",{title:"Copy",className:"".concat(d().copyButton),onClick:()=>{navigator.clipboard.writeText(x),m(!0)},children:u?(0,n.jsx)(Q.C,{alt:"Copied Message",weight:"fill",className:"text-green-500"}):(0,n.jsx)(Q.C,{alt:"Copy Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),"khoj"===e.chatMessage.by&&(e.chatMessage.intent?(0,n.jsx)(eu,{uquery:e.chatMessage.intent.query,kquery:e.chatMessage.message}):(0,n.jsx)(eu,{uquery:e.chatMessage.rawQuery||e.chatMessage.message,kquery:e.chatMessage.message}))]})]})})]})});eg.displayName="ChatMessage";var ef=a(3894),ep=a(20461),ex=a(77168),ev=a(15483),ej=a(81103),ew=e=>{let{name:t,avatar:a,link:s,description:o}=e;return(0,n.jsx)("div",{className:"relative group flex",children:(0,n.jsx)(ej.pn,{children:(0,n.jsxs)(ej.u,{delayDuration:0,children:[(0,n.jsx)(ej.aJ,{asChild:!0,children:(0,n.jsxs)(ec.z,{variant:"ghost",className:"flex items-center justify-center",children:[a,(0,n.jsx)("div",{children:t})]})}),(0,n.jsx)(ej._v,{children:(0,n.jsxs)("div",{className:"w-80 h-30",children:[(0,n.jsx)("a",{href:s,target:"_blank",rel:"noreferrer",className:"mt-1 ml-2 block no-underline",children:(0,n.jsxs)("div",{className:"flex items-center justify-start gap-2",children:[a,(0,n.jsxs)("div",{className:"mr-2 mt-1 flex justify-center items-center text-sm font-semibold text-gray-800",children:[t,(0,n.jsx)(v.o,{weight:"bold",className:"ml-1"})]})]})}),o&&(0,n.jsx)("p",{className:"mt-2 ml-6 text-sm text-gray-600 line-clamp-2",children:o||"A Khoj agent"})]})})]})})})};function eb(e){let t=e.trainOfThought.length-1,[a,s]=(0,l.useState)(e.completed);return(0,l.useEffect)(()=>{e.completed&&s(!0)},[e.completed]),(0,n.jsxs)("div",{className:"".concat(a?"":o().trainOfThought+" border"," rounded-lg"),children:[!e.completed&&(0,n.jsx)(V.l,{className:"float-right"}),e.completed&&(a?(0,n.jsxs)(ec.z,{className:"w-fit text-left justify-start content-start text-xs",onClick:()=>s(!1),variant:"ghost",size:"sm",children:["Thought Process ",(0,n.jsx)(ef.p,{size:16,className:"ml-1"})]}):(0,n.jsxs)(ec.z,{className:"w-fit text-left justify-start content-start text-xs p-0 h-fit",onClick:()=>s(!0),variant:"ghost",size:"sm",children:["Close ",(0,n.jsx)(ep.U,{size:16,className:"ml-1"})]})),(0,n.jsx)(r.M,{initial:!1,children:!a&&(0,n.jsx)(c.E.div,{initial:"closed",animate:"open",exit:"closed",variants:{open:{height:"auto",opacity:1,transition:{duration:.3,ease:"easeOut"}},closed:{height:0,opacity:0,transition:{duration:.3,ease:"easeIn"}}},children:e.trainOfThought.map((a,s)=>(0,n.jsx)(em,{message:a,primary:s===t&&e.lastMessage&&!e.completed,agentColor:e.agentColor},"train-".concat(s)))})})]},e.keyId)}function ey(e){var t,a,s,r,c,i,d,h,u;let[m,g]=(0,l.useState)(null),[f,p]=(0,l.useState)(0),[x,v]=(0,l.useState)(!0),[j,w]=(0,l.useState)(null),b=(0,l.useRef)(null),y=(0,l.useRef)(null),M=(0,l.useRef)(null),N=(0,l.useRef)(null),[k,_]=(0,l.useState)(null),[R,E]=(0,l.useState)(!1),[I,S]=(0,l.useState)(!0),T=(0,en.IC)(),F="[data-radix-scroll-area-viewport]",L=localStorage.getItem("message");(0,l.useEffect)(()=>{var e;let t=null===(e=y.current)||void 0===e?void 0:e.querySelector(F);if(!t)return;let a=()=>{let{scrollTop:e,scrollHeight:a,clientHeight:n}=t;S(a-(e+n)<=50)};return t.addEventListener("scroll",a),()=>t.removeEventListener("scroll",a)},[]),(0,l.useEffect)(()=>{e.incomingMessages&&e.incomingMessages.length>0&&I&&O()},[e.incomingMessages,I]),(0,l.useEffect)(()=>{m&&m.chat&&m.chat.length>0&&f<2&&requestAnimationFrame(()=>{var e;null===(e=M.current)||void 0===e||e.scrollIntoView({behavior:"auto",block:"start"})})},[m,f]),(0,l.useEffect)(()=>{if(!x||R)return;let t=new IntersectionObserver(t=>{t[0].isIntersecting&&x&&(E(!0),function(t){if(!x||R)return;let a=(t+1)*10,n="";if(e.conversationId)n="/api/chat/history?client=web&conversation_id=".concat(encodeURIComponent(e.conversationId),"&n=").concat(a);else{if(!e.publicConversationSlug)return;n="/api/chat/share/history?client=web&public_conversation_slug=".concat(e.publicConversationSlug,"&n=").concat(a)}fetch(n).then(e=>e.json()).then(a=>{if(e.setTitle(a.response.slug),a&&a.response&&a.response.chat&&a.response.chat.length>0){if(p(Math.ceil(a.response.chat.length/10)),a.response.chat.length===(null==m?void 0:m.chat.length)){v(!1),E(!1);return}e.setAgent(a.response.agent),g(a.response),E(!1),0===t?O(!0):D()}else{if(a.response.agent&&a.response.conversation_id){let t={chat:[],agent:a.response.agent,conversation_id:a.response.conversation_id,slug:a.response.slug};e.setAgent(a.response.agent),g(t),e.setIsChatSideBarOpen&&!L&&e.setIsChatSideBarOpen(!0)}v(!1),E(!1)}}).catch(e=>{console.error(e),window.location.href="/"})}(f))},{threshold:1});return b.current&&t.observe(b.current),()=>t.disconnect()},[x,f,R]),(0,l.useEffect)(()=>{v(!0),E(!1),p(0),g(null)},[e.conversationId]),(0,l.useEffect)(()=>{if(e.incomingMessages){let t=e.incomingMessages[e.incomingMessages.length-1];t&&!t.completed&&(_(e.incomingMessages.length-1),e.setTitle(t.rawQuery),t.turnId&&w(t.turnId))}},[e.incomingMessages]);let D=()=>{var e;let t=null===(e=y.current)||void 0===e?void 0:e.querySelector(F);requestAnimationFrame(()=>{var e;null===(e=N.current)||void 0===e||e.scrollIntoView({behavior:"auto",block:"start"}),null==t||t.scrollBy({behavior:"smooth",top:-150})})},O=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=null===(e=y.current)||void 0===e?void 0:e.querySelector(F);requestAnimationFrame(()=>{null==a||a.scrollTo({top:a.scrollHeight,behavior:t?"auto":"smooth"})}),S(!0)},B=t=>{t&&(g(e=>e&&t?{...e,chat:e.chat.filter(e=>e.turnId!==t)}:e),e.incomingMessages&&e.setIncomingMessages&&e.setIncomingMessages(e.incomingMessages.filter(e=>e.turnId!==t)))};return e.conversationId||e.publicConversationSlug?(0,n.jsx)(es.x,{className:"\n h-[calc(100svh-theme(spacing.44))]\n sm:h-[calc(100svh-theme(spacing.44))]\n md:h-[calc(100svh-theme(spacing.44))]\n lg:h-[calc(100svh-theme(spacing.72))]\n ",ref:y,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"".concat(o().chatHistory," ").concat(e.customClassName),children:[(0,n.jsx)("div",{ref:b,style:{height:"1px"},children:R&&(0,n.jsx)(V.l,{className:"opacity-50"})}),m&&m.chat&&m.chat.map((t,a)=>{var s,o,l;return(0,n.jsxs)(n.Fragment,{children:[t.trainOfThought&&"khoj"===t.by&&(0,n.jsx)(eb,{trainOfThought:null===(s=t.trainOfThought)||void 0===s?void 0:s.map(e=>e.data),lastMessage:!1,agentColor:(null==m?void 0:null===(o=m.agent)||void 0===o?void 0:o.color)||"orange",keyId:"".concat(a,"trainOfThought"),completed:!0},"".concat(a,"trainOfThought")),(0,n.jsx)(eg,{ref:a===m.chat.length-2?M:a===m.chat.length-(f-1)*10?N:null,isMobileWidth:T,chatMessage:t,customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(l=m.agent)||void 0===l?void 0:l.color,"-500"),isLastMessage:a===m.chat.length-1,onDeleteMessage:B,conversationId:e.conversationId},"".concat(a,"fullHistory"))]})}),e.incomingMessages&&e.incomingMessages.map((t,a)=>{var s,o,r,c,i;let d=null!==(i=null!==(c=t.turnId)&&void 0!==c?c:j)&&void 0!==i?i:void 0;return(0,n.jsxs)(l.Fragment,{children:[(0,n.jsx)(eg,{isMobileWidth:T,chatMessage:{message:t.rawQuery,context:[],onlineContext:{},codeContext:{},created:t.timestamp,by:"you",automationId:"",images:t.images,conversationId:e.conversationId,turnId:d,queryFiles:t.queryFiles},customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(s=m.agent)||void 0===s?void 0:s.color,"-500"),onDeleteMessage:B,conversationId:e.conversationId,turnId:d},"".concat(a,"outgoing")),t.trainOfThought&&(0,n.jsx)(eb,{trainOfThought:t.trainOfThought,lastMessage:a===k,agentColor:(null==m?void 0:null===(o=m.agent)||void 0===o?void 0:o.color)||"orange",keyId:"".concat(a,"trainOfThought"),completed:t.completed},"".concat(a,"trainOfThought")),(0,n.jsx)(eg,{isMobileWidth:T,chatMessage:{message:t.rawResponse,context:t.context,onlineContext:t.onlineContext,codeContext:t.codeContext,created:t.timestamp,by:"khoj",automationId:"",rawQuery:t.rawQuery,intent:{type:t.intentType||"",query:t.rawQuery,"memory-type":"","inferred-queries":t.inferredQueries||[]},conversationId:e.conversationId,images:t.generatedImages,queryFiles:t.generatedFiles,mermaidjsDiagram:t.generatedMermaidjsDiagram,turnId:d},conversationId:e.conversationId,turnId:d,onDeleteMessage:B,customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(r=m.agent)||void 0===r?void 0:r.color,"-500"),isLastMessage:a===e.incomingMessages.length-1},"".concat(a,"incoming"))]},"incomingMessage".concat(a))}),e.pendingMessage&&(0,n.jsx)(eg,{isMobileWidth:T,chatMessage:{message:e.pendingMessage,context:[],onlineContext:{},codeContext:{},created:new Date().getTime().toString(),by:"you",automationId:"",conversationId:e.conversationId,turnId:void 0},conversationId:e.conversationId,onDeleteMessage:B,customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(t=m.agent)||void 0===t?void 0:t.color,"-500"),isLastMessage:!0},"pendingMessage-".concat(e.pendingMessage.length)),m&&(0,n.jsx)("div",{className:"".concat(o().agentIndicator," pb-4"),children:(0,n.jsx)("div",{className:"relative group mx-2 cursor-pointer",children:(0,n.jsx)(ew,{name:m&&m.agent&&(null===(r=m.agent)||void 0===r?void 0:r.name)?m.agent.is_hidden?"Khoj":null===(c=m.agent)||void 0===c?void 0:c.name:"Agent",link:m&&m.agent&&(null===(i=m.agent)||void 0===i?void 0:i.slug)?"/agents?agent=".concat(null===(d=m.agent)||void 0===d?void 0:d.slug):"/agents",avatar:(0,C.TI)(null===(a=m.agent)||void 0===a?void 0:a.icon,null===(s=m.agent)||void 0===s?void 0:s.color)||(0,n.jsx)(ex.v,{}),description:m&&m.agent?(null===(h=m.agent)||void 0===h?void 0:h.persona)?null===(u=m.agent)||void 0===u?void 0:u.persona:"You can set a persona for your agent in the Chat Options side panel.":"Your agent is no longer available. You will be reset to the default agent."})})})]}),(0,n.jsx)("div",{className:"".concat(e.customClassName," fixed bottom-[20%] z-10"),children:!I&&(0,n.jsx)("button",{title:"Scroll to bottom",className:"absolute bottom-0 right-0 bg-white dark:bg-[hsl(var(--background))] text-neutral-500 dark:text-white p-2 rounded-full shadow-xl",onClick:()=>{O(),S(!0)},children:(0,n.jsx)(ev.K,{size:24})})})]})}):null}},42501:function(e){e.exports={chatHistory:"chatHistory_chatHistory__CoaVT",agentIndicator:"chatHistory_agentIndicator__wOU1f",trainOfThought:"chatHistory_trainOfThought__mMWSR"}},91499:function(e){e.exports={chatMessageContainer:"chatMessage_chatMessageContainer__sAivf",chatMessageWrapper:"chatMessage_chatMessageWrapper__u5m8A",khojfullHistory:"chatMessage_khojfullHistory__NPu2l",youfullHistory:"chatMessage_youfullHistory__ioyfH",you:"chatMessage_you__6GUC4",khoj:"chatMessage_khoj__cjWON",khojChatMessage:"chatMessage_khojChatMessage__BabQz",emptyChatMessage:"chatMessage_emptyChatMessage__J9JRn",imagesContainer:"chatMessage_imagesContainer__HTRjT",imageWrapper:"chatMessage_imageWrapper__DF92M",author:"chatMessage_author__muRtC",chatFooter:"chatMessage_chatFooter__0vR8s",chatButtons:"chatMessage_chatButtons__Lbk8T",codeCopyButton:"chatMessage_codeCopyButton__Y_Ujv",feedbackButtons:"chatMessage_feedbackButtons___Brdy",copyButton:"chatMessage_copyButton__jd7q7",trainOfThought:"chatMessage_trainOfThought__mR2Gg",primary:"chatMessage_primary__WYPEb",trainOfThoughtElement:"chatMessage_trainOfThoughtElement__le_bC"}}}]);
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4986],{74986:function(e,t,a){"use strict";a.d(t,{Z:function(){return ey}});var n=a(57437),s=a(42501),o=a.n(s),l=a(2265),r=a(48614),c=a(40521),i=a(91499),d=a.n(i),h=a(19983),u=a(13506),m=a.n(u),g=a(34040);a(2446);var f=a(5147),p=a(86018),x=a(38525),v=a(45178),j=a(66070),w=a(69304),b=a(57054),y=a(18848),C=a(42225),M=a(27648);let N=new h.Z({html:!0,linkify:!0,typographer:!0});function k(e){let t=(0,C.Le)(e.title||".txt","w-6 h-6 text-muted-foreground inline-flex mr-2"),a=e.title.split("/").pop()||e.title,s=function(e){let t=["org","md","markdown"].includes(e.title.split(".").pop()||"")?e.content.split("\n").slice(1).join("\n"):e.content;return e.showFullContent?y.Z.sanitize(N.render(t)):y.Z.sanitize(t)}(e),[o,r]=(0,l.useState)(!1);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(b.J2,{open:o&&!e.showFullContent,onOpenChange:r,children:[(0,n.jsx)(b.xo,{asChild:!0,children:(0,n.jsx)(j.Zb,{onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),className:"".concat(e.showFullContent?"w-auto bg-muted":"w-auto"," overflow-hidden break-words text-balance rounded-lg border-none p-2 shadow-none"),children:e.showFullContent?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("h3",{className:"".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground}"),children:[t,e.showFullContent?e.title:a]}),(0,n.jsx)("p",{className:"text-sm overflow-x-auto block",dangerouslySetInnerHTML:{__html:s}})]}):(0,n.jsx)(E,{type:"notes"},"".concat(e.title))})}),(0,n.jsx)(b.yk,{className:"w-[400px] mx-2",children:(0,n.jsxs)(j.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none p-2",children:[(0,n.jsxs)("h3",{className:"line-clamp-2 text-muted-foreground}",children:[t,e.title]}),(0,n.jsx)("p",{className:"border-t mt-1 pt-1 text-sm overflow-hidden line-clamp-5",dangerouslySetInnerHTML:{__html:s}})]})})]})})}function _(e){var t,a,s,o,r,c;let i=(0,C.Le)(".py","!w-4 h-4 text-muted-foreground flex-shrink-0"),d=y.Z.sanitize(e.code),[h,u]=(0,l.useState)(!1),[m,g]=(0,l.useState)(!1),p=e=>{let t="text/plain",a=e.b64_data;e.filename.match(/\.(png|jpg|jpeg|webp)$/)?(t="image/".concat(e.filename.split(".").pop()),a=atob(e.b64_data)):e.filename.endsWith(".json")?t="application/json":e.filename.endsWith(".csv")&&(t="text/csv");let n=new ArrayBuffer(a.length),s=new Uint8Array(n);for(let e=0;e<a.length;e++)s[e]=a.charCodeAt(e);let o=new Blob([n],{type:t}),l=URL.createObjectURL(o),r=document.createElement("a");r.href=l,r.download=e.filename,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(l)},x=(t,a)=>(null==t?void 0:t.length)==0?null:(0,n.jsx)("div",{className:"".concat(a||e.showFullContent?"border-t mt-1 pt-1":void 0),children:t.slice(0,e.showFullContent?void 0:1).map((t,s)=>(0,n.jsxs)("div",{children:[(0,n.jsxs)("h4",{className:"text-sm text-muted-foreground flex items-center",children:[(0,n.jsx)("span",{className:"overflow-hidden mr-2 font-bold ".concat(e.showFullContent?void 0:"line-clamp-1"),children:t.filename}),(0,n.jsx)("button",{className:"".concat(a?"hidden":void 0),onClick:e=>{e.preventDefault(),p(t)},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),title:"Download file: ".concat(t.filename),children:(0,n.jsx)(f.b,{className:"w-4 h-4",weight:m?"fill":"regular"})})]}),t.filename.match(/\.(txt|org|md|csv|json)$/)?(0,n.jsx)("pre",{className:"".concat(e.showFullContent?"block":"line-clamp-2"," text-sm mt-1 p-1 bg-background rounded overflow-x-auto"),children:t.b64_data}):t.filename.match(/\.(png|jpg|jpeg|webp)$/)?(0,n.jsx)("img",{src:"data:image/".concat(t.filename.split(".").pop(),";base64,").concat(t.b64_data),alt:t.filename,className:"mt-1 max-h-32 rounded"}):null]},"".concat(t.filename,"-").concat(s)))});return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(b.J2,{open:h&&!e.showFullContent,onOpenChange:u,children:[(0,n.jsx)(b.xo,{asChild:!0,children:(0,n.jsx)(j.Zb,{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:"".concat(e.showFullContent?"w-auto bg-muted":"w-auto"," overflow-hidden break-words text-balance rounded-lg border-none p-2 shadow-none"),children:e.showFullContent?(0,n.jsxs)("div",{className:"flex flex-col px-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[i,(0,n.jsxs)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:["code ",(null===(t=e.output_files)||void 0===t?void 0:t.length)>0?"artifacts":""]})]}),(0,n.jsx)("pre",{className:"text-xs pb-2 ".concat(e.showFullContent?"block overflow-x-auto":(null===(a=e.output_files)||void 0===a?void 0:a.length)>0?"hidden":"overflow-hidden line-clamp-3"),children:d}),(null===(s=e.output_files)||void 0===s?void 0:s.length)>0&&x(e.output_files,!1)]}):(0,n.jsx)(E,{type:"code"},"code-".concat(e.code))})}),(0,n.jsx)(b.yk,{className:"w-[400px] mx-2",children:(0,n.jsxs)(j.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none p-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[i,(0,n.jsxs)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:["code ",(null===(o=e.output_files)||void 0===o?void 0:o.length)>0?"artifact":""]})]}),(null===(r=e.output_files)||void 0===r?void 0:r.length)>0&&x(null===(c=e.output_files)||void 0===c?void 0:c.slice(0,1),!0)||(0,n.jsx)("pre",{className:"text-xs border-t mt-1 pt-1 overflow-hidden line-clamp-10",children:d})]})})]})})}function R(e){let[t,a]=(0,l.useState)(!1);if(!e.link||e.link.split(" ").length>1)return null;let s="https://www.google.com/s2/favicons?domain=globe",o="unknown";try{o=new URL(e.link).hostname,s="https://www.google.com/s2/favicons?domain=".concat(o)}catch(t){return console.warn("Error parsing domain from link: ".concat(e.link)),null}return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(b.J2,{open:t&&!e.showFullContent,onOpenChange:a,children:[(0,n.jsx)(b.xo,{asChild:!0,children:(0,n.jsx)(j.Zb,{onMouseEnter:()=>{a(!0)},onMouseLeave:()=>{a(!1)},className:"".concat(e.showFullContent?"w-auto bg-muted":"w-auto"," overflow-hidden break-words text-balance rounded-lg border-none p-2 shadow-none"),children:e.showFullContent?(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)(M.default,{href:e.link,children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("img",{src:s,alt:"",className:"!w-4 h-4 flex-shrink-0"}),(0,n.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:o})]})}),(0,n.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," font-bold"),children:e.title}),(0,n.jsx)("p",{className:"overflow-hidden text-sm ".concat(e.showFullContent?"block":"line-clamp-2"),children:e.description})]}):(0,n.jsx)(E,{type:"online",link:e.link},e.title)})}),(0,n.jsx)(b.yk,{className:"w-[400px] mx-2",children:(0,n.jsx)(j.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none",children:(0,n.jsx)("div",{className:"flex flex-col",children:(0,n.jsxs)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:"!no-underline px-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("img",{src:s,alt:"",className:"!w-4 h-4 flex-shrink-0"}),(0,n.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," text-muted-foreground flex-grow"),children:o})]}),(0,n.jsx)("h3",{className:"border-t mt-1 pt-1 overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," font-bold"),children:e.title}),(0,n.jsx)("p",{className:"overflow-hidden text-sm ".concat(e.showFullContent?"block":"line-clamp-5"),children:e.description})]})})})})]})})}function E(e){let t="",a="unknown";if(e.link)try{a=new URL(e.link).hostname,t="https://www.google.com/s2/favicons?domain=".concat(a)}catch(t){return console.warn("Error parsing domain from link: ".concat(e.link)),null}let s=null,o="!w-4 !h-4 text-muted-foreground inline-flex mr-2 rounded-lg";switch(e.type){case"code":s=(0,n.jsx)(p.E,{className:"".concat(o)});break;case"online":s=(0,n.jsx)("img",{src:t,alt:"",className:"".concat(o)});break;case"notes":s=(0,n.jsx)(x.j,{className:"".concat(o)});break;default:s=null}return s?(0,n.jsx)("div",{className:"flex items-center gap-2",children:s}):null}function I(e){let t=e.notesReferenceCardData.length>0||e.codeReferenceCardData.length>0||e.onlineReferenceCardData.length>0,a=e.notesReferenceCardData.length+e.codeReferenceCardData.length+e.onlineReferenceCardData.length;return 0===a?null:(0,n.jsx)("div",{className:"pt-0 px-4 pb-4",children:(0,n.jsxs)("h3",{className:"inline-flex items-center",children:[(0,n.jsxs)("div",{className:"text-gray-400 m-2",children:[a," sources"]}),(0,n.jsx)("div",{className:"flex flex-wrap gap-2 w-auto m-2",children:t&&(0,n.jsx)(S,{notesReferenceCardData:e.notesReferenceCardData,onlineReferenceCardData:e.onlineReferenceCardData,codeReferenceCardData:e.codeReferenceCardData,isMobileWidth:e.isMobileWidth})})]})})}function S(e){let[t,a]=(0,l.useState)(3);if((0,l.useEffect)(()=>{a(e.isMobileWidth?3:5)},[e.isMobileWidth]),!e.notesReferenceCardData&&!e.onlineReferenceCardData)return null;let s=e.codeReferenceCardData.slice(0,t),o=e.notesReferenceCardData.slice(0,t-s.length),r=o.length+s.length<t?e.onlineReferenceCardData.filter(e=>e.link).slice(0,t-s.length-o.length):[];return(0,n.jsxs)(w.yo,{children:[(0,n.jsxs)(w.aM,{className:"text-balance w-auto justify-start overflow-hidden break-words p-0 bg-transparent border-none text-gray-400 align-middle items-center m-0 inline-flex",children:[s.map((e,t)=>(0,l.createElement)(_,{showFullContent:!1,...e,key:"code-".concat(t)})),o.map((e,t)=>(0,l.createElement)(k,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),r.map((e,t)=>(0,l.createElement)(R,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),(0,n.jsx)(v.o,{className:"m-0"})]}),(0,n.jsxs)(w.ue,{className:"overflow-y-scroll",children:[(0,n.jsxs)(w.Tu,{children:[(0,n.jsx)(w.bC,{children:"References"}),(0,n.jsx)(w.Ei,{children:"View all references for this response"})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 w-auto mt-2",children:[e.codeReferenceCardData.map((e,t)=>(0,l.createElement)(_,{showFullContent:!0,...e,key:"code-".concat(t)})),e.notesReferenceCardData.map((e,t)=>(0,l.createElement)(k,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)})),e.onlineReferenceCardData.map((e,t)=>(0,l.createElement)(R,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)}))]})]})]})}var T=a(59199),F=a(62467),L=a(93893),D=a(2452),O=a(22105),B=a(52938),U=a(68950),q=a(63329),A=a(35099),z=a(46561),Z=a(33758),H=a(58717),W=a(51059),P=a(38513),G=a(46732),$=a(47924),J=a(19841),Q=a(88435),V=a(14308),K=a(84671),Y=a(36663);let X=(0,a(30166).default)(()=>Promise.all([a.e(6555),a.e(7293),a.e(3727),a.e(9597)]).then(a.bind(a,99597)).then(e=>e.default),{loadableGenerated:{webpack:()=>[99597]},ssr:!1});function ee(e){return(0,n.jsx)(l.Suspense,{fallback:(0,n.jsx)(V.Z,{}),children:(0,n.jsx)(X,{data:e.data})})}var et=a(26110),ea=a(49027),en=a(7436),es=a(19378),eo=a(50656),el=a(75419),er=a(41648),ec=a(62869),ei=e=>{let{chart:t}=e,[a,s]=(0,l.useState)(null),[o]=(0,l.useState)("mermaid-chart-".concat(Math.random().toString(12).substring(7))),r=(0,l.useRef)(null);(0,l.useEffect)(()=>{eo.Z.initialize({startOnLoad:!1}),eo.Z.parseError=e=>{let t;console.error("Mermaid errors:",e);try{t="string"==typeof e?JSON.parse(e):e}catch(a){t=(null==e?void 0:e.toString())||"Unknown error"}console.log("Mermaid error message:",t),"element is null"!==t.str?s("Something went wrong while rendering the diagram. Please try again later or downvote the message if the issue persists."):s(null)},eo.Z.contentLoaded()},[]);let c=async()=>{if(r.current)try{var e;let t=r.current.querySelector("svg");if(!t)throw Error("No SVG found");let[,,a,n]=(null===(e=t.getAttribute("viewBox"))||void 0===e?void 0:e.split(" ").map(Number))||[0,0,0,0],s=document.createElement("canvas");s.width=2*a,s.height=2*n;let o=s.getContext("2d");if(!o)throw Error("Failed to get canvas context");let l=new XMLSerializer().serializeToString(t),c=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(c),d=new Image;d.src=i,await new Promise((e,t)=>{d.onload=()=>{o.scale(2,2),o.drawImage(d,0,0,a,n),s.toBlob(a=>{if(!a){t(Error("Failed to create blob"));return}let n=URL.createObjectURL(a),s=document.createElement("a");s.href=n,s.download="mermaid-diagram-".concat(Date.now(),".png"),s.click(),URL.revokeObjectURL(n),URL.revokeObjectURL(i),e(!0)},"image/png")},d.onerror=()=>t(Error("Failed to load SVG"))})}catch(e){console.error("Error exporting diagram:",e),s("Failed to export diagram")}};return(0,l.useEffect)(()=>{r.current&&(r.current.removeAttribute("data-processed"),eo.Z.run({nodes:[r.current]}).then(()=>{s(null)}).catch(e=>{let t;try{t="string"==typeof e?JSON.parse(e):e}catch(a){t=(null==e?void 0:e.toString())||"Unknown error"}console.log("Mermaid error message:",t),"element is null"!==t.str?s("Something went wrong while rendering the diagram. Please try again later or downvote the message if the issue persists."):s(null)}))},[t]),(0,n.jsxs)("div",{children:[a?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 bg-red-100 border border-red-500 rounded-md p-1 mt-3 text-red-900 text-sm",children:[(0,n.jsx)(el.k,{className:"w-12 h-12"}),(0,n.jsx)("span",{children:a})]}),(0,n.jsx)("code",{className:"block bg-secondary text-secondary-foreground p-4 mt-3 rounded-lg font-mono text-sm whitespace-pre-wrap overflow-x-auto max-h-[400px] border border-gray-200",children:t})]}):(0,n.jsx)("div",{id:o,ref:r,className:"mermaid",style:{width:"auto",height:"auto",boxSizing:"border-box",overflow:"auto"},children:t}),!a&&(0,n.jsxs)(ec.z,{onClick:c,variant:"secondary",className:"mt-3",children:[(0,n.jsx)(er.U,{className:"w-5 h-5"}),"Export as PNG"]})]})};let ed=new h.Z({html:!0,linkify:!0,typographer:!0});function eh(e,t,a){fetch("/api/chat/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uquery:e,kquery:t,sentiment:a})})}function eu(e){let{uquery:t,kquery:a}=e,[s,o]=(0,l.useState)(null);return(0,l.useEffect)(()=>{null!==s&&setTimeout(()=>{o(null)},2e3)},[s]),(0,n.jsxs)("div",{className:"".concat(d().feedbackButtons," flex align-middle justify-center items-center"),children:[(0,n.jsx)("button",{title:"Like",className:d().thumbsUpButton,disabled:null!==s,onClick:()=>{eh(t,a,"positive"),o(!0)},children:!0===s?(0,n.jsx)(F.V,{alt:"Liked Message",className:"text-green-500",weight:"fill"}):(0,n.jsx)(F.V,{alt:"Like Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),(0,n.jsx)("button",{title:"Dislike",className:d().thumbsDownButton,disabled:null!==s,onClick:()=>{eh(t,a,"negative"),o(!1)},children:!1===s?(0,n.jsx)(L.L,{alt:"Disliked Message",className:"text-red-500",weight:"fill"}):(0,n.jsx)(L.L,{alt:"Dislike Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})})]})}function em(e){let t=e.message.match(/\*\*(.*)\*\*/),a=function(e,t){let a=e.toLowerCase(),s="inline mt-1 mr-2 ".concat(t," h-4 w-4");return a.includes("understanding")?(0,n.jsx)(D.a,{className:"".concat(s)}):a.includes("generating")?(0,n.jsx)(O.Z,{className:"".concat(s)}):a.includes("tools")?(0,n.jsx)(B.v,{className:"".concat(s)}):a.includes("notes")?(0,n.jsx)(U.g,{className:"".concat(s)}):a.includes("read")?(0,n.jsx)(q.f,{className:"".concat(s)}):a.includes("search")?(0,n.jsx)(A.Y,{className:"".concat(s)}):a.includes("summary")||a.includes("summarize")||a.includes("enhanc")?(0,n.jsx)(z.u,{className:"".concat(s)}):a.includes("diagram")?(0,n.jsx)(Z.j,{className:"".concat(s)}):a.includes("paint")?(0,n.jsx)(H.Y,{className:"".concat(s)}):a.includes("code")?(0,n.jsx)(p.E,{className:"".concat(s)}):(0,n.jsx)(D.a,{className:"".concat(s)})}(t?t[1]:"",e.primary?(0,K.oz)(e.agentColor):"text-gray-500"),s=y.Z.sanitize(ed.render(e.message));return s=s.replace(/<h[1-6].*?<\/h[1-6]>/g,""),(0,n.jsxs)("div",{className:"".concat(d().trainOfThoughtElement," break-words items-center ").concat(e.primary?"text-gray-400":"text-gray-300"," ").concat(d().trainOfThought," ").concat(e.primary?d().primary:""),children:[a,(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:s},className:"break-words"})]})}ed.use(m(),{inline:!0,code:!0});let eg=(0,l.forwardRef)((e,t)=>{var a,s;let o,r,c,i,h;let[u,m]=(0,l.useState)(!1),[f,p]=(0,l.useState)(!1),[x,v]=(0,l.useState)(""),[j,w]=(0,l.useState)(""),[b,M]=(0,l.useState)(!1),[N,k]=(0,l.useState)(!1),[_,R]=(0,l.useState)(""),[E,S]=(0,l.useState)(""),F=(0,l.useRef)(!1),L=(0,l.useRef)(null);async function D(){let t=e.chatMessage.message.match(/[^.!?]+[.!?]*/g)||[];if(!t||0===t.length||!t[0])return;M(!0);let a=O(t[0]);for(let e=0;e<t.length&&!F.current;e++){let n=a;e<t.length-1&&(a=O(t[e+1]));try{let e=await n,t=URL.createObjectURL(e);await function(e){return new Promise((t,a)=>{let n=new Audio(e);n.onended=t,n.onerror=a,n.play()})}(t)}catch(e){console.error("Error:",e);break}}M(!1),k(!1)}async function O(e){let t=await fetch("/api/chat/speech?text=".concat(encodeURIComponent(e)),{method:"POST",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("Network response was not ok");return await t.blob()}(0,l.useEffect)(()=>{F.current=N},[N]),(0,l.useEffect)(()=>{let e=new MutationObserver((e,t)=>{if(L.current)for(let t of e)"childList"===t.type&&t.addedNodes.length>0&&(0,Y.Z)(L.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}]})});return L.current&&e.observe(L.current,{childList:!0}),()=>e.disconnect()},[L.current]),(0,l.useEffect)(()=>{let t=e.chatMessage.message;e.chatMessage.excalidrawDiagram&&R(e.chatMessage.excalidrawDiagram),e.chatMessage.mermaidjsDiagram&&S(e.chatMessage.mermaidjsDiagram),t=t.replace(/\\\(/g,"LEFTPAREN").replace(/\\\)/g,"RIGHTPAREN").replace(/\\\[/g,"LEFTBRACKET").replace(/\\\]/g,"RIGHTBRACKET"),t=(0,T.AQ)(t,e.chatMessage.codeContext),e.chatMessage.codeContext&&Object.entries(e.chatMessage.codeContext).forEach(e=>{var a;let[n,s]=e;null===(a=s.results.output_files)||void 0===a||a.forEach(e=>{(e.filename.endsWith(".png")||e.filename.endsWith(".jpg"))&&!t.includes(")&&(t+="\n\n.concat(e.b64_data,")"))})});let a=t,n=t;if(e.chatMessage.images&&e.chatMessage.images.length>0){let t=e.chatMessage.images.map(e=>{let t=e.startsWith("data%3Aimage")?decodeURIComponent(e):e;return y.Z.sanitize(t)}),s=t.map((e,t)=>".concat(e,")")).join("\n"),o=t.map((e,t)=>'<div class="'.concat(d().imageWrapper,'"><img src="').concat(e,'" alt="uploaded image ').concat(t+1,'" /></div>')).join(""),l='<div class="'.concat(d().imagesContainer,'">').concat(o,"</div>");a="".concat(s,"\n\n").concat(a),n="".concat(l).concat(n)}v(a);let s=ed.render(n);s=s.replace(/LEFTPAREN/g,"\\(").replace(/RIGHTPAREN/g,"\\)").replace(/LEFTBRACKET/g,"\\[").replace(/RIGHTBRACKET/g,"\\]"),w(y.Z.sanitize(s))},[e.chatMessage.message,e.chatMessage.images,e.chatMessage.intent]),(0,l.useEffect)(()=>{u&&setTimeout(()=>{m(!1)},2e3)},[u]),(0,l.useEffect)(()=>{L.current&&(L.current.querySelectorAll("pre > .hljs").forEach(e=>{if(!e.querySelector("".concat(d().codeCopyButton))){let t=document.createElement("button"),a=(0,n.jsx)(W.w,{size:24});(0,g.createRoot)(t).render(a),t.className="hljs ".concat(d().codeCopyButton),t.addEventListener("click",()=>{let a=e.textContent||"";a=(a=(a=a.replace(/^\$+/,"")).replace(/^Copy/,"")).trim(),navigator.clipboard.writeText(a);let s=(0,n.jsx)(P.J,{size:24});(0,g.createRoot)(t).render(s)}),e.prepend(t)}}),(0,Y.Z)(L.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}]}))},[j,f,L]);let B=async t=>{let a=t.turnId||e.turnId;(await fetch("/api/chat/conversation/message",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversation_id:e.conversationId,turn_id:a})})).ok?e.onDeleteMessage(a):console.error("Failed to delete message")},U=function(e,t,a){let n=[],s=[],o=[];if(a)for(let[e,t]of Object.entries(a))t.results&&o.push({code:t.code,output:t.results.std_out,output_files:t.results.output_files,error:t.results.std_err});if(t){let e=[];for(let[a,n]of Object.entries(t)){if(n.answerBox&&e.push({title:n.answerBox.title,description:n.answerBox.answer,link:n.answerBox.source}),n.knowledgeGraph&&e.push({title:n.knowledgeGraph.title,description:n.knowledgeGraph.description,link:n.knowledgeGraph.descriptionLink}),n.webpages){if(n.webpages instanceof Array){let t=n.webpages.map(e=>({title:e.query,description:e.snippet,link:e.link}));e.push(...t)}else{let t=n.webpages;e.push({title:t.query,description:t.snippet,link:t.link})}}if(n.organic){let t=n.organic.map(e=>({title:e.title,description:e.snippet,link:e.link}));e.push(...t)}}n.push(...e)}if(e){let t=e.map(e=>e.compiled?{title:e.file,content:e.compiled}:{title:e.split("\n")[0],content:e.split("\n").slice(1).join("\n")});s.push(...t)}return{notesReferenceCardData:s,onlineReferenceCardData:n,codeReferenceCardData:o}}(e.chatMessage.context,e.chatMessage.onlineContext,e.chatMessage.codeContext);return(0,n.jsxs)("div",{ref:t,className:(a=e.chatMessage,o=[d().chatMessageContainer],"khoj"===a.by&&o.push("shadow-md"),o.push(d()[a.by]),a.message||o.push(d().emptyChatMessage),e.customClassName&&o.push(d()["".concat(a.by).concat(e.customClassName)]),o.join(" ")),onMouseLeave:e=>p(!1),onMouseEnter:e=>p(!0),children:[(0,n.jsxs)("div",{className:(s=e.chatMessage,(r=[d().chatMessageWrapper]).push(d()[s.by]),"khoj"===s.by&&r.push("border-l-4 border-opacity-50 ".concat("border-l-"+e.borderLeftColor)),r.join(" ")),children:[e.chatMessage.queryFiles&&e.chatMessage.queryFiles.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap flex-col mb-2 max-w-full",children:e.chatMessage.queryFiles.map((e,t)=>(0,n.jsxs)(et.Vq,{children:[(0,n.jsx)(et.hg,{asChild:!0,children:(0,n.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer bg-gray-500 bg-opacity-25 rounded-lg p-2 w-full ",children:[(0,n.jsx)("div",{className:"flex-shrink-0",children:(0,C.Le)(e.file_type)}),(0,n.jsx)("span",{className:"truncate flex-1 min-w-0 max-w-[200px]",children:e.name}),e.size&&(0,n.jsxs)("span",{className:"text-gray-400 flex-shrink-0",children:["(",(0,en.xq)(e.size),")"]})]})}),(0,n.jsxs)(et.cZ,{children:[(0,n.jsx)(et.fK,{children:(0,n.jsx)(ea.$N,{children:(0,n.jsx)("div",{className:"truncate min-w-0 break-words break-all text-wrap max-w-full whitespace-normal",children:e.name})})}),(0,n.jsx)(et.Be,{children:(0,n.jsx)(es.x,{className:"h-72 w-full rounded-md break-words break-all text-wrap",children:e.content})})]})]},t))}),(0,n.jsx)("div",{ref:L,className:d().chatMessage,dangerouslySetInnerHTML:{__html:j}}),_&&(0,n.jsx)(ee,{data:_}),E&&(0,n.jsx)(ei,{chart:E})]}),(0,n.jsx)("div",{className:d().teaserReferencesContainer,children:(0,n.jsx)(I,{isMobileWidth:e.isMobileWidth,notesReferenceCardData:U.notesReferenceCardData,onlineReferenceCardData:U.onlineReferenceCardData,codeReferenceCardData:U.codeReferenceCardData})}),(0,n.jsx)("div",{className:d().chatFooter,children:(f||e.isMobileWidth||e.isLastMessage||b)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{title:(i=(c=new Date(e.chatMessage.created+"Z")).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}).toUpperCase(),h=c.toLocaleString("en-US",{year:"numeric",month:"short",day:"2-digit"}).replaceAll("-"," "),"".concat(i," on ").concat(h)),className:"text-gray-400 relative top-0 left-4",children:function(e){e.endsWith("Z")||(e+="Z");let t=new Date(e),a=new Date().getTime()-t.getTime();return a<6e4?"Just now":a<36e5?"".concat(Math.round(a/6e4),"m ago"):a<864e5?"".concat(Math.round(a/36e5),"h ago"):"".concat(Math.round(a/864e5),"d ago")}(e.chatMessage.created)}),(0,n.jsxs)("div",{className:"".concat(d().chatButtons," shadow-sm"),children:["khoj"===e.chatMessage.by&&(b?N?(0,n.jsx)(V.l,{iconClassName:"p-0",className:"m-0"}):(0,n.jsx)("button",{title:"Pause Speech",onClick:e=>k(!0),children:(0,n.jsx)(G.d,{alt:"Pause Message",className:"hsl(var(--muted-foreground))"})}):(0,n.jsx)("button",{title:"Speak",onClick:e=>D(),children:(0,n.jsx)($.j,{alt:"Speak Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})})),e.chatMessage.turnId&&(0,n.jsx)("button",{title:"Delete",className:"".concat(d().deleteButton),onClick:()=>B(e.chatMessage),children:(0,n.jsx)(J.r,{alt:"Delete Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})}),(0,n.jsx)("button",{title:"Copy",className:"".concat(d().copyButton),onClick:()=>{navigator.clipboard.writeText(x),m(!0)},children:u?(0,n.jsx)(Q.C,{alt:"Copied Message",weight:"fill",className:"text-green-500"}):(0,n.jsx)(Q.C,{alt:"Copy Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),"khoj"===e.chatMessage.by&&(e.chatMessage.intent?(0,n.jsx)(eu,{uquery:e.chatMessage.intent.query,kquery:e.chatMessage.message}):(0,n.jsx)(eu,{uquery:e.chatMessage.rawQuery||e.chatMessage.message,kquery:e.chatMessage.message}))]})]})})]})});eg.displayName="ChatMessage";var ef=a(3894),ep=a(20461),ex=a(77168),ev=a(15483),ej=a(81103),ew=e=>{let{name:t,avatar:a,link:s,description:o}=e;return(0,n.jsx)("div",{className:"relative group flex",children:(0,n.jsx)(ej.pn,{children:(0,n.jsxs)(ej.u,{delayDuration:0,children:[(0,n.jsx)(ej.aJ,{asChild:!0,children:(0,n.jsxs)(ec.z,{variant:"ghost",className:"flex items-center justify-center",children:[a,(0,n.jsx)("div",{children:t})]})}),(0,n.jsx)(ej._v,{children:(0,n.jsxs)("div",{className:"w-80 h-30",children:[(0,n.jsx)("a",{href:s,target:"_blank",rel:"noreferrer",className:"mt-1 ml-2 block no-underline",children:(0,n.jsxs)("div",{className:"flex items-center justify-start gap-2",children:[a,(0,n.jsxs)("div",{className:"mr-2 mt-1 flex justify-center items-center text-sm font-semibold text-gray-800",children:[t,(0,n.jsx)(v.o,{weight:"bold",className:"ml-1"})]})]})}),o&&(0,n.jsx)("p",{className:"mt-2 ml-6 text-sm text-gray-600 line-clamp-2",children:o||"A Khoj agent"})]})})]})})})};function eb(e){let t=e.trainOfThought.length-1,[a,s]=(0,l.useState)(e.completed);return(0,l.useEffect)(()=>{e.completed&&s(!0)},[e.completed]),(0,n.jsxs)("div",{className:"".concat(a?"":o().trainOfThought+" border"," rounded-lg"),children:[!e.completed&&(0,n.jsx)(V.l,{className:"float-right"}),e.completed&&(a?(0,n.jsxs)(ec.z,{className:"w-fit text-left justify-start content-start text-xs",onClick:()=>s(!1),variant:"ghost",size:"sm",children:["Thought Process ",(0,n.jsx)(ef.p,{size:16,className:"ml-1"})]}):(0,n.jsxs)(ec.z,{className:"w-fit text-left justify-start content-start text-xs p-0 h-fit",onClick:()=>s(!0),variant:"ghost",size:"sm",children:["Close ",(0,n.jsx)(ep.U,{size:16,className:"ml-1"})]})),(0,n.jsx)(r.M,{initial:!1,children:!a&&(0,n.jsx)(c.E.div,{initial:"closed",animate:"open",exit:"closed",variants:{open:{height:"auto",opacity:1,transition:{duration:.3,ease:"easeOut"}},closed:{height:0,opacity:0,transition:{duration:.3,ease:"easeIn"}}},children:e.trainOfThought.map((a,s)=>(0,n.jsx)(em,{message:a,primary:s===t&&e.lastMessage&&!e.completed,agentColor:e.agentColor},"train-".concat(s)))})})]},e.keyId)}function ey(e){var t,a,s,r,c,i,d,h,u;let[m,g]=(0,l.useState)(null),[f,p]=(0,l.useState)(0),[x,v]=(0,l.useState)(!0),[j,w]=(0,l.useState)(null),b=(0,l.useRef)(null),y=(0,l.useRef)(null),M=(0,l.useRef)(null),N=(0,l.useRef)(null),[k,_]=(0,l.useState)(null),[R,E]=(0,l.useState)(!1),[I,S]=(0,l.useState)(!0),T=(0,en.IC)(),F="[data-radix-scroll-area-viewport]",L=localStorage.getItem("message");(0,l.useEffect)(()=>{var e;let t=null===(e=y.current)||void 0===e?void 0:e.querySelector(F);if(!t)return;let a=()=>{let{scrollTop:e,scrollHeight:a,clientHeight:n}=t;S(a-(e+n)<=50)};return t.addEventListener("scroll",a),()=>t.removeEventListener("scroll",a)},[]),(0,l.useEffect)(()=>{e.incomingMessages&&e.incomingMessages.length>0&&I&&O()},[e.incomingMessages,I]),(0,l.useEffect)(()=>{m&&m.chat&&m.chat.length>0&&f<2&&requestAnimationFrame(()=>{var e;null===(e=M.current)||void 0===e||e.scrollIntoView({behavior:"auto",block:"start"})})},[m,f]),(0,l.useEffect)(()=>{if(!x||R)return;let t=new IntersectionObserver(t=>{t[0].isIntersecting&&x&&(E(!0),function(t){if(!x||R)return;let a=(t+1)*10,n="";if(e.conversationId)n="/api/chat/history?client=web&conversation_id=".concat(encodeURIComponent(e.conversationId),"&n=").concat(a);else{if(!e.publicConversationSlug)return;n="/api/chat/share/history?client=web&public_conversation_slug=".concat(e.publicConversationSlug,"&n=").concat(a)}fetch(n).then(e=>e.json()).then(a=>{if(e.setTitle(a.response.slug),a&&a.response&&a.response.chat&&a.response.chat.length>0){if(p(Math.ceil(a.response.chat.length/10)),a.response.chat.length===(null==m?void 0:m.chat.length)){v(!1),E(!1);return}e.setAgent(a.response.agent),g(a.response),E(!1),0===t?O(!0):D()}else{if(a.response.agent&&a.response.conversation_id){let t={chat:[],agent:a.response.agent,conversation_id:a.response.conversation_id,slug:a.response.slug};e.setAgent(a.response.agent),g(t),e.setIsChatSideBarOpen&&!L&&e.setIsChatSideBarOpen(!0)}v(!1),E(!1)}}).catch(e=>{console.error(e),window.location.href="/"})}(f))},{threshold:1});return b.current&&t.observe(b.current),()=>t.disconnect()},[x,f,R]),(0,l.useEffect)(()=>{v(!0),E(!1),p(0),g(null)},[e.conversationId]),(0,l.useEffect)(()=>{if(e.incomingMessages){let t=e.incomingMessages[e.incomingMessages.length-1];t&&!t.completed&&(_(e.incomingMessages.length-1),e.setTitle(t.rawQuery),t.turnId&&w(t.turnId))}},[e.incomingMessages]);let D=()=>{var e;let t=null===(e=y.current)||void 0===e?void 0:e.querySelector(F);requestAnimationFrame(()=>{var e;null===(e=N.current)||void 0===e||e.scrollIntoView({behavior:"auto",block:"start"}),null==t||t.scrollBy({behavior:"smooth",top:-150})})},O=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=null===(e=y.current)||void 0===e?void 0:e.querySelector(F);requestAnimationFrame(()=>{null==a||a.scrollTo({top:a.scrollHeight,behavior:t?"auto":"smooth"})}),S(!0)},B=t=>{t&&(g(e=>e&&t?{...e,chat:e.chat.filter(e=>e.turnId!==t)}:e),e.incomingMessages&&e.setIncomingMessages&&e.setIncomingMessages(e.incomingMessages.filter(e=>e.turnId!==t)))};return e.conversationId||e.publicConversationSlug?(0,n.jsx)(es.x,{className:"\n h-[calc(100svh-theme(spacing.44))]\n sm:h-[calc(100svh-theme(spacing.44))]\n md:h-[calc(100svh-theme(spacing.44))]\n lg:h-[calc(100svh-theme(spacing.72))]\n ",ref:y,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"".concat(o().chatHistory," ").concat(e.customClassName),children:[(0,n.jsx)("div",{ref:b,style:{height:"1px"},children:R&&(0,n.jsx)(V.l,{className:"opacity-50"})}),m&&m.chat&&m.chat.map((t,a)=>{var s,o,l;return(0,n.jsxs)(n.Fragment,{children:[t.trainOfThought&&"khoj"===t.by&&(0,n.jsx)(eb,{trainOfThought:null===(s=t.trainOfThought)||void 0===s?void 0:s.map(e=>e.data),lastMessage:!1,agentColor:(null==m?void 0:null===(o=m.agent)||void 0===o?void 0:o.color)||"orange",keyId:"".concat(a,"trainOfThought"),completed:!0},"".concat(a,"trainOfThought")),(0,n.jsx)(eg,{ref:a===m.chat.length-2?M:a===m.chat.length-(f-1)*10?N:null,isMobileWidth:T,chatMessage:t,customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(l=m.agent)||void 0===l?void 0:l.color,"-500"),isLastMessage:a===m.chat.length-1,onDeleteMessage:B,conversationId:e.conversationId},"".concat(a,"fullHistory"))]})}),e.incomingMessages&&e.incomingMessages.map((t,a)=>{var s,o,r,c,i;let d=null!==(i=null!==(c=t.turnId)&&void 0!==c?c:j)&&void 0!==i?i:void 0;return(0,n.jsxs)(l.Fragment,{children:[(0,n.jsx)(eg,{isMobileWidth:T,chatMessage:{message:t.rawQuery,context:[],onlineContext:{},codeContext:{},created:t.timestamp,by:"you",automationId:"",images:t.images,conversationId:e.conversationId,turnId:d,queryFiles:t.queryFiles},customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(s=m.agent)||void 0===s?void 0:s.color,"-500"),onDeleteMessage:B,conversationId:e.conversationId,turnId:d},"".concat(a,"outgoing")),t.trainOfThought&&(0,n.jsx)(eb,{trainOfThought:t.trainOfThought,lastMessage:a===k,agentColor:(null==m?void 0:null===(o=m.agent)||void 0===o?void 0:o.color)||"orange",keyId:"".concat(a,"trainOfThought"),completed:t.completed},"".concat(a,"trainOfThought")),(0,n.jsx)(eg,{isMobileWidth:T,chatMessage:{message:t.rawResponse,context:t.context,onlineContext:t.onlineContext,codeContext:t.codeContext,created:t.timestamp,by:"khoj",automationId:"",rawQuery:t.rawQuery,intent:{type:t.intentType||"",query:t.rawQuery,"memory-type":"","inferred-queries":t.inferredQueries||[]},conversationId:e.conversationId,images:t.generatedImages,queryFiles:t.generatedFiles,mermaidjsDiagram:t.generatedMermaidjsDiagram,turnId:d},conversationId:e.conversationId,turnId:d,onDeleteMessage:B,customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(r=m.agent)||void 0===r?void 0:r.color,"-500"),isLastMessage:a===e.incomingMessages.length-1},"".concat(a,"incoming"))]},"incomingMessage".concat(a))}),e.pendingMessage&&(0,n.jsx)(eg,{isMobileWidth:T,chatMessage:{message:e.pendingMessage,context:[],onlineContext:{},codeContext:{},created:new Date().getTime().toString(),by:"you",automationId:"",conversationId:e.conversationId,turnId:void 0},conversationId:e.conversationId,onDeleteMessage:B,customClassName:"fullHistory",borderLeftColor:"".concat(null==m?void 0:null===(t=m.agent)||void 0===t?void 0:t.color,"-500"),isLastMessage:!0},"pendingMessage-".concat(e.pendingMessage.length)),m&&(0,n.jsx)("div",{className:"".concat(o().agentIndicator," pb-4"),children:(0,n.jsx)("div",{className:"relative group mx-2 cursor-pointer",children:(0,n.jsx)(ew,{name:m&&m.agent&&(null===(r=m.agent)||void 0===r?void 0:r.name)?m.agent.is_hidden?"Khoj":null===(c=m.agent)||void 0===c?void 0:c.name:"Agent",link:m&&m.agent&&(null===(i=m.agent)||void 0===i?void 0:i.slug)?"/agents?agent=".concat(null===(d=m.agent)||void 0===d?void 0:d.slug):"/agents",avatar:(0,C.TI)(null===(a=m.agent)||void 0===a?void 0:a.icon,null===(s=m.agent)||void 0===s?void 0:s.color)||(0,n.jsx)(ex.v,{}),description:m&&m.agent?(null===(h=m.agent)||void 0===h?void 0:h.persona)?null===(u=m.agent)||void 0===u?void 0:u.persona:"You can set a persona for your agent in the Chat Options side panel.":"Your agent is no longer available. You will be reset to the default agent."})})})]}),(0,n.jsx)("div",{className:"".concat(e.customClassName," fixed bottom-[20%] z-10"),children:!I&&(0,n.jsx)("button",{title:"Scroll to bottom",className:"absolute bottom-0 right-0 bg-white dark:bg-[hsl(var(--background))] text-neutral-500 dark:text-white p-2 rounded-full shadow-xl",onClick:()=>{O(),S(!0)},children:(0,n.jsx)(ev.K,{size:24})})})]})}):null}},42501:function(e){e.exports={chatHistory:"chatHistory_chatHistory__CoaVT",agentIndicator:"chatHistory_agentIndicator__wOU1f",trainOfThought:"chatHistory_trainOfThought__mMWSR"}},91499:function(e){e.exports={chatMessageContainer:"chatMessage_chatMessageContainer__sAivf",chatMessageWrapper:"chatMessage_chatMessageWrapper__u5m8A",khojfullHistory:"chatMessage_khojfullHistory__NPu2l",youfullHistory:"chatMessage_youfullHistory__ioyfH",you:"chatMessage_you__6GUC4",khoj:"chatMessage_khoj__cjWON",khojChatMessage:"chatMessage_khojChatMessage__BabQz",emptyChatMessage:"chatMessage_emptyChatMessage__J9JRn",imagesContainer:"chatMessage_imagesContainer__HTRjT",imageWrapper:"chatMessage_imageWrapper__DF92M",author:"chatMessage_author__muRtC",chatFooter:"chatMessage_chatFooter__0vR8s",chatButtons:"chatMessage_chatButtons__Lbk8T",codeCopyButton:"chatMessage_codeCopyButton__Y_Ujv",feedbackButtons:"chatMessage_feedbackButtons___Brdy",copyButton:"chatMessage_copyButton__jd7q7",trainOfThought:"chatMessage_trainOfThought__mR2Gg",primary:"chatMessage_primary__WYPEb",trainOfThoughtElement:"chatMessage_trainOfThoughtElement__le_bC"}}}]);
|
@@ -1 +1 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9718],{1813:function(e,a,t){Promise.resolve().then(t.bind(t,37335))},37335:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return w}});var l=t(57437),n=t(14675),r=t.n(n),o=t(63861),s=t(2265),i=t(56937),c=t(89203),d=t(78527),u=t(26110),p=t(33494),m=t(14308),h=t(65613),f=t(7436),v=t(25427),g=t(29501),x=t(13590),b=t(60729),A=t(34124),j=t(6512),y=t(37104),O=t(49027),_=t(27648);let Z=()=>window.fetch("/api/agents").then(e=>e.json()).catch(e=>console.log(e)),M=e=>fetch(e).then(e=>e.json());function N(e){let[a,t]=(0,s.useState)(!1),[n,r]=(0,s.useState)(null),[o,i]=(0,s.useState)(!0),d=(0,g.cI)({resolver:(0,x.F)(v.bc),defaultValues:{name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.selectedChatModelOption,files:[]}});return(0,s.useEffect)(()=>{d.reset({name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.selectedChatModelOption,files:[]})},[e.selectedChatModelOption,e.data]),(0,l.jsxs)(u.Vq,{open:a,onOpenChange:t,children:[(0,l.jsx)(u.hg,{children:(0,l.jsxs)("div",{className:"flex items-center text-md gap-2",children:[(0,l.jsx)(c.v,{}),"Create Agent"]})}),(0,l.jsxs)(u.cZ,{className:"lg:max-w-screen-lg py-4 overflow-y-scroll h-full md:h-4/6 rounded-lg flex flex-col",children:[(0,l.jsx)(u.fK,{children:(0,l.jsx)(O.$N,{children:"Create Agent"})}),!e.userProfile&&o&&(0,l.jsx)(p.Z,{onOpenChange:i,isMobileWidth:e.isMobileWidth}),(0,l.jsx)(v.ks,{form:d,onSubmit:a=>{fetch("/api/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}).then(a=>{200===a.status?(d.reset(),t(!1),r(null),e.setAgentChangeTriggered(!0)):a.json().then(e=>{console.error(e),e.error&&r(e.error)})}).catch(e=>{console.error("Error:",e),r(e)})},create:!0,errors:n,filesOptions:e.filesOptions,modelOptions:e.modelOptions,inputToolOptions:e.inputToolOptions,outputModeOptions:e.outputModeOptions,isSubscribed:e.isSubscribed})]})]})}function w(){let{data:e,error:a,mutate:t}=(0,o.ZP)("agents",Z,{revalidateOnFocus:!1}),{data:n,error:c,isLoading:u}=(0,i.GW)(),{data:g}=(0,i.h2)(!0),[x,O]=(0,s.useState)(!1),w=(0,f.IC)(),[E,V]=(0,s.useState)([]),[L,P]=(0,s.useState)([]),[C,S]=(0,s.useState)(null),{data:F,error:H}=(0,o.ZP)(g?"/api/content/computer":null,M),{data:T,error:k}=(0,o.ZP)("/api/agents/options",M),[I,W]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{I&&(t(),W(!1))},[I]),(0,s.useEffect)(()=>{if(e){V(e.filter(e=>e.creator===(null==n?void 0:n.username)));let a=e.filter(e=>"private"!==e.privacy_level&&e.creator!==(null==n?void 0:n.username));P(a);{let t=new URLSearchParams(window.location.search).get("agent");if(t){S(t);let l=e.find(e=>e.slug===t);l||(l=a.find(e=>e.slug===t)),l||fetch("/api/agents/".concat(t)).then(e=>{if(404===e.status)throw Error("Agent not found");return e.json()}).then(e=>{"protected"===e.privacy_level&&P(a=>[...a,e])})}}}},[e,n]),a)return(0,l.jsxs)("main",{className:r().main,children:[(0,l.jsx)("div",{className:"".concat(r().titleBar," text-5xl"),children:"Agents"}),(0,l.jsx)("div",{className:r().agentList,children:"Error loading agents"})]});if(!e)return(0,l.jsx)("main",{className:r().main,children:(0,l.jsxs)("div",{className:r().agentList,children:[(0,l.jsx)(m.l,{})," booting up your agents"]})});let B=(null==g?void 0:g.chat_model_options)||[],R=(null==g?void 0:g.selected_chat_model_config)||0,Y=(null==g?void 0:g.is_active)||!1,z=B.find(e=>e.id===R);return(0,l.jsxs)(b.Hn,{children:[(0,l.jsx)(A.S,{conversationId:""}),(0,l.jsxs)(b.kV,{children:[(0,l.jsxs)("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b px-4",children:[(0,l.jsx)(b.vP,{className:"-ml-1"}),(0,l.jsx)(j.Z,{orientation:"vertical",className:"mr-2 h-4"}),w?(0,l.jsx)("a",{className:"p-0 no-underline",href:"/",children:(0,l.jsx)(y.VO,{className:"h-auto w-16"})}):(0,l.jsx)("h2",{className:"text-lg",children:"Agents"})]}),(0,l.jsx)("main",{className:"w-full mx-auto",children:(0,l.jsx)("div",{className:"grid w-full mx-auto",children:(0,l.jsxs)("div",{className:"".concat(r().pageLayout," w-full"),children:[(0,l.jsxs)("div",{className:"pt-6 md:pt-8 flex justify-between",children:[(0,l.jsx)("h1",{className:"text-3xl flex items-center",children:"Agents"}),(0,l.jsx)("div",{className:"ml-auto float-right border p-2 pt-3 rounded-xl font-bold hover:bg-stone-100 dark:hover:bg-neutral-900",children:(0,l.jsx)(N,{data:{slug:"",name:"",persona:"",color:"",icon:"",privacy_level:"private",managed_by_admin:!1,chat_model:"",input_tools:[],output_modes:[],is_hidden:!1},userProfile:u?null:null!=n?n:null,isMobileWidth:w,filesOptions:F||[],modelOptions:(null==g?void 0:g.chat_model_options)||[],selectedChatModelOption:(null==z?void 0:z.name)||"",isSubscribed:Y,setAgentChangeTriggered:W,inputToolOptions:(null==T?void 0:T.input_tools)||{},outputModeOptions:(null==T?void 0:T.output_modes)||{}})})]}),x&&(0,l.jsx)(p.Z,{onOpenChange:O,isMobileWidth:w}),(0,l.jsx)(h.bZ,{className:"bg-secondary border-none my-4",children:(0,l.jsxs)(h.X,{children:[(0,l.jsx)(d.B,{weight:"fill",className:"h-4 w-4 text-purple-400 inline"}),(0,l.jsx)("span",{className:"font-bold",children:"How it works"})," Use any of these specialized personas to tune your conversation to your needs.",!Y&&(0,l.jsxs)("span",{children:[" ",(0,l.jsx)(_.default,{href:"/settings",className:"font-bold",children:"Upgrade your plan"})," to leverage custom models. You will fallback to the default model when chatting."]})]})}),(0,l.jsx)("div",{className:"pt-6 md:pt-8",children:(0,l.jsx)("div",{className:"".concat(r().agentList),children:n&&E.map(e=>(0,l.jsx)(v.EY,{data:e,userProfile:n,isMobileWidth:w,filesOptions:null!=F?F:[],selectedChatModelOption:(null==z?void 0:z.name)||"",isSubscribed:Y,setAgentChangeTriggered:W,modelOptions:(null==g?void 0:g.chat_model_options)||[],editCard:!0,agentSlug:C||"",inputToolOptions:(null==T?void 0:T.input_tools)||{},outputModeOptions:(null==T?void 0:T.output_modes)||{}},e.slug))})}),(0,l.jsxs)("div",{className:"pt-6 md:pt-8",children:[(0,l.jsx)("h2",{className:"text-2xl",children:"Explore"}),(0,l.jsx)("div",{className:"".concat(r().agentList),children:!u&&L.map(e=>(0,l.jsx)(v.EY,{data:e,userProfile:n||null,isMobileWidth:w,editCard:!1,filesOptions:null!=F?F:[],selectedChatModelOption:(null==z?void 0:z.name)||"",isSubscribed:Y,setAgentChangeTriggered:W,modelOptions:(null==g?void 0:g.chat_model_options)||[],agentSlug:C||"",inputToolOptions:(null==T?void 0:T.input_tools)||{},outputModeOptions:(null==T?void 0:T.output_modes)||{}},e.slug))})]})]})})})]})]})}},32759:function(e,a,t){"use strict";t.d(a,{E:function(){return s}});var l=t(57437),n=t(2265),r=t(60610),o=t(94508);let s=n.forwardRef((e,a)=>{let{className:t,value:n,indicatorColor:s,...i}=e;return(0,l.jsx)(r.fC,{ref:a,className:(0,o.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...i,children:(0,l.jsx)(r.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(s),style:{transform:"translateX(-".concat(100-(n||0),"%)")}})})});s.displayName=r.fC.displayName},76818:function(e,a,t){"use strict";t.d(a,{g:function(){return o}});var l=t(57437),n=t(2265),r=t(94508);let o=n.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,l.jsx)("textarea",{className:(0,r.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),ref:a,...n})});o.displayName="Textarea"},14675:function(e){e.exports={titleBar:"agents_titleBar__FzYbY",agentPersonality:"agents_agentPersonality__o0Ysz",pageLayout:"agents_pageLayout__gR3S3",infoButton:"agents_infoButton__NqI7E",agentList:"agents_agentList__XVx4A"}},2452:function(e,a,t){"use strict";t.d(a,{a:function(){return f}});var l=t(2265),n=t(49656);let r=new Map([["bold",l.createElement(l.Fragment,null,l.createElement("path",{d:"M252,124a60.14,60.14,0,0,0-32-53.08,52,52,0,0,0-92-32.11A52,52,0,0,0,36,70.92a60,60,0,0,0,0,106.14,52,52,0,0,0,92,32.13,52,52,0,0,0,92-32.13A60.05,60.05,0,0,0,252,124ZM88,204a28,28,0,0,1-26.85-20.07c1,0,1.89.07,2.85.07h8a12,12,0,0,0,0-24H64A36,36,0,0,1,52,90.05a12,12,0,0,0,8-11.32V72a28,28,0,0,1,56,0v60.18a51.61,51.61,0,0,0-7.2-3.85,12,12,0,1,0-9.6,22A28,28,0,0,1,88,204Zm104-44h-8a12,12,0,0,0,0,24h8c1,0,1.9,0,2.85-.07a28,28,0,1,1-38-33.61,12,12,0,1,0-9.6-22,51.61,51.61,0,0,0-7.2,3.85V72a28,28,0,0,1,56,0v6.73a12,12,0,0,0,8,11.32,36,36,0,0,1-12,70Zm16-44a12,12,0,0,1-12,12,40,40,0,0,1-40-40V84a12,12,0,0,1,24,0v4a16,16,0,0,0,16,16A12,12,0,0,1,208,116ZM100,88a40,40,0,0,1-40,40,12,12,0,0,1,0-24A16,16,0,0,0,76,88V84a12,12,0,0,1,24,0Z"}))],["duotone",l.createElement(l.Fragment,null,l.createElement("path",{d:"M240,124a48,48,0,0,1-32,45.27h0V176a40,40,0,0,1-80,0,40,40,0,0,1-80,0v-6.73h0a48,48,0,0,1,0-90.54V72a40,40,0,0,1,80,0,40,40,0,0,1,80,0v6.73A48,48,0,0,1,240,124Z",opacity:"0.2"}),l.createElement("path",{d:"M248,124a56.11,56.11,0,0,0-32-50.61V72a48,48,0,0,0-88-26.49A48,48,0,0,0,40,72v1.39a56,56,0,0,0,0,101.2V176a48,48,0,0,0,88,26.49A48,48,0,0,0,216,176v-1.41A56.09,56.09,0,0,0,248,124ZM88,208a32,32,0,0,1-31.81-28.56A55.87,55.87,0,0,0,64,180h8a8,8,0,0,0,0-16H64A40,40,0,0,1,50.67,86.27,8,8,0,0,0,56,78.73V72a32,32,0,0,1,64,0v68.26A47.8,47.8,0,0,0,88,128a8,8,0,0,0,0,16,32,32,0,0,1,0,64Zm104-44h-8a8,8,0,0,0,0,16h8a55.87,55.87,0,0,0,7.81-.56A32,32,0,1,1,168,144a8,8,0,0,0,0-16,47.8,47.8,0,0,0-32,12.26V72a32,32,0,0,1,64,0v6.73a8,8,0,0,0,5.33,7.54A40,40,0,0,1,192,164Zm16-52a8,8,0,0,1-8,8h-4a36,36,0,0,1-36-36V80a8,8,0,0,1,16,0v4a20,20,0,0,0,20,20h4A8,8,0,0,1,208,112ZM60,120H56a8,8,0,0,1,0-16h4A20,20,0,0,0,80,84V80a8,8,0,0,1,16,0v4A36,36,0,0,1,60,120Z"}))],["fill",l.createElement(l.Fragment,null,l.createElement("path",{d:"M212,76V72a44,44,0,0,0-74.86-31.31,3.93,3.93,0,0,0-1.14,2.8v88.72a4,4,0,0,0,6.2,3.33A47.67,47.67,0,0,1,167.68,128a8.18,8.18,0,0,1,8.31,7.58,8,8,0,0,1-8,8.42,32,32,0,0,0-32,32v33.88a4,4,0,0,0,1.49,3.12,47.92,47.92,0,0,0,74.21-17.16,4,4,0,0,0-4.49-5.56A68.06,68.06,0,0,1,192,192h-7.73a8.18,8.18,0,0,1-8.25-7.47,8,8,0,0,1,8-8.53h8a51.6,51.6,0,0,0,24-5.88v0A52,52,0,0,0,212,76Zm-12,36h-4a36,36,0,0,1-36-36V72a8,8,0,0,1,16,0v4a20,20,0,0,0,20,20h4a8,8,0,0,1,0,16ZM88,28A44.05,44.05,0,0,0,44,72v4a52,52,0,0,0-4,94.12h0A51.6,51.6,0,0,0,64,176h7.73A8.18,8.18,0,0,1,80,183.47,8,8,0,0,1,72,192H64a67.48,67.48,0,0,1-15.21-1.73,4,4,0,0,0-4.5,5.55A47.93,47.93,0,0,0,118.51,213a4,4,0,0,0,1.49-3.12V176a32,32,0,0,0-32-32,8,8,0,0,1-8-8.42A8.18,8.18,0,0,1,88.32,128a47.67,47.67,0,0,1,25.48,7.54,4,4,0,0,0,6.2-3.33V43.49a4,4,0,0,0-1.14-2.81A43.85,43.85,0,0,0,88,28Zm8,48a36,36,0,0,1-36,36H56a8,8,0,0,1,0-16h4A20,20,0,0,0,80,76V72a8,8,0,0,1,16,0Z"}))],["light",l.createElement(l.Fragment,null,l.createElement("path",{d:"M246,124a54.13,54.13,0,0,0-32-49.33V72a46,46,0,0,0-86-22.67A46,46,0,0,0,42,72v2.67a54,54,0,0,0,0,98.63V176a46,46,0,0,0,86,22.67A46,46,0,0,0,214,176v-2.7A54.07,54.07,0,0,0,246,124ZM88,210a34,34,0,0,1-34-32.94A53.67,53.67,0,0,0,64,178h8a6,6,0,0,0,0-12H64A42,42,0,0,1,50,84.39a6,6,0,0,0,4-5.66V72a34,34,0,0,1,68,0v73.05A45.89,45.89,0,0,0,88,130a6,6,0,0,0,0,12,34,34,0,0,1,0,68Zm104-44h-8a6,6,0,0,0,0,12h8a53.67,53.67,0,0,0,10-.94A34,34,0,1,1,168,142a6,6,0,0,0,0-12,45.89,45.89,0,0,0-34,15.05V72a34,34,0,0,1,68,0v6.73a6,6,0,0,0,4,5.66A42,42,0,0,1,192,166Zm14-54a6,6,0,0,1-6,6h-4a34,34,0,0,1-34-34V80a6,6,0,0,1,12,0v4a22,22,0,0,0,22,22h4A6,6,0,0,1,206,112ZM60,118H56a6,6,0,0,1,0-12h4A22,22,0,0,0,82,84V80a6,6,0,0,1,12,0v4A34,34,0,0,1,60,118Z"}))],["regular",l.createElement(l.Fragment,null,l.createElement("path",{d:"M248,124a56.11,56.11,0,0,0-32-50.61V72a48,48,0,0,0-88-26.49A48,48,0,0,0,40,72v1.39a56,56,0,0,0,0,101.2V176a48,48,0,0,0,88,26.49A48,48,0,0,0,216,176v-1.41A56.09,56.09,0,0,0,248,124ZM88,208a32,32,0,0,1-31.81-28.56A55.87,55.87,0,0,0,64,180h8a8,8,0,0,0,0-16H64A40,40,0,0,1,50.67,86.27,8,8,0,0,0,56,78.73V72a32,32,0,0,1,64,0v68.26A47.8,47.8,0,0,0,88,128a8,8,0,0,0,0,16,32,32,0,0,1,0,64Zm104-44h-8a8,8,0,0,0,0,16h8a55.87,55.87,0,0,0,7.81-.56A32,32,0,1,1,168,144a8,8,0,0,0,0-16,47.8,47.8,0,0,0-32,12.26V72a32,32,0,0,1,64,0v6.73a8,8,0,0,0,5.33,7.54A40,40,0,0,1,192,164Zm16-52a8,8,0,0,1-8,8h-4a36,36,0,0,1-36-36V80a8,8,0,0,1,16,0v4a20,20,0,0,0,20,20h4A8,8,0,0,1,208,112ZM60,120H56a8,8,0,0,1,0-16h4A20,20,0,0,0,80,84V80a8,8,0,0,1,16,0v4A36,36,0,0,1,60,120Z"}))],["thin",l.createElement(l.Fragment,null,l.createElement("path",{d:"M244,124a52.1,52.1,0,0,0-32-48V72a44,44,0,0,0-84-18.3A44,44,0,0,0,44,72v4a52,52,0,0,0,0,96v4a44,44,0,0,0,84,18.3A44,44,0,0,0,212,176v-4A52.07,52.07,0,0,0,244,124ZM88,212a36,36,0,0,1-36-36v-1.41A52.13,52.13,0,0,0,64,176h8a4,4,0,0,0,0-8H64A44,44,0,0,1,49.33,82.5,4,4,0,0,0,52,78.73V72a36,36,0,0,1,72,0v78.75A44,44,0,0,0,88,132a4,4,0,0,0,0,8,36,36,0,0,1,0,72Zm104-44h-8a4,4,0,0,0,0,8h8a52.13,52.13,0,0,0,12-1.41V176a36,36,0,1,1-36-36,4,4,0,0,0,0-8,44,44,0,0,0-36,18.75V72a36,36,0,0,1,72,0v6.73a4,4,0,0,0,2.67,3.77A44,44,0,0,1,192,168Zm12-56a4,4,0,0,1-4,4h-4a32,32,0,0,1-32-32V80a4,4,0,0,1,8,0v4a24,24,0,0,0,24,24h4A4,4,0,0,1,204,112ZM92,84a32,32,0,0,1-32,32H56a4,4,0,0,1,0-8h4A24,24,0,0,0,84,84V80a4,4,0,0,1,8,0Z"}))]]);var o=Object.defineProperty,s=Object.defineProperties,i=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,p=(e,a,t)=>a in e?o(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,m=(e,a)=>{for(var t in a||(a={}))d.call(a,t)&&p(e,t,a[t]);if(c)for(var t of c(a))u.call(a,t)&&p(e,t,a[t]);return e},h=(e,a)=>s(e,i(a));let f=(0,l.forwardRef)((e,a)=>l.createElement(n.Z,h(m({ref:a},e),{weights:r})));f.displayName="Brain"},78527:function(e,a,t){"use strict";t.d(a,{B:function(){return f}});var l=t(2265),n=t(49656);let r=new Map([["bold",l.createElement(l.Fragment,null,l.createElement("path",{d:"M219.71,117.38a12,12,0,0,0-7.25-8.52L161.28,88.39l10.59-70.61a12,12,0,0,0-20.64-10l-112,120a12,12,0,0,0,4.31,19.33l51.18,20.47L84.13,238.22a12,12,0,0,0,20.64,10l112-120A12,12,0,0,0,219.71,117.38ZM113.6,203.55l6.27-41.77a12,12,0,0,0-7.41-12.92L68.74,131.37,142.4,52.45l-6.27,41.77a12,12,0,0,0,7.41,12.92l43.72,17.49Z"}))],["duotone",l.createElement(l.Fragment,null,l.createElement("path",{d:"M96,240l16-80L48,136,160,16,144,96l64,24Z",opacity:"0.2"}),l.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["fill",l.createElement(l.Fragment,null,l.createElement("path",{d:"M213.85,125.46l-112,120a8,8,0,0,1-13.69-7l14.66-73.33L45.19,143.49a8,8,0,0,1-3-13l112-120a8,8,0,0,1,13.69,7L153.18,90.9l57.63,21.61a8,8,0,0,1,3,12.95Z"}))],["light",l.createElement(l.Fragment,null,l.createElement("path",{d:"M213.84,118.63a6,6,0,0,0-3.73-4.25L150.88,92.17l15-75a6,6,0,0,0-10.27-5.27l-112,120a6,6,0,0,0,2.28,9.71l59.23,22.21-15,75a6,6,0,0,0,3.14,6.52A6.07,6.07,0,0,0,96,246a6,6,0,0,0,4.39-1.91l112-120A6,6,0,0,0,213.84,118.63ZM106,220.46l11.85-59.28a6,6,0,0,0-3.77-6.8l-55.6-20.85,91.46-98L138.12,94.82a6,6,0,0,0,3.77,6.8l55.6,20.85Z"}))],["regular",l.createElement(l.Fragment,null,l.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["thin",l.createElement(l.Fragment,null,l.createElement("path",{d:"M211.89,119.09a4,4,0,0,0-2.49-2.84l-60.81-22.8,15.33-76.67a4,4,0,0,0-6.84-3.51l-112,120a4,4,0,0,0-1,3.64,4,4,0,0,0,2.49,2.84l60.81,22.8L92.08,239.22a4,4,0,0,0,6.84,3.51l112-120A4,4,0,0,0,211.89,119.09ZM102.68,227l13.24-66.2a4,4,0,0,0-2.52-4.53L55,134.36,153.32,29l-13.24,66.2a4,4,0,0,0,2.52,4.53L201,121.64Z"}))]]);var o=Object.defineProperty,s=Object.defineProperties,i=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,p=(e,a,t)=>a in e?o(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,m=(e,a)=>{for(var t in a||(a={}))d.call(a,t)&&p(e,t,a[t]);if(c)for(var t of c(a))u.call(a,t)&&p(e,t,a[t]);return e},h=(e,a)=>s(e,i(a));let f=(0,l.forwardRef)((e,a)=>l.createElement(n.Z,h(m({ref:a},e),{weights:r})));f.displayName="Lightning"},60610:function(e,a,t){"use strict";t.d(a,{fC:function(){return A},z$:function(){return j}});var l=t(2265),n=t(73966),r=t(66840),o=t(57437),s="Progress",[i,c]=(0,n.b)(s),[d,u]=i(s),p=l.forwardRef((e,a)=>{var t,l,n,s;let{__scopeProgress:i,value:c=null,max:u,getValueLabel:p=f,...m}=e;(u||0===u)&&!x(u)&&console.error((t="".concat(u),l="Progress","Invalid prop `max` of value `".concat(t,"` supplied to `").concat(l,"`. Only numbers greater than 0 are valid max values. Defaulting to `").concat(100,"`.")));let h=x(u)?u:100;null===c||b(c,h)||console.error((n="".concat(c),s="Progress","Invalid prop `value` of value `".concat(n,"` supplied to `").concat(s,"`. The `value` prop must be:\n - a positive number\n - less than the value passed to `max` (or ").concat(100," if no `max` prop is set)\n - `null` or `undefined` if the progress is indeterminate.\n\nDefaulting to `null`.")));let A=b(c,h)?c:null,j=g(A)?p(A,h):void 0;return(0,o.jsx)(d,{scope:i,value:A,max:h,children:(0,o.jsx)(r.WV.div,{"aria-valuemax":h,"aria-valuemin":0,"aria-valuenow":g(A)?A:void 0,"aria-valuetext":j,role:"progressbar","data-state":v(A,h),"data-value":null!=A?A:void 0,"data-max":h,...m,ref:a})})});p.displayName=s;var m="ProgressIndicator",h=l.forwardRef((e,a)=>{var t;let{__scopeProgress:l,...n}=e,s=u(m,l);return(0,o.jsx)(r.WV.div,{"data-state":v(s.value,s.max),"data-value":null!==(t=s.value)&&void 0!==t?t:void 0,"data-max":s.max,...n,ref:a})});function f(e,a){return"".concat(Math.round(e/a*100),"%")}function v(e,a){return null==e?"indeterminate":e===a?"complete":"loading"}function g(e){return"number"==typeof e}function x(e){return g(e)&&!isNaN(e)&&e>0}function b(e,a){return g(e)&&!isNaN(e)&&e<=a&&e>=0}h.displayName=m;var A=p,j=h}},function(e){e.O(0,[1607,3861,9259,8667,4363,4447,6663,7647,2327,5427,2971,2117,1744],function(){return e(e.s=1813)}),_N_E=e.O()}]);
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9718],{1813:function(e,a,t){Promise.resolve().then(t.bind(t,37335))},37335:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return w}});var l=t(57437),n=t(14675),r=t.n(n),o=t(63861),s=t(2265),i=t(56937),c=t(89203),d=t(78527),u=t(26110),p=t(33494),m=t(14308),h=t(65613),f=t(7436),v=t(25427),g=t(29501),x=t(13590),b=t(60729),A=t(34124),j=t(6512),y=t(37104),O=t(49027),_=t(27648);let Z=()=>window.fetch("/api/agents").then(e=>e.json()).catch(e=>console.log(e)),M=e=>fetch(e).then(e=>e.json());function N(e){let[a,t]=(0,s.useState)(!1),[n,r]=(0,s.useState)(null),[o,i]=(0,s.useState)(!0),d=(0,g.cI)({resolver:(0,x.F)(v.bc),defaultValues:{name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.selectedChatModelOption,files:[]}});return(0,s.useEffect)(()=>{d.reset({name:e.data.name,persona:e.data.persona,color:e.data.color,icon:e.data.icon,privacy_level:e.data.privacy_level,chat_model:e.selectedChatModelOption,files:[]})},[e.selectedChatModelOption,e.data]),(0,l.jsxs)(u.Vq,{open:a,onOpenChange:t,children:[(0,l.jsx)(u.hg,{children:(0,l.jsxs)("div",{className:"flex items-center text-md gap-2",children:[(0,l.jsx)(c.v,{}),"Create Agent"]})}),(0,l.jsxs)(u.cZ,{className:"lg:max-w-screen-lg py-4 overflow-y-scroll h-full md:h-4/6 rounded-lg flex flex-col",children:[(0,l.jsx)(u.fK,{children:(0,l.jsx)(O.$N,{children:"Create Agent"})}),!e.userProfile&&o&&(0,l.jsx)(p.Z,{onOpenChange:i,isMobileWidth:e.isMobileWidth}),(0,l.jsx)(v.ks,{form:d,onSubmit:a=>{fetch("/api/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}).then(a=>{200===a.status?(d.reset(),t(!1),r(null),e.setAgentChangeTriggered(!0)):a.json().then(e=>{console.error(e),e.error&&r(e.error)})}).catch(e=>{console.error("Error:",e),r(e)})},create:!0,errors:n,filesOptions:e.filesOptions,modelOptions:e.modelOptions,inputToolOptions:e.inputToolOptions,outputModeOptions:e.outputModeOptions,isSubscribed:e.isSubscribed})]})]})}function w(){let{data:e,error:a,mutate:t}=(0,o.ZP)("agents",Z,{revalidateOnFocus:!1}),{data:n,error:c,isLoading:u}=(0,i.GW)(),{data:g}=(0,i.h2)(!0),[x,O]=(0,s.useState)(!1),w=(0,f.IC)(),[E,V]=(0,s.useState)([]),[L,P]=(0,s.useState)([]),[C,S]=(0,s.useState)(null),{data:F,error:H}=(0,o.ZP)(g?"/api/content/computer":null,M),{data:T,error:k}=(0,o.ZP)("/api/agents/options",M),[I,W]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{I&&(t(),W(!1))},[I]),(0,s.useEffect)(()=>{if(e){V(e.filter(e=>e.creator===(null==n?void 0:n.username)));let a=e.filter(e=>"private"!==e.privacy_level&&e.creator!==(null==n?void 0:n.username));P(a);{let t=new URLSearchParams(window.location.search).get("agent");if(t){S(t);let l=e.find(e=>e.slug===t);l||(l=a.find(e=>e.slug===t)),l||fetch("/api/agents/".concat(t)).then(e=>{if(404===e.status)throw Error("Agent not found");return e.json()}).then(e=>{"protected"===e.privacy_level&&P(a=>[...a,e])})}}}},[e,n]),a)return(0,l.jsxs)("main",{className:r().main,children:[(0,l.jsx)("div",{className:"".concat(r().titleBar," text-5xl"),children:"Agents"}),(0,l.jsx)("div",{className:r().agentList,children:"Error loading agents"})]});if(!e)return(0,l.jsx)("main",{className:r().main,children:(0,l.jsxs)("div",{className:r().agentList,children:[(0,l.jsx)(m.l,{})," booting up your agents"]})});let B=(null==g?void 0:g.chat_model_options)||[],R=(null==g?void 0:g.selected_chat_model_config)||0,Y=(null==g?void 0:g.is_active)||!1,z=B.find(e=>e.id===R);return(0,l.jsxs)(b.Hn,{children:[(0,l.jsx)(A.S,{conversationId:""}),(0,l.jsxs)(b.kV,{children:[(0,l.jsxs)("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b px-4",children:[(0,l.jsx)(b.vP,{className:"-ml-1"}),(0,l.jsx)(j.Z,{orientation:"vertical",className:"mr-2 h-4"}),w?(0,l.jsx)("a",{className:"p-0 no-underline",href:"/",children:(0,l.jsx)(y.VO,{className:"h-auto w-16"})}):(0,l.jsx)("h2",{className:"text-lg",children:"Agents"})]}),(0,l.jsx)("main",{className:"w-full mx-auto",children:(0,l.jsx)("div",{className:"grid w-full mx-auto",children:(0,l.jsxs)("div",{className:"".concat(r().pageLayout," w-full"),children:[(0,l.jsxs)("div",{className:"pt-6 md:pt-8 flex justify-between",children:[(0,l.jsx)("h1",{className:"text-3xl flex items-center",children:"Agents"}),(0,l.jsx)("div",{className:"ml-auto float-right border p-2 pt-3 rounded-xl font-bold hover:bg-stone-100 dark:hover:bg-neutral-900",children:(0,l.jsx)(N,{data:{slug:"",name:"",persona:"",color:"",icon:"",privacy_level:"private",managed_by_admin:!1,chat_model:"",input_tools:[],output_modes:[],is_hidden:!1},userProfile:u?null:null!=n?n:null,isMobileWidth:w,filesOptions:F||[],modelOptions:(null==g?void 0:g.chat_model_options)||[],selectedChatModelOption:(null==z?void 0:z.name)||"",isSubscribed:Y,setAgentChangeTriggered:W,inputToolOptions:(null==T?void 0:T.input_tools)||{},outputModeOptions:(null==T?void 0:T.output_modes)||{}})})]}),x&&(0,l.jsx)(p.Z,{onOpenChange:O,isMobileWidth:w}),(0,l.jsx)(h.bZ,{className:"bg-secondary border-none my-4",children:(0,l.jsxs)(h.X,{children:[(0,l.jsx)(d.B,{weight:"fill",className:"h-4 w-4 text-purple-400 inline"}),(0,l.jsx)("span",{className:"font-bold",children:"How it works"})," Use any of these specialized personas to tune your conversation to your needs.",!Y&&(0,l.jsxs)("span",{children:[" ",(0,l.jsx)(_.default,{href:"/settings",className:"font-bold",children:"Upgrade your plan"})," to leverage custom models. You will fallback to the default model when chatting."]})]})}),(0,l.jsx)("div",{className:"pt-6 md:pt-8",children:(0,l.jsx)("div",{className:"".concat(r().agentList),children:n&&E.map(e=>(0,l.jsx)(v.EY,{data:e,userProfile:n,isMobileWidth:w,filesOptions:null!=F?F:[],selectedChatModelOption:(null==z?void 0:z.name)||"",isSubscribed:Y,setAgentChangeTriggered:W,modelOptions:(null==g?void 0:g.chat_model_options)||[],editCard:!0,agentSlug:C||"",inputToolOptions:(null==T?void 0:T.input_tools)||{},outputModeOptions:(null==T?void 0:T.output_modes)||{}},e.slug))})}),(0,l.jsxs)("div",{className:"pt-6 md:pt-8",children:[(0,l.jsx)("h2",{className:"text-2xl",children:"Explore"}),(0,l.jsx)("div",{className:"".concat(r().agentList),children:!u&&L.map(e=>(0,l.jsx)(v.EY,{data:e,userProfile:n||null,isMobileWidth:w,editCard:!1,filesOptions:null!=F?F:[],selectedChatModelOption:(null==z?void 0:z.name)||"",isSubscribed:Y,setAgentChangeTriggered:W,modelOptions:(null==g?void 0:g.chat_model_options)||[],agentSlug:C||"",inputToolOptions:(null==T?void 0:T.input_tools)||{},outputModeOptions:(null==T?void 0:T.output_modes)||{}},e.slug))})]})]})})})]})]})}},32759:function(e,a,t){"use strict";t.d(a,{E:function(){return s}});var l=t(57437),n=t(2265),r=t(60610),o=t(94508);let s=n.forwardRef((e,a)=>{let{className:t,value:n,indicatorColor:s,...i}=e;return(0,l.jsx)(r.fC,{ref:a,className:(0,o.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...i,children:(0,l.jsx)(r.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(s),style:{transform:"translateX(-".concat(100-(n||0),"%)")}})})});s.displayName=r.fC.displayName},76818:function(e,a,t){"use strict";t.d(a,{g:function(){return o}});var l=t(57437),n=t(2265),r=t(94508);let o=n.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,l.jsx)("textarea",{className:(0,r.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),ref:a,...n})});o.displayName="Textarea"},14675:function(e){e.exports={titleBar:"agents_titleBar__FzYbY",agentPersonality:"agents_agentPersonality__o0Ysz",pageLayout:"agents_pageLayout__gR3S3",infoButton:"agents_infoButton__NqI7E",agentList:"agents_agentList__XVx4A"}},2452:function(e,a,t){"use strict";t.d(a,{a:function(){return f}});var l=t(2265),n=t(49656);let r=new Map([["bold",l.createElement(l.Fragment,null,l.createElement("path",{d:"M252,124a60.14,60.14,0,0,0-32-53.08,52,52,0,0,0-92-32.11A52,52,0,0,0,36,70.92a60,60,0,0,0,0,106.14,52,52,0,0,0,92,32.13,52,52,0,0,0,92-32.13A60.05,60.05,0,0,0,252,124ZM88,204a28,28,0,0,1-26.85-20.07c1,0,1.89.07,2.85.07h8a12,12,0,0,0,0-24H64A36,36,0,0,1,52,90.05a12,12,0,0,0,8-11.32V72a28,28,0,0,1,56,0v60.18a51.61,51.61,0,0,0-7.2-3.85,12,12,0,1,0-9.6,22A28,28,0,0,1,88,204Zm104-44h-8a12,12,0,0,0,0,24h8c1,0,1.9,0,2.85-.07a28,28,0,1,1-38-33.61,12,12,0,1,0-9.6-22,51.61,51.61,0,0,0-7.2,3.85V72a28,28,0,0,1,56,0v6.73a12,12,0,0,0,8,11.32,36,36,0,0,1-12,70Zm16-44a12,12,0,0,1-12,12,40,40,0,0,1-40-40V84a12,12,0,0,1,24,0v4a16,16,0,0,0,16,16A12,12,0,0,1,208,116ZM100,88a40,40,0,0,1-40,40,12,12,0,0,1,0-24A16,16,0,0,0,76,88V84a12,12,0,0,1,24,0Z"}))],["duotone",l.createElement(l.Fragment,null,l.createElement("path",{d:"M240,124a48,48,0,0,1-32,45.27h0V176a40,40,0,0,1-80,0,40,40,0,0,1-80,0v-6.73h0a48,48,0,0,1,0-90.54V72a40,40,0,0,1,80,0,40,40,0,0,1,80,0v6.73A48,48,0,0,1,240,124Z",opacity:"0.2"}),l.createElement("path",{d:"M248,124a56.11,56.11,0,0,0-32-50.61V72a48,48,0,0,0-88-26.49A48,48,0,0,0,40,72v1.39a56,56,0,0,0,0,101.2V176a48,48,0,0,0,88,26.49A48,48,0,0,0,216,176v-1.41A56.09,56.09,0,0,0,248,124ZM88,208a32,32,0,0,1-31.81-28.56A55.87,55.87,0,0,0,64,180h8a8,8,0,0,0,0-16H64A40,40,0,0,1,50.67,86.27,8,8,0,0,0,56,78.73V72a32,32,0,0,1,64,0v68.26A47.8,47.8,0,0,0,88,128a8,8,0,0,0,0,16,32,32,0,0,1,0,64Zm104-44h-8a8,8,0,0,0,0,16h8a55.87,55.87,0,0,0,7.81-.56A32,32,0,1,1,168,144a8,8,0,0,0,0-16,47.8,47.8,0,0,0-32,12.26V72a32,32,0,0,1,64,0v6.73a8,8,0,0,0,5.33,7.54A40,40,0,0,1,192,164Zm16-52a8,8,0,0,1-8,8h-4a36,36,0,0,1-36-36V80a8,8,0,0,1,16,0v4a20,20,0,0,0,20,20h4A8,8,0,0,1,208,112ZM60,120H56a8,8,0,0,1,0-16h4A20,20,0,0,0,80,84V80a8,8,0,0,1,16,0v4A36,36,0,0,1,60,120Z"}))],["fill",l.createElement(l.Fragment,null,l.createElement("path",{d:"M212,76V72a44,44,0,0,0-74.86-31.31,3.93,3.93,0,0,0-1.14,2.8v88.72a4,4,0,0,0,6.2,3.33A47.67,47.67,0,0,1,167.68,128a8.18,8.18,0,0,1,8.31,7.58,8,8,0,0,1-8,8.42,32,32,0,0,0-32,32v33.88a4,4,0,0,0,1.49,3.12,47.92,47.92,0,0,0,74.21-17.16,4,4,0,0,0-4.49-5.56A68.06,68.06,0,0,1,192,192h-7.73a8.18,8.18,0,0,1-8.25-7.47,8,8,0,0,1,8-8.53h8a51.6,51.6,0,0,0,24-5.88v0A52,52,0,0,0,212,76Zm-12,36h-4a36,36,0,0,1-36-36V72a8,8,0,0,1,16,0v4a20,20,0,0,0,20,20h4a8,8,0,0,1,0,16ZM88,28A44.05,44.05,0,0,0,44,72v4a52,52,0,0,0-4,94.12h0A51.6,51.6,0,0,0,64,176h7.73A8.18,8.18,0,0,1,80,183.47,8,8,0,0,1,72,192H64a67.48,67.48,0,0,1-15.21-1.73,4,4,0,0,0-4.5,5.55A47.93,47.93,0,0,0,118.51,213a4,4,0,0,0,1.49-3.12V176a32,32,0,0,0-32-32,8,8,0,0,1-8-8.42A8.18,8.18,0,0,1,88.32,128a47.67,47.67,0,0,1,25.48,7.54,4,4,0,0,0,6.2-3.33V43.49a4,4,0,0,0-1.14-2.81A43.85,43.85,0,0,0,88,28Zm8,48a36,36,0,0,1-36,36H56a8,8,0,0,1,0-16h4A20,20,0,0,0,80,76V72a8,8,0,0,1,16,0Z"}))],["light",l.createElement(l.Fragment,null,l.createElement("path",{d:"M246,124a54.13,54.13,0,0,0-32-49.33V72a46,46,0,0,0-86-22.67A46,46,0,0,0,42,72v2.67a54,54,0,0,0,0,98.63V176a46,46,0,0,0,86,22.67A46,46,0,0,0,214,176v-2.7A54.07,54.07,0,0,0,246,124ZM88,210a34,34,0,0,1-34-32.94A53.67,53.67,0,0,0,64,178h8a6,6,0,0,0,0-12H64A42,42,0,0,1,50,84.39a6,6,0,0,0,4-5.66V72a34,34,0,0,1,68,0v73.05A45.89,45.89,0,0,0,88,130a6,6,0,0,0,0,12,34,34,0,0,1,0,68Zm104-44h-8a6,6,0,0,0,0,12h8a53.67,53.67,0,0,0,10-.94A34,34,0,1,1,168,142a6,6,0,0,0,0-12,45.89,45.89,0,0,0-34,15.05V72a34,34,0,0,1,68,0v6.73a6,6,0,0,0,4,5.66A42,42,0,0,1,192,166Zm14-54a6,6,0,0,1-6,6h-4a34,34,0,0,1-34-34V80a6,6,0,0,1,12,0v4a22,22,0,0,0,22,22h4A6,6,0,0,1,206,112ZM60,118H56a6,6,0,0,1,0-12h4A22,22,0,0,0,82,84V80a6,6,0,0,1,12,0v4A34,34,0,0,1,60,118Z"}))],["regular",l.createElement(l.Fragment,null,l.createElement("path",{d:"M248,124a56.11,56.11,0,0,0-32-50.61V72a48,48,0,0,0-88-26.49A48,48,0,0,0,40,72v1.39a56,56,0,0,0,0,101.2V176a48,48,0,0,0,88,26.49A48,48,0,0,0,216,176v-1.41A56.09,56.09,0,0,0,248,124ZM88,208a32,32,0,0,1-31.81-28.56A55.87,55.87,0,0,0,64,180h8a8,8,0,0,0,0-16H64A40,40,0,0,1,50.67,86.27,8,8,0,0,0,56,78.73V72a32,32,0,0,1,64,0v68.26A47.8,47.8,0,0,0,88,128a8,8,0,0,0,0,16,32,32,0,0,1,0,64Zm104-44h-8a8,8,0,0,0,0,16h8a55.87,55.87,0,0,0,7.81-.56A32,32,0,1,1,168,144a8,8,0,0,0,0-16,47.8,47.8,0,0,0-32,12.26V72a32,32,0,0,1,64,0v6.73a8,8,0,0,0,5.33,7.54A40,40,0,0,1,192,164Zm16-52a8,8,0,0,1-8,8h-4a36,36,0,0,1-36-36V80a8,8,0,0,1,16,0v4a20,20,0,0,0,20,20h4A8,8,0,0,1,208,112ZM60,120H56a8,8,0,0,1,0-16h4A20,20,0,0,0,80,84V80a8,8,0,0,1,16,0v4A36,36,0,0,1,60,120Z"}))],["thin",l.createElement(l.Fragment,null,l.createElement("path",{d:"M244,124a52.1,52.1,0,0,0-32-48V72a44,44,0,0,0-84-18.3A44,44,0,0,0,44,72v4a52,52,0,0,0,0,96v4a44,44,0,0,0,84,18.3A44,44,0,0,0,212,176v-4A52.07,52.07,0,0,0,244,124ZM88,212a36,36,0,0,1-36-36v-1.41A52.13,52.13,0,0,0,64,176h8a4,4,0,0,0,0-8H64A44,44,0,0,1,49.33,82.5,4,4,0,0,0,52,78.73V72a36,36,0,0,1,72,0v78.75A44,44,0,0,0,88,132a4,4,0,0,0,0,8,36,36,0,0,1,0,72Zm104-44h-8a4,4,0,0,0,0,8h8a52.13,52.13,0,0,0,12-1.41V176a36,36,0,1,1-36-36,4,4,0,0,0,0-8,44,44,0,0,0-36,18.75V72a36,36,0,0,1,72,0v6.73a4,4,0,0,0,2.67,3.77A44,44,0,0,1,192,168Zm12-56a4,4,0,0,1-4,4h-4a32,32,0,0,1-32-32V80a4,4,0,0,1,8,0v4a24,24,0,0,0,24,24h4A4,4,0,0,1,204,112ZM92,84a32,32,0,0,1-32,32H56a4,4,0,0,1,0-8h4A24,24,0,0,0,84,84V80a4,4,0,0,1,8,0Z"}))]]);var o=Object.defineProperty,s=Object.defineProperties,i=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,p=(e,a,t)=>a in e?o(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,m=(e,a)=>{for(var t in a||(a={}))d.call(a,t)&&p(e,t,a[t]);if(c)for(var t of c(a))u.call(a,t)&&p(e,t,a[t]);return e},h=(e,a)=>s(e,i(a));let f=(0,l.forwardRef)((e,a)=>l.createElement(n.Z,h(m({ref:a},e),{weights:r})));f.displayName="Brain"},78527:function(e,a,t){"use strict";t.d(a,{B:function(){return f}});var l=t(2265),n=t(49656);let r=new Map([["bold",l.createElement(l.Fragment,null,l.createElement("path",{d:"M219.71,117.38a12,12,0,0,0-7.25-8.52L161.28,88.39l10.59-70.61a12,12,0,0,0-20.64-10l-112,120a12,12,0,0,0,4.31,19.33l51.18,20.47L84.13,238.22a12,12,0,0,0,20.64,10l112-120A12,12,0,0,0,219.71,117.38ZM113.6,203.55l6.27-41.77a12,12,0,0,0-7.41-12.92L68.74,131.37,142.4,52.45l-6.27,41.77a12,12,0,0,0,7.41,12.92l43.72,17.49Z"}))],["duotone",l.createElement(l.Fragment,null,l.createElement("path",{d:"M96,240l16-80L48,136,160,16,144,96l64,24Z",opacity:"0.2"}),l.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["fill",l.createElement(l.Fragment,null,l.createElement("path",{d:"M213.85,125.46l-112,120a8,8,0,0,1-13.69-7l14.66-73.33L45.19,143.49a8,8,0,0,1-3-13l112-120a8,8,0,0,1,13.69,7L153.18,90.9l57.63,21.61a8,8,0,0,1,3,12.95Z"}))],["light",l.createElement(l.Fragment,null,l.createElement("path",{d:"M213.84,118.63a6,6,0,0,0-3.73-4.25L150.88,92.17l15-75a6,6,0,0,0-10.27-5.27l-112,120a6,6,0,0,0,2.28,9.71l59.23,22.21-15,75a6,6,0,0,0,3.14,6.52A6.07,6.07,0,0,0,96,246a6,6,0,0,0,4.39-1.91l112-120A6,6,0,0,0,213.84,118.63ZM106,220.46l11.85-59.28a6,6,0,0,0-3.77-6.8l-55.6-20.85,91.46-98L138.12,94.82a6,6,0,0,0,3.77,6.8l55.6,20.85Z"}))],["regular",l.createElement(l.Fragment,null,l.createElement("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.43a8,8,0,0,0,5,9.06l52.8,19.8Z"}))],["thin",l.createElement(l.Fragment,null,l.createElement("path",{d:"M211.89,119.09a4,4,0,0,0-2.49-2.84l-60.81-22.8,15.33-76.67a4,4,0,0,0-6.84-3.51l-112,120a4,4,0,0,0-1,3.64,4,4,0,0,0,2.49,2.84l60.81,22.8L92.08,239.22a4,4,0,0,0,6.84,3.51l112-120A4,4,0,0,0,211.89,119.09ZM102.68,227l13.24-66.2a4,4,0,0,0-2.52-4.53L55,134.36,153.32,29l-13.24,66.2a4,4,0,0,0,2.52,4.53L201,121.64Z"}))]]);var o=Object.defineProperty,s=Object.defineProperties,i=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,p=(e,a,t)=>a in e?o(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,m=(e,a)=>{for(var t in a||(a={}))d.call(a,t)&&p(e,t,a[t]);if(c)for(var t of c(a))u.call(a,t)&&p(e,t,a[t]);return e},h=(e,a)=>s(e,i(a));let f=(0,l.forwardRef)((e,a)=>l.createElement(n.Z,h(m({ref:a},e),{weights:r})));f.displayName="Lightning"},60610:function(e,a,t){"use strict";t.d(a,{fC:function(){return A},z$:function(){return j}});var l=t(2265),n=t(73966),r=t(66840),o=t(57437),s="Progress",[i,c]=(0,n.b)(s),[d,u]=i(s),p=l.forwardRef((e,a)=>{var t,l,n,s;let{__scopeProgress:i,value:c=null,max:u,getValueLabel:p=f,...m}=e;(u||0===u)&&!x(u)&&console.error((t="".concat(u),l="Progress","Invalid prop `max` of value `".concat(t,"` supplied to `").concat(l,"`. Only numbers greater than 0 are valid max values. Defaulting to `").concat(100,"`.")));let h=x(u)?u:100;null===c||b(c,h)||console.error((n="".concat(c),s="Progress","Invalid prop `value` of value `".concat(n,"` supplied to `").concat(s,"`. The `value` prop must be:\n - a positive number\n - less than the value passed to `max` (or ").concat(100," if no `max` prop is set)\n - `null` or `undefined` if the progress is indeterminate.\n\nDefaulting to `null`.")));let A=b(c,h)?c:null,j=g(A)?p(A,h):void 0;return(0,o.jsx)(d,{scope:i,value:A,max:h,children:(0,o.jsx)(r.WV.div,{"aria-valuemax":h,"aria-valuemin":0,"aria-valuenow":g(A)?A:void 0,"aria-valuetext":j,role:"progressbar","data-state":v(A,h),"data-value":null!=A?A:void 0,"data-max":h,...m,ref:a})})});p.displayName=s;var m="ProgressIndicator",h=l.forwardRef((e,a)=>{var t;let{__scopeProgress:l,...n}=e,s=u(m,l);return(0,o.jsx)(r.WV.div,{"data-state":v(s.value,s.max),"data-value":null!==(t=s.value)&&void 0!==t?t:void 0,"data-max":s.max,...n,ref:a})});function f(e,a){return"".concat(Math.round(e/a*100),"%")}function v(e,a){return null==e?"indeterminate":e===a?"complete":"loading"}function g(e){return"number"==typeof e}function x(e){return g(e)&&!isNaN(e)&&e>0}function b(e,a){return g(e)&&!isNaN(e)&&e<=a&&e>=0}h.displayName=m;var A=p,j=h}},function(e){e.O(0,[2663,3861,9259,8667,4363,4447,6663,7647,2327,5427,2971,2117,1744],function(){return e(e.s=1813)}),_N_E=e.O()}]);
|