khoj 1.33.3.dev32__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/__init__.py +0 -0
- khoj/app/README.md +94 -0
- khoj/app/__init__.py +0 -0
- khoj/app/asgi.py +16 -0
- khoj/app/settings.py +218 -0
- khoj/app/urls.py +25 -0
- khoj/configure.py +452 -0
- khoj/database/__init__.py +0 -0
- khoj/database/adapters/__init__.py +1821 -0
- khoj/database/admin.py +417 -0
- khoj/database/apps.py +6 -0
- khoj/database/management/__init__.py +0 -0
- khoj/database/management/commands/__init__.py +0 -0
- khoj/database/management/commands/change_default_model.py +116 -0
- khoj/database/management/commands/change_generated_images_url.py +61 -0
- khoj/database/management/commands/convert_images_png_to_webp.py +99 -0
- khoj/database/migrations/0001_khojuser.py +98 -0
- khoj/database/migrations/0002_googleuser.py +32 -0
- khoj/database/migrations/0003_vector_extension.py +10 -0
- khoj/database/migrations/0004_content_types_and_more.py +181 -0
- khoj/database/migrations/0005_embeddings_corpus_id.py +19 -0
- khoj/database/migrations/0006_embeddingsdates.py +33 -0
- khoj/database/migrations/0007_add_conversation.py +27 -0
- khoj/database/migrations/0008_alter_conversation_conversation_log.py +17 -0
- khoj/database/migrations/0009_khojapiuser.py +24 -0
- khoj/database/migrations/0010_chatmodeloptions_and_more.py +83 -0
- khoj/database/migrations/0010_rename_embeddings_entry_and_more.py +30 -0
- khoj/database/migrations/0011_merge_20231102_0138.py +14 -0
- khoj/database/migrations/0012_entry_file_source.py +21 -0
- khoj/database/migrations/0013_subscription.py +37 -0
- khoj/database/migrations/0014_alter_googleuser_picture.py +17 -0
- khoj/database/migrations/0015_alter_subscription_user.py +21 -0
- khoj/database/migrations/0016_alter_subscription_renewal_date.py +17 -0
- khoj/database/migrations/0017_searchmodel.py +32 -0
- khoj/database/migrations/0018_searchmodelconfig_delete_searchmodel.py +30 -0
- khoj/database/migrations/0019_alter_googleuser_family_name_and_more.py +27 -0
- khoj/database/migrations/0020_reflectivequestion.py +36 -0
- khoj/database/migrations/0021_speechtotextmodeloptions_and_more.py +42 -0
- khoj/database/migrations/0022_texttoimagemodelconfig.py +25 -0
- khoj/database/migrations/0023_usersearchmodelconfig.py +33 -0
- khoj/database/migrations/0024_alter_entry_embeddings.py +18 -0
- khoj/database/migrations/0025_clientapplication_khojuser_phone_number_and_more.py +46 -0
- khoj/database/migrations/0025_searchmodelconfig_embeddings_inference_endpoint_and_more.py +22 -0
- khoj/database/migrations/0026_searchmodelconfig_cross_encoder_inference_endpoint_and_more.py +22 -0
- khoj/database/migrations/0027_merge_20240118_1324.py +13 -0
- khoj/database/migrations/0028_khojuser_verified_phone_number.py +17 -0
- khoj/database/migrations/0029_userrequests.py +27 -0
- khoj/database/migrations/0030_conversation_slug_and_title.py +38 -0
- khoj/database/migrations/0031_agent_conversation_agent.py +53 -0
- khoj/database/migrations/0031_alter_googleuser_locale.py +30 -0
- khoj/database/migrations/0032_merge_20240322_0427.py +14 -0
- khoj/database/migrations/0033_rename_tuning_agent_personality.py +17 -0
- khoj/database/migrations/0034_alter_chatmodeloptions_chat_model.py +32 -0
- khoj/database/migrations/0035_processlock.py +26 -0
- khoj/database/migrations/0036_alter_processlock_name.py +19 -0
- khoj/database/migrations/0036_delete_offlinechatprocessorconversationconfig.py +15 -0
- khoj/database/migrations/0036_publicconversation.py +42 -0
- khoj/database/migrations/0037_chatmodeloptions_openai_config_and_more.py +51 -0
- khoj/database/migrations/0037_searchmodelconfig_bi_encoder_docs_encode_config_and_more.py +32 -0
- khoj/database/migrations/0038_merge_20240425_0857.py +14 -0
- khoj/database/migrations/0038_merge_20240426_1640.py +12 -0
- khoj/database/migrations/0039_merge_20240501_0301.py +12 -0
- khoj/database/migrations/0040_alter_processlock_name.py +26 -0
- khoj/database/migrations/0040_merge_20240504_1010.py +14 -0
- khoj/database/migrations/0041_merge_20240505_1234.py +14 -0
- khoj/database/migrations/0042_serverchatsettings.py +46 -0
- khoj/database/migrations/0043_alter_chatmodeloptions_model_type.py +21 -0
- khoj/database/migrations/0044_conversation_file_filters.py +17 -0
- khoj/database/migrations/0045_fileobject.py +37 -0
- khoj/database/migrations/0046_khojuser_email_verification_code_and_more.py +22 -0
- khoj/database/migrations/0047_alter_entry_file_type.py +31 -0
- khoj/database/migrations/0048_voicemodeloption_uservoicemodelconfig.py +52 -0
- khoj/database/migrations/0049_datastore.py +38 -0
- khoj/database/migrations/0049_texttoimagemodelconfig_api_key_and_more.py +58 -0
- khoj/database/migrations/0050_alter_processlock_name.py +25 -0
- khoj/database/migrations/0051_merge_20240702_1220.py +14 -0
- khoj/database/migrations/0052_alter_searchmodelconfig_bi_encoder_docs_encode_config_and_more.py +27 -0
- khoj/database/migrations/0053_agent_style_color_agent_style_icon.py +61 -0
- khoj/database/migrations/0054_alter_agent_style_color.py +38 -0
- khoj/database/migrations/0055_alter_agent_style_icon.py +37 -0
- khoj/database/migrations/0056_chatmodeloptions_vision_enabled.py +17 -0
- khoj/database/migrations/0056_searchmodelconfig_cross_encoder_model_config.py +17 -0
- khoj/database/migrations/0057_merge_20240816_1409.py +13 -0
- khoj/database/migrations/0057_remove_serverchatsettings_default_model_and_more.py +51 -0
- khoj/database/migrations/0058_alter_chatmodeloptions_chat_model.py +17 -0
- khoj/database/migrations/0059_searchmodelconfig_bi_encoder_confidence_threshold.py +17 -0
- khoj/database/migrations/0060_merge_20240905_1828.py +14 -0
- khoj/database/migrations/0061_alter_chatmodeloptions_model_type.py +26 -0
- khoj/database/migrations/0061_alter_texttoimagemodelconfig_model_type.py +21 -0
- khoj/database/migrations/0062_merge_20240913_0222.py +14 -0
- khoj/database/migrations/0063_conversation_temp_id.py +36 -0
- khoj/database/migrations/0064_remove_conversation_temp_id_alter_conversation_id.py +86 -0
- khoj/database/migrations/0065_remove_agent_avatar_remove_agent_public_and_more.py +49 -0
- khoj/database/migrations/0066_remove_agent_tools_agent_input_tools_and_more.py +69 -0
- khoj/database/migrations/0067_alter_agent_style_icon.py +50 -0
- khoj/database/migrations/0068_alter_agent_output_modes.py +24 -0
- khoj/database/migrations/0069_webscraper_serverchatsettings_web_scraper.py +89 -0
- khoj/database/migrations/0070_alter_agent_input_tools_alter_agent_output_modes.py +46 -0
- khoj/database/migrations/0071_subscription_enabled_trial_at_and_more.py +32 -0
- khoj/database/migrations/0072_entry_search_model.py +24 -0
- khoj/database/migrations/0073_delete_usersearchmodelconfig.py +15 -0
- khoj/database/migrations/0074_alter_conversation_title.py +17 -0
- khoj/database/migrations/0075_migrate_generated_assets_and_validate.py +85 -0
- khoj/database/migrations/0076_rename_openaiprocessorconversationconfig_aimodelapi_and_more.py +26 -0
- khoj/database/migrations/0077_chatmodel_alter_agent_chat_model_and_more.py +62 -0
- khoj/database/migrations/0078_khojuser_email_verification_code_expiry.py +17 -0
- khoj/database/migrations/__init__.py +0 -0
- khoj/database/models/__init__.py +725 -0
- khoj/database/tests.py +3 -0
- khoj/interface/compiled/404/index.html +1 -0
- khoj/interface/compiled/_next/static/Tg-vU1p1B-YKT5Qv8KSHt/_buildManifest.js +1 -0
- khoj/interface/compiled/_next/static/Tg-vU1p1B-YKT5Qv8KSHt/_ssgManifest.js +1 -0
- khoj/interface/compiled/_next/static/chunks/1010-8f39bb4648b5ba10.js +1 -0
- khoj/interface/compiled/_next/static/chunks/182-f1c48a203dc91e0e.js +20 -0
- khoj/interface/compiled/_next/static/chunks/1915-d3c36ad6ce697ce7.js +1 -0
- khoj/interface/compiled/_next/static/chunks/2117-165ef4747a5b836b.js +2 -0
- khoj/interface/compiled/_next/static/chunks/2581-455000f8aeb08fc3.js +1 -0
- khoj/interface/compiled/_next/static/chunks/3727.dcea8f2193111552.js +1 -0
- khoj/interface/compiled/_next/static/chunks/3789-a09e37a819171a9d.js +1 -0
- khoj/interface/compiled/_next/static/chunks/4124-6c28322ce218d2d5.js +1 -0
- khoj/interface/compiled/_next/static/chunks/5427-b52d95253e692bfa.js +1 -0
- khoj/interface/compiled/_next/static/chunks/5473-b1cf56dedac6577a.js +1 -0
- khoj/interface/compiled/_next/static/chunks/5477-0bbddb79c25a54a7.js +1 -0
- khoj/interface/compiled/_next/static/chunks/6065-64db9ad305ba0bcd.js +1 -0
- khoj/interface/compiled/_next/static/chunks/6293-469dd16402ea8a6f.js +3 -0
- khoj/interface/compiled/_next/static/chunks/688-b5b4391bbc0376f1.js +1 -0
- khoj/interface/compiled/_next/static/chunks/8667-b6bf63c72b2d76eb.js +1 -0
- khoj/interface/compiled/_next/static/chunks/9259-1172dbaca0515237.js +1 -0
- khoj/interface/compiled/_next/static/chunks/94ca1967.1d9b42d929a1ee8c.js +1 -0
- khoj/interface/compiled/_next/static/chunks/9597.83583248dfbf6e73.js +1 -0
- khoj/interface/compiled/_next/static/chunks/964ecbae.51d6faf8801d15e6.js +1 -0
- khoj/interface/compiled/_next/static/chunks/9665-391df1e5c51c960a.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/_not-found/page-a834eddae3e235df.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/agents/layout-e00fb81dca656a10.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/agents/page-28ce086a1129bca2.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/automations/layout-1fe1537449f43496.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/automations/page-bf365a60829d347f.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/chat/layout-33934fc2d6ae6838.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/chat/page-0e476e57eb2015e3.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/layout-30e7fda7262713ce.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/page-a5515ea71aec5ef0.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/search/layout-c02531d586972d7d.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/search/page-9140541e67ea307d.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/settings/layout-d09d6510a45cd4bd.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/settings/page-951ba40b5b94b23a.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-e8e5db7830bf3f47.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/share/chat/page-1beb80d8d741c932.js +1 -0
- khoj/interface/compiled/_next/static/chunks/d3ac728e-44ebd2a0c99b12a0.js +1 -0
- khoj/interface/compiled/_next/static/chunks/fd9d1056-4482b99a36fd1673.js +1 -0
- khoj/interface/compiled/_next/static/chunks/framework-8e0e0f4a6b83a956.js +1 -0
- khoj/interface/compiled/_next/static/chunks/main-app-de1f09df97a3cfc7.js +1 -0
- khoj/interface/compiled/_next/static/chunks/main-db4bfac6b0a8d00b.js +1 -0
- khoj/interface/compiled/_next/static/chunks/pages/_app-3c9ca398d360b709.js +1 -0
- khoj/interface/compiled/_next/static/chunks/pages/_error-cf5ca766ac8f493f.js +1 -0
- khoj/interface/compiled/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- khoj/interface/compiled/_next/static/chunks/webpack-a03962458328b163.js +1 -0
- khoj/interface/compiled/_next/static/css/089de1d8526b96e9.css +1 -0
- khoj/interface/compiled/_next/static/css/37a73b87f02df402.css +1 -0
- khoj/interface/compiled/_next/static/css/4e4e6a4a1c920d06.css +1 -0
- khoj/interface/compiled/_next/static/css/8d02837c730f8d13.css +25 -0
- khoj/interface/compiled/_next/static/css/8e6a3ca11a60b189.css +1 -0
- khoj/interface/compiled/_next/static/css/9c164d9727dd8092.css +1 -0
- khoj/interface/compiled/_next/static/css/dac88c17aaee5fcf.css +1 -0
- khoj/interface/compiled/_next/static/css/df4b47a2d0d85eae.css +1 -0
- khoj/interface/compiled/_next/static/css/e4eb883b5265d372.css +1 -0
- khoj/interface/compiled/_next/static/media/1d8a05b60287ae6c-s.p.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/6f22fce21a7c433c-s.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/77c207b095007c34-s.p.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/82ef96de0e8f4d8c-s.p.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_AMS-Regular.1608a09b.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_AMS-Regular.4aafdb68.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_AMS-Regular.a79f1c31.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Bold.b6770918.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Bold.cce5b8ec.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Bold.ec17d132.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Regular.07ef19e7.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Regular.55fac258.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Regular.dad44a7f.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Bold.9f256b85.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Bold.b18f59e1.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Bold.d42a5579.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Regular.7c187121.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Regular.d3c882a6.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Regular.ed38e79f.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Bold.b74a1a8b.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Bold.c3fb5ac2.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Bold.d181c465.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-BoldItalic.6f2bb1df.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-BoldItalic.70d8b0a5.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-BoldItalic.e3f82f9d.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Italic.47373d1e.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Italic.8916142b.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Italic.9024d815.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Regular.0462f03b.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Regular.7f51fe03.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Regular.b7f8fe9b.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Math-BoldItalic.572d331f.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Math-BoldItalic.a879cf83.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Math-BoldItalic.f1035d8d.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Math-Italic.5295ba48.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Math-Italic.939bc644.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Math-Italic.f28c23ac.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Bold.8c5b5494.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Bold.94e1e8dc.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Bold.bf59d231.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Italic.3b1e59b3.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Italic.7c9bc82b.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Italic.b4c20c84.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Regular.74048478.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Regular.ba21ed5f.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Regular.d4d7ba48.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Script-Regular.03e9641d.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Script-Regular.07505710.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Script-Regular.fe9cbbe1.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size1-Regular.e1e279cb.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size1-Regular.eae34984.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size1-Regular.fabc004a.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size2-Regular.57727022.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size2-Regular.5916a24f.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size2-Regular.d6b476ec.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size3-Regular.9acaf01c.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size3-Regular.a144ef58.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size3-Regular.b4230e7e.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size4-Regular.10d95fd3.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size4-Regular.7a996c9d.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size4-Regular.fbccdabe.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Typewriter-Regular.6258592b.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Typewriter-Regular.a8709e36.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Typewriter-Regular.d97aaf4a.ttf +0 -0
- khoj/interface/compiled/_next/static/media/a6ecd16fa044d500-s.p.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/c32c8052c071fc42-s.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/c4250770ab8708b6-s.p.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/e098aaaecc9cfbb2-s.p.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/flags.3afdda2f.webp +0 -0
- khoj/interface/compiled/_next/static/media/flags@2x.5fbe9fc1.webp +0 -0
- khoj/interface/compiled/_next/static/media/globe.98e105ca.webp +0 -0
- khoj/interface/compiled/_next/static/media/globe@2x.974df6f8.webp +0 -0
- khoj/interface/compiled/agents/index.html +1 -0
- khoj/interface/compiled/agents/index.txt +7 -0
- khoj/interface/compiled/agents.svg +6 -0
- khoj/interface/compiled/assets/icons/khoj_lantern.ico +0 -0
- khoj/interface/compiled/assets/icons/khoj_lantern.svg +100 -0
- khoj/interface/compiled/assets/icons/khoj_lantern_1200x1200.png +0 -0
- khoj/interface/compiled/assets/icons/khoj_lantern_128x128.png +0 -0
- khoj/interface/compiled/assets/icons/khoj_lantern_128x128_dark.png +0 -0
- khoj/interface/compiled/assets/icons/khoj_lantern_256x256.png +0 -0
- khoj/interface/compiled/assets/icons/khoj_lantern_512x512.png +0 -0
- khoj/interface/compiled/assets/icons/khoj_lantern_logomarktype_1200x630.png +0 -0
- khoj/interface/compiled/assets/samples/desktop-browse-draw-sample.png +0 -0
- khoj/interface/compiled/assets/samples/desktop-plain-chat-sample.png +0 -0
- khoj/interface/compiled/assets/samples/desktop-remember-plan-sample.png +0 -0
- khoj/interface/compiled/assets/samples/phone-browse-draw-sample.png +0 -0
- khoj/interface/compiled/assets/samples/phone-plain-chat-sample.png +0 -0
- khoj/interface/compiled/assets/samples/phone-remember-plan-sample.png +0 -0
- khoj/interface/compiled/automation.svg +37 -0
- khoj/interface/compiled/automations/index.html +1 -0
- khoj/interface/compiled/automations/index.txt +8 -0
- khoj/interface/compiled/chat/index.html +1 -0
- khoj/interface/compiled/chat/index.txt +7 -0
- khoj/interface/compiled/chat.svg +24 -0
- khoj/interface/compiled/close.svg +5 -0
- khoj/interface/compiled/copy-button-success.svg +6 -0
- khoj/interface/compiled/copy-button.svg +5 -0
- khoj/interface/compiled/index.html +1 -0
- khoj/interface/compiled/index.txt +7 -0
- khoj/interface/compiled/khoj.webmanifest +76 -0
- khoj/interface/compiled/logo.svg +24 -0
- khoj/interface/compiled/search/index.html +1 -0
- khoj/interface/compiled/search/index.txt +7 -0
- khoj/interface/compiled/send.svg +1 -0
- khoj/interface/compiled/settings/index.html +1 -0
- khoj/interface/compiled/settings/index.txt +9 -0
- khoj/interface/compiled/share/chat/index.html +1 -0
- khoj/interface/compiled/share/chat/index.txt +7 -0
- khoj/interface/compiled/share.svg +8 -0
- khoj/interface/compiled/thumbs-down.svg +6 -0
- khoj/interface/compiled/thumbs-up.svg +6 -0
- khoj/interface/email/feedback.html +34 -0
- khoj/interface/email/magic_link.html +40 -0
- khoj/interface/email/task.html +37 -0
- khoj/interface/email/welcome.html +90 -0
- khoj/interface/web/.well-known/assetlinks.json +11 -0
- khoj/interface/web/assets/icons/agents.svg +19 -0
- khoj/interface/web/assets/icons/automation.svg +43 -0
- khoj/interface/web/assets/icons/chat.svg +24 -0
- khoj/interface/web/assets/icons/github.svg +1 -0
- khoj/interface/web/assets/icons/khoj-logo-sideways-200.png +0 -0
- khoj/interface/web/assets/icons/khoj-logo-sideways-500.png +0 -0
- khoj/interface/web/assets/icons/khoj-logo-sideways.svg +32 -0
- khoj/interface/web/assets/icons/khoj.svg +26 -0
- khoj/interface/web/assets/icons/logotype.svg +1 -0
- khoj/interface/web/assets/icons/search.svg +57 -0
- khoj/interface/web/assets/icons/sync.svg +4 -0
- khoj/interface/web/assets/khoj.css +237 -0
- khoj/interface/web/assets/utils.js +33 -0
- khoj/interface/web/base_config.html +445 -0
- khoj/interface/web/content_source_github_input.html +208 -0
- khoj/interface/web/login.html +310 -0
- khoj/interface/web/utils.html +48 -0
- khoj/main.py +249 -0
- khoj/manage.py +22 -0
- khoj/migrations/__init__.py +0 -0
- khoj/migrations/migrate_offline_chat_default_model.py +69 -0
- khoj/migrations/migrate_offline_chat_default_model_2.py +71 -0
- khoj/migrations/migrate_offline_chat_schema.py +83 -0
- khoj/migrations/migrate_offline_model.py +29 -0
- khoj/migrations/migrate_processor_config_openai.py +67 -0
- khoj/migrations/migrate_server_pg.py +132 -0
- khoj/migrations/migrate_version.py +17 -0
- khoj/processor/__init__.py +0 -0
- khoj/processor/content/__init__.py +0 -0
- khoj/processor/content/docx/__init__.py +0 -0
- khoj/processor/content/docx/docx_to_entries.py +111 -0
- khoj/processor/content/github/__init__.py +0 -0
- khoj/processor/content/github/github_to_entries.py +226 -0
- khoj/processor/content/images/__init__.py +0 -0
- khoj/processor/content/images/image_to_entries.py +117 -0
- khoj/processor/content/markdown/__init__.py +0 -0
- khoj/processor/content/markdown/markdown_to_entries.py +160 -0
- khoj/processor/content/notion/notion_to_entries.py +259 -0
- khoj/processor/content/org_mode/__init__.py +0 -0
- khoj/processor/content/org_mode/org_to_entries.py +226 -0
- khoj/processor/content/org_mode/orgnode.py +532 -0
- khoj/processor/content/pdf/__init__.py +0 -0
- khoj/processor/content/pdf/pdf_to_entries.py +119 -0
- khoj/processor/content/plaintext/__init__.py +0 -0
- khoj/processor/content/plaintext/plaintext_to_entries.py +117 -0
- khoj/processor/content/text_to_entries.py +296 -0
- khoj/processor/conversation/__init__.py +0 -0
- khoj/processor/conversation/anthropic/__init__.py +0 -0
- khoj/processor/conversation/anthropic/anthropic_chat.py +243 -0
- khoj/processor/conversation/anthropic/utils.py +217 -0
- khoj/processor/conversation/google/__init__.py +0 -0
- khoj/processor/conversation/google/gemini_chat.py +253 -0
- khoj/processor/conversation/google/utils.py +260 -0
- khoj/processor/conversation/offline/__init__.py +0 -0
- khoj/processor/conversation/offline/chat_model.py +308 -0
- khoj/processor/conversation/offline/utils.py +80 -0
- khoj/processor/conversation/offline/whisper.py +15 -0
- khoj/processor/conversation/openai/__init__.py +0 -0
- khoj/processor/conversation/openai/gpt.py +243 -0
- khoj/processor/conversation/openai/utils.py +232 -0
- khoj/processor/conversation/openai/whisper.py +13 -0
- khoj/processor/conversation/prompts.py +1188 -0
- khoj/processor/conversation/utils.py +867 -0
- khoj/processor/embeddings.py +122 -0
- khoj/processor/image/generate.py +215 -0
- khoj/processor/speech/__init__.py +0 -0
- khoj/processor/speech/text_to_speech.py +51 -0
- khoj/processor/tools/__init__.py +0 -0
- khoj/processor/tools/online_search.py +472 -0
- khoj/processor/tools/run_code.py +179 -0
- khoj/routers/__init__.py +0 -0
- khoj/routers/api.py +760 -0
- khoj/routers/api_agents.py +295 -0
- khoj/routers/api_chat.py +1273 -0
- khoj/routers/api_content.py +634 -0
- khoj/routers/api_model.py +123 -0
- khoj/routers/api_phone.py +86 -0
- khoj/routers/api_subscription.py +144 -0
- khoj/routers/auth.py +307 -0
- khoj/routers/email.py +135 -0
- khoj/routers/helpers.py +2333 -0
- khoj/routers/notion.py +85 -0
- khoj/routers/research.py +364 -0
- khoj/routers/storage.py +63 -0
- khoj/routers/twilio.py +36 -0
- khoj/routers/web_client.py +141 -0
- khoj/search_filter/__init__.py +0 -0
- khoj/search_filter/base_filter.py +15 -0
- khoj/search_filter/date_filter.py +215 -0
- khoj/search_filter/file_filter.py +32 -0
- khoj/search_filter/word_filter.py +29 -0
- khoj/search_type/__init__.py +0 -0
- khoj/search_type/text_search.py +255 -0
- khoj/utils/__init__.py +0 -0
- khoj/utils/cli.py +101 -0
- khoj/utils/config.py +81 -0
- khoj/utils/constants.py +51 -0
- khoj/utils/fs_syncer.py +252 -0
- khoj/utils/helpers.py +627 -0
- khoj/utils/initialization.py +301 -0
- khoj/utils/jsonl.py +43 -0
- khoj/utils/models.py +47 -0
- khoj/utils/rawconfig.py +208 -0
- khoj/utils/state.py +48 -0
- khoj/utils/yaml.py +47 -0
- khoj-1.33.3.dev32.dist-info/METADATA +190 -0
- khoj-1.33.3.dev32.dist-info/RECORD +393 -0
- khoj-1.33.3.dev32.dist-info/WHEEL +4 -0
- khoj-1.33.3.dev32.dist-info/entry_points.txt +2 -0
- khoj-1.33.3.dev32.dist-info/licenses/LICENSE +661 -0
@@ -0,0 +1 @@
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3474],{28661:function(t,e,r){Promise.resolve().then(r.bind(r,35293)),Promise.resolve().then(r.bind(r,35976))},35293:function(t,e,r){"use strict";r.d(e,{ChatwootWidget:function(){return a}});var n=r(57437),s=r(48667);function a(){return(0,n.jsx)(s.default,{id:"chatwoot-widget",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:'\n window.chatwootSettings = {\n position: "right",\n type: "standard",\n launcherTitle: "Chat with us"\n };\n (function(d,t) {\n var BASE_URL="https://app.chatwoot.com";\n var g=d.createElement(t),s=d.getElementsByTagName(t)[0];\n g.src=BASE_URL+"/packs/js/sdk.js";\n g.defer = true;\n g.async = true;\n s.parentNode.insertBefore(g,s);\n g.onload=function(){\n window.chatwootSDK.run({\n websiteToken: \'5uV59Ay2pvMJenJary2hvvVM\',\n baseUrl: BASE_URL\n })\n }\n })(document,"script");\n '}})}},89534:function(t,e,r){"use strict";r.d(e,{FN:function(){return f},Mi:function(){return g},VW:function(){return d},_i:function(){return c},gD:function(){return p},lj:function(){return v},sA:function(){return m}});var n=r(57437),s=r(2265),a=r(41915),o=r(90535),i=r(32489),u=r(94508);let d=a.zt,c=s.forwardRef((t,e)=>{let{className:r,...s}=t;return(0,n.jsx)(a.l_,{ref:e,className:(0,u.cn)("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",r),...s})});c.displayName=a.l_.displayName;let l=(0,o.j)("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),f=s.forwardRef((t,e)=>{let{className:r,variant:s,...o}=t;return(0,n.jsx)(a.fC,{ref:e,className:(0,u.cn)(l({variant:s}),r),...o})});f.displayName=a.fC.displayName;let p=s.forwardRef((t,e)=>{let{className:r,...s}=t;return(0,n.jsx)(a.aU,{ref:e,className:(0,u.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",r),...s})});p.displayName=a.aU.displayName;let m=s.forwardRef((t,e)=>{let{className:r,...s}=t;return(0,n.jsx)(a.x8,{ref:e,className:(0,u.cn)("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",r),"toast-close":"",...s,children:(0,n.jsx)(i.Z,{className:"h-4 w-4"})})});m.displayName=a.x8.displayName;let g=s.forwardRef((t,e)=>{let{className:r,...s}=t;return(0,n.jsx)(a.Dx,{ref:e,className:(0,u.cn)("text-sm font-semibold",r),...s})});g.displayName=a.Dx.displayName;let v=s.forwardRef((t,e)=>{let{className:r,...s}=t;return(0,n.jsx)(a.dk,{ref:e,className:(0,u.cn)("text-sm opacity-90",r),...s})});v.displayName=a.dk.displayName},35976:function(t,e,r){"use strict";r.d(e,{Toaster:function(){return o}});var n=r(57437),s=r(89534),a=r(77992);function o(){let{toasts:t}=(0,a.pm)();return(0,n.jsxs)(s.VW,{children:[t.map(function(t){let{id:e,title:r,description:a,action:o,...i}=t;return(0,n.jsxs)(s.FN,{...i,children:[(0,n.jsxs)("div",{className:"grid gap-1",children:[r&&(0,n.jsx)(s.Mi,{children:r}),a&&(0,n.jsx)(s.lj,{children:a})]}),o,(0,n.jsx)(s.sA,{})]},e)}),(0,n.jsx)(s._i,{})]})}},77992:function(t,e,r){"use strict";r.d(e,{pm:function(){return f}});var n=r(2265);let s=0,a=new Map,o=t=>{if(a.has(t))return;let e=setTimeout(()=>{a.delete(t),c({type:"REMOVE_TOAST",toastId:t})},1e6);a.set(t,e)},i=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,1)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(t=>t.id===e.toast.id?{...t,...e.toast}:t)};case"DISMISS_TOAST":{let{toastId:r}=e;return r?o(r):t.toasts.forEach(t=>{o(t.id)}),{...t,toasts:t.toasts.map(t=>t.id===r||void 0===r?{...t,open:!1}:t)}}case"REMOVE_TOAST":if(void 0===e.toastId)return{...t,toasts:[]};return{...t,toasts:t.toasts.filter(t=>t.id!==e.toastId)}}},u=[],d={toasts:[]};function c(t){d=i(d,t),u.forEach(t=>{t(d)})}function l(t){let{...e}=t,r=(s=(s+1)%Number.MAX_SAFE_INTEGER).toString(),n=()=>c({type:"DISMISS_TOAST",toastId:r});return c({type:"ADD_TOAST",toast:{...e,id:r,open:!0,onOpenChange:t=>{t||n()}}}),{id:r,dismiss:n,update:t=>c({type:"UPDATE_TOAST",toast:{...t,id:r}})}}function f(){let[t,e]=n.useState(d);return n.useEffect(()=>(u.push(e),()=>{let t=u.indexOf(e);t>-1&&u.splice(t,1)}),[t]),{...t,toast:l,dismiss:t=>c({type:"DISMISS_TOAST",toastId:t})}}},94508:function(t,e,r){"use strict";r.d(e,{cn:function(){return a}});var n=r(61994),s=r(53335);function a(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return(0,s.m6)((0,n.W)(e))}}},function(t){t.O(0,[9259,8667,1915,2971,2117,1744],function(){return t(t.s=28661)}),_N_E=t.O()}]);
|
@@ -0,0 +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 em}});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),m=s(67341),u=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 w=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})});w.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 N=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})});N.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 y=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})});y.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(81228),F=s(94018),P=s(13272),O=s(88435),A=s(37295),I=s(2049),z=s(50525),Y=s(5147),R=s(80438),K=s(29975),Z=s(47615),W=s(47020),M=s(22345),U=s(75216),L=s(90483),B=s(73925),V=s(54271),H=s(95656),G=s(58717),J=s(56777),$=s(97525),q=s(45178),X=s(14308),Q=s(34688),ee=s(59199),et=s(37099),es=s(32759),ea=s(27648),en=s(85872),er=s(34124),ei=s(6512),el=s(37104);let eo=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),[m,x]=(0,o.useState)(null),[p,f]=(0,o.useState)(null),[j,g]=(0,o.useState)(!1),[b,w]=(0,o.useState)(0),[N,y]=(0,o.useState)([]),D=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(j||w(0),j){let e=setInterval(()=>{w(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)}})()},[N]);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,ee.ko)(e,x,g,f,y)}return(0,r.jsxs)(v.m5,{open:!0,onOpenChange:t,children:[(0,r.jsx)(et.aR,{open:null!==m||null!=p,children:(0,r.jsxs)(et._T,{children:[(0,r.jsx)(et.fY,{children:(0,r.jsx)(et.f$,{children:"Alert"})}),(0,r.jsx)(et.yT,{children:m||p}),(0,r.jsx)(et.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)(es.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)(ea.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)(u.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)(u.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"]})})})]})]})},ec=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)(u.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()))})})]})})},ed=()=>{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 eh(){let{apiKeys:e,generateAPIKey:t,copyAPIKey:s,deleteAPIKey:a}=ed(),[n,i]=(0,o.useState)(new Set),{toast:l}=(0,c.pm)();return(0,r.jsxs)(f.Zb,{className:"grid grid-flow-column border border-gray-300 shadow-md rounded-lg dark:bg-muted dark:border-none border-opacity-50 lg:w-2/3",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)(E.s,{className:"h-7 w-7 mr-2"}),"API Keys"]}),(0,r.jsxs)(u.z,{variant:"secondary",className:"!mt-0",onClick:t,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)(w,{children:e.map(e=>(0,r.jsxs)(N,{children:[(0,r.jsx)(y,{className:"pl-0 py-3",children:e.name}),(0,r.jsxs)(y,{className:"grid grid-flow-col grid-cols-[1fr_auto] bg-secondary dark:bg-background rounded-xl p-3 m-1",children:[(0,r.jsx)("span",{className:"font-mono text-left w-[50px] md:w-[400px]",children:n.has(e.token)?e.token:"".concat(e.token.slice(0,6),"...").concat(e.token.slice(-4))}),(0,r.jsxs)("div",{className:"grid grid-flow-col",children:[n.has(e.token)?(0,r.jsx)(F.N,{weight:"bold",className:"h-4 w-4 mr-2 hover:bg-primary/40",onClick:()=>i(t=>{let s=new Set(t);return s.delete(e.token),s})}):(0,r.jsx)(P.b,{weight:"bold",className:"h-4 w-4 mr-2 hover:bg-primary/40",onClick:()=>i(new Set([...n,e.token]))}),(0,r.jsx)(O.C,{weight:"bold",className:"h-4 w-4 mr-2 hover:bg-primary/40",onClick:()=>{l({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"}),s(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:()=>{l({title:"\uD83D\uDD11 Deleted API Key: ".concat(e.name),description:"Apps using this API key will no longer connect to this Khoj account"}),a(e.token)}})]})]})]},e.token))})})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4"})]})}function em(){let{userConfig:e}=(0,d.h2)(!0),[t,s]=(0,o.useState)(null),[a,n]=(0,o.useState)(void 0),[i,j]=(0,o.useState)(null),[g,b]=(0,o.useState)(void 0),[w,N]=(0,o.useState)(""),[y,v]=(0,o.useState)("verified"),[k,C]=(0,o.useState)(!1),{toast:T}=(0,c.pm)(),D=(0,h.IC)(),E="w-full lg:w-5/12 grid grid-flow-column border border-gray-300 shadow-md rounded-lg border dark:border-none border-opacity-50 dark:bg-muted";(0,o.useEffect)(()=>{var t;s(e),b(null==e?void 0:e.phone_number),v((null==e?void 0:e.is_phone_number_verified)?"verified":(null==e?void 0:e.phone_number)?"otp":"setup"),n(null==e?void 0:e.given_name),j(null!==(t=null==e?void 0:e.notion_token)&&void 0!==t?t:null)},[e]);let F=async()=>{try{if(!(await fetch("/api/phone?phone_number=".concat(g),{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to send OTP");v("verify")}catch(e){console.error("Error sending OTP:",e),T({title:"\uD83D\uDCF1 Phone",description:"Failed to send OTP. Try again or contact us at team@khoj.dev"})}},P=async()=>{try{if(!(await fetch("/api/phone/verify?code=".concat(w),{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to verify OTP");v("verified"),T({title:"\uD83D\uDCF1 Phone",description:"Phone number verified"})}catch(e){console.error("Error verifying OTP:",e),T({title:"\uD83D\uDCF1 Phone",description:"Failed to verify OTP. Try again or contact us at team@khoj.dev"})}},O=async()=>{try{if(!(await fetch("/api/phone",{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to disconnect phone number");b(void 0),v("setup"),T({title:"\uD83D\uDCF1 Phone",description:"Phone number disconnected"})}catch(e){console.error("Error disconnecting phone number:",e),T({title:"\uD83D\uDCF1 Phone",description:"Failed to disconnect phone number. Try again or contact us at team@khoj.dev"})}},ee=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");t&&(t.subscription_state="cancel"===e?d.o9.UNSUBSCRIBED:d.o9.SUBSCRIBED,s(t)),T({title:"\uD83D\uDCB3 Subscription",description:(null==t?void 0:t.subscription_state)==="unsubscribed"?"Your subscription was cancelled":"Your Futurist subscription has been renewed"})}catch(t){console.error("Error changing subscription:",t),T({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"})}},et=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&&t){t.subscription_state=d.o9.TRIAL;let e=new Date(Date.now()+864e5*t.length_of_free_trial);t.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),t.subscription_enabled_trial_at=new Date().toISOString(),s(t),T({title:"\uD83C\uDF89 Trial Enabled",description:"Your free trial will end on ".concat(t.subscription_renewal_date)})}}catch(e){console.error("Error enabling free trial:",e),T({title:"⚠️ Failed to Enable Free Trial",description:"Failed to enable free trial. Try again or contact us at team@khoj.dev"})}},es=async()=>{if(a)try{if(!(await fetch("/api/user/name?name=".concat(a),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to update name");t&&(t.given_name=a,s(t)),T({title:"✅ Updated Profile",description:"You name has been updated to ".concat(a)})}catch(e){console.error("Error updating name:",e),T({title:"⚠️ Failed to Update Profile",description:"Failed to update name. Try again or contact team@khoj.dev"})}},ea=e=>async s=>{if(!(null==t?void 0:t.is_active)){T({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=")+s,{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to update model");T({title:"✅ Updated ".concat((0,h.LF)(e)," Model")})}catch(t){console.error("Failed to update ".concat(e," model:"),t),T({description:"❌ Failed to update ".concat((0,h.LF)(e)," model. Try again."),variant:"destructive"})}},ed=async()=>{if(i)try{if(!(await fetch("/api/content/notion",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:i})})).ok)throw Error("Failed to save Notion API key");t&&(t.notion_token=i,s(t)),T({title:"✅ Saved Notion Settings",description:"You Notion API key has been saved."})}catch(e){console.error("Error updating name:",e),T({title:"⚠️ Failed to Save Notion Settings",description:"Failed to save Notion API key. Try again or contact team@khoj.dev"})}},em=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));T({title:"\uD83D\uDD04 Syncing ".concat(e),description:"Your ".concat(e," content is being synced.")})}catch(t){console.error("Error syncing content:",t),T({title:"⚠️ Failed to Sync ".concat(e),description:"Failed to sync ".concat(e," content. Try again or contact team@khoj.dev")})}},eu=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));t&&("computer"===e?t.enabled_content_source.computer=!1:"notion"===e?(t.enabled_content_source.notion=!1,t.notion_token=null,j(t.notion_token)):"github"===e&&(t.enabled_content_source.github=!1),s(t)),"computer"===e?T({title:"✅ Deleted Synced Files",description:"Your synced documents have been deleted."}):T({title:"✅ Disconnected ".concat(e),description:"Your ".concat(e," integration to Khoj has been disconnected.")})}catch(t){console.error("Error disconnecting ".concat(e,":"),t),T({title:"⚠️ Failed to Disconnect ".concat(e),description:"Failed to disconnect from ".concat(e,". Try again or contact team@khoj.dev")})}};return t?(0,r.jsxs)(en.Hn,{children:[(0,r.jsx)(er.S,{conversationId:""}),(0,r.jsxs)(en.kV,{children:[(0,r.jsxs)("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b px-4",children:[(0,r.jsx)(en.vP,{className:"-ml-1"}),(0,r.jsx)(ei.Z,{orientation:"vertical",className:"mr-2 h-4"}),D?(0,r.jsx)("a",{className:"p-0 no-underline",href:"/",children:(0,r.jsx)(el.VO,{className:"h-auto w-16"})}):(0,r.jsx)("h2",{className:"text-lg",children:"Settings"})]}),(0,r.jsxs)("div",{className:l().page,children:[(0,r.jsx)("title",{children:"Settings"}),(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)(X.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:E,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(A.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=>n(e.target.value),value:a,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)(u.z,{variant:"outline",size:"sm",onClick:es,disabled:a===t.given_name,children:[(0,r.jsx)(I.B,{className:"h-5 w-5 inline mr-2"}),"Save"]})})]}),(0,r.jsxs)(f.Zb,{id:"subscription",className:E,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(z.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"===t.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"," ",t.length_of_free_trial," ","day trial of the Khoj Futurist plan. Your trial ends on"," ",t.subscription_renewal_date,". Check"," ",(0,r.jsx)("a",{href:"https://khoj.dev/#pricing",target:"_blank",children:"pricing page"})," ","to compare plans."]})]})||"subscribed"===t.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:t.subscription_renewal_date})]})]})||"unsubscribed"===t.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:t.subscription_renewal_date})]})]})||"expired"===t.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl",children:"Humanist"}),t.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:t.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"==t.subscription_state&&(0,r.jsxs)(u.z,{variant:"outline",className:"hover:text-red-400",onClick:()=>ee("cancel"),children:[(0,r.jsx)(Y.b,{className:"h-5 w-5 mr-2"}),"Unsubscribe"]})||"unsubscribed"==t.subscription_state&&(0,r.jsxs)(u.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>ee("resubscribe"),children:[(0,r.jsx)(R.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Resubscribe"]})||t.subscription_enabled_trial_at&&(0,r.jsxs)(u.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>window.open("".concat(t.khoj_cloud_subscription_url,"?prefilled_email=").concat(t.username),"_blank","noopener,noreferrer"),children:[(0,r.jsx)(R.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Subscribe"]})||(0,r.jsxs)(u.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:et,children:[(0,r.jsx)(R.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Enable Trial"]})})]})]})]}),k&&(0,r.jsx)(eo,{onClose:()=>C(!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:E,children:[(0,r.jsxs)(f.Ol,{className:"flex flex-row text-2xl",children:[(0,r.jsx)(K.I,{className:"h-8 w-8 mr-2"}),"Files",t.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)(u.z,{variant:"outline",size:"sm",onClick:()=>C(!0),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})}),(0,r.jsxs)(u.z,{variant:"outline",size:"sm",className:"".concat(t.enabled_content_source.computer||"hidden"),onClick:()=>eu("computer"),children:[(0,r.jsx)(M.u,{className:"h-5 w-5 inline mr-1"}),"Disable"]})]})]}),(0,r.jsxs)(f.Zb,{id:"github",className:"".concat(E," hidden"),children:[(0,r.jsxs)(f.Ol,{className:"flex flex-row text-2xl",children:[(0,r.jsx)(U.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)(u.z,{variant:"outline",size:"sm",children:t.enabled_content_source.github&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})||(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(L.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]})}),(0,r.jsxs)(u.z,{variant:"outline",size:"sm",className:"".concat(t.enabled_content_source.github||"hidden"),children:[(0,r.jsx)(M.u,{className:"h-5 w-5 inline mr-1"}),"Disable"]})]})]}),(0,r.jsxs)(f.Zb,{id:"notion",className:E,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(B.F,{className:"h-7 w-7 mr-2"}),"Notion",t.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."}),!t.notion_oauth_url&&(0,r.jsx)(p.I,{onChange:e=>j(e.target.value),value:i||"",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:[t.notion_oauth_url&&!t.enabled_content_source.notion?(0,r.jsxs)(u.z,{variant:"outline",size:"sm",onClick:()=>{window.open(t.notion_oauth_url)},children:[(0,r.jsx)(L.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]}):t.enabled_content_source.notion&&i===t.notion_token?(0,r.jsxs)(u.z,{variant:"outline",size:"sm",onClick:()=>em("notion"),children:[(0,r.jsx)(V.t,{className:"h-5 w-5 inline mr-1"}),"Sync"]}):t.notion_oauth_url?(0,r.jsx)(r.Fragment,{}):(0,r.jsxs)(u.z,{variant:"outline",size:"sm",onClick:ed,disabled:i===t.notion_token,children:[(0,r.jsx)(I.B,{className:"h-5 w-5 inline mr-1"}),t.enabled_content_source.notion&&"Update API Key"||"Set API Key"]}),(0,r.jsxs)(u.z,{variant:"outline",size:"sm",className:"".concat(t.notion_token||"hidden"),onClick:()=>eu("notion"),children:[(0,r.jsx)(M.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:[t.chat_model_options.length>0&&(0,r.jsxs)(f.Zb,{className:E,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(H.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)(ec,{items:t.chat_model_options,selected:t.selected_chat_model_config,callbackFunc:ea("chat")})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:!t.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),t.paint_model_options.length>0&&(0,r.jsxs)(f.Zb,{className:E,children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(G.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)(ec,{items:t.paint_model_options,selected:t.selected_paint_model_config,callbackFunc:ea("paint")})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:!t.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),t.voice_model_options.length>0&&(0,r.jsxs)(f.Zb,{className:E,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)(ec,{items:t.voice_model_options,selected:t.selected_voice_model_config,callbackFunc:ea("voice")})]}),(0,r.jsx)(f.eW,{className:"flex flex-wrap gap-4",children:!t.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-col flex-wrap gap-8",children:[!t.anonymous_mode&&(0,r.jsx)(eh,{}),(0,r.jsxs)(f.Zb,{className:"".concat(E," lg:w-2/3"),children:[(0,r.jsxs)(f.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(J.V,{className:"h-7 w-7 mr-2"}),"Chat on Whatsapp","verified"===y&&(0,r.jsx)(Z.f,{weight:"bold",className:"h-4 w-4 ml-1 text-green-400"})||"setup"!==y&&(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)(Q.Z,{initialValue:g||"",onChangeNumber:b,disabled:"verify"===y,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"===y&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{children:"Enter the OTP sent to your number: ".concat(g)}),(0,r.jsx)(x.Zn,{autoFocus:!0,maxLength:6,value:w||"",onChange:N,onComplete:()=>v("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"===y&&(0,r.jsx)(u.z,{variant:"outline",onClick:P,children:"Verify"})||(0,r.jsx)(u.z,{variant:"outline",disabled:!g||g===t.phone_number&&"verified"===y||!(0,m.y)(g),onClick:F,children:t.phone_number?g&&(g!==t.phone_number||"verified"!==y)&&(0,m.y)(g)?(0,r.jsxs)(r.Fragment,{children:["Send OTP"," ",(0,r.jsx)(q.o,{className:"inline ml-2",weight:"bold"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)($.F,{className:"inline mr-2 text-green-400"}),"Switch Number"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(L.F,{className:"inline mr-2"}),"Setup Whatsapp"]})}),"verified"===y&&(0,r.jsxs)(u.z,{variant:"outline",onClick:()=>O(),children:[(0,r.jsx)(M.u,{className:"h-5 w-5 mr-2"}),"Disconnect"]})]})]})]})]})]})})})})]})]})]}):(0,r.jsx)(X.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 m}});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 m(){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"}}},function(e){e.O(0,[6008,1887,9259,8667,182,688,4124,2971,2117,1744],function(){return e(e.s=62960)}),_N_E=e.O()}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7138,8459,3317,244],{63521:function(){}},function(n){n.O(0,[2971,2117,1744],function(){return n(n.s=63521)}),_N_E=n.O()}]);
|
@@ -0,0 +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 f}});var a=s(57437),n=s(22515),o=s.n(n),i=s(2265),c=s(53789),r=s(14308);s(2446);var l=s(7436),d=s(56937),h=s(5477),u=s(85872),g=s(34124),m=s(6512),p=s(37104);function x(e){let[t,s]=(0,i.useState)(""),[n,r]=(0,i.useState)([]),[l,d]=(0,i.useState)(!1),[u,g]=(0,i.useState)(null),m=(0,i.useRef)(null),p=e.setQueryToProcess,x=e.streamedMessages,f=e.isMobileWidth?"w-full":"w-4/6";return((0,i.useEffect)(()=>{if(n.length>0){let t=n.map(e=>encodeURIComponent(e));e.setImages(t)}},[n,e.setImages]),(0,i.useEffect)(()=>{t&&(d(!0),p(t))},[t,p]),(0,i.useEffect)(()=>{x&&x.length>0&&x[x.length-1].completed?d(!1):s("")},[x]),e.publicConversationSlug||e.conversationId)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:o().chatBodyFull,children:(0,a.jsx)(c.Z,{publicConversationSlug:e.publicConversationSlug,conversationId:e.conversationId||"",setAgent:g,setTitle:e.setTitle,pendingMessage:l?t:"",incomingMessages:e.streamedMessages,customClassName:f})}),(0,a.jsx)("div",{className:"".concat(o().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-2xl md:rounded-xl h-fit ").concat(f," mr-auto ml-auto"),children:(0,a.jsx)(h.a,{isLoggedIn:e.isLoggedIn,sendMessage:e=>s(e),sendImage:e=>r(t=>[...t,e]),sendDisabled:l,chatOptionsData:e.chatOptionsData,conversationId:e.conversationId,agentColor:null==u?void 0:u.color,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles,setTriggeredAbort:()=>{},ref:m})})]}):(0,a.jsx)("div",{className:o().suggestions,children:"Whoops, nothing to see here!"})}function f(){let[e,t]=(0,i.useState)(null),[s,n]=(0,i.useState)(!0),[c,h]=(0,i.useState)("Khoj AI - Chat"),[f,_]=(0,i.useState)(void 0),[v,j]=(0,i.useState)([]),[S,C]=(0,i.useState)(""),[I,b]=(0,i.useState)(null),[N,y]=(0,i.useState)(void 0),[B,w]=(0,i.useState)([]),{data:O,error:k,isLoading:M}=(0,d.GW)(),E=(0,l.IC)();return((0,i.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{n(!1),e&&t(e)}).catch(e=>{console.error(e)}),(0,l.EK)(),y(window.location.pathname.split("/").pop()||"")},[]),(0,i.useEffect)(()=>{I&&localStorage.setItem("uploadedFiles",JSON.stringify(I))},[I]),(0,i.useEffect)(()=>{if(S&&!f){fetch("/api/chat/share/fork?public_conversation_slug=".concat(N),{method:"POST",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{_(e.conversation_id),localStorage.setItem("message",S),B.length>0&&localStorage.setItem("images",JSON.stringify(B)),window.location.href="/chat?conversationId=".concat(e.conversation_id)}).catch(e=>{console.error(e)});return}},[S,f,N]),s)?(0,a.jsx)(r.Z,{}):N?(0,a.jsxs)(u.Hn,{children:[(0,a.jsx)(g.S,{conversationId:f||""}),(0,a.jsxs)(u.kV,{children:[(0,a.jsxs)("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b px-4",children:[(0,a.jsx)(u.vP,{className:"-ml-1"}),(0,a.jsx)(m.Z,{orientation:"vertical",className:"mr-2 h-4"}),N&&(0,a.jsx)("div",{className:"".concat(o().chatTitleWrapper," text-nowrap text-ellipsis overflow-hidden max-w-screen-md grid items-top font-bold mx-2 md:mr-8 col-auto h-fit"),children:E?(0,a.jsx)("a",{className:"p-0 no-underline",href:"/",children:(0,a.jsx)(p.VO,{className:"h-auto w-16"})}):c&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden mr-4",children:c})})})]}),(0,a.jsxs)("div",{className:"".concat(o().main," ").concat(o().chatLayout),children:[(0,a.jsx)("title",{children:c}),(0,a.jsx)("div",{className:o().chatBox,children:(0,a.jsx)("div",{className:o().chatBoxBody,children:(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(r.Z,{}),children:(0,a.jsx)(x,{conversationId:f,streamedMessages:v,setQueryToProcess:C,isLoggedIn:!!O,publicConversationSlug:N,chatOptionsData:e,setTitle:h,setUploadedFiles:b,isMobileWidth:E,setImages:w})})})})]})]})]}):(0,a.jsx)("div",{className:o().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,8255,1887,3954,9259,8667,182,1010,6293,4124,5477,3789,2971,2117,1744],function(){return e(e.s=91955)}),_N_E=e.O()}]);
|