khoj 1.32.2.dev5__py3-none-any.whl → 1.32.3.dev2__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/database/models/__init__.py +1 -1
- khoj/interface/compiled/404/index.html +1 -1
- khoj/interface/compiled/_next/static/chunks/app/agents/layout-e49165209d2e406c.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/agents/{page-29a611a7bca38ef0.js → page-6f4ff1d32a66ed71.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/automations/{page-2b496761af80385b.js → page-148a48ddfb2ff90d.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/chat/layout-33934fc2d6ae6838.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/chat/{page-3cedff562384e2f9.js → page-be00870a40de3a25.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/{page-661bf7802aee26f7.js → page-e6218465240341ba.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/search/layout-c02531d586972d7d.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/search/{page-1cf8693a1355dd08.js → page-7af2cab294dccd81.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/settings/{page-1ff525b09e4677fb.js → page-6b600bf11fa89194.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-ece87a4fa7dfdc16.js → page-6054e88b56708f44.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/{webpack-031fd7ef41706d41.js → webpack-afd772b9f7c34b3f.js} +1 -1
- khoj/interface/compiled/_next/static/css/3cf13271869a4aeb.css +1 -0
- khoj/interface/compiled/_next/static/css/8a00c3799ec0c9f8.css +1 -0
- khoj/interface/compiled/_next/static/css/9504108437df6804.css +1 -0
- khoj/interface/compiled/agents/index.html +1 -1
- khoj/interface/compiled/agents/index.txt +2 -2
- khoj/interface/compiled/automations/index.html +1 -1
- khoj/interface/compiled/automations/index.txt +2 -2
- khoj/interface/compiled/chat/index.html +1 -1
- khoj/interface/compiled/chat/index.txt +2 -2
- khoj/interface/compiled/index.html +1 -1
- khoj/interface/compiled/index.txt +2 -2
- khoj/interface/compiled/search/index.html +1 -1
- khoj/interface/compiled/search/index.txt +2 -2
- khoj/interface/compiled/settings/index.html +1 -1
- khoj/interface/compiled/settings/index.txt +2 -2
- khoj/interface/compiled/share/chat/index.html +1 -1
- khoj/interface/compiled/share/chat/index.txt +2 -2
- khoj/processor/conversation/google/utils.py +0 -1
- khoj/processor/conversation/offline/chat_model.py +0 -1
- khoj/processor/conversation/prompts.py +32 -28
- khoj/routers/auth.py +5 -0
- {khoj-1.32.2.dev5.dist-info → khoj-1.32.3.dev2.dist-info}/METADATA +1 -1
- {khoj-1.32.2.dev5.dist-info → khoj-1.32.3.dev2.dist-info}/RECORD +41 -41
- khoj/interface/compiled/_next/static/chunks/app/agents/layout-2e626327abfbe612.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/chat/layout-ad4d1792ab1a4108.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/search/layout-4505b79deb734a30.js +0 -1
- khoj/interface/compiled/_next/static/css/4d48a4eef3f0b657.css +0 -1
- khoj/interface/compiled/_next/static/css/80bd6301fc657983.css +0 -1
- khoj/interface/compiled/_next/static/css/c8837bdb7d5f13de.css +0 -1
- /khoj/interface/compiled/_next/static/{EdJrUgX27r5xCkYXFDNO8 → K1Ap3ZXsswXf41SqV7Esk}/_buildManifest.js +0 -0
- /khoj/interface/compiled/_next/static/{EdJrUgX27r5xCkYXFDNO8 → K1Ap3ZXsswXf41SqV7Esk}/_ssgManifest.js +0 -0
- {khoj-1.32.2.dev5.dist-info → khoj-1.32.3.dev2.dist-info}/WHEEL +0 -0
- {khoj-1.32.2.dev5.dist-info → khoj-1.32.3.dev2.dist-info}/entry_points.txt +0 -0
- {khoj-1.32.2.dev5.dist-info → khoj-1.32.3.dev2.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1931],{1507:function(e,t,i){Promise.resolve().then(i.bind(i,93866))},93866:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return J}});var n,a,o=i(57437);i(47960);var r=i(76777),s=i.n(r);i(2446);var l=i(2265),c=i(63861),d=i(49656);let p=new Map([["bold",l.createElement(l.Fragment,null,l.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",l.createElement(l.Fragment,null,l.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),l.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",l.createElement(l.Fragment,null,l.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",l.createElement(l.Fragment,null,l.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",l.createElement(l.Fragment,null,l.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",l.createElement(l.Fragment,null,l.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]);var u=Object.defineProperty,h=Object.defineProperties,g=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,k=(e,t,i)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,b=(e,t)=>{for(var i in t||(t={}))f.call(t,i)&&k(e,i,t[i]);if(m)for(var i of m(t))y.call(t,i)&&k(e,i,t[i]);return e},w=(e,t)=>h(e,g(t));let v=(0,l.forwardRef)((e,t)=>l.createElement(d.Z,w(b({ref:t},e),{weights:p})));v.displayName="ArrowCounterClockwise";var x=i(66070),L=i(64670),C=i.n(L),j=i(84671),P=i(42225);(n=a||(a={})).Automation="Automation",n.Paint="Paint",n.Travel="Travel",n.Health="Health",n.Learning="Learning",n.Math="Mathematics",n.Language="Language",n.PopCulture="Pop Culture",n.Food="Food",n.Interviewing="Interviewing",n.Home="Home",n.Fun="Fun",n.Code="Code",n.Finance="Finance";let S={};S.Automation="blue",S.Paint="indigo",S.Travel="yellow",S.Health="teal",S.Learning="purple",S.Language="blue",S["Pop Culture"]="red",S.Food="yellow",S.Interviewing="orange",S.Home="green",S.Fun="fuchsia",S.Code="purple",S.Finance="green",S.Mathematics="blue";let A="orange",E=[{type:"Automation",color:S.Automation||A,description:"Send me a summary of HackerNews every morning.",link:"/automations?subject=Summarizing%20Top%20Headlines%20from%20HackerNews&query=Summarize%20the%20top%20headlines%20on%20HackerNews&crontime=00%207%20*%20*%20*"},{type:"Automation",color:S.Automation||A,description:"Compose a bedtime story that a five-year-old might enjoy.",link:"/automations?subject=Daily%20Bedtime%20Story&query=Compose%20a%20bedtime%20story%20that%20a%20five-year-old%20might%20enjoy.%20It%20should%20not%20exceed%20five%20paragraphs.%20Appeal%20to%20the%20imagination%2C%20but%20weave%20in%20learnings.&crontime=0%2021%20*%20*%20*"},{type:"Paint",color:S.Paint||A,description:"Paint a picture of a sunset but it's made of stained glass tiles",link:""},{type:"Travel",color:S.Travel||A,description:"Search for the best attractions in Austria Hungary",link:""},{type:"Health",color:S.Health||A,description:"Generate a weekly meal plan with recipes.",link:"/automations?subject=Weekly Meal Plan&query=Create a weekly meal plan with 7 dinner recipes, including ingredients and brief instructions. Focus on balanced, healthy meals.&crontime=0 18 * * 0"},{type:"Paint",color:S.Paint||A,description:"Paint a futuristic cityscape with flying cars.",link:""},{type:"Travel",color:S.Travel||A,description:"Find the top-rated coffee shops in Seattle.",link:""},{type:"Automation",color:S.Automation||A,description:"Send daily motivational quotes.",link:"/automations?subject=Daily Motivation&query=Provide an inspiring quote for the day along with a brief explanation of its meaning.&crontime=0 7 * * *"},{type:"Paint",color:S.Paint||A,description:"Create an abstract representation of jazz music.",link:""},{type:"Learning",color:S.Learning||A,description:"Research the history of the Eiffel Tower.",link:""},{type:"Automation",color:S.Automation||A,description:"Compile a weekly news summary.",link:"/automations?subject=Weekly News Digest&query=Summarize the top 5 most important news stories of the week across various categories.&crontime=0 18 * * 5"},{type:"Paint",color:S.Paint||A,description:"Paint a portrait of a cat wearing a Victorian-era costume.",link:""},{type:"Travel",color:S.Travel||A,description:"Find beginner-friendly hiking trails near Los Angeles.",link:""},{type:"Automation",color:S.Automation||A,description:"Generate a daily writing prompt.",link:"/automations?subject=Daily Writing Prompt&query=Create an engaging writing prompt suitable for short story or journal writing.&crontime=0 9 * * *"},{type:"Paint",color:S.Paint||A,description:"Create a surrealist landscape inspired by Salvador Dali.",link:""},{type:"Learning",color:S.Learning||A,description:"Research the benefits and drawbacks of electric vehicles.",link:""},{type:"Automation",color:S.Automation||A,description:"Send weekly language learning tips for Spanish.",link:"/automations?subject=Spanish Learning Tips&query=Provide a useful Spanish language learning tip, including vocabulary, grammar, or cultural insight.&crontime=0 19 * * 2"},{type:"Paint",color:S.Paint||A,description:"Paint a scene from a fairy tale in the style of Studio Ghibli.",link:""},{type:"Pop Culture",color:"yellow",description:"Find the best-rated science fiction books of the last decade.",link:""},{type:"Paint",color:S.Paint||A,description:"Paint a still life of exotic fruits in a neon color palette.",link:""},{type:"Travel",color:S.Travel||A,description:"Research the most eco-friendly cities in Europe.",link:""},{type:"Automation",color:S.Automation||A,description:"Send daily reminders for habit tracking.",link:"/automations?subject=Habit Tracker&query=Generate a daily reminder to track habits, including a motivational message.&crontime=0 20 * * *"},{type:"Paint",color:S.Paint||A,description:"Create a digital painting of a cyberpunk street market.",link:""},{type:"Learning",color:S.Learning||A,description:"Summarize the biography of this figure: https://en.wikipedia.org/wiki/Jean_Baptiste_Point_du_Sable",link:""},{type:"Language",color:"blue",description:"Send daily Spanish phrases used in Latin America.",link:"/automations?subject=Daily Latin American Spanish&query=Provide a common Spanish phrase or slang term used in Latin America, its meaning, and an example of usage. Include which countries it's most common in.&crontime=0 8 * * *"},{type:"Paint",color:S.Paint||A,description:"Create a vibrant painting inspired by Frida Kahlo's style.",link:""},{type:"Food",color:S.Food||A,description:"Find the best empanada recipe from Colombia.",link:""},{type:"Automation",color:S.Automation||A,description:"Weekly update on the Brazilian startup ecosystems.",link:"/automations?subject=LatAm Startup News&query=Provide a summary of the most significant developments in Latin American startup ecosystems this week. Include notable funding rounds, expansions, or policy changes.&crontime=0 18 * * 5"},{type:"Paint",color:S.Paint||A,description:"Paint a colorful scene of a traditional Day of the Dead celebration in Mexico.",link:""},{type:"Language",color:S.Language||A,description:"Daily Swahili phrase with English translation.",link:"/automations?subject=Daily Swahili Lesson&query=Provide a common Swahili phrase or proverb, its English translation, and a brief explanation of its cultural significance in East Africa.&crontime=0 7 * * *"},{type:"Paint",color:S.Paint||A,description:"Create a digital painting of the Serengeti during wildebeest migration.",link:""},{type:"Learning",color:S.Learning||A,description:"Research the top M-Pesa alternatives in East Africa.",link:""},{type:"Automation",color:S.Automation||A,description:"Weekly update on East African tech startups and innovations.",link:"/automations?subject=East African Tech News&query=Summarize the most significant developments in East African tech startups and innovations this week. Include notable funding rounds, new product launches, or policy changes affecting the tech ecosystem.&crontime=0 18 * * 5"},{type:"Paint",color:S.Paint||A,description:"Paint a colorful scene inspired by Maasai traditional clothing and jewelry.",link:""},{type:"Automation",color:S.Automation||A,description:"Weekly summary of EU policy changes and their impact.",link:"/automations?subject=EU Policy Update&query=Summarize the most significant EU policy changes or proposals from this week. Explain their potential impact on European citizens and businesses.&crontime=0 17 * * 5"},{type:"Paint",color:S.Paint||A,description:"Paint a digital landscape of the Northern Lights over the Norwegian fjords.",link:""},{type:"Automation",color:S.Automation||A,description:"Daily East Asian proverb with explanation.",link:"/automations?subject=East Asian Wisdom&query=Provide a proverb from an East Asian language (rotating through Chinese, Japanese, Korean, etc.), its English translation, and a brief explanation of its cultural significance and practical application.&crontime=0 7 * * *"},{type:"Paint",color:S.Paint||A,description:"Create a digital painting in the style of traditional Chinese ink wash landscape.",link:""},{type:"Pop Culture",color:"yellow",description:"Research the latest trends in K-pop and its global influence.",link:""},{type:"Automation",color:S.Automation||A,description:"Weekly summary of technological innovations from East Asian tech giants.",link:"/automations?subject=East Asian Tech Update&query=Summarize the most significant technological innovations or product launches from major East Asian tech companies (e.g., Samsung, Sony, Alibaba, Tencent) this week. Explain their potential impact on global markets.&crontime=0 18 * * 5"},{type:"Paint",color:S.Paint||A,description:"Paint a vibrant scene of a Japanese cherry blossom festival.",link:""},{type:"Automation",color:S.Automation||A,description:"Daily South Asian recipe with cultural significance.",link:"/automations?subject=South Asian Culinary Journey&query=Provide a traditional South Asian recipe (rotating through Indian, Pakistani, Bangladeshi, Sri Lankan, etc. cuisines), including ingredients, brief instructions, and its cultural significance or origin story.&crontime=0 10 * * *"},{type:"Pop Culture",color:S["Pop Culture"]||A,description:"Research the impact of Bollywood on global cinema and fashion.",link:""},{type:"Automation",color:S.Automation||A,description:"Weekly update on South Asian startup ecosystems and innovations.",link:"/automations?subject=South Asian Startup Pulse&query=Summarize the most significant developments in South Asian startup ecosystems this week. Include notable funding rounds, innovative solutions to local challenges, and any policy changes affecting the tech landscape in countries like India, Bangladesh, Pakistan, and Sri Lanka.&crontime=0 18 * * 5"},{type:"Interviewing",color:S.Interviewing||A,description:"Create interview prep questions for a consulting job.",link:""},{type:"Interviewing",color:S.Interviewing||A,description:"What information should I include in a CV for a PhD application?",link:""},{type:"Home",color:S.Home||A,description:"Recommend plants that can grow well indoors.",link:""},{type:"Health",color:S.Health||A,description:"Suggest healthy meal prep ideas for a busy work week.",link:""},{type:"Learning",color:S.Learning||A,description:"List effective time management techniques for students.",link:""},{type:"Learning",color:S.Learning||A,description:"Provide tips for improving public speaking skills.",link:""},{type:"Learning",color:S.Learning||A,description:"Recommend books for learning about personal finance.",link:""},{type:"Home",color:S.Home||A,description:"Suggest ways to reduce plastic waste in daily life.",link:""},{type:"Health",color:S.Health||A,description:"Create a beginner's guide to meditation and mindfulness.",link:""},{type:"Health",color:S.Health||A,description:"Give me some tips for improving my sleep quality.",link:""},{type:"Health",color:S.Health||A,description:"What are weight loss strategies supported by clinical studies?",link:""},{type:"Fun",color:S.Fun||A,description:"List creative date ideas for couples on a budget.",link:""},{type:"Code",color:S.Interviewing||A,description:"Provide tips for writing an effective resume.",link:""},{type:"Code",color:S.Code||A,description:"Explain the concept of recursion with a simple coding example.",link:""},{type:"Code",color:S.Code||A,description:"Provide a coding challenge to reverse a string without using built-in functions.",link:""},{type:"Code",color:S.Code||A,description:"Explain the difference between 'let', 'const', and 'var' in JavaScript.",link:""},{type:"Code",color:S.Code||A,description:"Create a coding exercise to implement a basic sorting algorithm (e.g., bubble sort).",link:""},{type:"Code",color:S.Code||A,description:"Explain object-oriented programming principles with a simple class example.",link:""},{type:"Code",color:S.Code||A,description:"Provide a coding challenge to find the longest palindromic substring in a given string.",link:""},{type:"Code",color:S.Code||A,description:"Explain the concept of asynchronous programming with a JavaScript Promise example.",link:""},{type:"Code",color:S.Code||A,description:"Create a coding exercise to implement a basic data structure (e.g., linked list or stack).",link:""},{type:"Code",color:S.Code||A,description:"Explain the time and space complexity of common algorithms (e.g., binary search).",link:""},{type:"Code",color:S.Code||A,description:"Provide a coding challenge to implement a simple REST API using Node.js and Express.",link:""},{type:"Code",color:S.Code||A,description:"Compare popular web frameworks in Rust and Python",link:""},{type:"Travel",color:S.Travel||A,description:"Craft an off-beat itinerary for a weekend in Lagos, Nigeria.",link:""},{type:"Language",color:S.Language||A,description:"Teach me about declensions in Latin.",link:""},{type:"Learning",color:S.Learning||A,description:"Break down the concept of photosynthesis for a middle school student.",link:""},{type:"Learning",color:S.Learning||A,description:"Use the Socratic method to explore the causes of World War I.",link:""},{type:"Learning",color:S.Learning||A,description:"Explain the water cycle using an analogy suitable for elementary students.",link:""},{type:"Learning",color:S.Learning||A,description:"Guide a high school student through solving a quadratic equation step-by-step.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a series of questions to help a student discover the principles of basic economics.",link:""},{type:"Learning",color:S.Learning||A,description:"Develop a hands-on experiment to demonstrate the concept of density to middle schoolers.",link:""},{type:"Learning",color:S.Learning||A,description:"Use guided discovery to help a student understand the structure of DNA.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a personalized learning plan for a student struggling with grammar concepts.",link:""},{type:"Learning",color:S.Learning||A,description:"Design a series of questions to encourage critical thinking about climate change.",link:""},{type:"Learning",color:S.Learning||A,description:"Develop a step-by-step guide for conducting a basic science experiment on plant growth.",link:""},{type:"Health",color:S.Health||A,description:"Provide a detailed explanation about how to manage type 2 diabetes.",link:""},{type:"Health",color:S.Health||A,description:"Explain the effects a stroke might have on the body.",link:""},{type:"Health",color:S.Health||A,description:"Describe the recommended steps for preventing heart disease.",link:""},{type:"Health",color:S.Health||A,description:"Explain the differences between various types of headaches and their treatments.",link:""},{type:"Health",color:S.Health||A,description:"Provide an overview of the most effective stress management techniques.",link:""},{type:"Health",color:S.Health||A,description:"Explain the importance of vaccination and how vaccines work.",link:""},{type:"Health",color:S.Health||A,description:"Describe the symptoms and treatment options for depression.",link:""},{type:"Health",color:S.Health||A,description:"Explain the process of digestion and common digestive disorders.",link:""},{type:"Health",color:S.Health||A,description:"Provide an overview of the different types of cancer screenings and their importance.",link:""},{type:"Health",color:S.Health||A,description:"Explain the effects of sleep deprivation on physical and mental health.",link:""},{type:"Fun",color:S.Fun||A,description:"Create a list of fun activities for a family game night.",link:""},{type:"Finance",color:S.Finance||A,description:"Explain the concept of compound interest and its importance in long-term savings.",link:""},{type:"Finance",color:S.Finance||A,description:"Provide an overview of different types of retirement accounts (e.g., 401(k), IRA, Roth IRA).",link:""},{type:"Finance",color:S.Finance||A,description:"Describe strategies for creating and sticking to a personal budget.",link:""},{type:"Finance",color:S.Finance||A,description:"Explain the basics of stock market investing for beginners.",link:""},{type:"Finance",color:S.Finance||A,description:"Outline the pros and cons of renting vs. buying a home.",link:""},{type:"Finance",color:S.Finance||A,description:"Describe different methods for paying off debt, such as the snowball and avalanche methods.",link:""},{type:"Finance",color:S.Finance||A,description:"Explain the importance of an emergency fund and how to build one.",link:""},{type:"Finance",color:S.Finance||A,description:"Provide an overview of different types of insurance and their importance in financial planning.",link:""},{type:"Finance",color:S.Finance||A,description:"Explain the concept of diversification in investment portfolios.",link:""},{type:"Finance",color:S.Finance||A,description:"Describe strategies for minimizing tax liability legally.",link:""},{type:"Finance",color:S.Finance||A,description:"Draw a diagram illustrating the flow of money in a personal budget.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a mind map summarizing key concepts from the Industrial Revolution.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a diagram of the life cycle of a flowering plant.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a diagram illustrating the structure of the United States government.",link:""},{type:"Code",color:S.Code||A,description:"Draw a diagram illustrating the architecture of a computer network.",link:""},{type:"Health",color:S.Health||A,description:"Draw a diagram of the digestive system.",link:""},{type:"Travel",color:S.Travel||A,description:"Create a sample flow chart of a travel itinerary for CDMX.",link:""},{type:"Food",color:S.Food||A,description:"Draw a diagram illustrating the steps in a recipe for lasagna.",link:""},{type:"Fun",color:S.Fun||A,description:"Draw a diagram of a basketball court, labeling the different positions.",link:""},{type:"Code",color:S.Code||A,description:"Draw a diagram of a simple electrical circuit.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a diagram illustrating the notes on a musical staff.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a plot diagram of A Tale of Two Cities.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a timeline of major events in World War II.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a free-body diagram of a falling object.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw the Lewis structure of a water molecule.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a diagram of the layers of the Earth.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a diagram of the solar system.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a graph of the equation y = x^2.",link:""},{type:"Mathematics",color:S.Mathematics||A,description:"Create a chart for the sine and cosine functions over one period.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a bar chart comparing the average monthly temperatures of two cities.",link:""},{type:"Finance",color:S.Finance||A,description:"Create a line chart showing the GDP growth rate over the last decade.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a chart for historical rainfall in Karachi last year.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a chart showing the trend in smartphone usage in Korea over the past five years.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a chart comparing the performance statistics of Lebron James and Kobe Bryant.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a chart showing historical casualties in major wars.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a chart illustrating the relationship between velocity and time.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a chart showing the frequency of earthquakes over the past century.",link:""},{type:"Mathematics",color:S.Mathematics||A,description:"Create a scatter plot of a set of random data points.",link:""}];function H(e){var t,i;let n=(0,j.Zc)(e.color),a="".concat(C().card," ").concat(n," md:w-full md:h-fit sm:w-full h-fit md:w-[200px] md:h-[180px] cursor-pointer md:p-2"),r="".concat(C().text," dark:text-white"),s=(0,o.jsx)(x.Zb,{className:a,children:(0,o.jsx)("div",{className:"flex w-full",children:(0,o.jsxs)(x.aY,{className:"m-0 p-2 w-full",children:[(t=e.title,i=e.color.toLowerCase(),"Automation"===t?(0,P.TI)("Robot",i,"w-6","h-6"):"Paint"===t?(0,P.TI)("Palette",i,"w-6","h-6"):"Pop Culture"===t?(0,P.TI)("Confetti",i,"w-6","h-6"):"Travel"===t?(0,P.TI)("Jeep",i,"w-6","h-6"):"Learning"===t?(0,P.TI)("Book",i,"w-6","h-6"):"Health"===t?(0,P.TI)("Asclepius",i,"w-6","h-6"):"Fun"===t?(0,P.TI)("Island",i,"w-6","h-6"):"Home"===t?(0,P.TI)("House",i,"w-6","h-6"):"Language"===t?(0,P.TI)("Translate",i,"w-6","h-6"):"Code"===t?(0,P.TI)("Code",i,"w-6","h-6"):"Food"===t?(0,P.TI)("BowlFood",i,"w-6","h-6"):"Interviewing"===t?(0,P.TI)("Lectern",i,"w-6","h-6"):"Finance"===t?(0,P.TI)("Wallet",i,"w-6","h-6"):"Mathematics"===t?(0,P.TI)("MathOperations",i,"w-6","h-6"):(0,P.TI)("Lightbulb",i,"w-6","h-6")),(0,o.jsx)(x.SZ,{className:"".concat(r," sm:line-clamp-2 md:line-clamp-4 pt-1 break-words whitespace-pre-wrap max-w-full"),children:e.body})]})})});return e.link?(0,o.jsx)("a",{href:e.link,className:"no-underline",children:s}):s}var F=i(92813),I=i(14308),M=i(5477),_=i(33494),D=i(56937),N=i(59199),T=i(7436),W=i(99376),B=i(19378),q=i(9262),O=i(57054),R=i(62869),z=i(37104),Z=i(17814);function U(e){return e.isMobileWidth?(0,o.jsx)(Z.dy,{open:!0,onClose:()=>e.setShowLoginPrompt(!1),children:(0,o.jsx)(Z.sc,{children:(0,o.jsx)(V,{...e})})}):(0,o.jsx)("div",{className:"fixed inset-x-0 bottom-8 z-30 flex items-center justify-center",children:(0,o.jsx)(V,{...e})})}function V(e){return(0,o.jsxs)(x.Zb,{className:"rounded-lg p-6 flex flex-col items-center justify-between gap-8 md:w-fit border-none md:flex-row md:z-30 md:shadow-lg",children:[!e.isMobileWidth&&(0,o.jsx)(z.S6,{className:"w-12 h-auto"}),(0,o.jsxs)("div",{className:"flex flex-col items-start justify-center gap-8 md:gap-2",children:[(0,o.jsx)(x.Ol,{className:"p-0 text-xl font-bold",children:"Welcome to Khoj!"}),(0,o.jsx)(x.SZ,{children:"Sign in to get started with Khoj, your AI research assistant."})]}),(0,o.jsx)(R.z,{variant:"default",className:"p-6 text-lg",onClick:()=>e.setShowLoginPrompt(!0),children:"Get started for free"})]})}function G(e){var t,i;let[n,a]=(0,l.useState)(""),[r,d]=(0,l.useState)([]),[p,u]=(0,l.useState)(!1),[h,g]=(0,l.useState)(""),[m,f]=(0,l.useState)([]),[y,k]=(0,l.useState)(null),b=(0,T.Nr)(y,500),[w,L]=(0,l.useState)(!1),[C,S]=(0,l.useState)("khoj"),[A,F]=(0,l.useState)([]),[I,R]=(0,l.useState)([]),z=(0,l.useRef)(null),[Z,V]=(0,l.useState)(!1),G=(0,W.useRouter)(),J=(0,W.useSearchParams)().get("q");(0,l.useEffect)(()=>{J&&a(decodeURIComponent(J))},[J]),(0,l.useEffect)(()=>{b&&L(!0)},[b]);let K=e.onConversationIdChange,{data:Y,error:Q}=(0,c.ZP)("agents",()=>window.fetch("/api/agents").then(e=>e.json()).catch(e=>console.log(e)),{revalidateOnFocus:!1}),X=e=>{G.push("/agents?agent=".concat(e))};function $(){f((function(e){for(let t=e.length-1;t>0;t--){let i=Math.floor(Math.random()*(t+1));[e[t],e[i]]=[e[i],e[t]]}return e})(E).slice(0,3))}return(0,l.useEffect)(()=>{var t,i;if(e.isLoadingUserConfig)return;let n=new Date,a=n.getDay(),o=n.getHours()>=17||4>n.getHours()?"evening":n.getHours()>=12?"afternoon":"morning",r=(null===(t=e.userConfig)||void 0===t?void 0:t.given_name)?", ".concat(null===(i=e.userConfig)||void 0===i?void 0:i.given_name):"",s=["What would you like to get done".concat(r,"?"),"Hey".concat(r,"! How can I help?"),"Good ".concat(o).concat(r,"! What's on your mind?"),"Ready to breeze through ".concat(["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][a],"?"),"Let's navigate your ".concat(["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][a]," workload")];g(s[Math.floor(Math.random()*s.length)])},[e.isLoadingUserConfig,e.userConfig]),(0,l.useEffect)(()=>{e.chatOptionsData&&$()},[e.chatOptionsData]),(0,l.useEffect)(()=>{let e=(Y||[]).filter(e=>null!=e);R(e),S(e.length>1?e[0].slug:"khoj"),F(e.map(e=>(0,P.TI)(e.icon,e.color)))},[Y,e.isMobileWidth]),(0,l.useEffect)(()=>{(async()=>{if(n&&!p){u(!0);try{let e=await (0,N.A0)(C||"khoj");null==K||K(e),localStorage.setItem("message",n),r.length>0&&localStorage.setItem("images",JSON.stringify(r)),window.location.href="/chat?conversationId=".concat(e)}catch(e){console.error("Error creating new conversation:",e),u(!1)}a(""),d([])}})(),(n||r.length>0)&&u(!0)},[C,n,p,K]),(0,l.useEffect)(()=>{let e=document.querySelector("[data-radix-scroll-area-viewport]"),t=()=>{k(null),L(!1)};return null==e||e.addEventListener("scroll",t),()=>null==e?void 0:e.removeEventListener("scroll",t)},[]),(0,o.jsxs)("div",{className:"".concat(s().homeGreetings," w-full md:w-auto"),children:[Z&&(0,o.jsx)(_.Z,{onOpenChange:V,isMobileWidth:e.isMobileWidth,loginRedirectMessage:"Login to your second brain"}),!e.isLoggedIn&&(0,o.jsx)(U,{isMobileWidth:e.isMobileWidth,setShowLoginPrompt:V}),(0,o.jsxs)("div",{className:"w-full text-center justify-end content-end",children:[(0,o.jsx)("div",{className:"items-center",children:(0,o.jsx)("h1",{className:"text-2xl md:text-3xl text-center w-fit pb-6 px-4 mx-auto",children:h})}),!e.isMobileWidth&&(0,o.jsxs)(B.x,{className:"w-full max-w-[600px] mx-auto",children:[(0,o.jsx)("div",{className:"flex pb-2 gap-2 items-center justify-center",children:I.map((t,i)=>(0,o.jsxs)(O.J2,{open:w&&b===t.slug,onOpenChange:e=>{e||(k(null),L(!1))},children:[(0,o.jsx)(O.xo,{asChild:!0,children:(0,o.jsx)(x.Zb,{className:"".concat(C===t.slug?(0,j.Iu)(t.color):"border-stone-100 dark:border-neutral-700 text-muted-foreground","\n hover:cursor-pointer rounded-lg px-2 py-2"),onDoubleClick:()=>X(t.slug),onClick:()=>{var e;S(t.slug),null===(e=z.current)||void 0===e||e.focus(),k(null),L(!1)},onMouseEnter:()=>k(t.slug),onMouseLeave:()=>{k(null),L(!1)},children:(0,o.jsxs)(x.ll,{className:"text-center text-md font-medium flex justify-center items-center whitespace-nowrap",children:[A[i]," ",t.name]})})}),(0,o.jsx)(O.yk,{className:"w-80 p-0 border-none bg-transparent shadow-none",onMouseLeave:()=>{k(null),L(!1)},children:(0,o.jsx)(q.EY,{data:t,userProfile:null,isMobileWidth:e.isMobileWidth||!1,showChatButton:!1,editCard:!1,filesOptions:[],selectedChatModelOption:"",agentSlug:"",isSubscribed:(0,D.T8)(e.userConfig),setAgentChangeTriggered:()=>{},modelOptions:[],inputToolOptions:{},outputModeOptions:{}})})]},"".concat(i,"-").concat(t.slug)))}),(0,o.jsx)(B.B,{orientation:"horizontal"})]})]}),(0,o.jsxs)("div",{className:"mx-auto ".concat(e.isMobileWidth?"w-full":"w-fit max-w-screen-md"),children:[!e.isMobileWidth&&(0,o.jsx)("div",{className:"w-full ".concat(s().inputBox," shadow-lg bg-background align-middle items-center justify-center px-3 py-1 dark:bg-neutral-700 border-stone-100 dark:border-none dark:shadow-none rounded-2xl"),children:(0,o.jsx)(M.a,{isLoggedIn:e.isLoggedIn,sendMessage:e=>a(e),sendImage:e=>d(t=>[...t,e]),sendDisabled:p,chatOptionsData:e.chatOptionsData,conversationId:null,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles,agentColor:null===(t=I.find(e=>e.slug===C))||void 0===t?void 0:t.color,ref:z,setTriggeredAbort:()=>{}})}),(0,o.jsx)("div",{className:"".concat(s().suggestions," w-full ").concat(e.isMobileWidth?"grid":"flex flex-row"," justify-center items-center"),children:m.map((t,i)=>(0,o.jsx)("div",{onClick:i=>{e.isLoggedIn?function(e,t,i){if(!e){let e="";i=i.charAt(0).toLowerCase()+i.slice(1),e="Online Search"===t?"/online "+i:"Paint"===t?"/image "+i:i;let n=document.getElementById("message");n&&(n.value=e,a(e))}}(t.link,t.type,t.description):(i.preventDefault(),i.stopPropagation(),V(!0))},children:(0,o.jsx)(H,{title:t.type,body:t.description,link:t.link,color:t.color},t.type+Math.random())},"".concat(t.type," ").concat(t.description)))}),(0,o.jsx)("div",{className:"flex items-center justify-center margin-auto",children:(0,o.jsxs)("button",{onClick:function(){$()},className:"m-2 p-1.5 rounded-lg dark:hover:bg-[var(--background-color)] hover:bg-stone-100 border border-stone-100 text-sm text-stone-500 dark:text-stone-300 dark:border-neutral-700",children:["More Ideas ",(0,o.jsx)(v,{className:"h-4 w-4 inline"})]})})]}),e.isMobileWidth&&(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("div",{className:"".concat(s().inputBox," pt-1 shadow-[0_-20px_25px_-5px_rgba(0,0,0,0.1)] dark:bg-neutral-700 bg-background align-middle items-center justify-center pb-3 mx-1 rounded-t-2xl rounded-b-none"),children:[(0,o.jsxs)(B.x,{className:"w-full max-w-[85vw]",children:[(0,o.jsx)("div",{className:"flex gap-2 items-center justify-left pt-1 pb-2 px-12",children:A.map((e,t)=>(0,o.jsx)(x.Zb,{className:"".concat(C===I[t].slug?(0,j.Iu)(I[t].color):"border-muted text-muted-foreground"," hover:cursor-pointer"),children:(0,o.jsxs)(x.ll,{className:"text-center text-xs font-medium flex justify-center items-center whitespace-nowrap px-1.5 py-1",onDoubleClick:()=>X(I[t].slug),onClick:()=>{var e;S(I[t].slug),null===(e=z.current)||void 0===e||e.focus()},children:[e," ",I[t].name]})},"".concat(t,"-").concat(I[t].slug)))}),(0,o.jsx)(B.B,{orientation:"horizontal"})]}),(0,o.jsx)(M.a,{isLoggedIn:e.isLoggedIn,sendMessage:e=>a(e),sendImage:e=>d(t=>[...t,e]),sendDisabled:p,chatOptionsData:e.chatOptionsData,conversationId:null,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles,agentColor:null===(i=I.find(e=>e.slug===C))||void 0===i?void 0:i.color,ref:z,setTriggeredAbort:()=>{}})]})})]})}function J(){let[e,t]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0),[a,r]=(0,l.useState)(null),[c,d]=(0,l.useState)(null),p=(0,T.IC)(),{userConfig:u,isLoadingUserConfig:h}=(0,D.h2)(!0),[g,m]=(0,l.useState)(null),f=(0,D.GW)();return((0,l.useEffect)(()=>{m(u)},[u]),(0,l.useEffect)(()=>{c&&localStorage.setItem("uploadedFiles",JSON.stringify(c))},[c]),(0,l.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{n(!1),e&&t(e)}).catch(e=>{console.error(e)})},[]),i)?(0,o.jsx)(I.Z,{}):(0,o.jsxs)("div",{className:"".concat(s().main," ").concat(s().chatLayout),children:[(0,o.jsx)("title",{children:"Khoj AI - Your Second Brain"}),(0,o.jsx)("div",{className:"".concat(s().sidePanel),children:(0,o.jsx)(F.ZP,{conversationId:a,uploadedFiles:[],isMobileWidth:p})}),(0,o.jsx)("div",{className:"".concat(s().chatBox),children:(0,o.jsx)("div",{className:"".concat(s().chatBoxBody),children:(0,o.jsx)(G,{isLoggedIn:null!==f,chatOptionsData:e,setUploadedFiles:d,isMobileWidth:p,onConversationIdChange:e=>{r(e)},userConfig:g,isLoadingUserConfig:h})})})]})}},99376:function(e,t,i){"use strict";var n=i(35475);i.o(n,"useRouter")&&i.d(t,{useRouter:function(){return n.useRouter}}),i.o(n,"useSearchParams")&&i.d(t,{useSearchParams:function(){return n.useSearchParams}})},47960:function(){},64670:function(e){e.exports={card:"suggestions_card__fbiZo",title:"suggestions_title__vNozc",text:"suggestions_text__J_IfY"}},76777:function(e){e.exports={main:"page_main__nw1Wk",suggestions:"page_suggestions__Y8EqU",inputBox:"page_inputBox__LrcZ4",chatBodyFull:"page_chatBodyFull__Qu2T2",chatBody:"page_chatBody__IirQQ",chatLayout:"page_chatLayout__bJUjP",chatBox:"page_chatBox__gsR6V",titleBar:"page_titleBar__3btUI",chatBoxBody:"page_chatBoxBody__xORKr",homeGreetings:"page_homeGreetings__VjQhh",sidePanel:"page_sidePanel__mxpxa"}}},function(e){e.O(0,[3587,2664,7265,2693,8407,8667,5401,6589,8117,9058,1662,2813,5477,9262,2971,2117,1744],function(){return e(e.s=1507)}),_N_E=e.O()}]);
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1931],{1507:function(e,t,i){Promise.resolve().then(i.bind(i,93866))},93866:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return J}});var n,a,o=i(57437);i(47960);var r=i(76777),s=i.n(r);i(2446);var l=i(2265),c=i(63861),d=i(49656);let p=new Map([["bold",l.createElement(l.Fragment,null,l.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",l.createElement(l.Fragment,null,l.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),l.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",l.createElement(l.Fragment,null,l.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",l.createElement(l.Fragment,null,l.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",l.createElement(l.Fragment,null,l.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",l.createElement(l.Fragment,null,l.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]);var u=Object.defineProperty,h=Object.defineProperties,g=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,k=(e,t,i)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,b=(e,t)=>{for(var i in t||(t={}))f.call(t,i)&&k(e,i,t[i]);if(m)for(var i of m(t))y.call(t,i)&&k(e,i,t[i]);return e},w=(e,t)=>h(e,g(t));let v=(0,l.forwardRef)((e,t)=>l.createElement(d.Z,w(b({ref:t},e),{weights:p})));v.displayName="ArrowCounterClockwise";var x=i(66070),L=i(64670),C=i.n(L),j=i(84671),P=i(42225);(n=a||(a={})).Automation="Automation",n.Paint="Paint",n.Travel="Travel",n.Health="Health",n.Learning="Learning",n.Math="Mathematics",n.Language="Language",n.PopCulture="Pop Culture",n.Food="Food",n.Interviewing="Interviewing",n.Home="Home",n.Fun="Fun",n.Code="Code",n.Finance="Finance";let S={};S.Automation="blue",S.Paint="indigo",S.Travel="yellow",S.Health="teal",S.Learning="purple",S.Language="blue",S["Pop Culture"]="red",S.Food="yellow",S.Interviewing="orange",S.Home="green",S.Fun="fuchsia",S.Code="purple",S.Finance="green",S.Mathematics="blue";let A="orange",E=[{type:"Automation",color:S.Automation||A,description:"Send me a summary of HackerNews every morning.",link:"/automations?subject=Summarizing%20Top%20Headlines%20from%20HackerNews&query=Summarize%20the%20top%20headlines%20on%20HackerNews&crontime=00%207%20*%20*%20*"},{type:"Automation",color:S.Automation||A,description:"Compose a bedtime story that a five-year-old might enjoy.",link:"/automations?subject=Daily%20Bedtime%20Story&query=Compose%20a%20bedtime%20story%20that%20a%20five-year-old%20might%20enjoy.%20It%20should%20not%20exceed%20five%20paragraphs.%20Appeal%20to%20the%20imagination%2C%20but%20weave%20in%20learnings.&crontime=0%2021%20*%20*%20*"},{type:"Paint",color:S.Paint||A,description:"Paint a picture of a sunset but it's made of stained glass tiles",link:""},{type:"Travel",color:S.Travel||A,description:"Search for the best attractions in Austria Hungary",link:""},{type:"Health",color:S.Health||A,description:"Generate a weekly meal plan with recipes.",link:"/automations?subject=Weekly Meal Plan&query=Create a weekly meal plan with 7 dinner recipes, including ingredients and brief instructions. Focus on balanced, healthy meals.&crontime=0 18 * * 0"},{type:"Paint",color:S.Paint||A,description:"Paint a futuristic cityscape with flying cars.",link:""},{type:"Travel",color:S.Travel||A,description:"Find the top-rated coffee shops in Seattle.",link:""},{type:"Automation",color:S.Automation||A,description:"Send daily motivational quotes.",link:"/automations?subject=Daily Motivation&query=Provide an inspiring quote for the day along with a brief explanation of its meaning.&crontime=0 7 * * *"},{type:"Paint",color:S.Paint||A,description:"Create an abstract representation of jazz music.",link:""},{type:"Learning",color:S.Learning||A,description:"Research the history of the Eiffel Tower.",link:""},{type:"Automation",color:S.Automation||A,description:"Compile a weekly news summary.",link:"/automations?subject=Weekly News Digest&query=Summarize the top 5 most important news stories of the week across various categories.&crontime=0 18 * * 5"},{type:"Paint",color:S.Paint||A,description:"Paint a portrait of a cat wearing a Victorian-era costume.",link:""},{type:"Travel",color:S.Travel||A,description:"Find beginner-friendly hiking trails near Los Angeles.",link:""},{type:"Automation",color:S.Automation||A,description:"Generate a daily writing prompt.",link:"/automations?subject=Daily Writing Prompt&query=Create an engaging writing prompt suitable for short story or journal writing.&crontime=0 9 * * *"},{type:"Paint",color:S.Paint||A,description:"Create a surrealist landscape inspired by Salvador Dali.",link:""},{type:"Learning",color:S.Learning||A,description:"Research the benefits and drawbacks of electric vehicles.",link:""},{type:"Automation",color:S.Automation||A,description:"Send weekly language learning tips for Spanish.",link:"/automations?subject=Spanish Learning Tips&query=Provide a useful Spanish language learning tip, including vocabulary, grammar, or cultural insight.&crontime=0 19 * * 2"},{type:"Paint",color:S.Paint||A,description:"Paint a scene from a fairy tale in the style of Studio Ghibli.",link:""},{type:"Pop Culture",color:"yellow",description:"Find the best-rated science fiction books of the last decade.",link:""},{type:"Paint",color:S.Paint||A,description:"Paint a still life of exotic fruits in a neon color palette.",link:""},{type:"Travel",color:S.Travel||A,description:"Research the most eco-friendly cities in Europe.",link:""},{type:"Automation",color:S.Automation||A,description:"Send daily reminders for habit tracking.",link:"/automations?subject=Habit Tracker&query=Generate a daily reminder to track habits, including a motivational message.&crontime=0 20 * * *"},{type:"Paint",color:S.Paint||A,description:"Create a digital painting of a cyberpunk street market.",link:""},{type:"Learning",color:S.Learning||A,description:"Summarize the biography of this figure: https://en.wikipedia.org/wiki/Jean_Baptiste_Point_du_Sable",link:""},{type:"Language",color:"blue",description:"Send daily Spanish phrases used in Latin America.",link:"/automations?subject=Daily Latin American Spanish&query=Provide a common Spanish phrase or slang term used in Latin America, its meaning, and an example of usage. Include which countries it's most common in.&crontime=0 8 * * *"},{type:"Paint",color:S.Paint||A,description:"Create a vibrant painting inspired by Frida Kahlo's style.",link:""},{type:"Food",color:S.Food||A,description:"Find the best empanada recipe from Colombia.",link:""},{type:"Automation",color:S.Automation||A,description:"Weekly update on the Brazilian startup ecosystems.",link:"/automations?subject=LatAm Startup News&query=Provide a summary of the most significant developments in Latin American startup ecosystems this week. Include notable funding rounds, expansions, or policy changes.&crontime=0 18 * * 5"},{type:"Paint",color:S.Paint||A,description:"Paint a colorful scene of a traditional Day of the Dead celebration in Mexico.",link:""},{type:"Language",color:S.Language||A,description:"Daily Swahili phrase with English translation.",link:"/automations?subject=Daily Swahili Lesson&query=Provide a common Swahili phrase or proverb, its English translation, and a brief explanation of its cultural significance in East Africa.&crontime=0 7 * * *"},{type:"Paint",color:S.Paint||A,description:"Create a digital painting of the Serengeti during wildebeest migration.",link:""},{type:"Learning",color:S.Learning||A,description:"Research the top M-Pesa alternatives in East Africa.",link:""},{type:"Automation",color:S.Automation||A,description:"Weekly update on East African tech startups and innovations.",link:"/automations?subject=East African Tech News&query=Summarize the most significant developments in East African tech startups and innovations this week. Include notable funding rounds, new product launches, or policy changes affecting the tech ecosystem.&crontime=0 18 * * 5"},{type:"Paint",color:S.Paint||A,description:"Paint a colorful scene inspired by Maasai traditional clothing and jewelry.",link:""},{type:"Automation",color:S.Automation||A,description:"Weekly summary of EU policy changes and their impact.",link:"/automations?subject=EU Policy Update&query=Summarize the most significant EU policy changes or proposals from this week. Explain their potential impact on European citizens and businesses.&crontime=0 17 * * 5"},{type:"Paint",color:S.Paint||A,description:"Paint a digital landscape of the Northern Lights over the Norwegian fjords.",link:""},{type:"Automation",color:S.Automation||A,description:"Daily East Asian proverb with explanation.",link:"/automations?subject=East Asian Wisdom&query=Provide a proverb from an East Asian language (rotating through Chinese, Japanese, Korean, etc.), its English translation, and a brief explanation of its cultural significance and practical application.&crontime=0 7 * * *"},{type:"Paint",color:S.Paint||A,description:"Create a digital painting in the style of traditional Chinese ink wash landscape.",link:""},{type:"Pop Culture",color:"yellow",description:"Research the latest trends in K-pop and its global influence.",link:""},{type:"Automation",color:S.Automation||A,description:"Weekly summary of technological innovations from East Asian tech giants.",link:"/automations?subject=East Asian Tech Update&query=Summarize the most significant technological innovations or product launches from major East Asian tech companies (e.g., Samsung, Sony, Alibaba, Tencent) this week. Explain their potential impact on global markets.&crontime=0 18 * * 5"},{type:"Paint",color:S.Paint||A,description:"Paint a vibrant scene of a Japanese cherry blossom festival.",link:""},{type:"Automation",color:S.Automation||A,description:"Daily South Asian recipe with cultural significance.",link:"/automations?subject=South Asian Culinary Journey&query=Provide a traditional South Asian recipe (rotating through Indian, Pakistani, Bangladeshi, Sri Lankan, etc. cuisines), including ingredients, brief instructions, and its cultural significance or origin story.&crontime=0 10 * * *"},{type:"Pop Culture",color:S["Pop Culture"]||A,description:"Research the impact of Bollywood on global cinema and fashion.",link:""},{type:"Automation",color:S.Automation||A,description:"Weekly update on South Asian startup ecosystems and innovations.",link:"/automations?subject=South Asian Startup Pulse&query=Summarize the most significant developments in South Asian startup ecosystems this week. Include notable funding rounds, innovative solutions to local challenges, and any policy changes affecting the tech landscape in countries like India, Bangladesh, Pakistan, and Sri Lanka.&crontime=0 18 * * 5"},{type:"Interviewing",color:S.Interviewing||A,description:"Create interview prep questions for a consulting job.",link:""},{type:"Interviewing",color:S.Interviewing||A,description:"What information should I include in a CV for a PhD application?",link:""},{type:"Home",color:S.Home||A,description:"Recommend plants that can grow well indoors.",link:""},{type:"Health",color:S.Health||A,description:"Suggest healthy meal prep ideas for a busy work week.",link:""},{type:"Learning",color:S.Learning||A,description:"List effective time management techniques for students.",link:""},{type:"Learning",color:S.Learning||A,description:"Provide tips for improving public speaking skills.",link:""},{type:"Learning",color:S.Learning||A,description:"Recommend books for learning about personal finance.",link:""},{type:"Home",color:S.Home||A,description:"Suggest ways to reduce plastic waste in daily life.",link:""},{type:"Health",color:S.Health||A,description:"Create a beginner's guide to meditation and mindfulness.",link:""},{type:"Health",color:S.Health||A,description:"Give me some tips for improving my sleep quality.",link:""},{type:"Health",color:S.Health||A,description:"What are weight loss strategies supported by clinical studies?",link:""},{type:"Fun",color:S.Fun||A,description:"List creative date ideas for couples on a budget.",link:""},{type:"Code",color:S.Interviewing||A,description:"Provide tips for writing an effective resume.",link:""},{type:"Code",color:S.Code||A,description:"Explain the concept of recursion with a simple coding example.",link:""},{type:"Code",color:S.Code||A,description:"Provide a coding challenge to reverse a string without using built-in functions.",link:""},{type:"Code",color:S.Code||A,description:"Explain the difference between 'let', 'const', and 'var' in JavaScript.",link:""},{type:"Code",color:S.Code||A,description:"Create a coding exercise to implement a basic sorting algorithm (e.g., bubble sort).",link:""},{type:"Code",color:S.Code||A,description:"Explain object-oriented programming principles with a simple class example.",link:""},{type:"Code",color:S.Code||A,description:"Provide a coding challenge to find the longest palindromic substring in a given string.",link:""},{type:"Code",color:S.Code||A,description:"Explain the concept of asynchronous programming with a JavaScript Promise example.",link:""},{type:"Code",color:S.Code||A,description:"Create a coding exercise to implement a basic data structure (e.g., linked list or stack).",link:""},{type:"Code",color:S.Code||A,description:"Explain the time and space complexity of common algorithms (e.g., binary search).",link:""},{type:"Code",color:S.Code||A,description:"Provide a coding challenge to implement a simple REST API using Node.js and Express.",link:""},{type:"Code",color:S.Code||A,description:"Compare popular web frameworks in Rust and Python",link:""},{type:"Travel",color:S.Travel||A,description:"Craft an off-beat itinerary for a weekend in Lagos, Nigeria.",link:""},{type:"Language",color:S.Language||A,description:"Teach me about declensions in Latin.",link:""},{type:"Learning",color:S.Learning||A,description:"Break down the concept of photosynthesis for a middle school student.",link:""},{type:"Learning",color:S.Learning||A,description:"Use the Socratic method to explore the causes of World War I.",link:""},{type:"Learning",color:S.Learning||A,description:"Explain the water cycle using an analogy suitable for elementary students.",link:""},{type:"Learning",color:S.Learning||A,description:"Guide a high school student through solving a quadratic equation step-by-step.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a series of questions to help a student discover the principles of basic economics.",link:""},{type:"Learning",color:S.Learning||A,description:"Develop a hands-on experiment to demonstrate the concept of density to middle schoolers.",link:""},{type:"Learning",color:S.Learning||A,description:"Use guided discovery to help a student understand the structure of DNA.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a personalized learning plan for a student struggling with grammar concepts.",link:""},{type:"Learning",color:S.Learning||A,description:"Design a series of questions to encourage critical thinking about climate change.",link:""},{type:"Learning",color:S.Learning||A,description:"Develop a step-by-step guide for conducting a basic science experiment on plant growth.",link:""},{type:"Health",color:S.Health||A,description:"Provide a detailed explanation about how to manage type 2 diabetes.",link:""},{type:"Health",color:S.Health||A,description:"Explain the effects a stroke might have on the body.",link:""},{type:"Health",color:S.Health||A,description:"Describe the recommended steps for preventing heart disease.",link:""},{type:"Health",color:S.Health||A,description:"Explain the differences between various types of headaches and their treatments.",link:""},{type:"Health",color:S.Health||A,description:"Provide an overview of the most effective stress management techniques.",link:""},{type:"Health",color:S.Health||A,description:"Explain the importance of vaccination and how vaccines work.",link:""},{type:"Health",color:S.Health||A,description:"Describe the symptoms and treatment options for depression.",link:""},{type:"Health",color:S.Health||A,description:"Explain the process of digestion and common digestive disorders.",link:""},{type:"Health",color:S.Health||A,description:"Provide an overview of the different types of cancer screenings and their importance.",link:""},{type:"Health",color:S.Health||A,description:"Explain the effects of sleep deprivation on physical and mental health.",link:""},{type:"Fun",color:S.Fun||A,description:"Create a list of fun activities for a family game night.",link:""},{type:"Finance",color:S.Finance||A,description:"Explain the concept of compound interest and its importance in long-term savings.",link:""},{type:"Finance",color:S.Finance||A,description:"Provide an overview of different types of retirement accounts (e.g., 401(k), IRA, Roth IRA).",link:""},{type:"Finance",color:S.Finance||A,description:"Describe strategies for creating and sticking to a personal budget.",link:""},{type:"Finance",color:S.Finance||A,description:"Explain the basics of stock market investing for beginners.",link:""},{type:"Finance",color:S.Finance||A,description:"Outline the pros and cons of renting vs. buying a home.",link:""},{type:"Finance",color:S.Finance||A,description:"Describe different methods for paying off debt, such as the snowball and avalanche methods.",link:""},{type:"Finance",color:S.Finance||A,description:"Explain the importance of an emergency fund and how to build one.",link:""},{type:"Finance",color:S.Finance||A,description:"Provide an overview of different types of insurance and their importance in financial planning.",link:""},{type:"Finance",color:S.Finance||A,description:"Explain the concept of diversification in investment portfolios.",link:""},{type:"Finance",color:S.Finance||A,description:"Describe strategies for minimizing tax liability legally.",link:""},{type:"Finance",color:S.Finance||A,description:"Draw a diagram illustrating the flow of money in a personal budget.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a mind map summarizing key concepts from the Industrial Revolution.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a diagram of the life cycle of a flowering plant.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a diagram illustrating the structure of the United States government.",link:""},{type:"Code",color:S.Code||A,description:"Draw a diagram illustrating the architecture of a computer network.",link:""},{type:"Health",color:S.Health||A,description:"Draw a diagram of the digestive system.",link:""},{type:"Travel",color:S.Travel||A,description:"Create a sample flow chart of a travel itinerary for CDMX.",link:""},{type:"Food",color:S.Food||A,description:"Draw a diagram illustrating the steps in a recipe for lasagna.",link:""},{type:"Fun",color:S.Fun||A,description:"Draw a diagram of a basketball court, labeling the different positions.",link:""},{type:"Code",color:S.Code||A,description:"Draw a diagram of a simple electrical circuit.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a diagram illustrating the notes on a musical staff.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a plot diagram of A Tale of Two Cities.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a timeline of major events in World War II.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a free-body diagram of a falling object.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw the Lewis structure of a water molecule.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a diagram of the layers of the Earth.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a diagram of the solar system.",link:""},{type:"Learning",color:S.Learning||A,description:"Draw a graph of the equation y = x^2.",link:""},{type:"Mathematics",color:S.Mathematics||A,description:"Create a chart for the sine and cosine functions over one period.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a bar chart comparing the average monthly temperatures of two cities.",link:""},{type:"Finance",color:S.Finance||A,description:"Create a line chart showing the GDP growth rate over the last decade.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a chart for historical rainfall in Karachi last year.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a chart showing the trend in smartphone usage in Korea over the past five years.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a chart comparing the performance statistics of Lebron James and Kobe Bryant.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a chart showing historical casualties in major wars.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a chart illustrating the relationship between velocity and time.",link:""},{type:"Learning",color:S.Learning||A,description:"Create a chart showing the frequency of earthquakes over the past century.",link:""},{type:"Mathematics",color:S.Mathematics||A,description:"Create a scatter plot of a set of random data points.",link:""}];function H(e){var t,i;let n=(0,j.Zc)(e.color),a="".concat(C().card," ").concat(n," md:w-full md:h-fit sm:w-full h-fit md:w-[200px] md:h-[180px] cursor-pointer md:p-2"),r="".concat(C().text," dark:text-white"),s=(0,o.jsx)(x.Zb,{className:a,children:(0,o.jsx)("div",{className:"flex w-full",children:(0,o.jsxs)(x.aY,{className:"m-0 p-2 w-full",children:[(t=e.title,i=e.color.toLowerCase(),"Automation"===t?(0,P.TI)("Robot",i,"w-6","h-6"):"Paint"===t?(0,P.TI)("Palette",i,"w-6","h-6"):"Pop Culture"===t?(0,P.TI)("Confetti",i,"w-6","h-6"):"Travel"===t?(0,P.TI)("Jeep",i,"w-6","h-6"):"Learning"===t?(0,P.TI)("Book",i,"w-6","h-6"):"Health"===t?(0,P.TI)("Asclepius",i,"w-6","h-6"):"Fun"===t?(0,P.TI)("Island",i,"w-6","h-6"):"Home"===t?(0,P.TI)("House",i,"w-6","h-6"):"Language"===t?(0,P.TI)("Translate",i,"w-6","h-6"):"Code"===t?(0,P.TI)("Code",i,"w-6","h-6"):"Food"===t?(0,P.TI)("BowlFood",i,"w-6","h-6"):"Interviewing"===t?(0,P.TI)("Lectern",i,"w-6","h-6"):"Finance"===t?(0,P.TI)("Wallet",i,"w-6","h-6"):"Mathematics"===t?(0,P.TI)("MathOperations",i,"w-6","h-6"):(0,P.TI)("Lightbulb",i,"w-6","h-6")),(0,o.jsx)(x.SZ,{className:"".concat(r," sm:line-clamp-2 md:line-clamp-4 pt-1 break-words whitespace-pre-wrap max-w-full"),children:e.body})]})})});return e.link?(0,o.jsx)("a",{href:e.link,className:"no-underline",children:s}):s}var F=i(92813),I=i(14308),M=i(5477),_=i(33494),D=i(56937),N=i(59199),T=i(7436),W=i(99376),B=i(19378),q=i(9262),O=i(57054),R=i(62869),z=i(37104),Z=i(17814);function U(e){return e.isMobileWidth?(0,o.jsx)(Z.dy,{open:!0,onClose:()=>e.setShowLoginPrompt(!1),children:(0,o.jsx)(Z.sc,{children:(0,o.jsx)(V,{...e})})}):(0,o.jsx)("div",{className:"fixed inset-x-0 bottom-8 z-30 flex items-center justify-center",children:(0,o.jsx)(V,{...e})})}function V(e){return(0,o.jsxs)(x.Zb,{className:"rounded-lg p-6 flex flex-col items-center justify-between gap-8 md:w-fit border-none md:flex-row md:z-30 md:shadow-lg",children:[!e.isMobileWidth&&(0,o.jsx)(z.S6,{className:"w-12 h-auto"}),(0,o.jsxs)("div",{className:"flex flex-col items-start justify-center gap-8 md:gap-2",children:[(0,o.jsx)(x.Ol,{className:"p-0 text-xl font-bold",children:"Welcome to Khoj!"}),(0,o.jsx)(x.SZ,{children:"Sign in to get started with Khoj, your AI research assistant."})]}),(0,o.jsx)(R.z,{variant:"default",className:"p-6 text-lg",onClick:()=>e.setShowLoginPrompt(!0),children:"Get started for free"})]})}function G(e){var t,i;let[n,a]=(0,l.useState)(""),[r,d]=(0,l.useState)([]),[p,u]=(0,l.useState)(!1),[h,g]=(0,l.useState)(""),[m,f]=(0,l.useState)([]),[y,k]=(0,l.useState)(null),b=(0,T.Nr)(y,500),[w,L]=(0,l.useState)(!1),[C,S]=(0,l.useState)("khoj"),[A,F]=(0,l.useState)([]),[I,R]=(0,l.useState)([]),z=(0,l.useRef)(null),[Z,V]=(0,l.useState)(!1),G=(0,W.useRouter)(),J=(0,W.useSearchParams)().get("q");(0,l.useEffect)(()=>{J&&a(decodeURIComponent(J))},[J]),(0,l.useEffect)(()=>{b&&L(!0)},[b]);let K=e.onConversationIdChange,{data:Y,error:Q}=(0,c.ZP)("agents",()=>window.fetch("/api/agents").then(e=>e.json()).catch(e=>console.log(e)),{revalidateOnFocus:!1}),X=e=>{G.push("/agents?agent=".concat(e))};function $(){f((function(e){for(let t=e.length-1;t>0;t--){let i=Math.floor(Math.random()*(t+1));[e[t],e[i]]=[e[i],e[t]]}return e})(E).slice(0,3))}return(0,l.useEffect)(()=>{var t,i;if(e.isLoadingUserConfig)return;let n=new Date,a=n.getDay(),o=n.getHours()>=17||4>n.getHours()?"evening":n.getHours()>=12?"afternoon":"morning",r=(null===(t=e.userConfig)||void 0===t?void 0:t.given_name)?", ".concat(null===(i=e.userConfig)||void 0===i?void 0:i.given_name):"",s=["What would you like to get done".concat(r,"?"),"Hey".concat(r,"! How can I help?"),"Good ".concat(o).concat(r,"! What's on your mind?"),"Ready to breeze through ".concat(["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][a],"?"),"Let's navigate your ".concat(["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][a]," workload")];g(s[Math.floor(Math.random()*s.length)])},[e.isLoadingUserConfig,e.userConfig]),(0,l.useEffect)(()=>{e.chatOptionsData&&$()},[e.chatOptionsData]),(0,l.useEffect)(()=>{let e=(Y||[]).filter(e=>null!=e);R(e),S(e.length>1?e[0].slug:"khoj"),F(e.map(e=>(0,P.TI)(e.icon,e.color)))},[Y,e.isMobileWidth]),(0,l.useEffect)(()=>{(async()=>{if(n&&!p){u(!0);try{let e=await (0,N.A0)(C||"khoj");null==K||K(e),localStorage.setItem("message",n),r.length>0&&localStorage.setItem("images",JSON.stringify(r)),window.location.href="/chat?conversationId=".concat(e)}catch(e){console.error("Error creating new conversation:",e),u(!1)}a(""),d([])}})(),(n||r.length>0)&&u(!0)},[C,n,p,K]),(0,l.useEffect)(()=>{let e=document.querySelector("[data-radix-scroll-area-viewport]"),t=()=>{k(null),L(!1)};return null==e||e.addEventListener("scroll",t),()=>null==e?void 0:e.removeEventListener("scroll",t)},[]),(0,o.jsxs)("div",{className:"".concat(s().homeGreetings," w-full md:w-auto"),children:[Z&&(0,o.jsx)(_.Z,{onOpenChange:V,isMobileWidth:e.isMobileWidth,loginRedirectMessage:"Login to your second brain"}),!e.isLoggedIn&&(0,o.jsx)(U,{isMobileWidth:e.isMobileWidth,setShowLoginPrompt:V}),(0,o.jsxs)("div",{className:"w-full text-center justify-end content-end",children:[(0,o.jsx)("div",{className:"items-center",children:(0,o.jsx)("h1",{className:"text-2xl md:text-3xl text-center w-fit pb-6 px-4 mx-auto",children:h})}),!e.isMobileWidth&&(0,o.jsxs)(B.x,{className:"w-full max-w-[600px] mx-auto",children:[(0,o.jsx)("div",{className:"flex pb-2 gap-2 items-center justify-center",children:I.map((t,i)=>(0,o.jsxs)(O.J2,{open:w&&b===t.slug,onOpenChange:e=>{e||(k(null),L(!1))},children:[(0,o.jsx)(O.xo,{asChild:!0,children:(0,o.jsx)(x.Zb,{className:"".concat(C===t.slug?(0,j.Iu)(t.color):"border-stone-100 dark:border-neutral-700 text-muted-foreground","\n hover:cursor-pointer rounded-lg px-2 py-2"),onDoubleClick:()=>X(t.slug),onClick:()=>{var e;S(t.slug),null===(e=z.current)||void 0===e||e.focus(),k(null),L(!1)},onMouseEnter:()=>k(t.slug),onMouseLeave:()=>{k(null),L(!1)},children:(0,o.jsxs)(x.ll,{className:"text-center text-md font-medium flex justify-center items-center whitespace-nowrap",children:[A[i]," ",t.name]})})}),(0,o.jsx)(O.yk,{className:"w-80 p-0 border-none bg-transparent shadow-none",onMouseLeave:()=>{k(null),L(!1)},children:(0,o.jsx)(q.EY,{data:t,userProfile:null,isMobileWidth:e.isMobileWidth||!1,showChatButton:!1,editCard:!1,filesOptions:[],selectedChatModelOption:"",agentSlug:"",isSubscribed:(0,D.T8)(e.userConfig),setAgentChangeTriggered:()=>{},modelOptions:[],inputToolOptions:{},outputModeOptions:{}})})]},"".concat(i,"-").concat(t.slug)))}),(0,o.jsx)(B.B,{orientation:"horizontal"})]})]}),(0,o.jsxs)("div",{className:"mx-auto ".concat(e.isMobileWidth?"w-full":"w-fit max-w-screen-md"),children:[!e.isMobileWidth&&(0,o.jsx)("div",{className:"w-full ".concat(s().inputBox," shadow-lg bg-background align-middle items-center justify-center px-3 py-1 dark:bg-neutral-700 border-stone-100 dark:border-none dark:shadow-none rounded-2xl"),children:(0,o.jsx)(M.a,{isLoggedIn:e.isLoggedIn,sendMessage:e=>a(e),sendImage:e=>d(t=>[...t,e]),sendDisabled:p,chatOptionsData:e.chatOptionsData,conversationId:null,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles,agentColor:null===(t=I.find(e=>e.slug===C))||void 0===t?void 0:t.color,ref:z,setTriggeredAbort:()=>{}})}),(0,o.jsx)("div",{className:"".concat(s().suggestions," w-full ").concat(e.isMobileWidth?"grid":"flex flex-row"," justify-center items-center"),children:m.map((t,i)=>(0,o.jsx)("div",{onClick:i=>{e.isLoggedIn?function(e,t,i){if(!e){let e="";i=i.charAt(0).toLowerCase()+i.slice(1),e="Online Search"===t?"/online "+i:"Paint"===t?"/image "+i:i;let n=document.getElementById("message");n&&(n.value=e,a(e))}}(t.link,t.type,t.description):(i.preventDefault(),i.stopPropagation(),V(!0))},children:(0,o.jsx)(H,{title:t.type,body:t.description,link:t.link,color:t.color},t.type+Math.random())},"".concat(t.type," ").concat(t.description)))}),(0,o.jsx)("div",{className:"flex items-center justify-center margin-auto",children:(0,o.jsxs)("button",{onClick:function(){$()},className:"m-2 p-1.5 rounded-lg dark:hover:bg-[var(--background-color)] hover:bg-stone-100 border border-stone-100 text-sm text-stone-500 dark:text-stone-300 dark:border-neutral-700",children:["More Ideas ",(0,o.jsx)(v,{className:"h-4 w-4 inline"})]})})]}),e.isMobileWidth&&(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("div",{className:"".concat(s().inputBox," pt-1 shadow-[0_-20px_25px_-5px_rgba(0,0,0,0.1)] dark:bg-neutral-700 bg-background align-middle items-center justify-center pb-3 mx-1 rounded-t-2xl rounded-b-none"),children:[(0,o.jsxs)(B.x,{className:"w-full max-w-[85vw]",children:[(0,o.jsx)("div",{className:"flex gap-2 items-center justify-left pt-1 pb-2 px-12",children:A.map((e,t)=>(0,o.jsx)(x.Zb,{className:"".concat(C===I[t].slug?(0,j.Iu)(I[t].color):"border-muted text-muted-foreground"," hover:cursor-pointer"),children:(0,o.jsxs)(x.ll,{className:"text-center text-xs font-medium flex justify-center items-center whitespace-nowrap px-1.5 py-1",onDoubleClick:()=>X(I[t].slug),onClick:()=>{var e;S(I[t].slug),null===(e=z.current)||void 0===e||e.focus()},children:[e," ",I[t].name]})},"".concat(t,"-").concat(I[t].slug)))}),(0,o.jsx)(B.B,{orientation:"horizontal"})]}),(0,o.jsx)(M.a,{isLoggedIn:e.isLoggedIn,sendMessage:e=>a(e),sendImage:e=>d(t=>[...t,e]),sendDisabled:p,chatOptionsData:e.chatOptionsData,conversationId:null,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles,agentColor:null===(i=I.find(e=>e.slug===C))||void 0===i?void 0:i.color,ref:z,setTriggeredAbort:()=>{}})]})})]})}function J(){let[e,t]=(0,l.useState)(null),[i,n]=(0,l.useState)(!0),[a,r]=(0,l.useState)(null),[c,d]=(0,l.useState)(null),p=(0,T.IC)(),{userConfig:u,isLoadingUserConfig:h}=(0,D.h2)(!0),[g,m]=(0,l.useState)(null),f=(0,D.GW)();return((0,l.useEffect)(()=>{m(u)},[u]),(0,l.useEffect)(()=>{c&&localStorage.setItem("uploadedFiles",JSON.stringify(c))},[c]),(0,l.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{n(!1),e&&t(e)}).catch(e=>{console.error(e)})},[]),i)?(0,o.jsx)(I.Z,{}):(0,o.jsxs)("div",{className:"".concat(s().main," ").concat(s().chatLayout),children:[(0,o.jsx)("title",{children:"Khoj AI - Your Second Brain"}),(0,o.jsx)("div",{className:"".concat(s().sidePanel),children:(0,o.jsx)(F.ZP,{conversationId:a,uploadedFiles:[],isMobileWidth:p})}),(0,o.jsx)("div",{className:"".concat(s().chatBox),children:(0,o.jsx)("div",{className:"".concat(s().chatBoxBody),children:(0,o.jsx)(G,{isLoggedIn:null!==f,chatOptionsData:e,setUploadedFiles:d,isMobileWidth:p,onConversationIdChange:e=>{r(e)},userConfig:g,isLoadingUserConfig:h})})})]})}},99376:function(e,t,i){"use strict";var n=i(35475);i.o(n,"useRouter")&&i.d(t,{useRouter:function(){return n.useRouter}}),i.o(n,"useSearchParams")&&i.d(t,{useSearchParams:function(){return n.useSearchParams}})},47960:function(){},64670:function(e){e.exports={card:"suggestions_card__fbiZo",title:"suggestions_title__vNozc",text:"suggestions_text__J_IfY"}},76777:function(e){e.exports={main:"page_main__nw1Wk",suggestions:"page_suggestions__Y8EqU",inputBox:"page_inputBox__LrcZ4",chatBodyFull:"page_chatBodyFull__Qu2T2",chatBody:"page_chatBody__IirQQ",chatLayout:"page_chatLayout__bJUjP",chatBox:"page_chatBox__gsR6V",titleBar:"page_titleBar__3btUI",chatBoxBody:"page_chatBoxBody__xORKr",homeGreetings:"page_homeGreetings__VjQhh",sidePanel:"page_sidePanel__mxpxa"}}},function(e){e.O(0,[3587,2664,5540,2693,8407,8667,5401,6589,8117,9058,1662,2813,5477,9262,2971,2117,1744],function(){return e(e.s=1507)}),_N_E=e.O()}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[244,8459,3317,7138],{63521:function(){}},function(n){n.O(0,[2971,2117,1744],function(){return n(n.s=63521)}),_N_E=n.O()}]);
|
@@ -1 +1 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2797],{94114:function(e,t,s){Promise.resolve().then(s.bind(s,96034))},96034:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return C}});var n=s(57437),a=s(95186),r=s(2265),l=s(92813),o=s(41816),i=s.n(o),d=s(19378),c=s(66070),u=s(73925),m=s(75216),h=s(91521),x=s(45178),f=s(58619),g=s(35099),j=s(64697),b=s(27556),p=s(77168),N=s(74915),y=s(62869),w=s(27648),v=s(42225),k=s(7436);let _=["What does the paper say about climate change?","Making a cappuccino at home","Benefits of eating mangoes","How to plan a wedding on a budget","Appointment with Dr. Makinde on 12th August","Class notes lecture 3 on quantum mechanics","Painting concepts for acrylics","Abstract from the paper attention is all you need","Climbing Everest without oxygen","Solving a rubik's cube in 30 seconds","Facts about the planet Mars","How to make a website using React","Fish at the bottom of the ocean","Fish farming Kenya 2021","How to make a cake without an oven","Installing a solar panel at home"];function S(e){var t;let s=e.note,a=(s.additional.file||"").startsWith("http"),r=a?s.additional.heading:s.additional.file.split("/").pop(),l=(0,v.Le)(r||".txt","h-4 w-4 inline mr-2");return(0,n.jsxs)(c.Zb,{className:"bg-secondary h-full shadow-sm rounded-lg bg-gradient-to-b from-background to-slate-50 dark:to-gray-950 border border-muted mb-4",children:[(0,n.jsx)(c.Ol,{children:(0,n.jsxs)(c.ll,{className:"inline-flex gap-2",children:["notion"===(t=s.additional.source)?(0,n.jsx)(u.F,{className:"text-muted-foreground"}):"github"===t?(0,n.jsx)(m.b,{className:"text-muted-foreground"}):(0,n.jsx)(h.S,{className:"text-muted-foreground"}),r]})}),(0,n.jsxs)(c.aY,{children:[(0,n.jsx)("div",{className:"line-clamp-4 text-muted-foreground",children:s.entry}),(0,n.jsxs)(y.z,{onClick:()=>e.setFocusSearchResult(s),variant:"ghost",className:"p-0 mt-2 text-orange-400 hover:bg-inherit",children:["See content",(0,n.jsx)(x.o,{className:"inline ml-2"})]})]}),(0,n.jsx)(c.eW,{children:a?(0,n.jsxs)("a",{href:s.additional.file,target:"_blank",className:"underline text-sm bg-muted p-1 rounded-lg text-muted-foreground",children:[(0,n.jsx)(f.a,{className:"inline m-2"}),s.additional.file]}):(0,n.jsxs)("div",{className:"bg-muted p-2 text-sm rounded-lg text-muted-foreground",children:[l,s.additional.file]})})]})}function C(){let[e,t]=(0,r.useState)(""),[s,o]=(0,r.useState)(null),[u,m]=(0,r.useState)(!1),[h,x]=(0,r.useState)(null),[C,E]=(0,r.useState)(""),F=(0,r.useRef)(null),M=(0,k.IC)();function P(){!u&&e.trim()&&fetch("/api/search?q=".concat(encodeURIComponent(e),"&client=web"),{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{o(e),m(!1)}).catch(e=>{console.error("Error:",e)})}return(0,r.useEffect)(()=>{E(_[Math.floor(Math.random()*_.length)])},[]),(0,r.useEffect)(()=>{if(e.trim())return x(null),F.current&&clearTimeout(F.current),e.trim()&&(F.current=setTimeout(()=>{P()},750)),()=>{F.current&&clearTimeout(F.current)}},[e]),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"h-full ".concat(i().sidePanel),children:(0,n.jsx)(l.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:M})}),(0,n.jsx)("div",{className:"".concat(i().searchLayout),children:(0,n.jsx)("div",{className:"md:w-3/4 sm:w-full mx-auto pt-6 md:pt-8",children:(0,n.jsxs)("div",{className:"p-4 md:w-3/4 sm:w-full mx-auto",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center border-2 border-muted p-1 gap-1 rounded-lg",children:[(0,n.jsx)(a.I,{autoFocus:!0,className:"border-none pl-4",onChange:e=>t(e.currentTarget.value),onKeyDown:e=>"Enter"===e.key&&P(),type:"search",placeholder:"Search Documents"}),(0,n.jsxs)("button",{className:"px-2 gap-2 inline-flex items-center rounded border-l border-gray-300 hover:text-gray-500",onClick:()=>P(),children:[(0,n.jsx)(g.Y,{className:"h-4 w-4"}),(0,n.jsx)("span",{children:"Find"})]})]}),h&&(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsxs)(y.z,{onClick:()=>x(null),className:"mb-4",variant:"outline",children:[(0,n.jsx)(j.X,{className:"inline mr-2"}),"Back"]}),function(e){let t=(e.additional.file||"").startsWith("http"),s=t?e.additional.heading:e.additional.file.split("/").pop(),a=(0,v.Le)(s||".txt","h-4 w-4 inline mr-2");return(0,n.jsxs)(c.Zb,{className:"bg-secondary h-full shadow-sm rounded-lg bg-gradient-to-b from-background to-slate-50 dark:to-gray-950 border border-muted mb-4",children:[(0,n.jsx)(c.Ol,{children:(0,n.jsx)(c.ll,{children:s})}),(0,n.jsx)(c.eW,{children:t?(0,n.jsxs)("a",{href:e.additional.file,target:"_blank",className:"underline text-sm bg-muted p-3 rounded-lg text-muted-foreground flex items-center gap-2",children:[(0,n.jsx)(f.a,{className:"inline"}),e.additional.file]}):(0,n.jsxs)("div",{className:"bg-muted p-3 text-sm rounded-lg text-muted-foreground flex items-center gap-2",children:[a,e.additional.file]})}),(0,n.jsx)(c.aY,{children:(0,n.jsx)("div",{className:"text-m",children:e.entry})})]})}(h)]}),!h&&s&&s.length>0&&(0,n.jsx)("div",{className:"mt-4 max-w-[92vw] break-all",children:(0,n.jsx)(d.x,{className:"h-[80vh]",children:s.map((e,t)=>(0,n.jsx)(S,{note:e,setFocusSearchResult:x},e["corpus-id"]))})}),null==s&&(0,n.jsxs)(c.Zb,{className:"flex flex-col items-center justify-center border-none shadow-none",children:[(0,n.jsxs)(c.Ol,{className:"flex flex-col items-center justify-center",children:[(0,n.jsx)(c.SZ,{className:"border-muted-foreground border w-fit rounded-lg mb-2 text-center text-lg p-4",children:(0,n.jsx)(b.r,{weight:"fill",className:"text-muted-foreground h-10 w-10"})}),(0,n.jsx)(c.ll,{className:"text-center",children:"Search across your documents"})]}),(0,n.jsxs)(c.aY,{className:"text-muted-foreground items-center justify-center text-center flex",children:[(0,n.jsx)(p.v,{className:"inline mr-2"})," ",C]})]}),s&&0===s.length&&(0,n.jsxs)(c.Zb,{className:"flex flex-col items-center justify-center border-none shadow-none",children:[(0,n.jsxs)(c.Ol,{className:"flex flex-col items-center justify-center",children:[(0,n.jsx)(c.SZ,{className:"border-muted-foreground border w-fit rounded-lg mb-2 text-center text-lg p-4",children:(0,n.jsx)(N.D,{weight:"fill",className:"text-muted-foreground h-10 w-10"})}),(0,n.jsx)(c.ll,{className:"text-center",children:"No documents found"})]}),(0,n.jsxs)(c.aY,{children:[(0,n.jsx)("div",{className:"text-muted-foreground items-center justify-center text-center flex",children:"To use search, upload your docs to your account."}),(0,n.jsx)(w.default,{href:"https://docs.khoj.dev/data-sources/share_your_data",className:"no-underline",children:(0,n.jsx)("div",{className:"mt-4 text-center text-secondary-foreground bg-secondary w-fit m-auto p-2 rounded-lg",children:"Learn More"})})]})]})]})})})]})}},41816:function(e){e.exports={searchLayout:"search_searchLayout__fP3m0",sidePanel:"search_sidePanel__myfc9"}}},function(e){e.O(0,[
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2797],{94114:function(e,t,s){Promise.resolve().then(s.bind(s,96034))},96034:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return C}});var n=s(57437),a=s(95186),r=s(2265),l=s(92813),o=s(41816),i=s.n(o),d=s(19378),c=s(66070),u=s(73925),m=s(75216),h=s(91521),x=s(45178),f=s(58619),g=s(35099),j=s(64697),b=s(27556),p=s(77168),N=s(74915),y=s(62869),w=s(27648),v=s(42225),k=s(7436);let _=["What does the paper say about climate change?","Making a cappuccino at home","Benefits of eating mangoes","How to plan a wedding on a budget","Appointment with Dr. Makinde on 12th August","Class notes lecture 3 on quantum mechanics","Painting concepts for acrylics","Abstract from the paper attention is all you need","Climbing Everest without oxygen","Solving a rubik's cube in 30 seconds","Facts about the planet Mars","How to make a website using React","Fish at the bottom of the ocean","Fish farming Kenya 2021","How to make a cake without an oven","Installing a solar panel at home"];function S(e){var t;let s=e.note,a=(s.additional.file||"").startsWith("http"),r=a?s.additional.heading:s.additional.file.split("/").pop(),l=(0,v.Le)(r||".txt","h-4 w-4 inline mr-2");return(0,n.jsxs)(c.Zb,{className:"bg-secondary h-full shadow-sm rounded-lg bg-gradient-to-b from-background to-slate-50 dark:to-gray-950 border border-muted mb-4",children:[(0,n.jsx)(c.Ol,{children:(0,n.jsxs)(c.ll,{className:"inline-flex gap-2",children:["notion"===(t=s.additional.source)?(0,n.jsx)(u.F,{className:"text-muted-foreground"}):"github"===t?(0,n.jsx)(m.b,{className:"text-muted-foreground"}):(0,n.jsx)(h.S,{className:"text-muted-foreground"}),r]})}),(0,n.jsxs)(c.aY,{children:[(0,n.jsx)("div",{className:"line-clamp-4 text-muted-foreground",children:s.entry}),(0,n.jsxs)(y.z,{onClick:()=>e.setFocusSearchResult(s),variant:"ghost",className:"p-0 mt-2 text-orange-400 hover:bg-inherit",children:["See content",(0,n.jsx)(x.o,{className:"inline ml-2"})]})]}),(0,n.jsx)(c.eW,{children:a?(0,n.jsxs)("a",{href:s.additional.file,target:"_blank",className:"underline text-sm bg-muted p-1 rounded-lg text-muted-foreground",children:[(0,n.jsx)(f.a,{className:"inline m-2"}),s.additional.file]}):(0,n.jsxs)("div",{className:"bg-muted p-2 text-sm rounded-lg text-muted-foreground",children:[l,s.additional.file]})})]})}function C(){let[e,t]=(0,r.useState)(""),[s,o]=(0,r.useState)(null),[u,m]=(0,r.useState)(!1),[h,x]=(0,r.useState)(null),[C,E]=(0,r.useState)(""),F=(0,r.useRef)(null),M=(0,k.IC)();function P(){!u&&e.trim()&&fetch("/api/search?q=".concat(encodeURIComponent(e),"&client=web"),{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{o(e),m(!1)}).catch(e=>{console.error("Error:",e)})}return(0,r.useEffect)(()=>{E(_[Math.floor(Math.random()*_.length)])},[]),(0,r.useEffect)(()=>{if(e.trim())return x(null),F.current&&clearTimeout(F.current),e.trim()&&(F.current=setTimeout(()=>{P()},750)),()=>{F.current&&clearTimeout(F.current)}},[e]),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"h-full ".concat(i().sidePanel),children:(0,n.jsx)(l.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:M})}),(0,n.jsx)("div",{className:"".concat(i().searchLayout),children:(0,n.jsx)("div",{className:"md:w-3/4 sm:w-full mx-auto pt-6 md:pt-8",children:(0,n.jsxs)("div",{className:"p-4 md:w-3/4 sm:w-full mx-auto",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center border-2 border-muted p-1 gap-1 rounded-lg",children:[(0,n.jsx)(a.I,{autoFocus:!0,className:"border-none pl-4",onChange:e=>t(e.currentTarget.value),onKeyDown:e=>"Enter"===e.key&&P(),type:"search",placeholder:"Search Documents"}),(0,n.jsxs)("button",{className:"px-2 gap-2 inline-flex items-center rounded border-l border-gray-300 hover:text-gray-500",onClick:()=>P(),children:[(0,n.jsx)(g.Y,{className:"h-4 w-4"}),(0,n.jsx)("span",{children:"Find"})]})]}),h&&(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsxs)(y.z,{onClick:()=>x(null),className:"mb-4",variant:"outline",children:[(0,n.jsx)(j.X,{className:"inline mr-2"}),"Back"]}),function(e){let t=(e.additional.file||"").startsWith("http"),s=t?e.additional.heading:e.additional.file.split("/").pop(),a=(0,v.Le)(s||".txt","h-4 w-4 inline mr-2");return(0,n.jsxs)(c.Zb,{className:"bg-secondary h-full shadow-sm rounded-lg bg-gradient-to-b from-background to-slate-50 dark:to-gray-950 border border-muted mb-4",children:[(0,n.jsx)(c.Ol,{children:(0,n.jsx)(c.ll,{children:s})}),(0,n.jsx)(c.eW,{children:t?(0,n.jsxs)("a",{href:e.additional.file,target:"_blank",className:"underline text-sm bg-muted p-3 rounded-lg text-muted-foreground flex items-center gap-2",children:[(0,n.jsx)(f.a,{className:"inline"}),e.additional.file]}):(0,n.jsxs)("div",{className:"bg-muted p-3 text-sm rounded-lg text-muted-foreground flex items-center gap-2",children:[a,e.additional.file]})}),(0,n.jsx)(c.aY,{children:(0,n.jsx)("div",{className:"text-m",children:e.entry})})]})}(h)]}),!h&&s&&s.length>0&&(0,n.jsx)("div",{className:"mt-4 max-w-[92vw] break-all",children:(0,n.jsx)(d.x,{className:"h-[80vh]",children:s.map((e,t)=>(0,n.jsx)(S,{note:e,setFocusSearchResult:x},e["corpus-id"]))})}),null==s&&(0,n.jsxs)(c.Zb,{className:"flex flex-col items-center justify-center border-none shadow-none",children:[(0,n.jsxs)(c.Ol,{className:"flex flex-col items-center justify-center",children:[(0,n.jsx)(c.SZ,{className:"border-muted-foreground border w-fit rounded-lg mb-2 text-center text-lg p-4",children:(0,n.jsx)(b.r,{weight:"fill",className:"text-muted-foreground h-10 w-10"})}),(0,n.jsx)(c.ll,{className:"text-center",children:"Search across your documents"})]}),(0,n.jsxs)(c.aY,{className:"text-muted-foreground items-center justify-center text-center flex",children:[(0,n.jsx)(p.v,{className:"inline mr-2"})," ",C]})]}),s&&0===s.length&&(0,n.jsxs)(c.Zb,{className:"flex flex-col items-center justify-center border-none shadow-none",children:[(0,n.jsxs)(c.Ol,{className:"flex flex-col items-center justify-center",children:[(0,n.jsx)(c.SZ,{className:"border-muted-foreground border w-fit rounded-lg mb-2 text-center text-lg p-4",children:(0,n.jsx)(N.D,{weight:"fill",className:"text-muted-foreground h-10 w-10"})}),(0,n.jsx)(c.ll,{className:"text-center",children:"No documents found"})]}),(0,n.jsxs)(c.aY,{children:[(0,n.jsx)("div",{className:"text-muted-foreground items-center justify-center text-center flex",children:"To use search, upload your docs to your account."}),(0,n.jsx)(w.default,{href:"https://docs.khoj.dev/data-sources/share_your_data",className:"no-underline",children:(0,n.jsx)("div",{className:"mt-4 text-center text-secondary-foreground bg-secondary w-fit m-auto p-2 rounded-lg",children:"Learn More"})})]})]})]})})})]})}},41816:function(e){e.exports={searchLayout:"search_searchLayout__fP3m0",sidePanel:"search_sidePanel__myfc9"}}},function(e){e.O(0,[5540,2693,8407,8667,5401,1201,2813,2971,2117,1744],function(){return e(e.s=94114)}),_N_E=e.O()}]);
|
@@ -1 +1 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6938],{62960:function(e,t,s){Promise.resolve().then(s.bind(s,31537))},31537:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return ei}});var a,n,r=s(57437),i=s(917),l=s.n(i);s(97510);var o=s(2265),c=s(77992),d=s(56937),h=s(7436),u=s(67341),m=s(62869),x=s(26371),p=s(95186),f=s(66070),j=s(84190),g=s(94508);let b=o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("div",{className:"relative w-full overflow-auto",children:(0,r.jsx)("table",{ref:t,className:(0,g.cn)("w-full caption-bottom text-sm",s),...a})})});b.displayName="Table",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("thead",{ref:t,className:(0,g.cn)("[&_tr]:border-b",s),...a})}).displayName="TableHeader";let y=o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("tbody",{ref:t,className:(0,g.cn)("[&_tr:last-child]:border-0",s),...a})});y.displayName="TableBody",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("tfoot",{ref:t,className:(0,g.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a})}).displayName="TableFooter";let w=o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("tr",{ref:t,className:(0,g.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...a})});w.displayName="TableRow",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("th",{ref:t,className:(0,g.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a})}).displayName="TableHead";let N=o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("td",{ref:t,className:(0,g.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a})});N.displayName="TableCell",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("caption",{ref:t,className:(0,g.cn)("mt-4 text-sm text-muted-foreground",s),...a})}).displayName="TableCaption";var v=s(23518),_=s(87296),k=s(89203),S=s(57466),C=s(38513),T=s(19841),D=s(3894),E=s(37295),F=s(2049),P=s(50525),O=s(5147),A=s(80438),I=s(29975),z=s(47615),Y=s(47020),R=s(22345),K=s(75216),W=s(90483),Z=s(73925),M=s(54271),U=s(95656),L=s(58717),B=s(81228),V=s(88435),H=s(56777),G=s(97525),J=s(45178),$=s(92813),q=s(14308),X=s(34688),Q=s(59199),ee=s(37099),et=s(32759),es=s(27648);let ea=e=>{let{onClose:t}=e,[s,a]=(0,o.useState)([]),[n,i]=(0,o.useState)([]),[l,c]=(0,o.useState)(""),[d,h]=(0,o.useState)(!1),[u,x]=(0,o.useState)(null),[p,f]=(0,o.useState)(null),[j,g]=(0,o.useState)(!1),[b,y]=(0,o.useState)(0),[w,N]=(0,o.useState)([]),D=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(j||y(0),j){let e=setInterval(()=>{y(e=>{let t=e+(Math.floor(5*Math.random())+1);return t<100?t:100})},800);return()=>clearInterval(e)}},[j]),(0,o.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/content/computer");if(!e.ok)throw Error("Failed to fetch files");let t=await e.json();Array.isArray(t)?a(t.toSorted()):console.error("Unexpected data format from API")}catch(e){console.error("Error fetching files:",e)}})()},[w]);let E=s.filter(e=>e.toLowerCase().includes(l.toLowerCase())),F=async()=>{let e=n.length>0?n:E;if(0!==e.length)try{if(!(await fetch("/api/content/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})})).ok)throw Error("Failed to delete files");a(t=>t.filter(t=>!e.includes(t))),i([])}catch(e){console.error("Error deleting files:",e)}},P=async e=>{try{if(!(await fetch("/api/content/file?filename=".concat(encodeURIComponent(e)),{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to delete file");a(t=>t.filter(t=>t!==e)),i(t=>t.filter(t=>t!==e))}catch(e){console.error("Error deleting file:",e)}};function O(e){(0,Q.ko)(e,x,g,f,N)}return(0,r.jsxs)(v.m5,{open:!0,onOpenChange:t,children:[(0,r.jsx)(ee.aR,{open:null!==u||null!=p,children:(0,r.jsxs)(ee._T,{children:[(0,r.jsx)(ee.fY,{children:(0,r.jsx)(ee.f$,{children:"Alert"})}),(0,r.jsx)(ee.yT,{children:u||p}),(0,r.jsx)(ee.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{x(null),f(null),g(!1)},children:"Close"})]})}),(0,r.jsxs)("div",{className:"flex flex-col h-full",onDragOver:function(e){e.preventDefault(),h(!0)},onDragLeave:function(e){e.preventDefault(),h(!1)},onDrop:function(e){e.preventDefault(),h(!1),e.dataTransfer.files&&O(e.dataTransfer.files)},onClick:function(){D&&D.current&&D.current.click()},children:[(0,r.jsx)("input",{type:"file",multiple:!0,ref:D,style:{display:"none"},onChange:function(e){e.target.files&&O(e.target.files)}}),(0,r.jsxs)("div",{className:"flex-none p-4",children:["Upload files",j&&(0,r.jsx)(et.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:b})]}),(0,r.jsx)("div",{className:"flex-none p-4 bg-secondary border-b ".concat(d?"animate-pulse":""," rounded-lg"),children:(0,r.jsx)("div",{className:"flex items-center justify-center w-full h-32 border-2 border-dashed border-gray-300 rounded-lg",children:d?(0,r.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,r.jsx)(_.u,{className:"h-6 w-6 mr-2"}),(0,r.jsx)("span",{children:"Drop files to upload"})]}):(0,r.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,r.jsx)(k.v,{className:"h-6 w-6 mr-2"}),(0,r.jsx)("span",{children:"Drag and drop files here"})]})})})]}),(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(0,r.jsx)("div",{className:"flex-none p-4 bg-background border-b",children:(0,r.jsx)(v.sZ,{placeholder:"Find synced files",value:l,onValueChange:c})}),(0,r.jsx)("div",{className:"flex-grow overflow-auto",children:(0,r.jsxs)(v.e8,{children:[(0,r.jsx)(v.rb,{children:0===s.length?(0,r.jsxs)("div",{className:"flex items-center justify-center",children:[(0,r.jsx)(S.C,{className:"h-4 w-4 mr-2",weight:"bold"}),"No files synced"]}):(0,r.jsxs)("div",{children:["Could not find a good match.",(0,r.jsx)(es.default,{href:"/search",className:"block",children:"Need advanced search? Click here."})]})}),(0,r.jsx)(v.fu,{heading:"Synced files",children:E.map(e=>(0,r.jsx)(v.di,{value:e,onSelect:e=>{i(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},children:(0,r.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,r.jsxs)("div",{className:"flex items-center ".concat(n.includes(e)?"font-semibold":""),children:[n.includes(e)&&(0,r.jsx)(C.J,{className:"h-4 w-4 mr-2"}),(0,r.jsx)("span",{className:"break-all",children:e})]}),(0,r.jsx)(m.z,{variant:"outline",size:"sm",onClick:()=>P(e),className:"ml-auto",children:(0,r.jsx)(T.r,{className:"h-4 w-4"})})]})},e))})]})}),(0,r.jsx)("div",{className:"flex-none p-4 bg-background border-t",children:(0,r.jsx)("div",{className:"flex justify-between",children:(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:F,className:"mr-2",children:[(0,r.jsx)(T.r,{className:"h-4 w-4 mr-2"}),n.length>0?"Delete Selected (".concat(n.length,")"):"Delete All"]})})})]})]})},en=e=>{var t,s;let{items:a,selected:n,callbackFunc:i}=e,[l,c]=(0,o.useState)(null!==(s=null==n?void 0:n.toString())&&void 0!==s?s:"0");return!!n&&(0,r.jsx)("div",{className:"overflow-hidden shadow-md rounded-lg",children:(0,r.jsxs)(j.h_,{children:[(0,r.jsx)(j.$F,{asChild:!0,className:"w-full rounded-lg",children:(0,r.jsxs)(m.z,{variant:"outline",className:"justify-start py-6 rounded-lg",children:[null===(t=a.find(e=>e.id.toString()===l))||void 0===t?void 0:t.name," ",(0,r.jsx)(D.p,{className:"h-4 w-4 ml-auto text-muted-foreground"})]})}),(0,r.jsx)(j.AW,{style:{maxHeight:"200px",overflowY:"auto",minWidth:"var(--radix-dropdown-menu-trigger-width)"},children:(0,r.jsx)(j._x,{value:l,onValueChange:async e=>{c(e),await i(e)},children:a.map(e=>(0,r.jsx)(j.qB,{value:e.id.toString(),children:e.name},e.id.toString()))})})]})})},er=()=>{let[e,t]=(0,o.useState)([]),{toast:s}=(0,c.pm)(),a=async()=>{try{let e=await fetch("/auth/token",{method:"POST",headers:{"Content-Type":"application/json"}}),s=await e.json();t(e=>[...e,s])}catch(e){console.error("Error generating API key:",e)}},n=async e=>{try{await navigator.clipboard.writeText(e),s({title:"\uD83D\uDD11 API Key",description:"Copied to clipboard"})}catch(e){console.error("Error copying API key:",e)}},r=async e=>{try{(await fetch("/auth/token?token=".concat(e),{method:"DELETE"})).ok&&t(t=>t.filter(t=>t.token!==e))}catch(e){console.error("Error deleting API key:",e)}},i=async()=>{try{let e=await fetch("/auth/token"),s=await e.json();(null==s?void 0:s.length)>0&&t(s)}catch(e){console.error("Error listing API keys:",e)}};return(0,o.useEffect)(()=>{i()},[]),{apiKeys:e,generateAPIKey:a,copyAPIKey:n,deleteAPIKey:r}};function ei(){let[e,t]=(0,o.useState)("Settings"),{apiKeys:s,generateAPIKey:a,copyAPIKey:n,deleteAPIKey:i}=er(),{userConfig:j}=(0,d.h2)(!0),[g,v]=(0,o.useState)(null),[C,D]=(0,o.useState)(void 0),[Q,ee]=(0,o.useState)(null),[et,es]=(0,o.useState)(void 0),[ei,el]=(0,o.useState)(""),[eo,ec]=(0,o.useState)("verified"),[ed,eh]=(0,o.useState)(!1),{toast:eu}=(0,c.pm)(),em=(0,h.IC)(),ex="w-full lg:w-1/3 grid grid-flow-column border border-gray-300 shadow-md rounded-lg bg-gradient-to-b from-background to-gray-50 dark:to-gray-950 border border-opacity-50";(0,o.useEffect)(()=>{var e;v(j),es(null==j?void 0:j.phone_number),ec((null==j?void 0:j.is_phone_number_verified)?"verified":(null==j?void 0:j.phone_number)?"otp":"setup"),D(null==j?void 0:j.given_name),ee(null!==(e=null==j?void 0:j.notion_token)&&void 0!==e?e:null)},[j]);let ep=async()=>{try{if(!(await fetch("/api/phone?phone_number=".concat(et),{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to send OTP");ec("verify")}catch(e){console.error("Error sending OTP:",e),eu({title:"\uD83D\uDCF1 Phone",description:"Failed to send OTP. Try again or contact us at team@khoj.dev"})}},ef=async()=>{try{if(!(await fetch("/api/phone/verify?code=".concat(ei),{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to verify OTP");ec("verified"),eu({title:"\uD83D\uDCF1 Phone",description:"Phone number verified"})}catch(e){console.error("Error verifying OTP:",e),eu({title:"\uD83D\uDCF1 Phone",description:"Failed to verify OTP. Try again or contact us at team@khoj.dev"})}},ej=async()=>{try{if(!(await fetch("/api/phone",{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to disconnect phone number");es(void 0),ec("setup"),eu({title:"\uD83D\uDCF1 Phone",description:"Phone number disconnected"})}catch(e){console.error("Error disconnecting phone number:",e),eu({title:"\uD83D\uDCF1 Phone",description:"Failed to disconnect phone number. Try again or contact us at team@khoj.dev"})}},eg=async e=>{try{if(!(await fetch("/api/subscription?operation=".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to change subscription");g&&(g.subscription_state="cancel"===e?d.o9.UNSUBSCRIBED:d.o9.SUBSCRIBED,v(g)),eu({title:"\uD83D\uDCB3 Subscription",description:(null==g?void 0:g.subscription_state)==="unsubscribed"?"Your subscription was cancelled":"Your Futurist subscription has been renewed"})}catch(t){console.error("Error changing subscription:",t),eu({title:"\uD83D\uDCB3 Subscription",description:"cancel"===e?"Failed to cancel subscription. Try again or contact us at team@khoj.dev":"Failed to renew subscription. Try again or contact us at team@khoj.dev"})}},eb=async()=>{try{let e=await fetch("/api/subscription/trial",{method:"POST"});if(!e.ok)throw Error("Failed to enable free trial");if((await e.json()).trial_enabled&&g){g.subscription_state=d.o9.TRIAL;let e=new Date(Date.now()+864e5*g.length_of_free_trial);g.subscription_renewal_date=(e=>{let t=new Date(e);return new Intl.DateTimeFormat("en-US",{day:"2-digit",month:"short",year:"numeric"}).format(t)})(e),g.subscription_enabled_trial_at=new Date().toISOString(),v(g),eu({title:"\uD83C\uDF89 Trial Enabled",description:"Your free trial will end on ".concat(g.subscription_renewal_date)})}}catch(e){console.error("Error enabling free trial:",e),eu({title:"⚠️ Failed to Enable Free Trial",description:"Failed to enable free trial. Try again or contact us at team@khoj.dev"})}},ey=async()=>{if(C)try{if(!(await fetch("/api/user/name?name=".concat(C),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to update name");g&&(g.given_name=C,v(g)),eu({title:"✅ Updated Profile",description:"You name has been updated to ".concat(C)})}catch(e){console.error("Error updating name:",e),eu({title:"⚠️ Failed to Update Profile",description:"Failed to update name. Try again or contact team@khoj.dev"})}},ew=e=>async t=>{if(!(null==g?void 0:g.is_active)){eu({title:"Model Update",description:"You need to be subscribed to update ".concat(e," models"),variant:"destructive"});return}try{if(!(await fetch("/api/model/".concat(e,"?id=")+t,{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to update model");eu({title:"✅ Updated ".concat((0,h.LF)(e)," Model")})}catch(t){console.error("Failed to update ".concat(e," model:"),t),eu({description:"❌ Failed to update ".concat((0,h.LF)(e)," model. Try again."),variant:"destructive"})}},eN=async()=>{if(Q)try{if(!(await fetch("/api/content/notion",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:Q})})).ok)throw Error("Failed to save Notion API key");g&&(g.notion_token=Q,v(g)),eu({title:"✅ Saved Notion Settings",description:"You Notion API key has been saved."})}catch(e){console.error("Error updating name:",e),eu({title:"⚠️ Failed to Save Notion Settings",description:"Failed to save Notion API key. Try again or contact team@khoj.dev"})}},ev=async e=>{try{if(!(await fetch("/api/content?t=".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to sync content from ".concat(e));eu({title:"\uD83D\uDD04 Syncing ".concat(e),description:"Your ".concat(e," content is being synced.")})}catch(t){console.error("Error syncing content:",t),eu({title:"⚠️ Failed to Sync ".concat(e),description:"Failed to sync ".concat(e," content. Try again or contact team@khoj.dev")})}},e_=async e=>{try{if(!(await fetch("/api/content/".concat(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to disconnect ".concat(e));g&&("computer"===e?g.enabled_content_source.computer=!1:"notion"===e?(g.enabled_content_source.notion=!1,g.notion_token=null,ee(g.notion_token)):"github"===e&&(g.enabled_content_source.github=!1),v(g)),"computer"===e?eu({title:"✅ Deleted Synced Files",description:"Your synced documents have been deleted."}):eu({title:"✅ Disconnected ".concat(e),description:"Your ".concat(e," integration to Khoj has been disconnected.")})}catch(t){console.error("Error disconnecting ".concat(e,":"),t),eu({title:"⚠️ Failed to Disconnect ".concat(e),description:"Failed to disconnect from ".concat(e,". Try again or contact team@khoj.dev")})}};return g?(0,r.jsxs)("div",{className:l().page,children:[(0,r.jsx)("title",{children:e}),(0,r.jsx)("div",{className:l().sidePanel,children:(0,r.jsx)($.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:em})}),(0,r.jsx)("div",{className:l().content,children:(0,r.jsx)("div",{className:"".concat(l().contentBody," mx-10 my-2"),children:(0,r.jsx)(o.Suspense,{fallback:(0,r.jsx)(q.Z,{}),children:(0,r.jsxs)("div",{id:"content",className:"grid grid-flow-column sm:grid-flow-row gap-16 m-8",children:[(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Profile"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[(0,r.jsxs)(f.Zb,{className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(E.Y,{className:"h-7 w-7 mr-2"}),"Name"]}),(0,r.jsxs)(f.aY,{className:"overflow-hidden",children:[(0,r.jsx)("p",{className:"pb-4 text-gray-400",children:"What should Khoj refer to you as?"}),(0,r.jsx)(p.I,{type:"text",onChange:e=>D(e.target.value),value:C,className:"w-full border border-gray-300 rounded-lg p-4 py-6"})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:ey,disabled:C===g.given_name,children:[(0,r.jsx)(F.B,{className:"h-5 w-5 inline mr-2"}),"Save"]})})]}),(0,r.jsxs)(f.Zb,{id:"subscription",className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(P.a,{className:"h-7 w-7 mr-2"}),"Subscription"]}),(0,r.jsxs)(f.aY,{className:"grid gap-2 overflow-hidden",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Current Plan"}),"trial"===g.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl text-primary/80",children:"Futurist (Trial)"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["You are on a"," ",g.length_of_free_trial," day trial of the Khoj Futurist plan. Your trial ends on ",g.subscription_renewal_date,". Check"," ",(0,r.jsx)("a",{href:"https://khoj.dev/#pricing",target:"_blank",children:"pricing page"})," ","to compare plans."]})]})||"subscribed"===g.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl text-primary/80",children:"Futurist"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"renews"})," on"," ",(0,r.jsx)("b",{children:g.subscription_renewal_date})]})]})||"unsubscribed"===g.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl",children:"Futurist"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"ends"})," on"," ",(0,r.jsx)("b",{children:g.subscription_renewal_date})]})]})||"expired"===g.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl",children:"Humanist"}),g.subscription_renewal_date&&(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"expired"})," on"," ",(0,r.jsx)("b",{children:g.subscription_renewal_date})]})||(0,r.jsxs)("p",{className:"text-gray-400",children:["Check"," ",(0,r.jsx)("a",{href:"https://khoj.dev/#pricing",target:"_blank",children:"pricing page"})," ","to compare plans."]})]})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:"subscribed"==g.subscription_state&&(0,r.jsxs)(m.z,{variant:"outline",className:"hover:text-red-400",onClick:()=>eg("cancel"),children:[(0,r.jsx)(O.b,{className:"h-5 w-5 mr-2"}),"Unsubscribe"]})||"unsubscribed"==g.subscription_state&&(0,r.jsxs)(m.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>eg("resubscribe"),children:[(0,r.jsx)(A.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Resubscribe"]})||g.subscription_enabled_trial_at&&(0,r.jsxs)(m.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>window.open("".concat(g.khoj_cloud_subscription_url,"?prefilled_email=").concat(g.username),"_blank","noopener,noreferrer"),children:[(0,r.jsx)(A.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Subscribe"]})||(0,r.jsxs)(m.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:eb,children:[(0,r.jsx)(A.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Enable Trial"]})})]})]})]}),ed&&(0,r.jsx)(ea,{onClose:()=>eh(!1)}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Content"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[(0,r.jsxs)(f.Zb,{id:"computer",className:ex,children:[(0,r.jsxs)(f.Ol,{className:"flex flex-row text-2xl",children:[(0,r.jsx)(I.I,{className:"h-8 w-8 mr-2"}),"Files",g.enabled_content_source.computer&&(0,r.jsx)(z.f,{className:"h-6 w-6 ml-auto text-green-500",weight:"fill"})]}),(0,r.jsx)(f.aY,{className:"overflow-hidden pb-12 text-gray-400",children:"Manage your synced files"}),(0,r.jsxs)(f.eW,{className:"flex flex-wrap gap-4",children:[(0,r.jsx)(m.z,{variant:"outline",size:"sm",onClick:()=>eh(!0),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Y.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(g.enabled_content_source.computer||"hidden"),onClick:()=>e_("computer"),children:[(0,r.jsx)(R.u,{className:"h-5 w-5 inline mr-1"}),"Disable"]})]})]}),(0,r.jsxs)(f.Zb,{id:"github",className:"".concat(ex," hidden"),children:[(0,r.jsxs)(f.Ol,{className:"flex flex-row text-2xl",children:[(0,r.jsx)(K.b,{className:"h-8 w-8 mr-2"}),"Github"]}),(0,r.jsx)(f.aY,{className:"overflow-hidden pb-12 text-gray-400",children:"Set Github repositories to index"}),(0,r.jsxs)(f.eW,{className:"flex flex-wrap gap-4",children:[(0,r.jsx)(m.z,{variant:"outline",size:"sm",children:g.enabled_content_source.github&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Y.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})||(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]})}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(g.enabled_content_source.github||"hidden"),children:[(0,r.jsx)(R.u,{className:"h-5 w-5 inline mr-1"}),"Disable"]})]})]}),(0,r.jsxs)(f.Zb,{id:"notion",className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(Z.F,{className:"h-7 w-7 mr-2"}),"Notion",g.enabled_content_source.notion&&(0,r.jsx)(z.f,{className:"h-6 w-6 ml-auto text-green-500",weight:"fill"})]}),(0,r.jsxs)(f.aY,{className:"grid gap-4",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Sync your Notion workspace."}),!g.notion_oauth_url&&(0,r.jsx)(p.I,{onChange:e=>ee(e.target.value),value:Q||"",placeholder:"Enter API Key of your Khoj integration on Notion",className:"w-full border border-gray-300 rounded-lg px-4 py-6"})]}),(0,r.jsxs)(f.eW,{className:"flex flex-wrap gap-4",children:[g.notion_oauth_url&&!g.enabled_content_source.notion?(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:()=>{window.open(g.notion_oauth_url)},children:[(0,r.jsx)(W.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]}):g.enabled_content_source.notion&&Q===g.notion_token?(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:()=>ev("notion"),children:[(0,r.jsx)(M.t,{className:"h-5 w-5 inline mr-1"}),"Sync"]}):g.notion_oauth_url?(0,r.jsx)(r.Fragment,{}):(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:eN,disabled:Q===g.notion_token,children:[(0,r.jsx)(F.B,{className:"h-5 w-5 inline mr-1"}),g.enabled_content_source.notion&&"Update API Key"||"Set API Key"]}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(g.notion_token||"hidden"),onClick:()=>e_("notion"),children:[(0,r.jsx)(R.u,{className:"h-5 w-5 inline mr-1"}),"Disconnect"]})]})]})]})]}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Models"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[g.chat_model_options.length>0&&(0,r.jsxs)(f.Zb,{className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(U.G,{className:"h-7 w-7 mr-2"}),"Chat"]}),(0,r.jsxs)(f.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the chat model to generate text responses"}),(0,r.jsx)(en,{items:g.chat_model_options,selected:g.selected_chat_model_config,callbackFunc:ew("chat")})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:!g.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),g.paint_model_options.length>0&&(0,r.jsxs)(f.Zb,{className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(L.Y,{className:"h-7 w-7 mr-2"}),"Paint"]}),(0,r.jsxs)(f.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the paint model to generate image responses"}),(0,r.jsx)(en,{items:g.paint_model_options,selected:g.selected_paint_model_config,callbackFunc:ew("paint")})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:!g.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),g.voice_model_options.length>0&&(0,r.jsxs)(f.Zb,{className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(_.u,{className:"h-7 w-7 mr-2"}),"Voice"]}),(0,r.jsxs)(f.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the voice model to generate speech responses"}),(0,r.jsx)(en,{items:g.voice_model_options,selected:g.selected_voice_model_config,callbackFunc:ew("voice")})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:!g.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]})]})]}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{id:"clients",className:"text-2xl",children:"Clients"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-8",children:[!g.anonymous_mode&&(0,r.jsxs)(f.Zb,{className:"grid grid-flow-column border border-gray-300 shadow-md rounded-lg bg-gradient-to-b from-background to-gray-50 dark:to-gray-950",children:[(0,r.jsxs)(f.Ol,{className:"text-xl grid grid-flow-col grid-cols-[1fr_auto] pb-0",children:[(0,r.jsxs)("span",{className:"flex flex-wrap",children:[(0,r.jsx)(B.s,{className:"h-7 w-7 mr-2"}),"API Keys"]}),(0,r.jsxs)(m.z,{variant:"secondary",className:"!mt-0",onClick:a,children:[(0,r.jsx)(k.v,{weight:"bold",className:"h-5 w-5 mr-2"}),"Generate Key"]})]}),(0,r.jsxs)(f.aY,{className:"overflow-hidden grid gap-6",children:[(0,r.jsxs)("p",{className:"text-md text-gray-400",children:["Access Khoj from the"," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Desktop",target:"_blank",children:"Desktop"}),","," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Obsidian",children:"Obsidian"}),","," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Emacs",children:"Emacs"})," ","apps and more."]}),(0,r.jsx)(b,{children:(0,r.jsx)(y,{children:s.map(e=>(0,r.jsxs)(w,{children:[(0,r.jsx)(N,{className:"pl-0 py-3",children:e.name}),(0,r.jsxs)(N,{className:"grid grid-flow-col grid-cols-[1fr_auto] bg-secondary rounded-xl p-3 m-1",children:[(0,r.jsx)("span",{children:"".concat(e.token.slice(0,6),"...").concat(e.token.slice(-4))}),(0,r.jsxs)("div",{className:"grid grid-flow-col",children:[(0,r.jsx)(V.C,{weight:"bold",className:"h-4 w-4 mr-2 hover:bg-primary/40",onClick:()=>{eu({title:"\uD83D\uDD11 Copied API Key: ".concat(e.name),description:"Set this API key in the Khoj apps you want to connect to this Khoj account"}),n(e.token)}}),(0,r.jsx)(T.r,{weight:"bold",className:"h-4 w-4 mr-2 md:ml-4 text-red-400 hover:bg-primary/40",onClick:()=>{eu({title:"\uD83D\uDD11 Deleted API Key: ".concat(e.name),description:"Apps using this API key will no longer connect to this Khoj account"}),i(e.token)}})]})]})]},e.token))})})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4"})]}),(0,r.jsxs)(f.Zb,{className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(H.V,{className:"h-7 w-7 mr-2"}),"Chat on Whatsapp","verified"===eo&&(0,r.jsx)(z.f,{weight:"bold",className:"h-4 w-4 ml-1 text-green-400"})||"setup"!==eo&&(0,r.jsx)(S.C,{weight:"bold",className:"h-4 w-4 ml-1 text-yellow-400"})]}),(0,r.jsxs)(f.aY,{className:"grid gap-4",children:[(0,r.jsxs)("p",{className:"text-gray-400",children:["Connect your number to chat with Khoj on WhatsApp. Learn more about the integration"," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/whatsapp",children:"here"}),"."]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(X.Z,{initialValue:et||"",onChangeNumber:es,disabled:"verify"===eo,initOptions:{separateDialCode:!0,initialCountry:"af",utilsScript:"https://assets.khoj.dev/intl-tel-input%4023.8.0_build_js_utils.js",containerClass:"".concat(l().phoneInput)}}),"verify"===eo&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{children:"Enter the OTP sent to your number: ".concat(et)}),(0,r.jsx)(x.Zn,{autoFocus:!0,maxLength:6,value:ei||"",onChange:el,onComplete:()=>ec("verify"),children:(0,r.jsxs)(x.hf,{children:[(0,r.jsx)(x.cY,{index:0}),(0,r.jsx)(x.cY,{index:1}),(0,r.jsx)(x.cY,{index:2}),(0,r.jsx)(x.cY,{index:3}),(0,r.jsx)(x.cY,{index:4}),(0,r.jsx)(x.cY,{index:5})]})})]})]})]}),(0,r.jsxs)(f.eW,{className:"flex flex-wrap gap-4",children:["verify"===eo&&(0,r.jsx)(m.z,{variant:"outline",onClick:ef,children:"Verify"})||(0,r.jsx)(m.z,{variant:"outline",disabled:!et||et===g.phone_number&&"verified"===eo||!(0,u.y)(et),onClick:ep,children:g.phone_number?et&&(et!==g.phone_number||"verified"!==eo)&&(0,u.y)(et)?(0,r.jsxs)(r.Fragment,{children:["Send OTP"," ",(0,r.jsx)(J.o,{className:"inline ml-2",weight:"bold"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(G.F,{className:"inline mr-2 text-green-400"}),"Switch Number"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.F,{className:"inline mr-2"}),"Setup Whatsapp"]})}),"verified"===eo&&(0,r.jsxs)(m.z,{variant:"outline",onClick:()=>ej(),children:[(0,r.jsx)(R.u,{className:"h-5 w-5 mr-2"}),"Disconnect"]})]})]})]})]})]})})})})]}):(0,r.jsx)(q.Z,{})}(a=n||(n={})).Setup="setup",a.SendOTP="otp",a.VerifyOTP="verify",a.Verified="verified"},32759:function(e,t,s){"use strict";s.d(t,{E:function(){return l}});var a=s(57437),n=s(2265),r=s(60610),i=s(94508);let l=n.forwardRef((e,t)=>{let{className:s,value:n,indicatorColor:l,...o}=e;return(0,a.jsx)(r.fC,{ref:t,className:(0,i.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",s),...o,children:(0,a.jsx)(r.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(l),style:{transform:"translateX(-".concat(100-(n||0),"%)")}})})});l.displayName=r.fC.displayName},77992:function(e,t,s){"use strict";s.d(t,{pm:function(){return u}});var a=s(2265);let n=0,r=new Map,i=e=>{if(r.has(e))return;let t=setTimeout(()=>{r.delete(e),d({type:"REMOVE_TOAST",toastId:e})},1e6);r.set(e,t)},l=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:s}=t;return s?i(s):e.toasts.forEach(e=>{i(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===s||void 0===s?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},o=[],c={toasts:[]};function d(e){c=l(c,e),o.forEach(e=>{e(c)})}function h(e){let{...t}=e,s=(n=(n+1)%Number.MAX_SAFE_INTEGER).toString(),a=()=>d({type:"DISMISS_TOAST",toastId:s});return d({type:"ADD_TOAST",toast:{...t,id:s,open:!0,onOpenChange:e=>{e||a()}}}),{id:s,dismiss:a,update:e=>d({type:"UPDATE_TOAST",toast:{...e,id:s}})}}function u(){let[e,t]=a.useState(c);return a.useEffect(()=>(o.push(t),()=>{let e=o.indexOf(t);e>-1&&o.splice(e,1)}),[e]),{...e,toast:h,dismiss:e=>d({type:"DISMISS_TOAST",toastId:e})}}},917:function(e){e.exports={page:"settings_page__mP7qk",contentBody:"settings_contentBody__uZjue",phoneInput:"settings_phoneInput__j6xJN",sidePanel:"settings_sidePanel__osdez"}}},function(e){e.O(0,[6008,7265,2693,8407,8667,5401,3091,2813,2971,2117,1744],function(){return e(e.s=62960)}),_N_E=e.O()}]);
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6938],{62960:function(e,t,s){Promise.resolve().then(s.bind(s,31537))},31537:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return ei}});var a,n,r=s(57437),i=s(917),l=s.n(i);s(97510);var o=s(2265),c=s(77992),d=s(56937),h=s(7436),u=s(67341),m=s(62869),x=s(26371),p=s(95186),f=s(66070),j=s(84190),g=s(94508);let b=o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("div",{className:"relative w-full overflow-auto",children:(0,r.jsx)("table",{ref:t,className:(0,g.cn)("w-full caption-bottom text-sm",s),...a})})});b.displayName="Table",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("thead",{ref:t,className:(0,g.cn)("[&_tr]:border-b",s),...a})}).displayName="TableHeader";let y=o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("tbody",{ref:t,className:(0,g.cn)("[&_tr:last-child]:border-0",s),...a})});y.displayName="TableBody",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("tfoot",{ref:t,className:(0,g.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a})}).displayName="TableFooter";let w=o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("tr",{ref:t,className:(0,g.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...a})});w.displayName="TableRow",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("th",{ref:t,className:(0,g.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a})}).displayName="TableHead";let N=o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("td",{ref:t,className:(0,g.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a})});N.displayName="TableCell",o.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("caption",{ref:t,className:(0,g.cn)("mt-4 text-sm text-muted-foreground",s),...a})}).displayName="TableCaption";var v=s(23518),_=s(87296),k=s(89203),S=s(57466),C=s(38513),T=s(19841),D=s(3894),E=s(37295),F=s(2049),P=s(50525),O=s(5147),A=s(80438),I=s(29975),z=s(47615),Y=s(47020),R=s(22345),K=s(75216),W=s(90483),Z=s(73925),M=s(54271),U=s(95656),L=s(58717),B=s(81228),V=s(88435),H=s(56777),G=s(97525),J=s(45178),$=s(92813),q=s(14308),X=s(34688),Q=s(59199),ee=s(37099),et=s(32759),es=s(27648);let ea=e=>{let{onClose:t}=e,[s,a]=(0,o.useState)([]),[n,i]=(0,o.useState)([]),[l,c]=(0,o.useState)(""),[d,h]=(0,o.useState)(!1),[u,x]=(0,o.useState)(null),[p,f]=(0,o.useState)(null),[j,g]=(0,o.useState)(!1),[b,y]=(0,o.useState)(0),[w,N]=(0,o.useState)([]),D=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(j||y(0),j){let e=setInterval(()=>{y(e=>{let t=e+(Math.floor(5*Math.random())+1);return t<100?t:100})},800);return()=>clearInterval(e)}},[j]),(0,o.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/content/computer");if(!e.ok)throw Error("Failed to fetch files");let t=await e.json();Array.isArray(t)?a(t.toSorted()):console.error("Unexpected data format from API")}catch(e){console.error("Error fetching files:",e)}})()},[w]);let E=s.filter(e=>e.toLowerCase().includes(l.toLowerCase())),F=async()=>{let e=n.length>0?n:E;if(0!==e.length)try{if(!(await fetch("/api/content/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})})).ok)throw Error("Failed to delete files");a(t=>t.filter(t=>!e.includes(t))),i([])}catch(e){console.error("Error deleting files:",e)}},P=async e=>{try{if(!(await fetch("/api/content/file?filename=".concat(encodeURIComponent(e)),{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to delete file");a(t=>t.filter(t=>t!==e)),i(t=>t.filter(t=>t!==e))}catch(e){console.error("Error deleting file:",e)}};function O(e){(0,Q.ko)(e,x,g,f,N)}return(0,r.jsxs)(v.m5,{open:!0,onOpenChange:t,children:[(0,r.jsx)(ee.aR,{open:null!==u||null!=p,children:(0,r.jsxs)(ee._T,{children:[(0,r.jsx)(ee.fY,{children:(0,r.jsx)(ee.f$,{children:"Alert"})}),(0,r.jsx)(ee.yT,{children:u||p}),(0,r.jsx)(ee.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{x(null),f(null),g(!1)},children:"Close"})]})}),(0,r.jsxs)("div",{className:"flex flex-col h-full",onDragOver:function(e){e.preventDefault(),h(!0)},onDragLeave:function(e){e.preventDefault(),h(!1)},onDrop:function(e){e.preventDefault(),h(!1),e.dataTransfer.files&&O(e.dataTransfer.files)},onClick:function(){D&&D.current&&D.current.click()},children:[(0,r.jsx)("input",{type:"file",multiple:!0,ref:D,style:{display:"none"},onChange:function(e){e.target.files&&O(e.target.files)}}),(0,r.jsxs)("div",{className:"flex-none p-4",children:["Upload files",j&&(0,r.jsx)(et.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:b})]}),(0,r.jsx)("div",{className:"flex-none p-4 bg-secondary border-b ".concat(d?"animate-pulse":""," rounded-lg"),children:(0,r.jsx)("div",{className:"flex items-center justify-center w-full h-32 border-2 border-dashed border-gray-300 rounded-lg",children:d?(0,r.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,r.jsx)(_.u,{className:"h-6 w-6 mr-2"}),(0,r.jsx)("span",{children:"Drop files to upload"})]}):(0,r.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,r.jsx)(k.v,{className:"h-6 w-6 mr-2"}),(0,r.jsx)("span",{children:"Drag and drop files here"})]})})})]}),(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(0,r.jsx)("div",{className:"flex-none p-4 bg-background border-b",children:(0,r.jsx)(v.sZ,{placeholder:"Find synced files",value:l,onValueChange:c})}),(0,r.jsx)("div",{className:"flex-grow overflow-auto",children:(0,r.jsxs)(v.e8,{children:[(0,r.jsx)(v.rb,{children:0===s.length?(0,r.jsxs)("div",{className:"flex items-center justify-center",children:[(0,r.jsx)(S.C,{className:"h-4 w-4 mr-2",weight:"bold"}),"No files synced"]}):(0,r.jsxs)("div",{children:["Could not find a good match.",(0,r.jsx)(es.default,{href:"/search",className:"block",children:"Need advanced search? Click here."})]})}),(0,r.jsx)(v.fu,{heading:"Synced files",children:E.map(e=>(0,r.jsx)(v.di,{value:e,onSelect:e=>{i(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},children:(0,r.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,r.jsxs)("div",{className:"flex items-center ".concat(n.includes(e)?"font-semibold":""),children:[n.includes(e)&&(0,r.jsx)(C.J,{className:"h-4 w-4 mr-2"}),(0,r.jsx)("span",{className:"break-all",children:e})]}),(0,r.jsx)(m.z,{variant:"outline",size:"sm",onClick:()=>P(e),className:"ml-auto",children:(0,r.jsx)(T.r,{className:"h-4 w-4"})})]})},e))})]})}),(0,r.jsx)("div",{className:"flex-none p-4 bg-background border-t",children:(0,r.jsx)("div",{className:"flex justify-between",children:(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:F,className:"mr-2",children:[(0,r.jsx)(T.r,{className:"h-4 w-4 mr-2"}),n.length>0?"Delete Selected (".concat(n.length,")"):"Delete All"]})})})]})]})},en=e=>{var t,s;let{items:a,selected:n,callbackFunc:i}=e,[l,c]=(0,o.useState)(null!==(s=null==n?void 0:n.toString())&&void 0!==s?s:"0");return!!n&&(0,r.jsx)("div",{className:"overflow-hidden shadow-md rounded-lg",children:(0,r.jsxs)(j.h_,{children:[(0,r.jsx)(j.$F,{asChild:!0,className:"w-full rounded-lg",children:(0,r.jsxs)(m.z,{variant:"outline",className:"justify-start py-6 rounded-lg",children:[null===(t=a.find(e=>e.id.toString()===l))||void 0===t?void 0:t.name," ",(0,r.jsx)(D.p,{className:"h-4 w-4 ml-auto text-muted-foreground"})]})}),(0,r.jsx)(j.AW,{style:{maxHeight:"200px",overflowY:"auto",minWidth:"var(--radix-dropdown-menu-trigger-width)"},children:(0,r.jsx)(j._x,{value:l,onValueChange:async e=>{c(e),await i(e)},children:a.map(e=>(0,r.jsx)(j.qB,{value:e.id.toString(),children:e.name},e.id.toString()))})})]})})},er=()=>{let[e,t]=(0,o.useState)([]),{toast:s}=(0,c.pm)(),a=async()=>{try{let e=await fetch("/auth/token",{method:"POST",headers:{"Content-Type":"application/json"}}),s=await e.json();t(e=>[...e,s])}catch(e){console.error("Error generating API key:",e)}},n=async e=>{try{await navigator.clipboard.writeText(e),s({title:"\uD83D\uDD11 API Key",description:"Copied to clipboard"})}catch(e){console.error("Error copying API key:",e)}},r=async e=>{try{(await fetch("/auth/token?token=".concat(e),{method:"DELETE"})).ok&&t(t=>t.filter(t=>t.token!==e))}catch(e){console.error("Error deleting API key:",e)}},i=async()=>{try{let e=await fetch("/auth/token"),s=await e.json();(null==s?void 0:s.length)>0&&t(s)}catch(e){console.error("Error listing API keys:",e)}};return(0,o.useEffect)(()=>{i()},[]),{apiKeys:e,generateAPIKey:a,copyAPIKey:n,deleteAPIKey:r}};function ei(){let[e,t]=(0,o.useState)("Settings"),{apiKeys:s,generateAPIKey:a,copyAPIKey:n,deleteAPIKey:i}=er(),{userConfig:j}=(0,d.h2)(!0),[g,v]=(0,o.useState)(null),[C,D]=(0,o.useState)(void 0),[Q,ee]=(0,o.useState)(null),[et,es]=(0,o.useState)(void 0),[ei,el]=(0,o.useState)(""),[eo,ec]=(0,o.useState)("verified"),[ed,eh]=(0,o.useState)(!1),{toast:eu}=(0,c.pm)(),em=(0,h.IC)(),ex="w-full lg:w-1/3 grid grid-flow-column border border-gray-300 shadow-md rounded-lg bg-gradient-to-b from-background to-gray-50 dark:to-gray-950 border border-opacity-50";(0,o.useEffect)(()=>{var e;v(j),es(null==j?void 0:j.phone_number),ec((null==j?void 0:j.is_phone_number_verified)?"verified":(null==j?void 0:j.phone_number)?"otp":"setup"),D(null==j?void 0:j.given_name),ee(null!==(e=null==j?void 0:j.notion_token)&&void 0!==e?e:null)},[j]);let ep=async()=>{try{if(!(await fetch("/api/phone?phone_number=".concat(et),{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to send OTP");ec("verify")}catch(e){console.error("Error sending OTP:",e),eu({title:"\uD83D\uDCF1 Phone",description:"Failed to send OTP. Try again or contact us at team@khoj.dev"})}},ef=async()=>{try{if(!(await fetch("/api/phone/verify?code=".concat(ei),{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to verify OTP");ec("verified"),eu({title:"\uD83D\uDCF1 Phone",description:"Phone number verified"})}catch(e){console.error("Error verifying OTP:",e),eu({title:"\uD83D\uDCF1 Phone",description:"Failed to verify OTP. Try again or contact us at team@khoj.dev"})}},ej=async()=>{try{if(!(await fetch("/api/phone",{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to disconnect phone number");es(void 0),ec("setup"),eu({title:"\uD83D\uDCF1 Phone",description:"Phone number disconnected"})}catch(e){console.error("Error disconnecting phone number:",e),eu({title:"\uD83D\uDCF1 Phone",description:"Failed to disconnect phone number. Try again or contact us at team@khoj.dev"})}},eg=async e=>{try{if(!(await fetch("/api/subscription?operation=".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to change subscription");g&&(g.subscription_state="cancel"===e?d.o9.UNSUBSCRIBED:d.o9.SUBSCRIBED,v(g)),eu({title:"\uD83D\uDCB3 Subscription",description:(null==g?void 0:g.subscription_state)==="unsubscribed"?"Your subscription was cancelled":"Your Futurist subscription has been renewed"})}catch(t){console.error("Error changing subscription:",t),eu({title:"\uD83D\uDCB3 Subscription",description:"cancel"===e?"Failed to cancel subscription. Try again or contact us at team@khoj.dev":"Failed to renew subscription. Try again or contact us at team@khoj.dev"})}},eb=async()=>{try{let e=await fetch("/api/subscription/trial",{method:"POST"});if(!e.ok)throw Error("Failed to enable free trial");if((await e.json()).trial_enabled&&g){g.subscription_state=d.o9.TRIAL;let e=new Date(Date.now()+864e5*g.length_of_free_trial);g.subscription_renewal_date=(e=>{let t=new Date(e);return new Intl.DateTimeFormat("en-US",{day:"2-digit",month:"short",year:"numeric"}).format(t)})(e),g.subscription_enabled_trial_at=new Date().toISOString(),v(g),eu({title:"\uD83C\uDF89 Trial Enabled",description:"Your free trial will end on ".concat(g.subscription_renewal_date)})}}catch(e){console.error("Error enabling free trial:",e),eu({title:"⚠️ Failed to Enable Free Trial",description:"Failed to enable free trial. Try again or contact us at team@khoj.dev"})}},ey=async()=>{if(C)try{if(!(await fetch("/api/user/name?name=".concat(C),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to update name");g&&(g.given_name=C,v(g)),eu({title:"✅ Updated Profile",description:"You name has been updated to ".concat(C)})}catch(e){console.error("Error updating name:",e),eu({title:"⚠️ Failed to Update Profile",description:"Failed to update name. Try again or contact team@khoj.dev"})}},ew=e=>async t=>{if(!(null==g?void 0:g.is_active)){eu({title:"Model Update",description:"You need to be subscribed to update ".concat(e," models"),variant:"destructive"});return}try{if(!(await fetch("/api/model/".concat(e,"?id=")+t,{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to update model");eu({title:"✅ Updated ".concat((0,h.LF)(e)," Model")})}catch(t){console.error("Failed to update ".concat(e," model:"),t),eu({description:"❌ Failed to update ".concat((0,h.LF)(e)," model. Try again."),variant:"destructive"})}},eN=async()=>{if(Q)try{if(!(await fetch("/api/content/notion",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:Q})})).ok)throw Error("Failed to save Notion API key");g&&(g.notion_token=Q,v(g)),eu({title:"✅ Saved Notion Settings",description:"You Notion API key has been saved."})}catch(e){console.error("Error updating name:",e),eu({title:"⚠️ Failed to Save Notion Settings",description:"Failed to save Notion API key. Try again or contact team@khoj.dev"})}},ev=async e=>{try{if(!(await fetch("/api/content?t=".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to sync content from ".concat(e));eu({title:"\uD83D\uDD04 Syncing ".concat(e),description:"Your ".concat(e," content is being synced.")})}catch(t){console.error("Error syncing content:",t),eu({title:"⚠️ Failed to Sync ".concat(e),description:"Failed to sync ".concat(e," content. Try again or contact team@khoj.dev")})}},e_=async e=>{try{if(!(await fetch("/api/content/".concat(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to disconnect ".concat(e));g&&("computer"===e?g.enabled_content_source.computer=!1:"notion"===e?(g.enabled_content_source.notion=!1,g.notion_token=null,ee(g.notion_token)):"github"===e&&(g.enabled_content_source.github=!1),v(g)),"computer"===e?eu({title:"✅ Deleted Synced Files",description:"Your synced documents have been deleted."}):eu({title:"✅ Disconnected ".concat(e),description:"Your ".concat(e," integration to Khoj has been disconnected.")})}catch(t){console.error("Error disconnecting ".concat(e,":"),t),eu({title:"⚠️ Failed to Disconnect ".concat(e),description:"Failed to disconnect from ".concat(e,". Try again or contact team@khoj.dev")})}};return g?(0,r.jsxs)("div",{className:l().page,children:[(0,r.jsx)("title",{children:e}),(0,r.jsx)("div",{className:l().sidePanel,children:(0,r.jsx)($.ZP,{conversationId:null,uploadedFiles:[],isMobileWidth:em})}),(0,r.jsx)("div",{className:l().content,children:(0,r.jsx)("div",{className:"".concat(l().contentBody," mx-10 my-2"),children:(0,r.jsx)(o.Suspense,{fallback:(0,r.jsx)(q.Z,{}),children:(0,r.jsxs)("div",{id:"content",className:"grid grid-flow-column sm:grid-flow-row gap-16 m-8",children:[(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Profile"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[(0,r.jsxs)(f.Zb,{className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(E.Y,{className:"h-7 w-7 mr-2"}),"Name"]}),(0,r.jsxs)(f.aY,{className:"overflow-hidden",children:[(0,r.jsx)("p",{className:"pb-4 text-gray-400",children:"What should Khoj refer to you as?"}),(0,r.jsx)(p.I,{type:"text",onChange:e=>D(e.target.value),value:C,className:"w-full border border-gray-300 rounded-lg p-4 py-6"})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:ey,disabled:C===g.given_name,children:[(0,r.jsx)(F.B,{className:"h-5 w-5 inline mr-2"}),"Save"]})})]}),(0,r.jsxs)(f.Zb,{id:"subscription",className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(P.a,{className:"h-7 w-7 mr-2"}),"Subscription"]}),(0,r.jsxs)(f.aY,{className:"grid gap-2 overflow-hidden",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Current Plan"}),"trial"===g.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl text-primary/80",children:"Futurist (Trial)"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["You are on a"," ",g.length_of_free_trial," day trial of the Khoj Futurist plan. Your trial ends on ",g.subscription_renewal_date,". Check"," ",(0,r.jsx)("a",{href:"https://khoj.dev/#pricing",target:"_blank",children:"pricing page"})," ","to compare plans."]})]})||"subscribed"===g.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl text-primary/80",children:"Futurist"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"renews"})," on"," ",(0,r.jsx)("b",{children:g.subscription_renewal_date})]})]})||"unsubscribed"===g.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl",children:"Futurist"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"ends"})," on"," ",(0,r.jsx)("b",{children:g.subscription_renewal_date})]})]})||"expired"===g.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl",children:"Humanist"}),g.subscription_renewal_date&&(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"expired"})," on"," ",(0,r.jsx)("b",{children:g.subscription_renewal_date})]})||(0,r.jsxs)("p",{className:"text-gray-400",children:["Check"," ",(0,r.jsx)("a",{href:"https://khoj.dev/#pricing",target:"_blank",children:"pricing page"})," ","to compare plans."]})]})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:"subscribed"==g.subscription_state&&(0,r.jsxs)(m.z,{variant:"outline",className:"hover:text-red-400",onClick:()=>eg("cancel"),children:[(0,r.jsx)(O.b,{className:"h-5 w-5 mr-2"}),"Unsubscribe"]})||"unsubscribed"==g.subscription_state&&(0,r.jsxs)(m.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>eg("resubscribe"),children:[(0,r.jsx)(A.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Resubscribe"]})||g.subscription_enabled_trial_at&&(0,r.jsxs)(m.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>window.open("".concat(g.khoj_cloud_subscription_url,"?prefilled_email=").concat(g.username),"_blank","noopener,noreferrer"),children:[(0,r.jsx)(A.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Subscribe"]})||(0,r.jsxs)(m.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:eb,children:[(0,r.jsx)(A.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Enable Trial"]})})]})]})]}),ed&&(0,r.jsx)(ea,{onClose:()=>eh(!1)}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Content"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[(0,r.jsxs)(f.Zb,{id:"computer",className:ex,children:[(0,r.jsxs)(f.Ol,{className:"flex flex-row text-2xl",children:[(0,r.jsx)(I.I,{className:"h-8 w-8 mr-2"}),"Files",g.enabled_content_source.computer&&(0,r.jsx)(z.f,{className:"h-6 w-6 ml-auto text-green-500",weight:"fill"})]}),(0,r.jsx)(f.aY,{className:"overflow-hidden pb-12 text-gray-400",children:"Manage your synced files"}),(0,r.jsxs)(f.eW,{className:"flex flex-wrap gap-4",children:[(0,r.jsx)(m.z,{variant:"outline",size:"sm",onClick:()=>eh(!0),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Y.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(g.enabled_content_source.computer||"hidden"),onClick:()=>e_("computer"),children:[(0,r.jsx)(R.u,{className:"h-5 w-5 inline mr-1"}),"Disable"]})]})]}),(0,r.jsxs)(f.Zb,{id:"github",className:"".concat(ex," hidden"),children:[(0,r.jsxs)(f.Ol,{className:"flex flex-row text-2xl",children:[(0,r.jsx)(K.b,{className:"h-8 w-8 mr-2"}),"Github"]}),(0,r.jsx)(f.aY,{className:"overflow-hidden pb-12 text-gray-400",children:"Set Github repositories to index"}),(0,r.jsxs)(f.eW,{className:"flex flex-wrap gap-4",children:[(0,r.jsx)(m.z,{variant:"outline",size:"sm",children:g.enabled_content_source.github&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Y.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})||(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]})}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(g.enabled_content_source.github||"hidden"),children:[(0,r.jsx)(R.u,{className:"h-5 w-5 inline mr-1"}),"Disable"]})]})]}),(0,r.jsxs)(f.Zb,{id:"notion",className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(Z.F,{className:"h-7 w-7 mr-2"}),"Notion",g.enabled_content_source.notion&&(0,r.jsx)(z.f,{className:"h-6 w-6 ml-auto text-green-500",weight:"fill"})]}),(0,r.jsxs)(f.aY,{className:"grid gap-4",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Sync your Notion workspace."}),!g.notion_oauth_url&&(0,r.jsx)(p.I,{onChange:e=>ee(e.target.value),value:Q||"",placeholder:"Enter API Key of your Khoj integration on Notion",className:"w-full border border-gray-300 rounded-lg px-4 py-6"})]}),(0,r.jsxs)(f.eW,{className:"flex flex-wrap gap-4",children:[g.notion_oauth_url&&!g.enabled_content_source.notion?(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:()=>{window.open(g.notion_oauth_url)},children:[(0,r.jsx)(W.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]}):g.enabled_content_source.notion&&Q===g.notion_token?(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:()=>ev("notion"),children:[(0,r.jsx)(M.t,{className:"h-5 w-5 inline mr-1"}),"Sync"]}):g.notion_oauth_url?(0,r.jsx)(r.Fragment,{}):(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:eN,disabled:Q===g.notion_token,children:[(0,r.jsx)(F.B,{className:"h-5 w-5 inline mr-1"}),g.enabled_content_source.notion&&"Update API Key"||"Set API Key"]}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(g.notion_token||"hidden"),onClick:()=>e_("notion"),children:[(0,r.jsx)(R.u,{className:"h-5 w-5 inline mr-1"}),"Disconnect"]})]})]})]})]}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Models"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[g.chat_model_options.length>0&&(0,r.jsxs)(f.Zb,{className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(U.G,{className:"h-7 w-7 mr-2"}),"Chat"]}),(0,r.jsxs)(f.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the chat model to generate text responses"}),(0,r.jsx)(en,{items:g.chat_model_options,selected:g.selected_chat_model_config,callbackFunc:ew("chat")})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:!g.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),g.paint_model_options.length>0&&(0,r.jsxs)(f.Zb,{className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(L.Y,{className:"h-7 w-7 mr-2"}),"Paint"]}),(0,r.jsxs)(f.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the paint model to generate image responses"}),(0,r.jsx)(en,{items:g.paint_model_options,selected:g.selected_paint_model_config,callbackFunc:ew("paint")})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:!g.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),g.voice_model_options.length>0&&(0,r.jsxs)(f.Zb,{className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(_.u,{className:"h-7 w-7 mr-2"}),"Voice"]}),(0,r.jsxs)(f.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the voice model to generate speech responses"}),(0,r.jsx)(en,{items:g.voice_model_options,selected:g.selected_voice_model_config,callbackFunc:ew("voice")})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:!g.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]})]})]}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{id:"clients",className:"text-2xl",children:"Clients"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-8",children:[!g.anonymous_mode&&(0,r.jsxs)(f.Zb,{className:"grid grid-flow-column border border-gray-300 shadow-md rounded-lg bg-gradient-to-b from-background to-gray-50 dark:to-gray-950",children:[(0,r.jsxs)(f.Ol,{className:"text-xl grid grid-flow-col grid-cols-[1fr_auto] pb-0",children:[(0,r.jsxs)("span",{className:"flex flex-wrap",children:[(0,r.jsx)(B.s,{className:"h-7 w-7 mr-2"}),"API Keys"]}),(0,r.jsxs)(m.z,{variant:"secondary",className:"!mt-0",onClick:a,children:[(0,r.jsx)(k.v,{weight:"bold",className:"h-5 w-5 mr-2"}),"Generate Key"]})]}),(0,r.jsxs)(f.aY,{className:"overflow-hidden grid gap-6",children:[(0,r.jsxs)("p",{className:"text-md text-gray-400",children:["Access Khoj from the"," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Desktop",target:"_blank",children:"Desktop"}),","," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Obsidian",children:"Obsidian"}),","," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Emacs",children:"Emacs"})," ","apps and more."]}),(0,r.jsx)(b,{children:(0,r.jsx)(y,{children:s.map(e=>(0,r.jsxs)(w,{children:[(0,r.jsx)(N,{className:"pl-0 py-3",children:e.name}),(0,r.jsxs)(N,{className:"grid grid-flow-col grid-cols-[1fr_auto] bg-secondary rounded-xl p-3 m-1",children:[(0,r.jsx)("span",{children:"".concat(e.token.slice(0,6),"...").concat(e.token.slice(-4))}),(0,r.jsxs)("div",{className:"grid grid-flow-col",children:[(0,r.jsx)(V.C,{weight:"bold",className:"h-4 w-4 mr-2 hover:bg-primary/40",onClick:()=>{eu({title:"\uD83D\uDD11 Copied API Key: ".concat(e.name),description:"Set this API key in the Khoj apps you want to connect to this Khoj account"}),n(e.token)}}),(0,r.jsx)(T.r,{weight:"bold",className:"h-4 w-4 mr-2 md:ml-4 text-red-400 hover:bg-primary/40",onClick:()=>{eu({title:"\uD83D\uDD11 Deleted API Key: ".concat(e.name),description:"Apps using this API key will no longer connect to this Khoj account"}),i(e.token)}})]})]})]},e.token))})})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4"})]}),(0,r.jsxs)(f.Zb,{className:ex,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(H.V,{className:"h-7 w-7 mr-2"}),"Chat on Whatsapp","verified"===eo&&(0,r.jsx)(z.f,{weight:"bold",className:"h-4 w-4 ml-1 text-green-400"})||"setup"!==eo&&(0,r.jsx)(S.C,{weight:"bold",className:"h-4 w-4 ml-1 text-yellow-400"})]}),(0,r.jsxs)(f.aY,{className:"grid gap-4",children:[(0,r.jsxs)("p",{className:"text-gray-400",children:["Connect your number to chat with Khoj on WhatsApp. Learn more about the integration"," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/whatsapp",children:"here"}),"."]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(X.Z,{initialValue:et||"",onChangeNumber:es,disabled:"verify"===eo,initOptions:{separateDialCode:!0,initialCountry:"af",utilsScript:"https://assets.khoj.dev/intl-tel-input%4023.8.0_build_js_utils.js",containerClass:"".concat(l().phoneInput)}}),"verify"===eo&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{children:"Enter the OTP sent to your number: ".concat(et)}),(0,r.jsx)(x.Zn,{autoFocus:!0,maxLength:6,value:ei||"",onChange:el,onComplete:()=>ec("verify"),children:(0,r.jsxs)(x.hf,{children:[(0,r.jsx)(x.cY,{index:0}),(0,r.jsx)(x.cY,{index:1}),(0,r.jsx)(x.cY,{index:2}),(0,r.jsx)(x.cY,{index:3}),(0,r.jsx)(x.cY,{index:4}),(0,r.jsx)(x.cY,{index:5})]})})]})]})]}),(0,r.jsxs)(f.eW,{className:"flex flex-wrap gap-4",children:["verify"===eo&&(0,r.jsx)(m.z,{variant:"outline",onClick:ef,children:"Verify"})||(0,r.jsx)(m.z,{variant:"outline",disabled:!et||et===g.phone_number&&"verified"===eo||!(0,u.y)(et),onClick:ep,children:g.phone_number?et&&(et!==g.phone_number||"verified"!==eo)&&(0,u.y)(et)?(0,r.jsxs)(r.Fragment,{children:["Send OTP"," ",(0,r.jsx)(J.o,{className:"inline ml-2",weight:"bold"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(G.F,{className:"inline mr-2 text-green-400"}),"Switch Number"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.F,{className:"inline mr-2"}),"Setup Whatsapp"]})}),"verified"===eo&&(0,r.jsxs)(m.z,{variant:"outline",onClick:()=>ej(),children:[(0,r.jsx)(R.u,{className:"h-5 w-5 mr-2"}),"Disconnect"]})]})]})]})]})]})})})})]}):(0,r.jsx)(q.Z,{})}(a=n||(n={})).Setup="setup",a.SendOTP="otp",a.VerifyOTP="verify",a.Verified="verified"},32759:function(e,t,s){"use strict";s.d(t,{E:function(){return l}});var a=s(57437),n=s(2265),r=s(60610),i=s(94508);let l=n.forwardRef((e,t)=>{let{className:s,value:n,indicatorColor:l,...o}=e;return(0,a.jsx)(r.fC,{ref:t,className:(0,i.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",s),...o,children:(0,a.jsx)(r.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(l),style:{transform:"translateX(-".concat(100-(n||0),"%)")}})})});l.displayName=r.fC.displayName},77992:function(e,t,s){"use strict";s.d(t,{pm:function(){return u}});var a=s(2265);let n=0,r=new Map,i=e=>{if(r.has(e))return;let t=setTimeout(()=>{r.delete(e),d({type:"REMOVE_TOAST",toastId:e})},1e6);r.set(e,t)},l=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:s}=t;return s?i(s):e.toasts.forEach(e=>{i(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===s||void 0===s?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},o=[],c={toasts:[]};function d(e){c=l(c,e),o.forEach(e=>{e(c)})}function h(e){let{...t}=e,s=(n=(n+1)%Number.MAX_SAFE_INTEGER).toString(),a=()=>d({type:"DISMISS_TOAST",toastId:s});return d({type:"ADD_TOAST",toast:{...t,id:s,open:!0,onOpenChange:e=>{e||a()}}}),{id:s,dismiss:a,update:e=>d({type:"UPDATE_TOAST",toast:{...e,id:s}})}}function u(){let[e,t]=a.useState(c);return a.useEffect(()=>(o.push(t),()=>{let e=o.indexOf(t);e>-1&&o.splice(e,1)}),[e]),{...e,toast:h,dismiss:e=>d({type:"DISMISS_TOAST",toastId:e})}}},917:function(e){e.exports={page:"settings_page__mP7qk",contentBody:"settings_contentBody__uZjue",phoneInput:"settings_phoneInput__j6xJN",sidePanel:"settings_sidePanel__osdez"}}},function(e){e.O(0,[6008,5540,2693,8407,8667,5401,3091,2813,2971,2117,1744],function(){return e(e.s=62960)}),_N_E=e.O()}]);
|
@@ -1 +1 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3111],{91955:function(e,t,s){Promise.resolve().then(s.bind(s,41694))},41694:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var a=s(57437),o=s(22515),n=s.n(o),i=s(2265),l=s(92813),c=s(62264),d=s(14308);s(2446);var r=s(7436),h=s(56937),u=s(5477);function g(e){let[t,s]=(0,i.useState)(""),[o,l]=(0,i.useState)([]),[d,r]=(0,i.useState)(!1),[h,g]=(0,i.useState)(null),p=(0,i.useRef)(null),m=e.setQueryToProcess,f=e.streamedMessages,_=e.isMobileWidth?"w-full":"w-4/6";return((0,i.useEffect)(()=>{if(o.length>0){let t=o.map(e=>encodeURIComponent(e));e.setImages(t)}},[o,e.setImages]),(0,i.useEffect)(()=>{t&&(r(!0),m(t))},[t,m]),(0,i.useEffect)(()=>{f&&f.length>0&&f[f.length-1].completed?r(!1):s("")},[f]),e.publicConversationSlug||e.conversationId)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:n().chatBodyFull,children:(0,a.jsx)(c.Z,{publicConversationSlug:e.publicConversationSlug,conversationId:e.conversationId||"",setAgent:g,setTitle:e.setTitle,pendingMessage:d?t:"",incomingMessages:e.streamedMessages,customClassName:_})}),(0,a.jsx)("div",{className:"".concat(n().inputBox," p-1 md:px-2 shadow-md bg-background align-middle items-center justify-center dark:bg-neutral-700 dark:border-0 dark:shadow-sm rounded-t-2xl rounded-b-none md:rounded-xl h-fit ").concat(_," mr-auto ml-auto"),children:(0,a.jsx)(u.a,{isLoggedIn:e.isLoggedIn,sendMessage:e=>s(e),sendImage:e=>l(t=>[...t,e]),sendDisabled:d,chatOptionsData:e.chatOptionsData,conversationId:e.conversationId,agentColor:null==h?void 0:h.color,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles,setTriggeredAbort:()=>{},ref:p})})]}):(0,a.jsx)("div",{className:n().suggestions,children:"Whoops, nothing to see here!"})}function p(){let[e,t]=(0,i.useState)(null),[s,o]=(0,i.useState)(!0),[c,u]=(0,i.useState)("Khoj AI - Chat"),[p,m]=(0,i.useState)(void 0),[f,_]=(0,i.useState)([]),[x,v]=(0,i.useState)(""),[j,S]=(0,i.useState)(null),[C,I]=(0,i.useState)(void 0),[b,y]=(0,i.useState)([]),B=(0,h.GW)(),N=(0,r.IC)();return((0,i.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{o(!1),e&&t(e)}).catch(e=>{console.error(e)}),(0,r.EK)(),I(window.location.pathname.split("/").pop()||"")},[]),(0,i.useEffect)(()=>{j&&localStorage.setItem("uploadedFiles",JSON.stringify(j))},[j]),(0,i.useEffect)(()=>{if(x&&!p){fetch("/api/chat/share/fork?public_conversation_slug=".concat(C),{method:"POST",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{m(e.conversation_id),localStorage.setItem("message",x),b.length>0&&localStorage.setItem("images",JSON.stringify(b)),window.location.href="/chat?conversationId=".concat(e.conversation_id)}).catch(e=>{console.error(e)});return}},[x,p,C]),s)?(0,a.jsx)(d.Z,{}):C?(0,a.jsxs)("div",{className:"".concat(n().main," ").concat(n().chatLayout),children:[(0,a.jsx)("title",{children:c}),(0,a.jsx)("div",{className:n().sidePanel,children:(0,a.jsx)(l.ZP,{conversationId:null!=p?p:null,uploadedFiles:[],isMobileWidth:N})}),(0,a.jsx)("div",{className:n().chatBox,children:(0,a.jsxs)("div",{className:n().chatBoxBody,children:[!N&&c&&(0,a.jsx)("div",{className:"".concat(n().chatTitleWrapper," text-nowrap text-ellipsis overflow-hidden max-w-screen-md grid items-top font-bold mr-8 pt-6 col-auto h-fit"),children:c&&(0,a.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden",children:c})}),(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(d.Z,{}),children:(0,a.jsx)(g,{conversationId:p,streamedMessages:f,setQueryToProcess:v,isLoggedIn:null!==B,publicConversationSlug:C,chatOptionsData:e,setTitle:u,setUploadedFiles:S,isMobileWidth:N,setImages:y})})]})})]}):(0,a.jsx)("div",{className:n().suggestions,children:"Whoops, nothing to see here!"})}},22515:function(e){e.exports={main:"sharedChat_main__7Nayy",suggestions:"sharedChat_suggestions__V8kr_",inputBox:"sharedChat_inputBox__wRW5A",chatBodyFull:"sharedChat_chatBodyFull__O1MOv",chatBody:"sharedChat_chatBody__OnHDL",chatLayout:"sharedChat_chatLayout__gutlc",chatBox:"sharedChat_chatBox__PmAPg",titleBar:"sharedChat_titleBar__vOHp_",chatBoxBody:"sharedChat_chatBoxBody__ef2Nl",agentIndicator:"sharedChat_agentIndicator__ORCl4"}}},function(e){e.O(0,[
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3111],{91955:function(e,t,s){Promise.resolve().then(s.bind(s,41694))},41694:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var a=s(57437),o=s(22515),n=s.n(o),i=s(2265),l=s(92813),c=s(62264),d=s(14308);s(2446);var r=s(7436),h=s(56937),u=s(5477);function g(e){let[t,s]=(0,i.useState)(""),[o,l]=(0,i.useState)([]),[d,r]=(0,i.useState)(!1),[h,g]=(0,i.useState)(null),p=(0,i.useRef)(null),m=e.setQueryToProcess,f=e.streamedMessages,_=e.isMobileWidth?"w-full":"w-4/6";return((0,i.useEffect)(()=>{if(o.length>0){let t=o.map(e=>encodeURIComponent(e));e.setImages(t)}},[o,e.setImages]),(0,i.useEffect)(()=>{t&&(r(!0),m(t))},[t,m]),(0,i.useEffect)(()=>{f&&f.length>0&&f[f.length-1].completed?r(!1):s("")},[f]),e.publicConversationSlug||e.conversationId)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:n().chatBodyFull,children:(0,a.jsx)(c.Z,{publicConversationSlug:e.publicConversationSlug,conversationId:e.conversationId||"",setAgent:g,setTitle:e.setTitle,pendingMessage:d?t:"",incomingMessages:e.streamedMessages,customClassName:_})}),(0,a.jsx)("div",{className:"".concat(n().inputBox," p-1 md:px-2 shadow-md bg-background align-middle items-center justify-center dark:bg-neutral-700 dark:border-0 dark:shadow-sm rounded-t-2xl rounded-b-none md:rounded-xl h-fit ").concat(_," mr-auto ml-auto"),children:(0,a.jsx)(u.a,{isLoggedIn:e.isLoggedIn,sendMessage:e=>s(e),sendImage:e=>l(t=>[...t,e]),sendDisabled:d,chatOptionsData:e.chatOptionsData,conversationId:e.conversationId,agentColor:null==h?void 0:h.color,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles,setTriggeredAbort:()=>{},ref:p})})]}):(0,a.jsx)("div",{className:n().suggestions,children:"Whoops, nothing to see here!"})}function p(){let[e,t]=(0,i.useState)(null),[s,o]=(0,i.useState)(!0),[c,u]=(0,i.useState)("Khoj AI - Chat"),[p,m]=(0,i.useState)(void 0),[f,_]=(0,i.useState)([]),[x,v]=(0,i.useState)(""),[j,S]=(0,i.useState)(null),[C,I]=(0,i.useState)(void 0),[b,y]=(0,i.useState)([]),B=(0,h.GW)(),N=(0,r.IC)();return((0,i.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{o(!1),e&&t(e)}).catch(e=>{console.error(e)}),(0,r.EK)(),I(window.location.pathname.split("/").pop()||"")},[]),(0,i.useEffect)(()=>{j&&localStorage.setItem("uploadedFiles",JSON.stringify(j))},[j]),(0,i.useEffect)(()=>{if(x&&!p){fetch("/api/chat/share/fork?public_conversation_slug=".concat(C),{method:"POST",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{m(e.conversation_id),localStorage.setItem("message",x),b.length>0&&localStorage.setItem("images",JSON.stringify(b)),window.location.href="/chat?conversationId=".concat(e.conversation_id)}).catch(e=>{console.error(e)});return}},[x,p,C]),s)?(0,a.jsx)(d.Z,{}):C?(0,a.jsxs)("div",{className:"".concat(n().main," ").concat(n().chatLayout),children:[(0,a.jsx)("title",{children:c}),(0,a.jsx)("div",{className:n().sidePanel,children:(0,a.jsx)(l.ZP,{conversationId:null!=p?p:null,uploadedFiles:[],isMobileWidth:N})}),(0,a.jsx)("div",{className:n().chatBox,children:(0,a.jsxs)("div",{className:n().chatBoxBody,children:[!N&&c&&(0,a.jsx)("div",{className:"".concat(n().chatTitleWrapper," text-nowrap text-ellipsis overflow-hidden max-w-screen-md grid items-top font-bold mr-8 pt-6 col-auto h-fit"),children:c&&(0,a.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden",children:c})}),(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(d.Z,{}),children:(0,a.jsx)(g,{conversationId:p,streamedMessages:f,setQueryToProcess:v,isLoggedIn:null!==B,publicConversationSlug:C,chatOptionsData:e,setTitle:u,setUploadedFiles:S,isMobileWidth:N,setImages:y})})]})})]}):(0,a.jsx)("div",{className:n().suggestions,children:"Whoops, nothing to see here!"})}},22515:function(e){e.exports={main:"sharedChat_main__7Nayy",suggestions:"sharedChat_suggestions__V8kr_",inputBox:"sharedChat_inputBox__wRW5A",chatBodyFull:"sharedChat_chatBodyFull__O1MOv",chatBody:"sharedChat_chatBody__OnHDL",chatLayout:"sharedChat_chatLayout__gutlc",chatBox:"sharedChat_chatBox__PmAPg",titleBar:"sharedChat_titleBar__vOHp_",chatBoxBody:"sharedChat_chatBoxBody__ef2Nl",agentIndicator:"sharedChat_agentIndicator__ORCl4"}}},function(e){e.O(0,[9346,5540,2693,2664,3954,8407,8667,5401,6589,9058,2781,2813,5477,2264,2971,2117,1744],function(){return e(e.s=91955)}),_N_E=e.O()}]);
|
@@ -1 +1 @@
|
|
1
|
-
!function(){"use strict";var e,t,n,r,o,u,i,c,f,a={},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}},r=!0;try{a[e](n,n.exports,s),r=!1}finally{r&&delete l[e]}return n.exports}s.m=a,e=[],s.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u<e.length;u++){for(var n=e[u][0],r=e[u][1],o=e[u][2],c=!0,f=0;f<n.length;f++)i>=o&&Object.keys(s.O).every(function(e){return s.O[e](n[f])})?n.splice(f--,1):(c=!1,o<i&&(i=o));if(c){e.splice(u--,1);var a=r();void 0!==a&&(t=a)}}return t},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},s.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var o=Object.create(null);s.r(o);var u={};t=t||[null,n({}),n([]),n(n)];for(var i=2&r&&e;"object"==typeof i&&!~t.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach(function(t){u[t]=function(){return e[t]}});return u.default=function(){return e},s.d(o,u),o},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,n){return s.f[n](e,t),t},[]))},s.u=function(e){return"static/chunks/"+(({6555:"964ecbae",7293:"94ca1967"})[e]||e)+"."+({3727:"dcea8f2193111552",6555:"51d6faf8801d15e6",7293:"1d9b42d929a1ee8c",9597:"83583248dfbf6e73"})[e]+".js"},s.miniCssF=function(e){},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="_N_E:",s.l=function(e,t,n,u){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var i,c,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var l=f[a];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+n){i=l;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",o+n),i.src=s.tu(e)),r[e]=[t];var d=function(t,n){i.onerror=i.onload=null,clearTimeout(p);var o=r[e];if(delete r[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),c&&document.head.appendChild(i)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.tt=function(){return void 0===u&&(u={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(u=trustedTypes.createPolicy("nextjs#bundler",u))),u},s.tu=function(e){return s.tt().createScriptURL(e)},s.p="/_next/",i={2272:0,3254:0,3587:0,2664:0,
|
1
|
+
!function(){"use strict";var e,t,n,r,o,u,i,c,f,a={},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}},r=!0;try{a[e](n,n.exports,s),r=!1}finally{r&&delete l[e]}return n.exports}s.m=a,e=[],s.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u<e.length;u++){for(var n=e[u][0],r=e[u][1],o=e[u][2],c=!0,f=0;f<n.length;f++)i>=o&&Object.keys(s.O).every(function(e){return s.O[e](n[f])})?n.splice(f--,1):(c=!1,o<i&&(i=o));if(c){e.splice(u--,1);var a=r();void 0!==a&&(t=a)}}return t},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},s.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var o=Object.create(null);s.r(o);var u={};t=t||[null,n({}),n([]),n(n)];for(var i=2&r&&e;"object"==typeof i&&!~t.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach(function(t){u[t]=function(){return e[t]}});return u.default=function(){return e},s.d(o,u),o},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,n){return s.f[n](e,t),t},[]))},s.u=function(e){return"static/chunks/"+(({6555:"964ecbae",7293:"94ca1967"})[e]||e)+"."+({3727:"dcea8f2193111552",6555:"51d6faf8801d15e6",7293:"1d9b42d929a1ee8c",9597:"83583248dfbf6e73"})[e]+".js"},s.miniCssF=function(e){},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="_N_E:",s.l=function(e,t,n,u){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var i,c,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var l=f[a];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+n){i=l;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",o+n),i.src=s.tu(e)),r[e]=[t];var d=function(t,n){i.onerror=i.onload=null,clearTimeout(p);var o=r[e];if(delete r[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),c&&document.head.appendChild(i)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.tt=function(){return void 0===u&&(u={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(u=trustedTypes.createPolicy("nextjs#bundler",u))),u},s.tu=function(e){return s.tt().createScriptURL(e)},s.p="/_next/",i={2272:0,3254:0,3587:0,2664:0,5540:0,2693:0,1387:0,6008:0,9346:0},s.f.j=function(e,t){var n=s.o(i,e)?i[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(/^(2(272|664|693)|(13|35)87|3254|5540|6008|9346)$/.test(e))i[e]=0;else{var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=s.p+s.u(e),u=Error();s.l(o,function(t){if(s.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",u.name="ChunkLoadError",u.type=r,u.request=o,n[1](u)}},"chunk-"+e,e)}}},s.O.j=function(e){return 0===i[e]},c=function(e,t){var n,r,o=t[0],u=t[1],c=t[2],f=0;if(o.some(function(e){return 0!==i[e]})){for(n in u)s.o(u,n)&&(s.m[n]=u[n]);if(c)var a=c(s)}for(e&&e(t);f<o.length;f++)r=o[f],s.o(i,r)&&i[r]&&i[r][0](),i[r]=0;return s.O(a)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(c.bind(null,0)),f.push=c.bind(null,f.push.bind(f)),s.nc=void 0}();
|
@@ -0,0 +1 @@
|
|
1
|
+
div.sharedChat_main__7Nayy{height:100vh;color:hsla(var(--foreground))}.sharedChat_suggestions__V8kr_{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:1rem;justify-content:center}div.sharedChat_inputBox__wRW5A{border:1px solid var(--border-color);margin-bottom:20px;gap:12px;align-content:center}input.sharedChat_inputBox__wRW5A{border:none}input.sharedChat_inputBox__wRW5A:focus{outline:none;background-color:transparent}div.sharedChat_inputBox__wRW5A:focus{box-shadow:0 8px 16px 0 rgba(0,0,0,.2)}div.sharedChat_chatBodyFull__O1MOv{display:grid;grid-template-columns:1fr;height:100%}button.sharedChat_inputBox__wRW5A{border:none;outline:none;background-color:transparent;cursor:pointer;border-radius:.5rem;padding:.5rem;background:linear-gradient(var(--calm-green),var(--calm-blue))}div.sharedChat_chatBody__OnHDL{display:grid;grid-template-columns:1fr 1fr;height:100%}.sharedChat_inputBox__wRW5A{color:hsla(var(--foreground))}div.sharedChat_chatLayout__gutlc{display:grid;grid-template-columns:auto 1fr;gap:1rem}div.sharedChat_chatBox__PmAPg{display:grid;height:100%}div.sharedChat_titleBar__vOHp_{display:grid;grid-template-columns:1fr auto}div.sharedChat_chatBoxBody__ef2Nl{display:grid;height:100%;width:95%;margin:auto}div.sharedChat_agentIndicator__ORCl4 a{display:flex;text-align:center;align-content:center;align-items:center}div.sharedChat_agentIndicator__ORCl4{padding:10px}@media (max-width:768px){div.sharedChat_chatBody__OnHDL{grid-template-columns:0fr 1fr}div.sharedChat_chatBox__PmAPg{padding:0;height:-moz-min-content;height:min-content}}@media screen and (max-width:768px){div.sharedChat_inputBox__wRW5A{margin-bottom:0}div.sharedChat_chatBoxBody__ef2Nl{width:100%}div.sharedChat_chatBox__PmAPg{padding:0;height:-moz-min-content;height:min-content}div.sharedChat_chatLayout__gutlc{gap:0;grid-template-columns:1fr}}
|
@@ -0,0 +1 @@
|
|
1
|
+
div.agents_titleBar__FzYbY{padding:16px 0;text-align:left}.agents_agentPersonality__o0Ysz p{white-space:inherit;overflow:hidden;height:77px;line-height:1.5}div.agents_agentPersonality__o0Ysz{text-align:left;grid-column:span 3;overflow:hidden}div.agents_pageLayout__gR3S3{max-width:60vw;margin:auto auto 2rem}div.agents_sidePanel__wGVGc{position:fixed;height:100%;z-index:1}button.agents_infoButton__NqI7E{border:none;background-color:transparent!important;text-align:left;font-family:inherit;font-size:medium}div.agents_agentList__XVx4A{display:grid;gap:20px;padding-top:30px;margin-right:auto;grid-auto-flow:row;grid-template-columns:1fr 1fr;margin-left:auto}@media only screen and (max-width:768px){div.agents_agentList__XVx4A{width:100%;padding:0;margin-right:auto;margin-left:auto;grid-template-columns:1fr}div.agents_pageLayout__gR3S3{max-width:90vw}div.agents_sidePanel__wGVGc{position:relative;height:100%}}.loginPrompt_gsiMaterialButton__8QVFH{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;-webkit-appearance:none;background-image:none;border-radius:20px;box-sizing:border-box;color:#1f1f1f;cursor:pointer;font-family:Roboto,arial,sans-serif;font-size:14px;height:40px;letter-spacing:.25px;outline:none;overflow:hidden;padding:0;position:relative;text-align:center;transition:background-color .218s,border-color .218s,box-shadow .218s;vertical-align:middle;white-space:nowrap;width:40px;max-width:400px;min-width:-moz-min-content;min-width:min-content}.loginPrompt_gsiMaterialButton__8QVFH .loginPrompt_gsiMaterialButtonIcon__6TSC5{height:100%;min-width:20px;width:100%;margin:0;padding:9px}.loginPrompt_gsiMaterialButton__8QVFH .loginPrompt_gsiMaterialButtonContentWrapper__9tahB{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;height:100%;justify-content:space-between;position:relative;width:100%}.loginPrompt_gsiMaterialButton__8QVFH .loginPrompt_gsiMaterialButtonContents__3_YcB{flex-grow:1;font-family:Roboto,arial,sans-serif;font-weight:500;overflow:hidden;text-overflow:ellipsis;vertical-align:top}.loginPrompt_gsiMaterialButton__8QVFH .loginPrompt_gsiMaterialButtonState__CDGQm{transition:opacity .218s;bottom:0;left:0;opacity:0;position:absolute;right:0;top:0}.loginPrompt_gsiMaterialButton__8QVFH:disabled{cursor:default;background-color:#ffffff61;border-color:#1f1f1f1f}.loginPrompt_gsiMaterialButton__8QVFH:disabled .loginPrompt_gsiMaterialButtonContents__3_YcB,.loginPrompt_gsiMaterialButton__8QVFH:disabled .loginPrompt_gsiMaterialButtonIcon__6TSC5{opacity:38%}.loginPrompt_gsiMaterialButton__8QVFH:not(:disabled):active .loginPrompt_gsiMaterialButton-State__mAfCZ,.loginPrompt_gsiMaterialButton__8QVFH:not(:disabled):focus .loginPrompt_gsiMaterialButtonState__CDGQm{background-color:#303030;opacity:12%}.loginPrompt_gsiMaterialButton__8QVFH:not(:disabled):hover{box-shadow:0 1px 2px 0 rgba(60,64,67,.3),0 1px 3px 1px rgba(60,64,67,.15)}.loginPrompt_gsiMaterialButton__8QVFH:not(:disabled):hover .loginPrompt_gsiMaterialButtonState__CDGQm{background-color:#303030;opacity:8%}div.search_searchLayout__fP3m0{display:grid;grid-template-columns:1fr;gap:1rem;height:100vh}div.search_sidePanel__myfc9{position:fixed;height:100%;z-index:1}@media screen and (max-width:768px){div.search_searchLayout__fP3m0{gap:0}div.search_sidePanel__myfc9{position:relative;height:100%}}div.chatHistory_chatHistory__CoaVT{display:flex;flex-direction:column;height:100%;margin:auto}div.chatHistory_agentIndicator__wOU1f a{display:flex;text-align:center;align-content:center;align-items:center}div.chatHistory_trainOfThought__mMWSR{border:1px solid var(--border-color);border-radius:16px;padding:8px 16px;margin:12px}div.chatMessage_chatMessageContainer__sAivf{display:flex;flex-direction:column;margin:12px;border-radius:16px;padding:8px 16px 0;word-break:break-word}div.chatMessage_chatMessageWrapper__u5m8A{padding-left:1rem;padding-bottom:1rem;max-width:80vw}div.chatMessage_chatMessageWrapper__u5m8A ol,div.chatMessage_chatMessageWrapper__u5m8A p:not(:last-child),div.chatMessage_chatMessageWrapper__u5m8A ul{margin-bottom:16px}div.chatMessage_chatMessageWrapper__u5m8A a span{display:revert!important}div.chatMessage_khojfullHistory__NPu2l{border-width:1px;padding-left:4px}div.chatMessage_youfullHistory__ioyfH{max-width:100%}div.chatMessage_chatMessageContainer__sAivf.chatMessage_youfullHistory__ioyfH{padding-left:0}div.chatMessage_you__6GUC4{background-color:hsla(var(--secondary));align-self:flex-end;border-radius:16px}div.chatMessage_khoj__cjWON{background-color:transparent;color:hsl(var(--accent-foreground));align-self:flex-start}div.chatMessage_khojChatMessage__BabQz{padding-top:8px;padding-left:16px}div.chatMessage_emptyChatMessage__J9JRn{display:none}div.chatMessage_imagesContainer__HTRjT{display:flex;overflow-x:auto;padding-bottom:8px;margin-bottom:8px}div.chatMessage_imageWrapper__DF92M{flex:0 0 auto;margin-right:8px}div.chatMessage_imageWrapper__DF92M img{width:auto;height:128px;-o-object-fit:cover;object-fit:cover;border-radius:8px}div.chatMessage_khoj__cjWON div.chatMessage_imageWrapper__DF92M img{height:512px}div.chatMessage_khoj__cjWON div.chatMessage_imageWrapper__DF92M{flex:1 1 auto}div.chatMessage_khoj__cjWON div.chatMessage_imagesContainer__HTRjT{display:flex;flex-wrap:wrap;flex-direction:row;overflow-x:hidden}div.chatMessage_chatMessageContainer__sAivf>img{width:auto;height:auto;max-width:100%;max-height:80vh;-o-object-fit:contain;object-fit:contain;display:block;margin-top:.25rem;margin-right:auto}div.chatMessage_chatMessageContainer__sAivf h3 img{width:24px}div.chatMessage_you__6GUC4{color:hsla(var(--secondary-foreground))}div.chatMessage_author__muRtC{font-size:.75rem;color:grey;text-align:right}div.chatMessage_chatFooter__0vR8s{display:flex;justify-content:space-between;min-height:28px}div.chatMessage_chatButtons__Lbk8T{display:flex;justify-content:flex-end;width:-moz-min-content;width:min-content;border:1px solid var(--border-color);border-radius:16px;position:relative;bottom:-12px;background-color:hsla(var(--secondary))}div.chatMessage_chatFooter__0vR8s button{cursor:pointer;color:hsl(var(--muted-foreground));border:none;border-radius:16px;padding:4px;margin-left:4px;margin-right:4px}div.chatMessage_chatFooter__0vR8s button:hover{background-color:hsla(var(--frosted-background-color))}button.chatMessage_codeCopyButton__Y_Ujv{cursor:pointer;float:right;border-radius:8px}button.chatMessage_codeCopyButton__Y_Ujv:hover{color:hsla(var(--frosted-background-color))}button.chatMessage_codeCopyButton__Y_Ujv img,button.chatMessage_copyButton__jd7q7 img,div.chatMessage_feedbackButtons___Brdy img{width:24px}div.chatMessage_trainOfThought__mR2Gg strong{font-weight:500}div.chatMessage_trainOfThought__mR2Gg.chatMessage_primary__WYPEb strong{font-weight:500;color:hsla(var(--secondary-foreground))}div.chatMessage_trainOfThought__mR2Gg.chatMessage_primary__WYPEb p{color:inherit}div.chatMessage_trainOfThoughtElement__le_bC{display:grid;grid-template-columns:auto 1fr;align-items:start}div.chatMessage_trainOfThoughtElement__le_bC ol,div.chatMessage_trainOfThoughtElement__le_bC ul{margin:auto;word-break:break-word}@media screen and (max-width:768px){div.chatMessage_youfullHistory__ioyfH{max-width:90%}div.chatMessage_khoj__cjWON div.chatMessage_imageWrapper__DF92M img{width:100%;height:auto}}div.chatInputArea_actualInputArea__Ha6cN{display:grid;grid-template-columns:auto 1fr auto auto}.agentCard_agentPersonality__MmRlN p{white-space:inherit;overflow:hidden;height:77px;line-height:1.5}div.agentCard_agentPersonality__MmRlN{text-align:left;grid-column:span 3;overflow:hidden}button.agentCard_infoButton__heh_w{border:none;background-color:transparent!important;text-align:left;font-family:inherit;font-size:medium}
|
@@ -0,0 +1 @@
|
|
1
|
+
div.chat_main__8xQu5{height:100dvh;color:hsla(var(--foreground))}.chat_suggestions__m8n2t{display:flex;overflow-x:none;height:50%;padding:10px;white-space:nowrap;gap:1rem}div.chat_inputBox__LOFws{border:1px solid var(--border-color);margin-bottom:20px;gap:12px;align-content:center}input.chat_inputBox__LOFws{border:none}input.chat_inputBox__LOFws:focus{outline:none;background-color:transparent}div.chat_inputBox__LOFws:focus{box-shadow:0 8px 16px 0 rgba(0,0,0,.2)}div.chat_chatBodyFull__FfKEK{display:grid;grid-template-columns:1fr;height:100%}button.chat_inputBox__LOFws{border:none;outline:none;background-color:transparent;cursor:pointer;border-radius:.5rem;padding:.5rem;background:linear-gradient(var(--calm-green),var(--calm-blue))}div.chat_chatBody__sS1LX{display:grid;grid-template-columns:1fr 1fr;height:100%}.chat_inputBox__LOFws{color:hsla(var(--foreground))}div.chat_chatLayout__pR203{display:grid;grid-template-columns:auto 1fr;gap:1rem}div.chat_chatBox__FBct_{display:grid;height:100%}div.chat_titleBar__R5QlK{display:grid;grid-template-columns:1fr auto}div.chat_chatBoxBody__qT_SC{display:grid;height:100%;width:95%;margin:auto}div.chat_agentIndicator__8V55w a{display:flex;text-align:center;align-content:center;align-items:center}div.chat_agentIndicator__8V55w{padding:10px}div.chat_chatTitleWrapper__6ChWq{grid-template-columns:1fr auto}@media screen and (max-width:768px){div.chat_inputBox__LOFws{margin-bottom:0}div.chat_chatBoxBody__qT_SC{width:100%}div.chat_chatBody__sS1LX{grid-template-columns:0fr 1fr}div.chat_chatBox__FBct_{padding:0;height:100%}div.chat_chatLayout__pR203{gap:0;grid-template-columns:1fr}}div.sidePanel_session__R9wgH{padding:.5rem;margin-bottom:.25rem;border-radius:.5rem;cursor:pointer;max-width:14rem;font-size:medium;display:grid;grid-template-columns:minmax(auto,400px) 1fr;gap:0}div.sidePanel_compressed__YBPtM{grid-template-columns:minmax(12rem,100%) 1fr 1fr}div.sidePanel_sessionHover__iwfo8,div.sidePanel_session__R9wgH:hover{background-color:hsla(var(--popover))}div.sidePanel_session__R9wgH:hover{color:hsla(var(--popover-foreground))}div.sidePanel_session__R9wgH a{text-decoration:none}button.sidePanel_button__ihOfG{border:none;outline:none;background-color:transparent;cursor:pointer;color:var(--main-text-color);width:24px}button.sidePanel_showMoreButton__dt9Zw{border-radius:.5rem;padding:8px}div.sidePanel_panel__VZ8ye{display:flex;flex-direction:column;padding:1rem;overflow-y:auto;max-width:auto;transition:background-color .5s}div.sidePanel_expanded__ZjTHo{gap:1rem;background-color:hsla(var(--muted));height:100%}div.sidePanel_collapsed__OjVmG{display:grid;grid-template-columns:1fr;height:-moz-fit-content;height:fit-content;padding:1rem 0 0 1rem}p.sidePanel_session__R9wgH{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;text-align:left;font-size:small}div.sidePanel_header__d5cGA{display:grid;grid-template-columns:1fr auto}div.sidePanel_profile__x0w58{display:grid;grid-template-columns:auto 1fr;gap:1rem;align-items:center;margin-top:auto}div.sidePanel_panelWrapper__k_lal{display:grid;grid-template-rows:1fr auto auto;height:100%}div.sidePanel_modalSessionsList__nKe2n{position:fixed;top:0;left:0;width:100%;height:100%;background-color:hsla(var(--frosted-background-color));z-index:1;display:flex;justify-content:center;align-items:center;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}div.sidePanel_modalSessionsList__nKe2n div.sidePanel_content__Wq20_{max-width:80%;max-height:80%;background-color:hsla(var(--frosted-background-color));overflow:auto;padding:20px;border-radius:10px}div.sidePanel_modalSessionsList__nKe2n div.sidePanel_session__R9wgH{max-width:100%;text-overflow:ellipsis}@media screen and (max-width:768px){div.sidePanel_panel__VZ8ye{padding:.25rem;width:100%}div.sidePanel_expanded__ZjTHo{z-index:1}div.sidePanel_singleReference__r9z1n{padding:4px}div.sidePanel_panelWrapper__k_lal{width:100%;padding:0 1rem}div.sidePanel_session__R9wgH.sidePanel_compressed__YBPtM{max-width:100%;display:grid;grid-template-columns:70vw auto;justify-content:space-between}div.sidePanel_session__R9wgH{max-width:100%;grid-template-columns:minmax(auto,70vw) 1fr}}menu.navMenu_menu__fqlFF a{text-decoration:none;font-size:medium;font-weight:400;padding:0 4px;border-radius:4px;display:flex;justify-self:center;margin:0;align-items:center;gap:4px}a.navMenu_selected__A__aP{background-color:hsl(var(--accent))}div.navMenu_titleBar__HJoio{display:flex;justify-content:space-between;align-content:space-evenly;align-items:start}div.navMenu_titleBar__HJoio menu{padding:0;margin:0;border-radius:.5rem;display:grid;grid-auto-flow:column;gap:32px}div.navMenu_settingsMenuProfile__3npiK img{border-radius:50%;width:32px;height:32px;margin:0}div.navMenu_settingsMenu__X2i2U{padding:0 4px;border-radius:4px;display:flex;justify-self:center;margin:0;align-items:center}div.navMenu_settingsMenuOptions__KWnLv{display:block;grid-auto-flow:row;position:absolute;background-color:var(--background-color);box-shadow:0 8px 16px 0 rgba(0,0,0,.2);top:64px;text-align:left;padding:8px;border-radius:8px}@media screen and (max-width:600px){menu.navMenu_menu__fqlFF span{display:none}div.navMenu_settingsMenuOptions__KWnLv{right:4px}div.navMenu_titleBar__HJoio{padding:4px}}
|