khoj 2.0.0b14.dev51__py3-none-any.whl → 2.0.0b15.dev23__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/adapters/__init__.py +59 -20
- khoj/database/admin.py +4 -0
- khoj/database/migrations/0094_serverchatsettings_think_free_deep_and_more.py +61 -0
- khoj/database/models/__init__.py +18 -2
- khoj/interface/compiled/404/index.html +2 -2
- khoj/interface/compiled/_next/static/chunks/{9808-0ae18d938933fea3.js → 9808-bd5d7361ad026094.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/{webpack-e572645654c4335e.js → webpack-820bd66958a5e279.js} +1 -1
- khoj/interface/compiled/_next/static/css/821d0d60b0b6871d.css +1 -0
- khoj/interface/compiled/_next/static/css/fb7ea16e60b40ecd.css +1 -0
- khoj/interface/compiled/agents/index.html +2 -2
- khoj/interface/compiled/agents/index.txt +2 -2
- khoj/interface/compiled/automations/index.html +2 -2
- khoj/interface/compiled/automations/index.txt +3 -3
- khoj/interface/compiled/chat/index.html +2 -2
- khoj/interface/compiled/chat/index.txt +3 -3
- khoj/interface/compiled/index.html +2 -2
- khoj/interface/compiled/index.txt +2 -2
- khoj/interface/compiled/search/index.html +2 -2
- khoj/interface/compiled/search/index.txt +2 -2
- khoj/interface/compiled/settings/index.html +2 -2
- khoj/interface/compiled/settings/index.txt +4 -4
- khoj/interface/compiled/share/chat/index.html +2 -2
- khoj/interface/compiled/share/chat/index.txt +2 -2
- khoj/processor/conversation/anthropic/anthropic_chat.py +4 -88
- khoj/processor/conversation/anthropic/utils.py +1 -2
- khoj/processor/conversation/google/gemini_chat.py +4 -88
- khoj/processor/conversation/google/utils.py +6 -3
- khoj/processor/conversation/openai/gpt.py +16 -93
- khoj/processor/conversation/openai/utils.py +38 -30
- khoj/processor/conversation/prompts.py +30 -39
- khoj/processor/conversation/utils.py +72 -84
- khoj/processor/image/generate.py +69 -15
- khoj/processor/tools/run_code.py +3 -2
- khoj/routers/api_chat.py +8 -21
- khoj/routers/helpers.py +243 -156
- khoj/routers/research.py +6 -6
- khoj/utils/helpers.py +6 -2
- {khoj-2.0.0b14.dev51.dist-info → khoj-2.0.0b15.dev23.dist-info}/METADATA +1 -1
- {khoj-2.0.0b14.dev51.dist-info → khoj-2.0.0b15.dev23.dist-info}/RECORD +51 -50
- khoj/interface/compiled/_next/static/css/2945c4a857922f3b.css +0 -1
- khoj/interface/compiled/_next/static/css/ecea704005ba630c.css +0 -1
- /khoj/interface/compiled/_next/static/{yBzbL9kxl5BudSA9F4Gr6 → PcD2gC0kChVzNip15DdDQ}/_buildManifest.js +0 -0
- /khoj/interface/compiled/_next/static/{yBzbL9kxl5BudSA9F4Gr6 → PcD2gC0kChVzNip15DdDQ}/_ssgManifest.js +0 -0
- /khoj/interface/compiled/_next/static/chunks/{1327-511bb0a862efce80.js → 1327-e254819a9172cfa7.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{1915-fbfe167c84ad60c5.js → 1915-5c6508f6ebb62a30.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{2117-e78b6902ad6f75ec.js → 2117-080746c8e170c81a.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{2939-4d4084c5b888b960.js → 2939-4af3fd24b8ffc9ad.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{4447-d6cf93724d57e34b.js → 4447-cd95608f8e93e711.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{8667-4b7790573b08c50d.js → 8667-50b03a89e82e0ba7.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{9139-ce1ae935dac9c871.js → 9139-8ac4d9feb10f8869.js} +0 -0
- {khoj-2.0.0b14.dev51.dist-info → khoj-2.0.0b15.dev23.dist-info}/WHEEL +0 -0
- {khoj-2.0.0b14.dev51.dist-info → khoj-2.0.0b15.dev23.dist-info}/entry_points.txt +0 -0
- {khoj-2.0.0b14.dev51.dist-info → khoj-2.0.0b15.dev23.dist-info}/licenses/LICENSE +0 -0
khoj/interface/compiled/_next/static/chunks/{9808-0ae18d938933fea3.js → 9808-bd5d7361ad026094.js}
RENAMED
@@ -1 +1 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9808],{29808:function(e,t,n){"use strict";n.d(t,{Z:function(){return eL}});var a=n(57437),s=n(42501),r=n.n(s),l=n(2265),o=n(48614),i=n(98239),c=n(91499),d=n.n(c),u=n(19983),h=n(13506),m=n.n(h),g=n(34040),f=n(54887);n(2446);var x=n(37052),p=n(19273),v=n(3244),j=n(4235),w=n(66070),y=n(69304),b=n(57054),N=n(18848),M=n(42225),k=n(27648);let C=new u.Z({html:!0,linkify:!0,typographer:!0});function _(e){let t=(0,M.Le)(e.title||".txt","w-6 h-6 text-muted-foreground inline-flex mr-2"),n=e.title.split("/").pop()||e.title,s=function(e){let t=["org","md","markdown"].includes(e.title.split(".").pop()||"")?e.content.split("\n").slice(1).join("\n"):e.content;return e.showFullContent?N.Z.sanitize(C.render(t)):N.Z.sanitize(t)}(e),[r,o]=(0,l.useState)(!1);return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(b.J2,{open:r&&!e.showFullContent,onOpenChange:o,children:[(0,a.jsx)(b.xo,{asChild:!0,children:(0,a.jsx)(w.Zb,{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),className:"".concat(e.showFullContent?"w-auto bg-muted":"w-auto"," overflow-hidden break-words text-balance rounded-lg border-none p-2 shadow-none"),children:e.showFullContent?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("h3",{className:"".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground}"),children:[t,e.showFullContent?e.title:n]}),(0,a.jsx)("p",{className:"text-sm overflow-x-auto block",dangerouslySetInnerHTML:{__html:s}})]}):(0,a.jsx)(T,{type:"notes"},"".concat(e.title))})}),(0,a.jsx)(b.yk,{className:"w-[400px] mx-2",children:(0,a.jsxs)(w.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none p-2",children:[(0,a.jsxs)("h3",{className:"line-clamp-2 text-muted-foreground}",children:[t,e.title]}),(0,a.jsx)("p",{className:"border-t mt-1 pt-1 text-sm overflow-hidden line-clamp-5",dangerouslySetInnerHTML:{__html:s}})]})})]})})}function S(e){var t,n,s,r,o,i;let c=(0,M.Le)(".py","!w-4 h-4 text-muted-foreground flex-shrink-0"),d=N.Z.sanitize(e.code),[u,h]=(0,l.useState)(!1),[m,g]=(0,l.useState)(!1),f=e=>{let t="text/plain",n=e.b64_data;e.filename.match(/\.(png|jpg|jpeg|webp)$/)?(t="image/".concat(e.filename.split(".").pop()),n=atob(e.b64_data)):e.filename.endsWith(".json")?t="application/json":e.filename.endsWith(".csv")&&(t="text/csv");let a=new ArrayBuffer(n.length),s=new Uint8Array(a);for(let e=0;e<n.length;e++)s[e]=n.charCodeAt(e);let r=new Blob([a],{type:t}),l=URL.createObjectURL(r),o=document.createElement("a");o.href=l,o.download=e.filename,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(l)},p=(t,n)=>(null==t?void 0:t.length)==0?null:(0,a.jsx)("div",{className:"".concat(n||e.showFullContent?"border-t mt-1 pt-1":void 0),children:t.slice(0,e.showFullContent?void 0:1).map((t,s)=>(0,a.jsxs)("div",{children:[(0,a.jsxs)("h4",{className:"text-sm text-muted-foreground flex items-center",children:[(0,a.jsx)("span",{className:"overflow-hidden mr-2 font-bold ".concat(e.showFullContent?void 0:"line-clamp-1"),children:t.filename}),(0,a.jsx)("button",{className:"".concat(n?"hidden":void 0),onClick:e=>{e.preventDefault(),f(t)},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),title:"Download file: ".concat(t.filename),children:(0,a.jsx)(x.b,{className:"w-4 h-4",weight:m?"fill":"regular"})})]}),t.filename.match(/\.(txt|org|md|csv|json)$/)?(0,a.jsx)("pre",{className:"".concat(e.showFullContent?"block":"line-clamp-2"," text-sm mt-1 p-1 bg-background rounded overflow-x-auto"),children:t.b64_data}):t.filename.match(/\.(png|jpg|jpeg|webp)$/)?(0,a.jsx)("img",{src:"data:image/".concat(t.filename.split(".").pop(),";base64,").concat(t.b64_data),alt:t.filename,className:"mt-1 max-h-32 rounded"}):null]},"".concat(t.filename,"-").concat(s)))});return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(b.J2,{open:u&&!e.showFullContent,onOpenChange:h,children:[(0,a.jsx)(b.xo,{asChild:!0,children:(0,a.jsx)(w.Zb,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),className:"".concat(e.showFullContent?"w-auto bg-muted":"w-auto"," overflow-hidden break-words text-balance rounded-lg border-none p-2 shadow-none"),children:e.showFullContent?(0,a.jsxs)("div",{className:"flex flex-col px-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[c,(0,a.jsxs)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:["code ",(null===(t=e.output_files)||void 0===t?void 0:t.length)>0?"artifacts":""]})]}),(0,a.jsx)("pre",{className:"text-xs pb-2 ".concat(e.showFullContent?"block overflow-x-auto":(null===(n=e.output_files)||void 0===n?void 0:n.length)>0?"hidden":"overflow-hidden line-clamp-3"),children:d}),(null===(s=e.output_files)||void 0===s?void 0:s.length)>0&&p(e.output_files,!1)]}):(0,a.jsx)(T,{type:"code"},"code-".concat(e.code))})}),(0,a.jsx)(b.yk,{className:"w-[400px] mx-2",children:(0,a.jsxs)(w.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none p-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[c,(0,a.jsxs)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:["code ",(null===(r=e.output_files)||void 0===r?void 0:r.length)>0?"artifact":""]})]}),(null===(o=e.output_files)||void 0===o?void 0:o.length)>0&&p(null===(i=e.output_files)||void 0===i?void 0:i.slice(0,1),!0)||(0,a.jsx)("pre",{className:"text-xs border-t mt-1 pt-1 overflow-hidden line-clamp-10",children:d})]})})]})})}function E(e){let[t,n]=(0,l.useState)(!1);if(!e.link||e.link.split(" ").length>1)return null;let s="https://www.google.com/s2/favicons?domain=globe",r="unknown";try{r=new URL(e.link).hostname,s="https://www.google.com/s2/favicons?domain=".concat(r)}catch(t){return console.warn("Error parsing domain from link: ".concat(e.link)),null}return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(b.J2,{open:t&&!e.showFullContent,onOpenChange:n,children:[(0,a.jsx)(b.xo,{asChild:!0,children:(0,a.jsx)(w.Zb,{onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)},className:"".concat(e.showFullContent?"w-auto bg-muted":"w-auto"," overflow-hidden break-words text-balance rounded-lg border-none p-2 shadow-none"),children:e.showFullContent?(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(k.default,{href:e.link,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("img",{src:s,alt:"",className:"!w-4 h-4 flex-shrink-0"}),(0,a.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:r})]})}),(0,a.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," font-bold"),children:e.title}),(0,a.jsx)("p",{className:"overflow-hidden text-sm ".concat(e.showFullContent?"block":"line-clamp-2"),children:e.description})]}):(0,a.jsx)(T,{type:"online",link:e.link},e.title)})}),(0,a.jsx)(b.yk,{className:"w-[400px] mx-2",children:(0,a.jsx)(w.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none",children:(0,a.jsx)("div",{className:"flex flex-col",children:(0,a.jsxs)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:"!no-underline px-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("img",{src:s,alt:"",className:"!w-4 h-4 flex-shrink-0"}),(0,a.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," text-muted-foreground flex-grow"),children:r})]}),(0,a.jsx)("h3",{className:"border-t mt-1 pt-1 overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," font-bold"),children:e.title}),(0,a.jsx)("p",{className:"overflow-hidden text-sm ".concat(e.showFullContent?"block":"line-clamp-5"),children:e.description})]})})})})]})})}function T(e){let t="",n="unknown";if(e.link)try{n=new URL(e.link).hostname,t="https://www.google.com/s2/favicons?domain=".concat(n)}catch(t){return console.warn("Error parsing domain from link: ".concat(e.link)),null}let s=null,r="!w-4 !h-4 text-muted-foreground inline-flex mr-2 rounded-lg";switch(e.type){case"code":s=(0,a.jsx)(p.E,{className:"".concat(r)});break;case"online":s=(0,a.jsx)("img",{src:t,alt:"",className:"".concat(r)});break;case"notes":s=(0,a.jsx)(v.j,{className:"".concat(r)});break;default:s=null}return s?(0,a.jsx)("div",{className:"flex items-center gap-2",children:s}):null}function R(e){let t=e.notesReferenceCardData.length>0||e.codeReferenceCardData.length>0||e.onlineReferenceCardData.length>0,n=e.notesReferenceCardData.length+e.codeReferenceCardData.length+e.onlineReferenceCardData.length;return 0===n?null:(0,a.jsx)("div",{className:"pt-0 px-4 pb-4",children:(0,a.jsxs)("h3",{className:"inline-flex items-center",children:[(0,a.jsxs)("div",{className:"text-gray-400 m-2",children:[n," sources"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 w-auto m-2",children:t&&(0,a.jsx)(I,{notesReferenceCardData:e.notesReferenceCardData,onlineReferenceCardData:e.onlineReferenceCardData,codeReferenceCardData:e.codeReferenceCardData,isMobileWidth:e.isMobileWidth})})]})})}function I(e){let[t,n]=(0,l.useState)(3);if((0,l.useEffect)(()=>{n(e.isMobileWidth?3:5)},[e.isMobileWidth]),!e.notesReferenceCardData&&!e.onlineReferenceCardData)return null;let s=e.codeReferenceCardData.slice(0,t),r=e.notesReferenceCardData.slice(0,t-s.length),o=r.length+s.length<t?e.onlineReferenceCardData.filter(e=>e.link).slice(0,t-s.length-r.length):[];return(0,a.jsxs)(y.yo,{children:[(0,a.jsxs)(y.aM,{className:"text-balance w-auto justify-start overflow-hidden break-words p-0 bg-transparent border-none text-gray-400 align-middle items-center m-0 inline-flex",children:[s.map((e,t)=>(0,l.createElement)(S,{showFullContent:!1,...e,key:"code-".concat(t)})),r.map((e,t)=>(0,l.createElement)(_,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),o.map((e,t)=>(0,l.createElement)(E,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),(0,a.jsx)(j.o,{className:"m-0"})]}),(0,a.jsxs)(y.ue,{className:"overflow-y-scroll",children:[(0,a.jsxs)(y.Tu,{children:[(0,a.jsx)(y.bC,{children:"References"}),(0,a.jsx)(y.Ei,{children:"View all references for this response"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 w-auto mt-2",children:[e.codeReferenceCardData.map((e,t)=>(0,l.createElement)(S,{showFullContent:!0,...e,key:"code-".concat(t)})),e.notesReferenceCardData.map((e,t)=>(0,l.createElement)(_,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)})),e.onlineReferenceCardData.map((e,t)=>(0,l.createElement)(E,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)}))]})]})]})}var O=n(59199);function L(e){let{content:t,targetLine:n,maxLines:s=20}=e,r=(t||"").split("\n");if(n&&n>0&&n<=r.length){let e=Math.max(1,n-2),t=Math.min(r.length,n+5),s=r.slice(e-1,t);return(0,a.jsx)("pre",{className:"whitespace-pre-wrap text-xs",children:s.map((t,s)=>{let r=e+s,l=r===n;return(0,a.jsxs)("div",{className:l?"bg-green-100 dark:bg-green-900":"",children:[(0,a.jsxs)("span",{className:"text-gray-400 select-none mr-2",children:[r.toString().padStart(3," "),":"]}),t]},r)})})}let l=r.slice(0,s);return(0,a.jsxs)("pre",{className:"whitespace-pre-wrap text-xs",children:[l.map((e,t)=>(0,a.jsxs)("div",{children:[(0,a.jsxs)("span",{className:"text-gray-400 select-none mr-2",children:[(t+1).toString().padStart(3," "),":"]}),e]},t)),r.length>s&&(0,a.jsxs)("div",{className:"text-gray-500 italic",children:["... and ",r.length-s," more lines"]})]})}function F(e,t){let[n,a]=(0,l.useState)(""),[s,r]=(0,l.useState)(!1),[o,i]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let n=!1;return async function(){if(t&&e){r(!0),i(null),a("");try{let t=await fetch("/api/content/file?file_name=".concat(encodeURIComponent(e)));if(!t.ok)throw Error("Failed to fetch file content (".concat(t.status,")"));let s=await t.json();n||a(s.raw_text||"")}catch(e){n||i(e instanceof Error?e.message:"Failed to load file content")}finally{n||r(!1)}}}(),()=>{n=!0}},[e,t]),{content:n,loading:s,error:o}}var D=n(24379),B=n(58441),P=n(49807),A=n(74541),z=n(52874),q=n(5033),U=n(30655),H=n(80382),Z=n(7143),W=n(2585),V=n(58905),G=n(39966),$=n(71640),J=n(24148),Q=n(68382),K=n(78582),Y=n(96620),X=n(77276),ee=n(39957),et=n(14308),en=n(84671),ea=n(36663);let es=(0,n(30166).default)(()=>Promise.all([n.e(6555),n.e(7293),n.e(4609),n.e(2242)]).then(n.bind(n,92242)).then(e=>e.default),{loadableGenerated:{webpack:()=>[92242]},ssr:!1});function er(e){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(et.Z,{}),children:(0,a.jsx)(es,{data:e.data})})}var el=n(26110),eo=n(49027),ei=n(7436),ec=n(19378),ed=n(50656),eu=n(45199),eh=n(25778),em=n(62869),eg=e=>{let{chart:t}=e,[n,s]=(0,l.useState)(null),[r]=(0,l.useState)("mermaid-chart-".concat(Math.random().toString(12).substring(7))),o=(0,l.useRef)(null);(0,l.useEffect)(()=>{ed.Z.initialize({startOnLoad:!1}),ed.Z.parseError=e=>{let t;console.error("Mermaid errors:",e);try{t="string"==typeof e?JSON.parse(e):e}catch(n){t=(null==e?void 0:e.toString())||"Unknown error"}console.log("Mermaid error message:",t),"element is null"!==t.str?s("Something went wrong while rendering the diagram. Please try again later or downvote the message if the issue persists."):s(null)},ed.Z.contentLoaded()},[]);let i=async()=>{if(o.current)try{var e;let t=o.current.querySelector("svg");if(!t)throw Error("No SVG found");let[,,n,a]=(null===(e=t.getAttribute("viewBox"))||void 0===e?void 0:e.split(" ").map(Number))||[0,0,0,0],s=document.createElement("canvas");s.width=2*n,s.height=2*a;let r=s.getContext("2d");if(!r)throw Error("Failed to get canvas context");let l=new XMLSerializer().serializeToString(t),i=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),c=URL.createObjectURL(i),d=new Image;d.src=c,await new Promise((e,t)=>{d.onload=()=>{r.scale(2,2),r.drawImage(d,0,0,n,a),s.toBlob(n=>{if(!n){t(Error("Failed to create blob"));return}let a=URL.createObjectURL(n),s=document.createElement("a");s.href=a,s.download="mermaid-diagram-".concat(Date.now(),".png"),s.click(),URL.revokeObjectURL(a),URL.revokeObjectURL(c),e(!0)},"image/png")},d.onerror=()=>t(Error("Failed to load SVG"))})}catch(e){console.error("Error exporting diagram:",e),s("Failed to export diagram")}};return(0,l.useEffect)(()=>{o.current&&(o.current.removeAttribute("data-processed"),ed.Z.run({nodes:[o.current]}).then(()=>{s(null)}).catch(e=>{let t;try{t="string"==typeof e?JSON.parse(e):e}catch(n){t=(null==e?void 0:e.toString())||"Unknown error"}console.log("Mermaid error message:",t),"element is null"!==t.str?s("Something went wrong while rendering the diagram. Please try again later or downvote the message if the issue persists."):s(null)}))},[t]),(0,a.jsxs)("div",{children:[n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 bg-red-100 border border-red-500 rounded-md p-1 mt-3 text-red-900 text-sm",children:[(0,a.jsx)(eu.k,{className:"w-12 h-12"}),(0,a.jsx)("span",{children:n})]}),(0,a.jsx)("code",{className:"block bg-secondary text-secondary-foreground p-4 mt-3 rounded-lg font-mono text-sm whitespace-pre-wrap overflow-x-auto max-h-[400px] border border-gray-200",children:t})]}):(0,a.jsx)("div",{id:r,ref:o,className:"mermaid",style:{width:"auto",height:"auto",boxSizing:"border-box",overflow:"auto"},children:t}),!n&&(0,a.jsxs)(em.z,{onClick:i,variant:"secondary",className:"mt-3",children:[(0,a.jsx)(eh.U,{className:"w-5 h-5"}),"Export as PNG"]})]})};let ef=new u.Z({html:!0,linkify:!0,typographer:!0});function ex(e,t,n){fetch("/api/chat/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uquery:e,kquery:t,sentiment:n})})}function ep(e){let{uquery:t,kquery:n}=e,[s,r]=(0,l.useState)(null);return(0,l.useEffect)(()=>{null!==s&&setTimeout(()=>{r(null)},2e3)},[s]),(0,a.jsxs)("div",{className:"".concat(d().feedbackButtons," flex align-middle justify-center items-center"),children:[(0,a.jsx)("button",{title:"Like",className:d().thumbsUpButton,disabled:null!==s,onClick:()=>{ex(t,n,"positive"),r(!0)},children:!0===s?(0,a.jsx)(D.V,{alt:"Liked Message",className:"text-green-500",weight:"fill"}):(0,a.jsx)(D.V,{alt:"Like Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),(0,a.jsx)("button",{title:"Dislike",className:d().thumbsDownButton,disabled:null!==s,onClick:()=>{ex(t,n,"negative"),r(!1)},children:!1===s?(0,a.jsx)(B.L,{alt:"Disliked Message",className:"text-red-500",weight:"fill"}):(0,a.jsx)(B.L,{alt:"Dislike Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})})]})}function ev(e){let t=e.message.match(/\*\*(.*)\*\*/),n=function(e,t){let n=e.toLowerCase(),s="inline mt-1 mr-2 ".concat(t," h-4 w-4");return n.includes("understanding")?(0,a.jsx)(P.a,{className:"".concat(s)}):n.includes("generating")?(0,a.jsx)(A.Z,{className:"".concat(s)}):n.includes("tools")?(0,a.jsx)(z.v,{className:"".concat(s)}):n.includes("notes")?(0,a.jsx)(q.gt,{className:"".concat(s)}):n.includes("read")?(0,a.jsx)(U.f,{className:"".concat(s)}):n.includes("search")?(0,a.jsx)(H.Y,{className:"".concat(s)}):n.includes("summary")||n.includes("summarize")||n.includes("enhanc")?(0,a.jsx)(Z.u,{className:"".concat(s)}):n.includes("diagram")?(0,a.jsx)(W.j,{className:"".concat(s)}):n.includes("paint")?(0,a.jsx)(V.Y,{className:"".concat(s)}):n.includes("code")?(0,a.jsx)(p.E,{className:"".concat(s)}):n.includes("operating")?(0,a.jsx)(G.A,{className:"".concat(s)}):(0,a.jsx)(P.a,{className:"".concat(s)})}(t?t[1]:"",e.primary?(0,en.oz)(e.agentColor):"text-gray-500"),s=e.message,r=null;try{let e=s.match(/\{.*("action": "screenshot"|"type": "screenshot"|"image": "data:image\/.*").*\}/);if(e){r=JSON.parse(e[0]);let t='<img src="'.concat(r.image,'" alt="State of environment" class="max-w-full" />');s=s.replace(":\n**Action**: ".concat(e[0]),"\n\n- ".concat(r.text,"\n").concat(t))}}catch(e){console.error("Failed to parse screenshot data",e)}let l=N.Z.sanitize(ef.render(s));return l=l.replace(/<h[1-6].*?<\/h[1-6]>/g,""),(0,a.jsxs)("div",{className:"".concat(d().trainOfThoughtElement," break-words items-center ").concat(e.primary?"text-gray-400":"text-gray-300"," ").concat(d().trainOfThought," ").concat(e.primary?d().primary:""),children:[n,(0,a.jsx)("div",{dangerouslySetInnerHTML:{__html:l},className:"break-words"})]})}ef.use(m(),{inline:!0,code:!0}),ef.use(function(e){let t=e.renderer.rules.link_open||function(e,t,n,a,s){return s.renderToken(e,t,n)};e.renderer.rules.link_open=function(e,n,a,s,r){let l=e[n],o=l.attrIndex("href");if(o>=0){let e=l.attrs[o][1];if(e.startsWith("filelink://")){let t=e.replace("filelink://","").match(/^(.+?)(?:#line=(\d+))?$/);if(t){let e=t[1],n=t[2];l.attrSet("data-file-path",e),n&&l.attrSet("data-line-number",n);let a=l.attrIndex("class");a>=0&&l.attrs?l.attrs[a][1]="".concat(l.attrs[a][1]," file-link"):l.attrSet("class","file-link"),l.attrSet("href","#"),l.attrSet("role","button"),l.attrSet("tabindex","0")}}}return t(e,n,a,s,r)}});let ej=(0,l.forwardRef)((e,t)=>{var n,s;let r,o;let[i,c]=(0,l.useState)(!1),[u,h]=(0,l.useState)(!1),[m,x]=(0,l.useState)(""),[p,v]=(0,l.useState)(""),[j,w]=(0,l.useState)(!1),[y,b]=(0,l.useState)(!1),[k,C]=(0,l.useState)(""),[_,S]=(0,l.useState)(""),[E,T]=(0,l.useState)(!1),[I,D]=(0,l.useState)(""),[B,P]=(0,l.useState)(void 0),[A,z]=(0,l.useState)(!1),[q,U]=(0,l.useState)(null),[H,Z]=(0,l.useState)(""),[W,V]=(0,l.useState)(!1),[G,en]=(0,l.useState)(""),[es,ed]=(0,l.useState)(void 0),[eu,eh]=(0,l.useState)(!1),[em,ex]=(0,l.useState)(null),[ev,ej]=(0,l.useState)(""),[ew,ey]=(0,l.useState)({x:0,y:0}),eb=(0,l.useRef)(null),eN=(0,l.useRef)(!1),eM=(0,l.useRef)(null);(0,l.useEffect)(()=>{eN.current=y},[y]),(0,l.useEffect)(()=>{let e=new MutationObserver((e,t)=>{if(eM.current)for(let t of e)"childList"===t.type&&t.addedNodes.length>0&&(0,ea.Z)(eM.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}]})});return eM.current&&e.observe(eM.current,{childList:!0}),()=>e.disconnect()},[eM.current]),(0,l.useEffect)(()=>{let t=e.chatMessage.message;e.chatMessage.excalidrawDiagram&&C(e.chatMessage.excalidrawDiagram),e.chatMessage.mermaidjsDiagram&&S(e.chatMessage.mermaidjsDiagram),t=t.replace(/\\\(/g,"LEFTPAREN").replace(/\\\)/g,"RIGHTPAREN").replace(/\\\[/g,"LEFTBRACKET").replace(/\\\]/g,"RIGHTBRACKET"),t=(t=(0,O.AQ)(t,e.chatMessage.codeContext)).replace(/\[([^\]]+)\]\(file:\/\/([^)]+)\)/g,(e,t,n)=>"[".concat(t,"](filelink://").concat(n,")")),e.chatMessage.codeContext&&Object.entries(e.chatMessage.codeContext).forEach(e=>{var n,a;let[s,r]=e;null===(a=r.results)||void 0===a||null===(n=a.output_files)||void 0===n||n.forEach(e=>{(e.filename.endsWith(".png")||e.filename.endsWith(".jpg"))&&!t.includes(")&&(t+="\n\n.concat(e.b64_data,")"))})});let n=t,a=t;if(e.chatMessage.images&&e.chatMessage.images.length>0){let t=e.chatMessage.images.map(e=>{let t=e.startsWith("data%3Aimage")?decodeURIComponent(e):e;return N.Z.sanitize(t)}),s=t.map((e,t)=>".concat(e,")")).join("\n"),r=t.map((e,t)=>'<div class="'.concat(d().imageWrapper,'"><img src="').concat(e,'" alt="uploaded image ').concat(t+1,'" /></div>')).join(""),l='<div class="'.concat(d().imagesContainer,'">').concat(r,"</div>");n="".concat(s,"\n\n").concat(n),a="".concat(l).concat(a)}x(n);let s=ef.render(a);s=s.replace(/LEFTPAREN/g,"\\(").replace(/RIGHTPAREN/g,"\\)").replace(/LEFTBRACKET/g,"\\[").replace(/RIGHTBRACKET/g,"\\]"),v(N.Z.sanitize(s,{ADD_ATTR:["data-file-path","data-line-number"]}))},[e.chatMessage.message,e.chatMessage.images,e.chatMessage.intent]),(0,l.useEffect)(()=>{i&&setTimeout(()=>{c(!1)},2e3)},[i]),(0,l.useEffect)(()=>{if(eM.current){eM.current.querySelectorAll("pre > .hljs").forEach(e=>{if(!e.querySelector("".concat(d().codeCopyButton))){let t=document.createElement("button"),n=(0,a.jsx)($.w,{size:24});(0,g.createRoot)(t).render(n),t.className="hljs ".concat(d().codeCopyButton),t.addEventListener("click",()=>{let n=e.textContent||"";n=(n=(n=n.replace(/^\$+/,"")).replace(/^Copy/,"")).trim(),navigator.clipboard.writeText(n);let s=(0,a.jsx)(J.J,{size:24});(0,g.createRoot)(t).render(s)}),e.prepend(t)}});let e=eM.current,t=e=>{var t;let n=e.target,a=null==n?void 0:null===(t=n.closest)||void 0===t?void 0:t.call(n,"a.file-link");if(!a)return;e.preventDefault(),e.stopPropagation();let s=a.getAttribute("data-file-path")||"",r=a.getAttribute("data-line-number")||void 0;s&&(V(!1),D(s),P(r?parseInt(r):void 0),T(!0))},n=null,s=e=>{var t;let a=e.target,s=null==a?void 0:null===(t=a.closest)||void 0===t?void 0:t.call(a,"a.file-link");if(!s||n===s)return;n=s;let r=s.getBoundingClientRect(),l=s.getAttribute("data-file-path")||"",o=s.getAttribute("data-line-number")||void 0;l&&(ey({x:Math.max(8,r.left),y:r.bottom+6}),en(l),ed(o?parseInt(o):void 0),eb.current&&(window.clearTimeout(eb.current),eb.current=null),V(!0))},r=e=>{var t;let a=e.target,s=e.relatedTarget,r=null==a?void 0:null===(t=a.closest)||void 0===t?void 0:t.call(a,"a.file-link");s&&r&&r.contains(s)||(eb.current&&window.clearTimeout(eb.current),eb.current=window.setTimeout(()=>{V(!1),n=null,eb.current=null},200))},l=e=>{var t;let n=e.target,a=null==n?void 0:null===(t=n.closest)||void 0===t?void 0:t.call(n,"a.file-link");if(!a||"Enter"!==e.key&&" "!==e.key)return;e.preventDefault(),e.stopPropagation();let s=a.getAttribute("data-file-path")||"",r=a.getAttribute("data-line-number")||void 0;s&&(V(!1),D(s),P(r?parseInt(r):void 0),T(!0))};return e.addEventListener("pointerdown",t),e.addEventListener("keydown",l),e.addEventListener("mouseover",s),e.addEventListener("mouseout",r),(0,ea.Z)(eM.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}]}),()=>{e.removeEventListener("pointerdown",t),e.removeEventListener("keydown",l),e.removeEventListener("mouseover",s),e.removeEventListener("mouseout",r),eb.current&&(window.clearTimeout(eb.current),eb.current=null)}}},[p,eM]);let{content:ek,loading:eC,error:e_}=F(I,E),{content:eS,loading:eE,error:eT}=F(G,W);function eR(e){let t=new Date(e+"Z"),n=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}).toUpperCase(),a=t.toLocaleString("en-US",{year:"numeric",month:"short",day:"2-digit"}).replaceAll("-"," ");return"".concat(n," on ").concat(a)}async function eI(){let t=e.chatMessage.message.match(/[^.!?]+[.!?]*/g)||[];if(!t||0===t.length||!t[0])return;w(!0);let n=eO(t[0]);for(let e=0;e<t.length&&!eN.current;e++){let a=n;e<t.length-1&&(n=eO(t[e+1]));try{let e=await a,t=URL.createObjectURL(e);await function(e){return new Promise((t,n)=>{let a=new Audio(e);a.onended=t,a.onerror=n,a.play()})}(t)}catch(e){console.error("Error:",e);break}}w(!1),b(!1)}async function eO(e){let t=await fetch("/api/chat/speech?text=".concat(encodeURIComponent(e)),{method:"POST",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("Network response was not ok");return await t.blob()}(0,l.useEffect)(()=>{Z(ek)},[ek]),(0,l.useEffect)(()=>{z(eC)},[eC]),(0,l.useEffect)(()=>{U(e_)},[e_]),(0,l.useEffect)(()=>{ej(eS)},[eS]),(0,l.useEffect)(()=>{eh(eE)},[eE]),(0,l.useEffect)(()=>{ex(eT)},[eT]);let eL=async t=>{let n=t.turnId||e.turnId;(await fetch("/api/chat/conversation/message",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversation_id:e.conversationId,turn_id:n})})).ok?e.onDeleteMessage(n):console.error("Failed to delete message")},eF=function(e,t,n){let a=[],s=[],r=[];if(n)for(let[e,t]of Object.entries(n))t.results&&r.push({code:t.code,output:t.results.std_out,output_files:t.results.output_files,error:t.results.std_err});if(t){let e=[];for(let[n,a]of Object.entries(t)){if(a.answerBox&&e.push({title:a.answerBox.title,description:a.answerBox.answer,link:a.answerBox.source}),a.knowledgeGraph&&e.push({title:a.knowledgeGraph.title,description:a.knowledgeGraph.description,link:a.knowledgeGraph.descriptionLink}),a.webpages){if(a.webpages instanceof Array){let t=a.webpages.map(e=>({title:e.query,description:e.snippet,link:e.link}));e.push(...t)}else{let t=a.webpages;e.push({title:t.query,description:t.snippet,link:t.link})}}if(a.organic){let t=a.organic.map(e=>({title:e.title,description:e.snippet,link:e.link}));e.push(...t)}}a.push(...e)}if(e){let t=e.map(e=>{if(!e.compiled&&""!==e.compiled){let t=("string"==typeof e?e:null==e?"":String(e)).split("\n");return{title:t[0]&&t[0].trim()?t[0]:"(untitled)",content:t.slice(1).join("\n")}}return{title:e.file,content:e.compiled}});s.push(...t)}return{notesReferenceCardData:s,onlineReferenceCardData:a,codeReferenceCardData:r}}(e.chatMessage.context,e.chatMessage.onlineContext,e.chatMessage.codeContext);return(0,a.jsxs)("div",{ref:t,className:(n=e.chatMessage,r=[d().chatMessageContainer],"khoj"===n.by&&r.push("shadow-md"),r.push(d()[n.by]),n.message||r.push(d().emptyChatMessage),e.customClassName&&r.push(d()["".concat(n.by).concat(e.customClassName)]),r.join(" ")),onMouseLeave:e=>h(!1),onMouseEnter:e=>h(!0),"data-created":eR(e.chatMessage.created),children:[(0,a.jsxs)("div",{className:(s=e.chatMessage,(o=[d().chatMessageWrapper]).push(d()[s.by]),"khoj"===s.by&&o.push("border-l-4 border-opacity-50 ".concat("border-l-"+e.borderLeftColor)),o.join(" ")),children:[e.chatMessage.queryFiles&&e.chatMessage.queryFiles.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap flex-col mb-2 max-w-full",children:e.chatMessage.queryFiles.map((e,t)=>(0,a.jsxs)(el.Vq,{children:[(0,a.jsx)(el.hg,{asChild:!0,children:(0,a.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer bg-gray-500 bg-opacity-25 rounded-lg p-2 w-full ",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,M.Le)(e.file_type)}),(0,a.jsx)("span",{className:"truncate flex-1 min-w-0 max-w-[200px]",children:e.name}),e.size&&(0,a.jsxs)("span",{className:"text-gray-400 flex-shrink-0",children:["(",(0,ei.xq)(e.size),")"]})]})}),(0,a.jsxs)(el.cZ,{children:[(0,a.jsx)(el.fK,{children:(0,a.jsx)(eo.$N,{children:(0,a.jsx)("div",{className:"truncate min-w-0 break-words break-all text-wrap max-w-full whitespace-normal",children:e.name})})}),(0,a.jsx)(el.Be,{children:(0,a.jsx)(ec.x,{className:"h-72 w-full rounded-md break-words break-all text-wrap",children:e.content})})]})]},t))}),(0,a.jsx)("div",{ref:eM,className:d().chatMessage,dangerouslySetInnerHTML:{__html:p}}),W&&(0,f.createPortal)((0,a.jsx)("div",{onMouseEnter:()=>{eb.current&&(window.clearTimeout(eb.current),eb.current=null),V(!0)},onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),V(!1),G&&(D(G),P(es),T(!0))},onMouseLeave:()=>{eb.current&&window.clearTimeout(eb.current),eb.current=window.setTimeout(()=>{V(!1),eb.current=null},200)},style:{position:"fixed",left:ew.x,top:ew.y,zIndex:9999},className:"w-96 max-h-80 rounded-md border bg-popover p-4 text-popover-foreground shadow-md",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center text-sm font-medium",children:[(0,a.jsx)("span",{className:"truncate",children:G.split("/").pop()||G}),es&&(0,a.jsxs)("span",{className:"text-gray-500 ml-2",children:["- Line ",es]})]}),(0,a.jsxs)(ec.x,{className:"max-h-60",children:[eu&&(0,a.jsx)("div",{className:"flex items-center justify-center p-4",children:(0,a.jsx)(et.l,{})}),!eu&&em&&(0,a.jsxs)("div",{className:"p-3 text-red-500 text-sm",children:["Error: ",em]}),!eu&&!em&&(0,a.jsx)("div",{className:"text-sm",children:(0,a.jsx)(L,{content:ev,targetLine:es,maxLines:8})})]})]})}),document.body),(0,a.jsx)(el.Vq,{open:E,onOpenChange:T,children:(0,a.jsxs)(el.cZ,{className:"max-w-2xl",children:[(0,a.jsx)(el.fK,{children:(0,a.jsx)(eo.$N,{children:(0,a.jsxs)("div",{className:"truncate min-w-0 break-words break-all text-wrap max-w-full whitespace-normal",children:[I.split("/").pop()||I,(0,a.jsx)("span",{className:"text-gray-500 ml-2",children:B?"- Line ".concat(B):""})]})})}),(0,a.jsx)("div",{className:"text-left",children:(0,a.jsxs)(ec.x,{className:"h-80 w-full rounded-md",children:[A&&(0,a.jsx)("div",{className:"flex items-center justify-center p-4",children:(0,a.jsx)(et.l,{})}),!A&&q&&(0,a.jsxs)("div",{className:"p-3 text-red-500 text-sm",children:["Error: ",q]}),!A&&!q&&(0,a.jsx)("div",{className:"text-sm",children:(0,a.jsx)(L,{content:H,targetLine:B,maxLines:20})})]})})]})}),k&&(0,a.jsx)(er,{data:k}),_&&(0,a.jsx)(eg,{chart:_})]}),(0,a.jsx)("div",{className:d().teaserReferencesContainer,children:(0,a.jsx)(R,{isMobileWidth:e.isMobileWidth,notesReferenceCardData:eF.notesReferenceCardData,onlineReferenceCardData:eF.onlineReferenceCardData,codeReferenceCardData:eF.codeReferenceCardData})}),(0,a.jsx)("div",{className:d().chatFooter,children:(u||e.isMobileWidth||e.isLastMessage||j)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{title:eR(e.chatMessage.created),className:"text-gray-400 relative top-0 left-4",children:function(e){e.endsWith("Z")||(e+="Z");let t=new Date(e),n=new Date().getTime()-t.getTime();return n<6e4?"Just now":n<36e5?"".concat(Math.round(n/6e4),"m ago"):n<864e5?"".concat(Math.round(n/36e5),"h ago"):"".concat(Math.round(n/864e5),"d ago")}(e.chatMessage.created)}),(0,a.jsxs)("div",{className:"".concat(d().chatButtons," shadow-sm"),children:["khoj"===e.chatMessage.by&&(j?y?(0,a.jsx)(et.l,{iconClassName:"p-0",className:"m-0"}):(0,a.jsx)("button",{title:"Pause Speech",onClick:e=>b(!0),children:(0,a.jsx)(Q.d,{alt:"Pause Message",className:"hsl(var(--muted-foreground))"})}):(0,a.jsx)("button",{title:"Speak",onClick:e=>eI(),children:(0,a.jsx)(K.j,{alt:"Speak Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})})),e.chatMessage.turnId&&(0,a.jsx)("button",{title:"Delete",className:"".concat(d().deleteButton),onClick:()=>eL(e.chatMessage),children:(0,a.jsx)(Y.r,{alt:"Delete Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})}),"khoj"===e.chatMessage.by&&e.onRetryMessage&&e.isLastMessage&&(0,a.jsx)("button",{title:"Retry",className:"".concat(d().retryButton),onClick:()=>{var t,n,a;let s=e.chatMessage.turnId||e.turnId,r=e.chatMessage.rawQuery||(null===(t=e.chatMessage.intent)||void 0===t?void 0:t.query);if(console.log("Retry button clicked for turnId:",s),console.log("ChatMessage data:",{rawQuery:e.chatMessage.rawQuery,intent:e.chatMessage.intent,message:e.chatMessage.message}),console.log("Extracted query:",r),r)null===(n=e.onRetryMessage)||void 0===n||n.call(e,r,s);else{console.error("No original query found for retry");let t=prompt("Enter the original query to retry:");t&&(null===(a=e.onRetryMessage)||void 0===a||a.call(e,t,s))}},children:(0,a.jsx)(X._,{alt:"Retry Message",className:"hsl(var(--muted-foreground)) hover:text-blue-500"})}),(0,a.jsx)("button",{title:"Copy",className:"".concat(d().copyButton),onClick:()=>{navigator.clipboard.writeText(m),c(!0)},children:i?(0,a.jsx)(ee.C,{alt:"Copied Message",weight:"fill",className:"text-green-500"}):(0,a.jsx)(ee.C,{alt:"Copy Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),"khoj"===e.chatMessage.by&&(e.chatMessage.intent?(0,a.jsx)(ep,{uquery:e.chatMessage.intent.query,kquery:e.chatMessage.message}):(0,a.jsx)(ep,{uquery:e.chatMessage.rawQuery||e.chatMessage.message,kquery:e.chatMessage.message}))]})]})})]})});ej.displayName="ChatMessage";var ew=n(17104),ey=n(66142),eb=n(25397),eN=n(44849),eM=n.n(eN);function ek(e){let{frames:t,autoPlay:n=!0,playbackSpeed:s=1e3}=e,[r,o]=(0,l.useState)(0),[i,c]=(0,l.useState)(n),[d,u]=(0,l.useState)(!0),h=(0,l.useRef)(null);(0,l.useEffect)(()=>{d&&t.length>0&&o(t.length-1)},[t.length,d]),(0,l.useEffect)(()=>(i&&t.length>1?h.current=setInterval(()=>{o(e=>{let n=e+1;return n>=t.length?(c(!1),e):n})},s):h.current&&(clearInterval(h.current),h.current=null),()=>{h.current&&clearInterval(h.current)}),[i,t.length,s]);let m=t[r],g=e=>{o(e),u(!1),c(!1)};return t.length?(0,a.jsxs)("div",{className:eM().videoPlayer,children:[(0,a.jsxs)("div",{className:eM().screen,children:[(null==m?void 0:m.image)&&(0,a.jsx)("img",{src:m.image,alt:"Train of thought frame ".concat(r+1),className:eM().screenImage}),(0,a.jsx)("div",{className:eM().textOverlay,children:(0,a.jsx)("div",{className:eM().thoughtText,children:null==m?void 0:m.text})})]}),(0,a.jsxs)("div",{className:eM().controls,children:[(0,a.jsxs)("div",{className:eM().timeline,children:[(0,a.jsx)("input",{type:"range",min:0,max:Math.max(0,t.length-1),value:r,onChange:e=>g(parseInt(e.target.value)),className:eM().timelineSlider}),(0,a.jsx)("div",{className:eM().frameMarkers,children:t.map((e,t)=>(0,a.jsx)("div",{className:"".concat(eM().frameMarker," ").concat(e.image?eM().hasImage:eM().textOnly," ").concat(t===r?eM().active:""),onClick:()=>g(t),title:"Frame ".concat(t+1,": ").concat(e.text.slice(0,50),"...")},t))})]}),(0,a.jsxs)("div",{className:eM().controlButtons,children:[(0,a.jsx)("button",{onClick:()=>{r>0&&(o(r-1),u(!1),c(!1))},disabled:0===r,title:"Previous frame",className:eM().controlButton,children:(0,a.jsx)(ew.F,{size:16})}),(0,a.jsx)("button",{onClick:()=>{c(!i),u(!1)},disabled:t.length<=1,title:i?"Pause":"Play",className:eM().controlButton,children:i?(0,a.jsx)(Q.d,{size:16}):(0,a.jsx)(ey.s,{size:16})}),(0,a.jsx)("button",{onClick:()=>{r<t.length-1&&(o(r+1),u(!1),c(!1))},disabled:r===t.length-1,title:"Next frame",className:eM().controlButton,children:(0,a.jsx)(eb.N,{size:16})}),(0,a.jsx)("button",{onClick:()=>{u(!0),o(t.length-1),c(!1)},className:"".concat(eM().controlButton," ").concat(d?eM().active:""),title:"Auto-track latest",children:"Live"})]}),(0,a.jsx)("div",{className:eM().frameInfo,children:(0,a.jsxs)("span",{children:[r+1," / ",t.length]})})]})]}):null}var eC=n(72102),e_=n(23713),eS=n(795),eE=n(935),eT=n(81103),eR=e=>{let{name:t,avatar:n,link:s,description:r}=e;return(0,a.jsx)("div",{className:"relative group flex",children:(0,a.jsx)(eT.pn,{children:(0,a.jsxs)(eT.u,{delayDuration:0,children:[(0,a.jsx)(eT.aJ,{asChild:!0,children:(0,a.jsxs)(em.z,{variant:"ghost",className:"flex items-center justify-center",children:[n,(0,a.jsx)("div",{children:t})]})}),(0,a.jsx)(eT._v,{children:(0,a.jsxs)("div",{className:"w-80 h-30",children:[(0,a.jsx)("a",{href:s,target:"_blank",rel:"noreferrer",className:"mt-1 ml-2 block no-underline",children:(0,a.jsxs)("div",{className:"flex items-center justify-start gap-2",children:[n,(0,a.jsxs)("div",{className:"mr-2 mt-1 flex justify-center items-center text-sm font-semibold text-gray-800",children:[t,(0,a.jsx)(j.o,{weight:"bold",className:"ml-1"})]})]})}),r&&(0,a.jsx)("p",{className:"mt-2 ml-6 text-sm text-gray-600 line-clamp-2",children:r||"A Khoj agent"})]})})]})})})},eI=n(37104);function eO(e){let[t,n]=(0,l.useState)(e.completed),[s,c]=(0,l.useState)([]);return(0,l.useEffect)(()=>{e.completed&&n(!0)},[e.completed]),(0,l.useEffect)(()=>{if(!e.trainOfThought||0===e.trainOfThought.length){c([]);return}c(function(e){if(!e)return[];let t=[],n=[],a=[];return e.forEach((e,s)=>{let r=e.data,l=!1;try{let e=r.match(/\{.*(\"action\": \"screenshot\"|\"type\": \"screenshot\"|\"image\": \"data:image\/.*\").*\}/);if(e){let o=JSON.parse(e[0]);o.image&&(l=!0,r=r.replace(":\n**Action**: ".concat(e[0]),""),o.text&&(r+="\n\n".concat(o.text)),a.length>0&&(t.push({type:"text",textEntries:[...a]}),a=[]),n.push({text:r,image:o.image,timestamp:s}))}}catch(e){console.error("Failed to parse screenshot data",e)}l||(n.length>0&&(t.push({type:"video",frames:[...n]}),n=[]),a.push(e))}),n.length>0&&t.push({type:"video",frames:n}),a.length>0&&t.push({type:"text",textEntries:a}),t}("string"==typeof e.trainOfThought[0]?e.trainOfThought.map((e,t)=>({type:"text",data:e})):e.trainOfThought))},[e.trainOfThought]),(0,a.jsxs)("div",{className:"".concat(t?"":r().trainOfThought+" border"," rounded-lg"),children:[!e.completed&&(0,a.jsx)(et.l,{className:"float-right"}),e.completed&&(t?(0,a.jsxs)(em.z,{className:"w-fit text-left justify-start content-start text-xs",onClick:()=>n(!1),variant:"ghost",size:"sm",children:["Thought Process ",(0,a.jsx)(eC.p,{size:16,className:"ml-1"})]}):(0,a.jsxs)(em.z,{className:"w-fit text-left justify-start content-start text-xs p-0 h-fit",onClick:()=>n(!0),variant:"ghost",size:"sm",children:["Close ",(0,a.jsx)(e_.U,{size:16,className:"ml-1"})]})),(0,a.jsx)(o.M,{initial:!1,children:!t&&(0,a.jsx)(i.E.div,{initial:"closed",animate:"open",exit:"closed",variants:{open:{height:"auto",opacity:1,transition:{duration:.3,ease:"easeOut"}},closed:{height:0,opacity:0,transition:{duration:.3,ease:"easeIn"}}},children:s.map((t,n)=>(0,a.jsxs)("div",{children:["video"===t.type&&t.frames&&t.frames.length>0&&(0,a.jsx)(ek,{frames:t.frames,autoPlay:!1,playbackSpeed:1500}),"text"===t.type&&t.textEntries&&t.textEntries.map((r,l)=>{let o=s.length-1,i=l===t.textEntries.length-1,c=n===o&&i&&e.lastMessage&&!e.completed;return(0,a.jsx)(ev,{message:r.data,primary:c,agentColor:e.agentColor},"train-text-".concat(n,"-").concat(l,"-").concat(r.data.length))})]},"train-group-".concat(n)))})})]},e.keyId)}function eL(e){var t,n,s,o,i,c,d;let[u,h]=(0,l.useState)(null),[m,g]=(0,l.useState)(0),[f,x]=(0,l.useState)(!0),[p,v]=(0,l.useState)(null),j=(0,l.useRef)(null),w=(0,l.useRef)(null),y=(0,l.useRef)(null),b=(0,l.useRef)(null),N=(0,l.useRef)(null),[k,C]=(0,l.useState)(null),[_,S]=(0,l.useState)(!1),[E,T]=(0,l.useState)(!0),R=(0,ei.IC)(),I="[data-radix-scroll-area-viewport]",O=localStorage.getItem("message");(0,l.useEffect)(()=>{var e;let t=null===(e=w.current)||void 0===e?void 0:e.querySelector(I);if(!t)return;let n=()=>{let{scrollTop:e,scrollHeight:n,clientHeight:a}=t;T(n-(e+a)<=50)};return t.addEventListener("scroll",n),n(),()=>t.removeEventListener("scroll",n)},[w]),(0,l.useEffect)(()=>{e.incomingMessages&&e.incomingMessages.length>0&&E&&F(!0)},[e.incomingMessages,E]),(0,l.useEffect)(()=>{var t;let n=y.current,a=null===(t=w.current)||void 0===t?void 0:t.querySelector(I);if(!n||!a)return;let s=new ResizeObserver(()=>{let{scrollTop:t,scrollHeight:n,clientHeight:s}=a;if(n-(t+s)<=50&&e.incomingMessages&&e.incomingMessages.length>0){let t=e.incomingMessages[e.incomingMessages.length-1];(!t.completed||t.completed&&null!==k)&&F(!0)}});return s.observe(n),()=>s.disconnect()},[e.incomingMessages,k,w]),(0,l.useEffect)(()=>{u&&u.chat&&u.chat.length>0&&m<2&&requestAnimationFrame(()=>{var e;null===(e=b.current)||void 0===e||e.scrollIntoView({behavior:"auto",block:"start"})})},[u,m]),(0,l.useEffect)(()=>{if(!f||_)return;let t=new IntersectionObserver(t=>{t[0].isIntersecting&&f&&(S(!0),function(t){if(!f||_)return;let n=(t+1)*10,a="";if(e.conversationId)a="/api/chat/history?client=web&conversation_id=".concat(encodeURIComponent(e.conversationId),"&n=").concat(n);else{if(!e.publicConversationSlug)return;a="/api/chat/share/history?client=web&public_conversation_slug=".concat(e.publicConversationSlug,"&n=").concat(n)}fetch(a).then(e=>e.json()).then(n=>{var a;if(e.setTitle(n.response.slug),e.setIsOwner&&e.setIsOwner(null==n?void 0:null===(a=n.response)||void 0===a?void 0:a.is_owner),n&&n.response&&n.response.chat&&n.response.chat.length>0){if(g(Math.ceil(n.response.chat.length/10)),n.response.chat.length===(null==u?void 0:u.chat.length)){x(!1),S(!1);return}e.setAgent(n.response.agent),h(n.response),S(!1),0===t?F(!0):L()}else{if(n.response.agent&&n.response.conversation_id){let t={chat:[],agent:n.response.agent,conversation_id:n.response.conversation_id,slug:n.response.slug,is_owner:n.response.is_owner};e.setAgent(n.response.agent),h(t),e.setIsChatSideBarOpen&&!O&&e.setIsChatSideBarOpen(!0)}x(!1),S(!1)}}).catch(e=>{console.error(e),window.location.href="/"})}(m))},{threshold:1});return j.current&&t.observe(j.current),()=>t.disconnect()},[f,m,_]),(0,l.useEffect)(()=>{x(!0),S(!1),g(0),h(null)},[e.conversationId]),(0,l.useEffect)(()=>{if(e.incomingMessages){let t=e.incomingMessages[e.incomingMessages.length-1];t&&!t.completed&&(C(e.incomingMessages.length-1),e.setTitle(t.rawQuery),t.turnId&&v(t.turnId))}},[e.incomingMessages]);let L=()=>{var e;let t=null===(e=w.current)||void 0===e?void 0:e.querySelector(I);requestAnimationFrame(()=>{var e;null===(e=N.current)||void 0===e||e.scrollIntoView({behavior:"auto",block:"start"}),null==t||t.scrollBy({behavior:"smooth",top:-150})})},F=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=null===(e=w.current)||void 0===e?void 0:e.querySelector(I);requestAnimationFrame(()=>{null==n||n.scrollTo({top:n.scrollHeight,behavior:t?"auto":"smooth"})}),(t||n&&n.scrollHeight-(n.scrollTop+n.clientHeight)<5)&&T(!0)};function D(){var e,t;return u&&u.agent&&(null===(e=u.agent)||void 0===e?void 0:e.name)?u.agent.is_hidden?"Khoj":null===(t=u.agent)||void 0===t?void 0:t.name:"Agent"}let B=t=>{t&&(h(e=>e&&t?{...e,chat:e.chat.filter(e=>e.turnId!==t)}:e),e.incomingMessages&&e.setIncomingMessages&&e.setIncomingMessages(e.incomingMessages.filter(e=>e.turnId!==t)))},P=(t,n)=>{var a;t&&(n&&B(n),null===(a=e.onRetryMessage)||void 0===a||a.call(e,t,n))};return e.conversationId||e.publicConversationSlug?(0,a.jsx)(ec.x,{className:"\n h-[calc(100svh-theme(spacing.44))]\n sm:h-[calc(100svh-theme(spacing.44))]\n md:h-[calc(100svh-theme(spacing.44))]\n lg:h-[calc(100svh-theme(spacing.44))]\n ",ref:w,children:(0,a.jsxs)("div",{ref:y,children:[(0,a.jsxs)("div",{className:"print-only-header",children:[(0,a.jsxs)("div",{className:"print-header-content",children:[(0,a.jsx)("div",{className:"print-header-left",children:(0,a.jsx)(eI.S6,{className:"print-logo"})}),(0,a.jsxs)("div",{className:"print-header-right",children:[(0,a.jsx)("h1",{children:(null==u?void 0:u.slug)||"Conversation with Khoj"}),(0,a.jsx)("div",{className:"conversation-meta",children:(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"Agent:"})," ",D()]})})]})]}),(0,a.jsx)("hr",{})]}),(0,a.jsxs)("div",{className:"".concat(r().chatHistory," ").concat(e.customClassName),children:[(0,a.jsx)("div",{ref:j,style:{height:"1px"},children:_&&(0,a.jsx)(et.l,{className:"opacity-50"})}),u&&u.chat&&u.chat.map((t,n)=>{var s,r;return(0,a.jsxs)(l.Fragment,{children:[t.trainOfThought&&"khoj"===t.by&&(0,a.jsx)(eO,{trainOfThought:t.trainOfThought,lastMessage:!1,agentColor:(null==u?void 0:null===(s=u.agent)||void 0===s?void 0:s.color)||"orange",keyId:"".concat(n,"trainOfThought"),completed:!0},"".concat(n,"trainOfThought")),(0,a.jsx)(ej,{ref:n===u.chat.length-2?b:n===u.chat.length-(m-1)*10?N:null,isMobileWidth:R,chatMessage:t,customClassName:"fullHistory",borderLeftColor:"".concat(null==u?void 0:null===(r=u.agent)||void 0===r?void 0:r.color,"-500"),isLastMessage:n===u.chat.length-1,onDeleteMessage:B,onRetryMessage:P,conversationId:e.conversationId},"".concat(n,"fullHistory"))]},"chatMessage-".concat(n))}),e.incomingMessages&&e.incomingMessages.map((t,n)=>{var s,r,o,i,c;let d=null!==(c=null!==(i=t.turnId)&&void 0!==i?i:p)&&void 0!==c?c:void 0;return(0,a.jsxs)(l.Fragment,{children:[(0,a.jsx)(ej,{isMobileWidth:R,chatMessage:{message:t.rawQuery,context:[],onlineContext:{},codeContext:{},created:t.timestamp,by:"you",automationId:"",images:t.images,conversationId:e.conversationId,turnId:d,queryFiles:t.queryFiles},customClassName:"fullHistory",borderLeftColor:"".concat(null==u?void 0:null===(s=u.agent)||void 0===s?void 0:s.color,"-500"),onDeleteMessage:B,onRetryMessage:P,conversationId:e.conversationId,turnId:d},"".concat(n,"outgoing")),t.trainOfThought&&t.trainOfThought.length>0&&(0,a.jsx)(eO,{trainOfThought:t.trainOfThought,lastMessage:n===k,agentColor:(null==u?void 0:null===(r=u.agent)||void 0===r?void 0:r.color)||"orange",keyId:"".concat(n,"trainOfThought"),completed:t.completed},"".concat(n,"trainOfThought-").concat(t.trainOfThought.length,"-").concat(t.trainOfThought.map(e=>e.length).join("-"))),(0,a.jsx)(ej,{isMobileWidth:R,chatMessage:{message:t.rawResponse,context:t.context,onlineContext:t.onlineContext,codeContext:t.codeContext,created:t.timestamp,by:"khoj",automationId:"",rawQuery:t.rawQuery,intent:{type:t.intentType||"",query:t.rawQuery,"memory-type":"","inferred-queries":t.inferredQueries||[]},conversationId:e.conversationId,images:t.generatedImages,queryFiles:t.generatedFiles,mermaidjsDiagram:t.generatedMermaidjsDiagram,turnId:d},conversationId:e.conversationId,turnId:d,onDeleteMessage:B,onRetryMessage:P,customClassName:"fullHistory",borderLeftColor:"".concat(null==u?void 0:null===(o=u.agent)||void 0===o?void 0:o.color,"-500"),isLastMessage:n===e.incomingMessages.length-1},"".concat(n,"incoming"))]},"incomingMessage".concat(n))}),e.pendingMessage&&(0,a.jsx)(ej,{isMobileWidth:R,chatMessage:{message:e.pendingMessage,context:[],onlineContext:{},codeContext:{},created:new Date().getTime().toString(),by:"you",automationId:"",conversationId:e.conversationId,turnId:void 0},conversationId:e.conversationId,onDeleteMessage:B,onRetryMessage:P,customClassName:"fullHistory",borderLeftColor:"".concat(null==u?void 0:null===(t=u.agent)||void 0===t?void 0:t.color,"-500"),isLastMessage:!0},"pendingMessage-".concat(e.pendingMessage.length)),u&&(0,a.jsx)("div",{className:"".concat(r().agentIndicator," pb-4"),children:(0,a.jsx)("div",{className:"relative group mx-2 cursor-pointer",children:(0,a.jsx)(eR,{name:D(),link:u&&u.agent&&(null===(o=u.agent)||void 0===o?void 0:o.slug)?"/agents?agent=".concat(null===(i=u.agent)||void 0===i?void 0:i.slug):"/agents",avatar:(0,M.TI)(null===(n=u.agent)||void 0===n?void 0:n.icon,null===(s=u.agent)||void 0===s?void 0:s.color)||(0,a.jsx)(eS.v,{}),description:u&&u.agent?(null===(c=u.agent)||void 0===c?void 0:c.persona)?null===(d=u.agent)||void 0===d?void 0:d.persona:"You can set a persona for your agent in the Chat Options side panel.":"Your agent is no longer available. You will be reset to the default agent."})})})]}),(0,a.jsx)("div",{className:"".concat(e.customClassName," fixed bottom-[20%] z-10"),children:!E&&(0,a.jsx)("button",{title:"Scroll to bottom",className:"absolute bottom-0 right-0 bg-white dark:bg-[hsl(var(--background))] text-neutral-500 dark:text-white p-2 rounded-full shadow-xl",onClick:()=>{F()},children:(0,a.jsx)(eE.K,{size:24})})})]})}):null}},42501:function(e){e.exports={chatHistory:"chatHistory_chatHistory__CoaVT",agentIndicator:"chatHistory_agentIndicator__wOU1f",trainOfThought:"chatHistory_trainOfThought__mMWSR"}},91499:function(e){e.exports={chatMessageContainer:"chatMessage_chatMessageContainer__sAivf",chatMessageWrapper:"chatMessage_chatMessageWrapper__u5m8A","file-link":"chatMessage_file-link__PL84f",khojfullHistory:"chatMessage_khojfullHistory__NPu2l",youfullHistory:"chatMessage_youfullHistory__ioyfH",you:"chatMessage_you__6GUC4",khoj:"chatMessage_khoj__cjWON",khojChatMessage:"chatMessage_khojChatMessage__BabQz",emptyChatMessage:"chatMessage_emptyChatMessage__J9JRn",imagesContainer:"chatMessage_imagesContainer__HTRjT",imageWrapper:"chatMessage_imageWrapper__DF92M",author:"chatMessage_author__muRtC",chatFooter:"chatMessage_chatFooter__0vR8s",chatButtons:"chatMessage_chatButtons__Lbk8T",codeCopyButton:"chatMessage_codeCopyButton__Y_Ujv",feedbackButtons:"chatMessage_feedbackButtons___Brdy",copyButton:"chatMessage_copyButton__jd7q7",retryButton:"chatMessage_retryButton__Z7Pzk",trainOfThought:"chatMessage_trainOfThought__mR2Gg",primary:"chatMessage_primary__WYPEb",trainOfThoughtElement:"chatMessage_trainOfThoughtElement__le_bC"}},44849:function(e){e.exports={videoPlayer:"trainOfThoughtVideoPlayer_videoPlayer__Dz3mA",screen:"trainOfThoughtVideoPlayer_screen__dvEVh",screenImage:"trainOfThoughtVideoPlayer_screenImage__3SgOQ",textOverlay:"trainOfThoughtVideoPlayer_textOverlay__BGbhO",thoughtText:"trainOfThoughtVideoPlayer_thoughtText__zn_vT",controls:"trainOfThoughtVideoPlayer_controls__HDkO_",timeline:"trainOfThoughtVideoPlayer_timeline__hSpWu",timelineSlider:"trainOfThoughtVideoPlayer_timelineSlider__GQ8dx",frameMarkers:"trainOfThoughtVideoPlayer_frameMarkers__5y3He",frameMarker:"trainOfThoughtVideoPlayer_frameMarker__DBO9Y",hasImage:"trainOfThoughtVideoPlayer_hasImage__GFGAk",textOnly:"trainOfThoughtVideoPlayer_textOnly__okufk",active:"trainOfThoughtVideoPlayer_active__zp6u9",controlButtons:"trainOfThoughtVideoPlayer_controlButtons__rqfIH",controlButton:"trainOfThoughtVideoPlayer_controlButton___RdE_",frameInfo:"trainOfThoughtVideoPlayer_frameInfo__u5nwA"}}}]);
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9808],{29808:function(e,t,n){"use strict";n.d(t,{Z:function(){return eL}});var a=n(57437),s=n(42501),r=n.n(s),l=n(2265),o=n(48614),i=n(98239),c=n(91499),d=n.n(c),u=n(19983),h=n(13506),m=n.n(h),g=n(34040),f=n(54887);n(2446);var x=n(37052),p=n(19273),v=n(3244),j=n(4235),w=n(66070),y=n(69304),b=n(57054),N=n(18848),M=n(42225),k=n(27648);let C=new u.Z({html:!0,linkify:!0,typographer:!0});function _(e){let t=(0,M.Le)(e.title||".txt","w-6 h-6 text-muted-foreground inline-flex mr-2"),n=e.title.split("/").pop()||e.title,s=function(e){let t=["org","md","markdown"].includes(e.title.split(".").pop()||"")?e.content.split("\n").slice(1).join("\n"):e.content;return e.showFullContent?N.Z.sanitize(C.render(t)):N.Z.sanitize(t)}(e),[r,o]=(0,l.useState)(!1);return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(b.J2,{open:r&&!e.showFullContent,onOpenChange:o,children:[(0,a.jsx)(b.xo,{asChild:!0,children:(0,a.jsx)(w.Zb,{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),className:"".concat(e.showFullContent?"w-auto bg-muted":"w-auto"," overflow-hidden break-words text-balance rounded-lg border-none p-2 shadow-none"),children:e.showFullContent?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("h3",{className:"".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground}"),children:[t,e.showFullContent?e.title:n]}),(0,a.jsx)("p",{className:"text-sm overflow-x-auto block",dangerouslySetInnerHTML:{__html:s}})]}):(0,a.jsx)(T,{type:"notes"},"".concat(e.title))})}),(0,a.jsx)(b.yk,{className:"w-[400px] mx-2",children:(0,a.jsxs)(w.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none p-2",children:[(0,a.jsxs)("h3",{className:"line-clamp-2 text-muted-foreground}",children:[t,e.title]}),(0,a.jsx)("p",{className:"border-t mt-1 pt-1 text-sm overflow-hidden line-clamp-5",dangerouslySetInnerHTML:{__html:s}})]})})]})})}function S(e){var t,n,s,r,o,i;let c=(0,M.Le)(".py","!w-4 h-4 text-muted-foreground flex-shrink-0"),d=N.Z.sanitize(e.code),[u,h]=(0,l.useState)(!1),[m,g]=(0,l.useState)(!1),f=e=>{let t="text/plain",n=e.b64_data;e.filename.match(/\.(png|jpg|jpeg|webp)$/)?(t="image/".concat(e.filename.split(".").pop()),n=atob(e.b64_data)):e.filename.endsWith(".json")?t="application/json":e.filename.endsWith(".csv")&&(t="text/csv");let a=new ArrayBuffer(n.length),s=new Uint8Array(a);for(let e=0;e<n.length;e++)s[e]=n.charCodeAt(e);let r=new Blob([a],{type:t}),l=URL.createObjectURL(r),o=document.createElement("a");o.href=l,o.download=e.filename,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(l)},p=(t,n)=>(null==t?void 0:t.length)==0?null:(0,a.jsx)("div",{className:"".concat(n||e.showFullContent?"border-t mt-1 pt-1":void 0),children:t.slice(0,e.showFullContent?void 0:1).map((t,s)=>(0,a.jsxs)("div",{children:[(0,a.jsxs)("h4",{className:"text-sm text-muted-foreground flex items-center",children:[(0,a.jsx)("span",{className:"overflow-hidden mr-2 font-bold ".concat(e.showFullContent?void 0:"line-clamp-1"),children:t.filename}),(0,a.jsx)("button",{className:"".concat(n?"hidden":void 0),onClick:e=>{e.preventDefault(),f(t)},onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),title:"Download file: ".concat(t.filename),children:(0,a.jsx)(x.b,{className:"w-4 h-4",weight:m?"fill":"regular"})})]}),t.filename.match(/\.(txt|org|md|csv|json)$/)?(0,a.jsx)("pre",{className:"".concat(e.showFullContent?"block":"line-clamp-2"," text-sm mt-1 p-1 bg-background rounded overflow-x-auto"),children:t.b64_data}):t.filename.match(/\.(png|jpg|jpeg|webp)$/)?(0,a.jsx)("img",{src:"data:image/".concat(t.filename.split(".").pop(),";base64,").concat(t.b64_data),alt:t.filename,className:"mt-1 max-h-32 rounded"}):null]},"".concat(t.filename,"-").concat(s)))});return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(b.J2,{open:u&&!e.showFullContent,onOpenChange:h,children:[(0,a.jsx)(b.xo,{asChild:!0,children:(0,a.jsx)(w.Zb,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),className:"".concat(e.showFullContent?"w-auto bg-muted":"w-auto"," overflow-hidden break-words text-balance rounded-lg border-none p-2 shadow-none"),children:e.showFullContent?(0,a.jsxs)("div",{className:"flex flex-col px-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[c,(0,a.jsxs)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:["code ",(null===(t=e.output_files)||void 0===t?void 0:t.length)>0?"artifacts":""]})]}),(0,a.jsx)("pre",{className:"text-xs pb-2 ".concat(e.showFullContent?"block overflow-x-auto":(null===(n=e.output_files)||void 0===n?void 0:n.length)>0?"hidden":"overflow-hidden line-clamp-3"),children:d}),(null===(s=e.output_files)||void 0===s?void 0:s.length)>0&&p(e.output_files,!1)]}):(0,a.jsx)(T,{type:"code"},"code-".concat(e.code))})}),(0,a.jsx)(b.yk,{className:"w-[400px] mx-2",children:(0,a.jsxs)(w.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none p-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[c,(0,a.jsxs)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:["code ",(null===(r=e.output_files)||void 0===r?void 0:r.length)>0?"artifact":""]})]}),(null===(o=e.output_files)||void 0===o?void 0:o.length)>0&&p(null===(i=e.output_files)||void 0===i?void 0:i.slice(0,1),!0)||(0,a.jsx)("pre",{className:"text-xs border-t mt-1 pt-1 overflow-hidden line-clamp-10",children:d})]})})]})})}function E(e){let[t,n]=(0,l.useState)(!1);if(!e.link||e.link.split(" ").length>1)return null;let s="https://www.google.com/s2/favicons?domain=globe",r="unknown";try{r=new URL(e.link).hostname,s="https://www.google.com/s2/favicons?domain=".concat(r)}catch(t){return console.warn("Error parsing domain from link: ".concat(e.link)),null}return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(b.J2,{open:t&&!e.showFullContent,onOpenChange:n,children:[(0,a.jsx)(b.xo,{asChild:!0,children:(0,a.jsx)(w.Zb,{onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)},className:"".concat(e.showFullContent?"w-auto bg-muted":"w-auto"," overflow-hidden break-words text-balance rounded-lg border-none p-2 shadow-none"),children:e.showFullContent?(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(k.default,{href:e.link,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("img",{src:s,alt:"",className:"!w-4 h-4 flex-shrink-0"}),(0,a.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:r})]})}),(0,a.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," font-bold"),children:e.title}),(0,a.jsx)("p",{className:"overflow-hidden text-sm ".concat(e.showFullContent?"block":"line-clamp-2"),children:e.description})]}):(0,a.jsx)(T,{type:"online",link:e.link},e.title)})}),(0,a.jsx)(b.yk,{className:"w-[400px] mx-2",children:(0,a.jsx)(w.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none",children:(0,a.jsx)("div",{className:"flex flex-col",children:(0,a.jsxs)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:"!no-underline px-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("img",{src:s,alt:"",className:"!w-4 h-4 flex-shrink-0"}),(0,a.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," text-muted-foreground flex-grow"),children:r})]}),(0,a.jsx)("h3",{className:"border-t mt-1 pt-1 overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," font-bold"),children:e.title}),(0,a.jsx)("p",{className:"overflow-hidden text-sm ".concat(e.showFullContent?"block":"line-clamp-5"),children:e.description})]})})})})]})})}function T(e){let t="",n="unknown";if(e.link)try{n=new URL(e.link).hostname,t="https://www.google.com/s2/favicons?domain=".concat(n)}catch(t){return console.warn("Error parsing domain from link: ".concat(e.link)),null}let s=null,r="!w-4 !h-4 text-muted-foreground inline-flex mr-2 rounded-lg";switch(e.type){case"code":s=(0,a.jsx)(p.E,{className:"".concat(r)});break;case"online":s=(0,a.jsx)("img",{src:t,alt:"",className:"".concat(r)});break;case"notes":s=(0,a.jsx)(v.j,{className:"".concat(r)});break;default:s=null}return s?(0,a.jsx)("div",{className:"flex items-center gap-2",children:s}):null}function R(e){let t=e.notesReferenceCardData.length>0||e.codeReferenceCardData.length>0||e.onlineReferenceCardData.length>0,n=e.notesReferenceCardData.length+e.codeReferenceCardData.length+e.onlineReferenceCardData.length;return 0===n?null:(0,a.jsx)("div",{className:"pt-0 px-4 pb-4",children:(0,a.jsxs)("h3",{className:"inline-flex items-center",children:[(0,a.jsxs)("div",{className:"text-gray-400 m-2",children:[n," sources"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 w-auto m-2",children:t&&(0,a.jsx)(I,{notesReferenceCardData:e.notesReferenceCardData,onlineReferenceCardData:e.onlineReferenceCardData,codeReferenceCardData:e.codeReferenceCardData,isMobileWidth:e.isMobileWidth})})]})})}function I(e){let[t,n]=(0,l.useState)(3);if((0,l.useEffect)(()=>{n(e.isMobileWidth?3:5)},[e.isMobileWidth]),!e.notesReferenceCardData&&!e.onlineReferenceCardData)return null;let s=e.codeReferenceCardData.slice(0,t),r=e.notesReferenceCardData.slice(0,t-s.length),o=r.length+s.length<t?e.onlineReferenceCardData.filter(e=>e.link).slice(0,t-s.length-r.length):[];return(0,a.jsxs)(y.yo,{children:[(0,a.jsxs)(y.aM,{className:"text-balance w-auto justify-start overflow-hidden break-words p-0 bg-transparent border-none text-gray-400 align-middle items-center m-0 inline-flex",children:[s.map((e,t)=>(0,l.createElement)(S,{showFullContent:!1,...e,key:"code-".concat(t)})),r.map((e,t)=>(0,l.createElement)(_,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),o.map((e,t)=>(0,l.createElement)(E,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),(0,a.jsx)(j.o,{className:"m-0"})]}),(0,a.jsxs)(y.ue,{className:"overflow-y-scroll",children:[(0,a.jsxs)(y.Tu,{children:[(0,a.jsx)(y.bC,{children:"References"}),(0,a.jsx)(y.Ei,{children:"View all references for this response"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 w-auto mt-2",children:[e.codeReferenceCardData.map((e,t)=>(0,l.createElement)(S,{showFullContent:!0,...e,key:"code-".concat(t)})),e.notesReferenceCardData.map((e,t)=>(0,l.createElement)(_,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)})),e.onlineReferenceCardData.map((e,t)=>(0,l.createElement)(E,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)}))]})]})]})}var O=n(59199);function L(e){let{content:t,targetLine:n,maxLines:s=20}=e,r=(t||"").split("\n");if(n&&n>0&&n<=r.length){let e=Math.max(1,n-2),t=Math.min(r.length,n+5),s=r.slice(e-1,t);return(0,a.jsx)("pre",{className:"whitespace-pre-wrap text-xs",children:s.map((t,s)=>{let r=e+s,l=r===n;return(0,a.jsxs)("div",{className:l?"bg-green-100 dark:bg-green-900":"",children:[(0,a.jsxs)("span",{className:"text-gray-400 select-none mr-2",children:[r.toString().padStart(3," "),":"]}),t]},r)})})}let l=r.slice(0,s);return(0,a.jsxs)("pre",{className:"whitespace-pre-wrap text-xs",children:[l.map((e,t)=>(0,a.jsxs)("div",{children:[(0,a.jsxs)("span",{className:"text-gray-400 select-none mr-2",children:[(t+1).toString().padStart(3," "),":"]}),e]},t)),r.length>s&&(0,a.jsxs)("div",{className:"text-gray-500 italic",children:["... and ",r.length-s," more lines"]})]})}function F(e,t){let[n,a]=(0,l.useState)(""),[s,r]=(0,l.useState)(!1),[o,i]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let n=!1;return async function(){if(t&&e){r(!0),i(null),a("");try{let t=await fetch("/api/content/file?file_name=".concat(encodeURIComponent(e)));if(!t.ok)throw Error("Failed to fetch file content (".concat(t.status,")"));let s=await t.json();n||a(s.raw_text||"")}catch(e){n||i(e instanceof Error?e.message:"Failed to load file content")}finally{n||r(!1)}}}(),()=>{n=!0}},[e,t]),{content:n,loading:s,error:o}}var D=n(24379),B=n(58441),P=n(49807),A=n(74541),z=n(52874),q=n(5033),U=n(30655),H=n(80382),Z=n(7143),W=n(2585),V=n(58905),G=n(39966),$=n(71640),J=n(24148),Q=n(68382),K=n(78582),Y=n(96620),X=n(77276),ee=n(39957),et=n(14308),en=n(84671),ea=n(36663);let es=(0,n(30166).default)(()=>Promise.all([n.e(6555),n.e(7293),n.e(4609),n.e(2242)]).then(n.bind(n,92242)).then(e=>e.default),{loadableGenerated:{webpack:()=>[92242]},ssr:!1});function er(e){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(et.Z,{}),children:(0,a.jsx)(es,{data:e.data})})}var el=n(26110),eo=n(49027),ei=n(7436),ec=n(19378),ed=n(50656),eu=n(45199),eh=n(25778),em=n(62869),eg=e=>{let{chart:t}=e,[n,s]=(0,l.useState)(null),[r]=(0,l.useState)("mermaid-chart-".concat(Math.random().toString(12).substring(7))),o=(0,l.useRef)(null);(0,l.useEffect)(()=>{ed.Z.initialize({startOnLoad:!1}),ed.Z.parseError=e=>{let t;console.error("Mermaid errors:",e);try{t="string"==typeof e?JSON.parse(e):e}catch(n){t=(null==e?void 0:e.toString())||"Unknown error"}console.log("Mermaid error message:",t),"element is null"!==t.str?s("Something went wrong while rendering the diagram. Please try again later or downvote the message if the issue persists."):s(null)},ed.Z.contentLoaded()},[]);let i=async()=>{if(o.current)try{var e;let t=o.current.querySelector("svg");if(!t)throw Error("No SVG found");let[,,n,a]=(null===(e=t.getAttribute("viewBox"))||void 0===e?void 0:e.split(" ").map(Number))||[0,0,0,0],s=document.createElement("canvas");s.width=2*n,s.height=2*a;let r=s.getContext("2d");if(!r)throw Error("Failed to get canvas context");let l=new XMLSerializer().serializeToString(t),i=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),c=URL.createObjectURL(i),d=new Image;d.src=c,await new Promise((e,t)=>{d.onload=()=>{r.scale(2,2),r.drawImage(d,0,0,n,a),s.toBlob(n=>{if(!n){t(Error("Failed to create blob"));return}let a=URL.createObjectURL(n),s=document.createElement("a");s.href=a,s.download="mermaid-diagram-".concat(Date.now(),".png"),s.click(),URL.revokeObjectURL(a),URL.revokeObjectURL(c),e(!0)},"image/png")},d.onerror=()=>t(Error("Failed to load SVG"))})}catch(e){console.error("Error exporting diagram:",e),s("Failed to export diagram")}};return(0,l.useEffect)(()=>{o.current&&(o.current.removeAttribute("data-processed"),ed.Z.run({nodes:[o.current]}).then(()=>{s(null)}).catch(e=>{let t;try{t="string"==typeof e?JSON.parse(e):e}catch(n){t=(null==e?void 0:e.toString())||"Unknown error"}console.log("Mermaid error message:",t),"element is null"!==t.str?s("Something went wrong while rendering the diagram. Please try again later or downvote the message if the issue persists."):s(null)}))},[t]),(0,a.jsxs)("div",{children:[n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 bg-red-100 border border-red-500 rounded-md p-1 mt-3 text-red-900 text-sm",children:[(0,a.jsx)(eu.k,{className:"w-12 h-12"}),(0,a.jsx)("span",{children:n})]}),(0,a.jsx)("code",{className:"block bg-secondary text-secondary-foreground p-4 mt-3 rounded-lg font-mono text-sm whitespace-pre-wrap overflow-x-auto max-h-[400px] border border-gray-200",children:t})]}):(0,a.jsx)("div",{id:r,ref:o,className:"mermaid",style:{width:"auto",height:"auto",boxSizing:"border-box",overflow:"auto"},children:t}),!n&&(0,a.jsxs)(em.z,{onClick:i,variant:"secondary",className:"mt-3",children:[(0,a.jsx)(eh.U,{className:"w-5 h-5"}),"Export as PNG"]})]})};let ef=new u.Z({html:!0,linkify:!0,typographer:!0});function ex(e,t,n){fetch("/api/chat/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uquery:e,kquery:t,sentiment:n})})}function ep(e){let{uquery:t,kquery:n}=e,[s,r]=(0,l.useState)(null);return(0,l.useEffect)(()=>{null!==s&&setTimeout(()=>{r(null)},2e3)},[s]),(0,a.jsxs)("div",{className:"".concat(d().feedbackButtons," flex align-middle justify-center items-center"),children:[(0,a.jsx)("button",{title:"Like",className:d().thumbsUpButton,disabled:null!==s,onClick:()=>{ex(t,n,"positive"),r(!0)},children:!0===s?(0,a.jsx)(D.V,{alt:"Liked Message",className:"text-green-500",weight:"fill"}):(0,a.jsx)(D.V,{alt:"Like Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),(0,a.jsx)("button",{title:"Dislike",className:d().thumbsDownButton,disabled:null!==s,onClick:()=>{ex(t,n,"negative"),r(!1)},children:!1===s?(0,a.jsx)(B.L,{alt:"Disliked Message",className:"text-red-500",weight:"fill"}):(0,a.jsx)(B.L,{alt:"Dislike Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})})]})}function ev(e){let t=e.message.match(/\*\*(.*)\*\*/),n=function(e,t){let n=e.toLowerCase(),s="inline mt-1 mr-2 ".concat(t," h-4 w-4");return n.includes("understanding")?(0,a.jsx)(P.a,{className:"".concat(s)}):n.includes("generating")?(0,a.jsx)(A.Z,{className:"".concat(s)}):n.includes("tools")?(0,a.jsx)(z.v,{className:"".concat(s)}):n.includes("notes")?(0,a.jsx)(q.gt,{className:"".concat(s)}):n.includes("read")?(0,a.jsx)(U.f,{className:"".concat(s)}):n.includes("search")?(0,a.jsx)(H.Y,{className:"".concat(s)}):n.includes("summary")||n.includes("summarize")||n.includes("enhanc")?(0,a.jsx)(Z.u,{className:"".concat(s)}):n.includes("diagram")?(0,a.jsx)(W.j,{className:"".concat(s)}):n.includes("paint")?(0,a.jsx)(V.Y,{className:"".concat(s)}):n.includes("code")?(0,a.jsx)(p.E,{className:"".concat(s)}):n.includes("operating")?(0,a.jsx)(G.A,{className:"".concat(s)}):(0,a.jsx)(P.a,{className:"".concat(s)})}(t?t[1]:"",e.primary?(0,en.oz)(e.agentColor):"text-gray-500"),s=e.message,r=null;try{let e=s.match(/\{.*("action": "screenshot"|"type": "screenshot"|"image": "data:image\/.*").*\}/);if(e){r=JSON.parse(e[0]);let t='<img src="'.concat(r.image,'" alt="State of environment" class="max-w-full" />');s=s.replace(":\n**Action**: ".concat(e[0]),"\n\n- ".concat(r.text,"\n").concat(t))}}catch(e){console.error("Failed to parse screenshot data",e)}let l=N.Z.sanitize(ef.render(s));return l=l.replace(/<h[1-6].*?<\/h[1-6]>/g,""),(0,a.jsxs)("div",{className:"".concat(d().trainOfThoughtElement," break-words items-center ").concat(e.primary?"text-gray-400":"text-gray-300"," ").concat(d().trainOfThought," ").concat(e.primary?d().primary:""),children:[n,(0,a.jsx)("div",{dangerouslySetInnerHTML:{__html:l},className:"break-words"})]})}ef.use(m(),{inline:!0,code:!0}),ef.use(function(e){let t=e.renderer.rules.link_open||function(e,t,n,a,s){return s.renderToken(e,t,n)};e.renderer.rules.link_open=function(e,n,a,s,r){let l=e[n],o=l.attrIndex("href");if(o>=0){let e=l.attrs[o][1];if(e.startsWith("filelink://")){let t=e.replace("filelink://","").match(/^(.+?)(?:#line=(\d+))?$/);if(t){let e=t[1],n=t[2];l.attrSet("data-file-path",e),n&&l.attrSet("data-line-number",n);let a=l.attrIndex("class");a>=0&&l.attrs?l.attrs[a][1]="".concat(l.attrs[a][1]," file-link"):l.attrSet("class","file-link"),l.attrSet("href","#"),l.attrSet("role","button"),l.attrSet("tabindex","0")}}}return t(e,n,a,s,r)}});let ej=(0,l.forwardRef)((e,t)=>{var n,s;let r,o;let[i,c]=(0,l.useState)(!1),[u,h]=(0,l.useState)(!1),[m,x]=(0,l.useState)(""),[p,v]=(0,l.useState)(""),[j,w]=(0,l.useState)(!1),[y,b]=(0,l.useState)(!1),[k,C]=(0,l.useState)(""),[_,S]=(0,l.useState)(""),[E,T]=(0,l.useState)(!1),[I,D]=(0,l.useState)(""),[B,P]=(0,l.useState)(void 0),[A,z]=(0,l.useState)(!1),[q,U]=(0,l.useState)(null),[H,Z]=(0,l.useState)(""),[W,V]=(0,l.useState)(!1),[G,en]=(0,l.useState)(""),[es,ed]=(0,l.useState)(void 0),[eu,eh]=(0,l.useState)(!1),[em,ex]=(0,l.useState)(null),[ev,ej]=(0,l.useState)(""),[ew,ey]=(0,l.useState)({x:0,y:0}),eb=(0,l.useRef)(null),eN=(0,l.useRef)(!1),eM=(0,l.useRef)(null);(0,l.useEffect)(()=>{eN.current=y},[y]),(0,l.useEffect)(()=>{let e=new MutationObserver((e,t)=>{if(eM.current)for(let t of e)"childList"===t.type&&t.addedNodes.length>0&&(0,ea.Z)(eM.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}]})});return eM.current&&e.observe(eM.current,{childList:!0}),()=>e.disconnect()},[eM.current]),(0,l.useEffect)(()=>{let t=e.chatMessage.message;e.chatMessage.excalidrawDiagram&&C(e.chatMessage.excalidrawDiagram),e.chatMessage.mermaidjsDiagram&&S(e.chatMessage.mermaidjsDiagram),t=(0,O.AQ)(t,e.chatMessage.codeContext),e.chatMessage.codeContext&&Object.entries(e.chatMessage.codeContext).forEach(e=>{var n,a;let[s,r]=e;null===(a=r.results)||void 0===a||null===(n=a.output_files)||void 0===n||n.forEach(e=>{(e.filename.endsWith(".png")||e.filename.endsWith(".jpg"))&&!t.includes(")&&(t+="\n\n.concat(e.b64_data,")"))})});let n=t,a=t;if(e.chatMessage.images&&e.chatMessage.images.length>0){let t=e.chatMessage.images.map(e=>{let t=e.startsWith("data%3Aimage")?decodeURIComponent(e):e;return N.Z.sanitize(t)}),s=t.map((e,t)=>".concat(e,")")).join("\n"),r=t.map((e,t)=>'<div class="'.concat(d().imageWrapper,'"><img src="').concat(e,'" alt="rendered image ').concat(t+1,'" /></div>')).join(""),l='<div class="'.concat(d().imagesContainer,'">').concat(r,"</div>");n="".concat(s,"\n\n").concat(n),a="".concat(l).concat(a)}x(n),a=(a=a.replace(/\\\(/g,"LEFTPAREN").replace(/\\\)/g,"RIGHTPAREN").replace(/\\\[/g,"LEFTBRACKET").replace(/\\\]/g,"RIGHTBRACKET")).replace(/\[([^\]]+)\]\(file:\/\/([^)]+)\)/g,(e,t,n)=>"[".concat(t,"](filelink://").concat(n,")"));let s=ef.render(a);s=s.replace(/LEFTPAREN/g,"\\(").replace(/RIGHTPAREN/g,"\\)").replace(/LEFTBRACKET/g,"\\[").replace(/RIGHTBRACKET/g,"\\]"),v(N.Z.sanitize(s,{ADD_ATTR:["data-file-path","data-line-number"]}))},[e.chatMessage.message,e.chatMessage.images,e.chatMessage.intent]),(0,l.useEffect)(()=>{i&&setTimeout(()=>{c(!1)},2e3)},[i]),(0,l.useEffect)(()=>{if(eM.current){eM.current.querySelectorAll("pre > .hljs").forEach(e=>{if(!e.querySelector("".concat(d().codeCopyButton))){let t=document.createElement("button"),n=(0,a.jsx)($.w,{size:24});(0,g.createRoot)(t).render(n),t.className="hljs ".concat(d().codeCopyButton),t.addEventListener("click",()=>{let n=e.textContent||"";n=(n=(n=n.replace(/^\$+/,"")).replace(/^Copy/,"")).trim(),navigator.clipboard.writeText(n);let s=(0,a.jsx)(J.J,{size:24});(0,g.createRoot)(t).render(s)}),e.prepend(t)}});let e=eM.current,t=e=>{var t;let n=e.target,a=null==n?void 0:null===(t=n.closest)||void 0===t?void 0:t.call(n,"a.file-link");if(!a)return;e.preventDefault(),e.stopPropagation();let s=a.getAttribute("data-file-path")||"",r=a.getAttribute("data-line-number")||void 0;s&&(V(!1),D(s),P(r?parseInt(r):void 0),T(!0))},n=null,s=e=>{var t;let a=e.target,s=null==a?void 0:null===(t=a.closest)||void 0===t?void 0:t.call(a,"a.file-link");if(!s||n===s)return;n=s;let r=s.getBoundingClientRect(),l=s.getAttribute("data-file-path")||"",o=s.getAttribute("data-line-number")||void 0;l&&(ey({x:Math.max(8,r.left),y:r.bottom+6}),en(l),ed(o?parseInt(o):void 0),eb.current&&(window.clearTimeout(eb.current),eb.current=null),V(!0))},r=e=>{var t;let a=e.target,s=e.relatedTarget,r=null==a?void 0:null===(t=a.closest)||void 0===t?void 0:t.call(a,"a.file-link");s&&r&&r.contains(s)||(eb.current&&window.clearTimeout(eb.current),eb.current=window.setTimeout(()=>{V(!1),n=null,eb.current=null},200))},l=e=>{var t;let n=e.target,a=null==n?void 0:null===(t=n.closest)||void 0===t?void 0:t.call(n,"a.file-link");if(!a||"Enter"!==e.key&&" "!==e.key)return;e.preventDefault(),e.stopPropagation();let s=a.getAttribute("data-file-path")||"",r=a.getAttribute("data-line-number")||void 0;s&&(V(!1),D(s),P(r?parseInt(r):void 0),T(!0))};return e.addEventListener("pointerdown",t),e.addEventListener("keydown",l),e.addEventListener("mouseover",s),e.addEventListener("mouseout",r),(0,ea.Z)(eM.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}]}),()=>{e.removeEventListener("pointerdown",t),e.removeEventListener("keydown",l),e.removeEventListener("mouseover",s),e.removeEventListener("mouseout",r),eb.current&&(window.clearTimeout(eb.current),eb.current=null)}}},[p,eM]);let{content:ek,loading:eC,error:e_}=F(I,E),{content:eS,loading:eE,error:eT}=F(G,W);function eR(e){let t=new Date(e+"Z"),n=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}).toUpperCase(),a=t.toLocaleString("en-US",{year:"numeric",month:"short",day:"2-digit"}).replaceAll("-"," ");return"".concat(n," on ").concat(a)}async function eI(){let t=e.chatMessage.message.match(/[^.!?]+[.!?]*/g)||[];if(!t||0===t.length||!t[0])return;w(!0);let n=eO(t[0]);for(let e=0;e<t.length&&!eN.current;e++){let a=n;e<t.length-1&&(n=eO(t[e+1]));try{let e=await a,t=URL.createObjectURL(e);await function(e){return new Promise((t,n)=>{let a=new Audio(e);a.onended=t,a.onerror=n,a.play()})}(t)}catch(e){console.error("Error:",e);break}}w(!1),b(!1)}async function eO(e){let t=await fetch("/api/chat/speech?text=".concat(encodeURIComponent(e)),{method:"POST",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("Network response was not ok");return await t.blob()}(0,l.useEffect)(()=>{Z(ek)},[ek]),(0,l.useEffect)(()=>{z(eC)},[eC]),(0,l.useEffect)(()=>{U(e_)},[e_]),(0,l.useEffect)(()=>{ej(eS)},[eS]),(0,l.useEffect)(()=>{eh(eE)},[eE]),(0,l.useEffect)(()=>{ex(eT)},[eT]);let eL=async t=>{let n=t.turnId||e.turnId;(await fetch("/api/chat/conversation/message",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversation_id:e.conversationId,turn_id:n})})).ok?e.onDeleteMessage(n):console.error("Failed to delete message")},eF=function(e,t,n){let a=[],s=[],r=[];if(n)for(let[e,t]of Object.entries(n))t.results&&r.push({code:t.code,output:t.results.std_out,output_files:t.results.output_files,error:t.results.std_err});if(t){let e=[];for(let[n,a]of Object.entries(t)){if(a.answerBox&&e.push({title:a.answerBox.title,description:a.answerBox.answer,link:a.answerBox.source}),a.knowledgeGraph&&e.push({title:a.knowledgeGraph.title,description:a.knowledgeGraph.description,link:a.knowledgeGraph.descriptionLink}),a.webpages){if(a.webpages instanceof Array){let t=a.webpages.map(e=>({title:e.query,description:e.snippet,link:e.link}));e.push(...t)}else{let t=a.webpages;e.push({title:t.query,description:t.snippet,link:t.link})}}if(a.organic){let t=a.organic.map(e=>({title:e.title,description:e.snippet,link:e.link}));e.push(...t)}}a.push(...e)}if(e){let t=e.map(e=>{if(!e.compiled&&""!==e.compiled){let t=("string"==typeof e?e:null==e?"":String(e)).split("\n");return{title:t[0]&&t[0].trim()?t[0]:"(untitled)",content:t.slice(1).join("\n")}}return{title:e.file,content:e.compiled}});s.push(...t)}return{notesReferenceCardData:s,onlineReferenceCardData:a,codeReferenceCardData:r}}(e.chatMessage.context,e.chatMessage.onlineContext,e.chatMessage.codeContext);return(0,a.jsxs)("div",{ref:t,className:(n=e.chatMessage,r=[d().chatMessageContainer],"khoj"===n.by&&r.push("shadow-md"),r.push(d()[n.by]),n.message||r.push(d().emptyChatMessage),e.customClassName&&r.push(d()["".concat(n.by).concat(e.customClassName)]),r.join(" ")),onMouseLeave:e=>h(!1),onMouseEnter:e=>h(!0),"data-created":eR(e.chatMessage.created),children:[(0,a.jsxs)("div",{className:(s=e.chatMessage,(o=[d().chatMessageWrapper]).push(d()[s.by]),"khoj"===s.by&&o.push("border-l-4 border-opacity-50 ".concat("border-l-"+e.borderLeftColor)),o.join(" ")),children:[e.chatMessage.queryFiles&&e.chatMessage.queryFiles.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap flex-col mb-2 max-w-full",children:e.chatMessage.queryFiles.map((e,t)=>(0,a.jsxs)(el.Vq,{children:[(0,a.jsx)(el.hg,{asChild:!0,children:(0,a.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer bg-gray-500 bg-opacity-25 rounded-lg p-2 w-full ",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,M.Le)(e.file_type)}),(0,a.jsx)("span",{className:"truncate flex-1 min-w-0 max-w-[200px]",children:e.name}),e.size&&(0,a.jsxs)("span",{className:"text-gray-400 flex-shrink-0",children:["(",(0,ei.xq)(e.size),")"]})]})}),(0,a.jsxs)(el.cZ,{children:[(0,a.jsx)(el.fK,{children:(0,a.jsx)(eo.$N,{children:(0,a.jsx)("div",{className:"truncate min-w-0 break-words break-all text-wrap max-w-full whitespace-normal",children:e.name})})}),(0,a.jsx)(el.Be,{children:(0,a.jsx)(ec.x,{className:"h-72 w-full rounded-md break-words break-all text-wrap",children:e.content})})]})]},t))}),(0,a.jsx)("div",{ref:eM,className:d().chatMessage,dangerouslySetInnerHTML:{__html:p}}),W&&(0,f.createPortal)((0,a.jsx)("div",{onMouseEnter:()=>{eb.current&&(window.clearTimeout(eb.current),eb.current=null),V(!0)},onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),V(!1),G&&(D(G),P(es),T(!0))},onMouseLeave:()=>{eb.current&&window.clearTimeout(eb.current),eb.current=window.setTimeout(()=>{V(!1),eb.current=null},200)},style:{position:"fixed",left:ew.x,top:ew.y,zIndex:9999},className:"w-96 max-h-80 rounded-md border bg-popover p-4 text-popover-foreground shadow-md",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center text-sm font-medium",children:[(0,a.jsx)("span",{className:"truncate",children:G.split("/").pop()||G}),es&&(0,a.jsxs)("span",{className:"text-gray-500 ml-2",children:["- Line ",es]})]}),(0,a.jsxs)(ec.x,{className:"max-h-60",children:[eu&&(0,a.jsx)("div",{className:"flex items-center justify-center p-4",children:(0,a.jsx)(et.l,{})}),!eu&&em&&(0,a.jsxs)("div",{className:"p-3 text-red-500 text-sm",children:["Error: ",em]}),!eu&&!em&&(0,a.jsx)("div",{className:"text-sm",children:(0,a.jsx)(L,{content:ev,targetLine:es,maxLines:8})})]})]})}),document.body),(0,a.jsx)(el.Vq,{open:E,onOpenChange:T,children:(0,a.jsxs)(el.cZ,{className:"max-w-2xl",children:[(0,a.jsx)(el.fK,{children:(0,a.jsx)(eo.$N,{children:(0,a.jsxs)("div",{className:"truncate min-w-0 break-words break-all text-wrap max-w-full whitespace-normal",children:[I.split("/").pop()||I,(0,a.jsx)("span",{className:"text-gray-500 ml-2",children:B?"- Line ".concat(B):""})]})})}),(0,a.jsx)("div",{className:"text-left",children:(0,a.jsxs)(ec.x,{className:"h-80 w-full rounded-md",children:[A&&(0,a.jsx)("div",{className:"flex items-center justify-center p-4",children:(0,a.jsx)(et.l,{})}),!A&&q&&(0,a.jsxs)("div",{className:"p-3 text-red-500 text-sm",children:["Error: ",q]}),!A&&!q&&(0,a.jsx)("div",{className:"text-sm",children:(0,a.jsx)(L,{content:H,targetLine:B,maxLines:20})})]})})]})}),k&&(0,a.jsx)(er,{data:k}),_&&(0,a.jsx)(eg,{chart:_})]}),(0,a.jsx)("div",{className:d().teaserReferencesContainer,children:(0,a.jsx)(R,{isMobileWidth:e.isMobileWidth,notesReferenceCardData:eF.notesReferenceCardData,onlineReferenceCardData:eF.onlineReferenceCardData,codeReferenceCardData:eF.codeReferenceCardData})}),(0,a.jsx)("div",{className:d().chatFooter,children:(u||e.isMobileWidth||e.isLastMessage||j)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{title:eR(e.chatMessage.created),className:"text-gray-400 relative top-0 left-4",children:function(e){e.endsWith("Z")||(e+="Z");let t=new Date(e),n=new Date().getTime()-t.getTime();return n<6e4?"Just now":n<36e5?"".concat(Math.round(n/6e4),"m ago"):n<864e5?"".concat(Math.round(n/36e5),"h ago"):"".concat(Math.round(n/864e5),"d ago")}(e.chatMessage.created)}),(0,a.jsxs)("div",{className:"".concat(d().chatButtons," shadow-sm"),children:["khoj"===e.chatMessage.by&&(j?y?(0,a.jsx)(et.l,{iconClassName:"p-0",className:"m-0"}):(0,a.jsx)("button",{title:"Pause Speech",onClick:e=>b(!0),children:(0,a.jsx)(Q.d,{alt:"Pause Message",className:"hsl(var(--muted-foreground))"})}):(0,a.jsx)("button",{title:"Speak",onClick:e=>eI(),children:(0,a.jsx)(K.j,{alt:"Speak Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})})),e.chatMessage.turnId&&(0,a.jsx)("button",{title:"Delete",className:"".concat(d().deleteButton),onClick:()=>eL(e.chatMessage),children:(0,a.jsx)(Y.r,{alt:"Delete Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})}),"khoj"===e.chatMessage.by&&e.onRetryMessage&&e.isLastMessage&&(0,a.jsx)("button",{title:"Retry",className:"".concat(d().retryButton),onClick:()=>{var t,n,a;let s=e.chatMessage.turnId||e.turnId,r=e.chatMessage.rawQuery||(null===(t=e.chatMessage.intent)||void 0===t?void 0:t.query);if(console.log("Retry button clicked for turnId:",s),console.log("ChatMessage data:",{rawQuery:e.chatMessage.rawQuery,intent:e.chatMessage.intent,message:e.chatMessage.message}),console.log("Extracted query:",r),r)null===(n=e.onRetryMessage)||void 0===n||n.call(e,r,s);else{console.error("No original query found for retry");let t=prompt("Enter the original query to retry:");t&&(null===(a=e.onRetryMessage)||void 0===a||a.call(e,t,s))}},children:(0,a.jsx)(X._,{alt:"Retry Message",className:"hsl(var(--muted-foreground)) hover:text-blue-500"})}),(0,a.jsx)("button",{title:"Copy",className:"".concat(d().copyButton),onClick:()=>{navigator.clipboard.writeText(m),c(!0)},children:i?(0,a.jsx)(ee.C,{alt:"Copied Message",weight:"fill",className:"text-green-500"}):(0,a.jsx)(ee.C,{alt:"Copy Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),"khoj"===e.chatMessage.by&&(e.chatMessage.intent?(0,a.jsx)(ep,{uquery:e.chatMessage.intent.query,kquery:e.chatMessage.message}):(0,a.jsx)(ep,{uquery:e.chatMessage.rawQuery||e.chatMessage.message,kquery:e.chatMessage.message}))]})]})})]})});ej.displayName="ChatMessage";var ew=n(17104),ey=n(66142),eb=n(25397),eN=n(44849),eM=n.n(eN);function ek(e){let{frames:t,autoPlay:n=!0,playbackSpeed:s=1e3}=e,[r,o]=(0,l.useState)(0),[i,c]=(0,l.useState)(n),[d,u]=(0,l.useState)(!0),h=(0,l.useRef)(null);(0,l.useEffect)(()=>{d&&t.length>0&&o(t.length-1)},[t.length,d]),(0,l.useEffect)(()=>(i&&t.length>1?h.current=setInterval(()=>{o(e=>{let n=e+1;return n>=t.length?(c(!1),e):n})},s):h.current&&(clearInterval(h.current),h.current=null),()=>{h.current&&clearInterval(h.current)}),[i,t.length,s]);let m=t[r],g=e=>{o(e),u(!1),c(!1)};return t.length?(0,a.jsxs)("div",{className:eM().videoPlayer,children:[(0,a.jsxs)("div",{className:eM().screen,children:[(null==m?void 0:m.image)&&(0,a.jsx)("img",{src:m.image,alt:"Train of thought frame ".concat(r+1),className:eM().screenImage}),(0,a.jsx)("div",{className:eM().textOverlay,children:(0,a.jsx)("div",{className:eM().thoughtText,children:null==m?void 0:m.text})})]}),(0,a.jsxs)("div",{className:eM().controls,children:[(0,a.jsxs)("div",{className:eM().timeline,children:[(0,a.jsx)("input",{type:"range",min:0,max:Math.max(0,t.length-1),value:r,onChange:e=>g(parseInt(e.target.value)),className:eM().timelineSlider}),(0,a.jsx)("div",{className:eM().frameMarkers,children:t.map((e,t)=>(0,a.jsx)("div",{className:"".concat(eM().frameMarker," ").concat(e.image?eM().hasImage:eM().textOnly," ").concat(t===r?eM().active:""),onClick:()=>g(t),title:"Frame ".concat(t+1,": ").concat(e.text.slice(0,50),"...")},t))})]}),(0,a.jsxs)("div",{className:eM().controlButtons,children:[(0,a.jsx)("button",{onClick:()=>{r>0&&(o(r-1),u(!1),c(!1))},disabled:0===r,title:"Previous frame",className:eM().controlButton,children:(0,a.jsx)(ew.F,{size:16})}),(0,a.jsx)("button",{onClick:()=>{c(!i),u(!1)},disabled:t.length<=1,title:i?"Pause":"Play",className:eM().controlButton,children:i?(0,a.jsx)(Q.d,{size:16}):(0,a.jsx)(ey.s,{size:16})}),(0,a.jsx)("button",{onClick:()=>{r<t.length-1&&(o(r+1),u(!1),c(!1))},disabled:r===t.length-1,title:"Next frame",className:eM().controlButton,children:(0,a.jsx)(eb.N,{size:16})}),(0,a.jsx)("button",{onClick:()=>{u(!0),o(t.length-1),c(!1)},className:"".concat(eM().controlButton," ").concat(d?eM().active:""),title:"Auto-track latest",children:"Live"})]}),(0,a.jsx)("div",{className:eM().frameInfo,children:(0,a.jsxs)("span",{children:[r+1," / ",t.length]})})]})]}):null}var eC=n(72102),e_=n(23713),eS=n(795),eE=n(935),eT=n(81103),eR=e=>{let{name:t,avatar:n,link:s,description:r}=e;return(0,a.jsx)("div",{className:"relative group flex",children:(0,a.jsx)(eT.pn,{children:(0,a.jsxs)(eT.u,{delayDuration:0,children:[(0,a.jsx)(eT.aJ,{asChild:!0,children:(0,a.jsxs)(em.z,{variant:"ghost",className:"flex items-center justify-center",children:[n,(0,a.jsx)("div",{children:t})]})}),(0,a.jsx)(eT._v,{children:(0,a.jsxs)("div",{className:"w-80 h-30",children:[(0,a.jsx)("a",{href:s,target:"_blank",rel:"noreferrer",className:"mt-1 ml-2 block no-underline",children:(0,a.jsxs)("div",{className:"flex items-center justify-start gap-2",children:[n,(0,a.jsxs)("div",{className:"mr-2 mt-1 flex justify-center items-center text-sm font-semibold text-gray-800",children:[t,(0,a.jsx)(j.o,{weight:"bold",className:"ml-1"})]})]})}),r&&(0,a.jsx)("p",{className:"mt-2 ml-6 text-sm text-gray-600 line-clamp-2",children:r||"A Khoj agent"})]})})]})})})},eI=n(37104);function eO(e){let[t,n]=(0,l.useState)(e.completed),[s,c]=(0,l.useState)([]);return(0,l.useEffect)(()=>{e.completed&&n(!0)},[e.completed]),(0,l.useEffect)(()=>{if(!e.trainOfThought||0===e.trainOfThought.length){c([]);return}c(function(e){if(!e)return[];let t=[],n=[],a=[];return e.forEach((e,s)=>{let r=e.data,l=!1;try{let e=r.match(/\{.*(\"action\": \"screenshot\"|\"type\": \"screenshot\"|\"image\": \"data:image\/.*\").*\}/);if(e){let o=JSON.parse(e[0]);o.image&&(l=!0,r=r.replace(":\n**Action**: ".concat(e[0]),""),o.text&&(r+="\n\n".concat(o.text)),a.length>0&&(t.push({type:"text",textEntries:[...a]}),a=[]),n.push({text:r,image:o.image,timestamp:s}))}}catch(e){console.error("Failed to parse screenshot data",e)}l||(n.length>0&&(t.push({type:"video",frames:[...n]}),n=[]),a.push(e))}),n.length>0&&t.push({type:"video",frames:n}),a.length>0&&t.push({type:"text",textEntries:a}),t}("string"==typeof e.trainOfThought[0]?e.trainOfThought.map((e,t)=>({type:"text",data:e})):e.trainOfThought))},[e.trainOfThought]),(0,a.jsxs)("div",{className:"".concat(t?"":r().trainOfThought+" border"," rounded-lg"),children:[!e.completed&&(0,a.jsx)(et.l,{className:"float-right"}),e.completed&&(t?(0,a.jsxs)(em.z,{className:"w-fit text-left justify-start content-start text-xs",onClick:()=>n(!1),variant:"ghost",size:"sm",children:["Thought Process ",(0,a.jsx)(eC.p,{size:16,className:"ml-1"})]}):(0,a.jsxs)(em.z,{className:"w-fit text-left justify-start content-start text-xs p-0 h-fit",onClick:()=>n(!0),variant:"ghost",size:"sm",children:["Close ",(0,a.jsx)(e_.U,{size:16,className:"ml-1"})]})),(0,a.jsx)(o.M,{initial:!1,children:!t&&(0,a.jsx)(i.E.div,{initial:"closed",animate:"open",exit:"closed",variants:{open:{height:"auto",opacity:1,transition:{duration:.3,ease:"easeOut"}},closed:{height:0,opacity:0,transition:{duration:.3,ease:"easeIn"}}},children:s.map((t,n)=>(0,a.jsxs)("div",{children:["video"===t.type&&t.frames&&t.frames.length>0&&(0,a.jsx)(ek,{frames:t.frames,autoPlay:!1,playbackSpeed:1500}),"text"===t.type&&t.textEntries&&t.textEntries.map((r,l)=>{let o=s.length-1,i=l===t.textEntries.length-1,c=n===o&&i&&e.lastMessage&&!e.completed;return(0,a.jsx)(ev,{message:r.data,primary:c,agentColor:e.agentColor},"train-text-".concat(n,"-").concat(l,"-").concat(r.data.length))})]},"train-group-".concat(n)))})})]},e.keyId)}function eL(e){var t,n,s,o,i,c,d;let[u,h]=(0,l.useState)(null),[m,g]=(0,l.useState)(0),[f,x]=(0,l.useState)(!0),[p,v]=(0,l.useState)(null),j=(0,l.useRef)(null),w=(0,l.useRef)(null),y=(0,l.useRef)(null),b=(0,l.useRef)(null),N=(0,l.useRef)(null),[k,C]=(0,l.useState)(null),[_,S]=(0,l.useState)(!1),[E,T]=(0,l.useState)(!0),R=(0,ei.IC)(),I="[data-radix-scroll-area-viewport]",O=localStorage.getItem("message");(0,l.useEffect)(()=>{var e;let t=null===(e=w.current)||void 0===e?void 0:e.querySelector(I);if(!t)return;let n=()=>{let{scrollTop:e,scrollHeight:n,clientHeight:a}=t;T(n-(e+a)<=50)};return t.addEventListener("scroll",n),n(),()=>t.removeEventListener("scroll",n)},[w]),(0,l.useEffect)(()=>{e.incomingMessages&&e.incomingMessages.length>0&&E&&F(!0)},[e.incomingMessages,E]),(0,l.useEffect)(()=>{var t;let n=y.current,a=null===(t=w.current)||void 0===t?void 0:t.querySelector(I);if(!n||!a)return;let s=new ResizeObserver(()=>{let{scrollTop:t,scrollHeight:n,clientHeight:s}=a;if(n-(t+s)<=50&&e.incomingMessages&&e.incomingMessages.length>0){let t=e.incomingMessages[e.incomingMessages.length-1];(!t.completed||t.completed&&null!==k)&&F(!0)}});return s.observe(n),()=>s.disconnect()},[e.incomingMessages,k,w]),(0,l.useEffect)(()=>{u&&u.chat&&u.chat.length>0&&m<2&&requestAnimationFrame(()=>{var e;null===(e=b.current)||void 0===e||e.scrollIntoView({behavior:"auto",block:"start"})})},[u,m]),(0,l.useEffect)(()=>{if(!f||_)return;let t=new IntersectionObserver(t=>{t[0].isIntersecting&&f&&(S(!0),function(t){if(!f||_)return;let n=(t+1)*10,a="";if(e.conversationId)a="/api/chat/history?client=web&conversation_id=".concat(encodeURIComponent(e.conversationId),"&n=").concat(n);else{if(!e.publicConversationSlug)return;a="/api/chat/share/history?client=web&public_conversation_slug=".concat(e.publicConversationSlug,"&n=").concat(n)}fetch(a).then(e=>e.json()).then(n=>{var a;if(e.setTitle(n.response.slug),e.setIsOwner&&e.setIsOwner(null==n?void 0:null===(a=n.response)||void 0===a?void 0:a.is_owner),n&&n.response&&n.response.chat&&n.response.chat.length>0){if(g(Math.ceil(n.response.chat.length/10)),n.response.chat.length===(null==u?void 0:u.chat.length)){x(!1),S(!1);return}e.setAgent(n.response.agent),h(n.response),S(!1),0===t?F(!0):L()}else{if(n.response.agent&&n.response.conversation_id){let t={chat:[],agent:n.response.agent,conversation_id:n.response.conversation_id,slug:n.response.slug,is_owner:n.response.is_owner};e.setAgent(n.response.agent),h(t),e.setIsChatSideBarOpen&&!O&&e.setIsChatSideBarOpen(!0)}x(!1),S(!1)}}).catch(e=>{console.error(e),window.location.href="/"})}(m))},{threshold:1});return j.current&&t.observe(j.current),()=>t.disconnect()},[f,m,_]),(0,l.useEffect)(()=>{x(!0),S(!1),g(0),h(null)},[e.conversationId]),(0,l.useEffect)(()=>{if(e.incomingMessages){let t=e.incomingMessages[e.incomingMessages.length-1];t&&!t.completed&&(C(e.incomingMessages.length-1),e.setTitle(t.rawQuery),t.turnId&&v(t.turnId))}},[e.incomingMessages]);let L=()=>{var e;let t=null===(e=w.current)||void 0===e?void 0:e.querySelector(I);requestAnimationFrame(()=>{var e;null===(e=N.current)||void 0===e||e.scrollIntoView({behavior:"auto",block:"start"}),null==t||t.scrollBy({behavior:"smooth",top:-150})})},F=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=null===(e=w.current)||void 0===e?void 0:e.querySelector(I);requestAnimationFrame(()=>{null==n||n.scrollTo({top:n.scrollHeight,behavior:t?"auto":"smooth"})}),(t||n&&n.scrollHeight-(n.scrollTop+n.clientHeight)<5)&&T(!0)};function D(){var e,t;return u&&u.agent&&(null===(e=u.agent)||void 0===e?void 0:e.name)?u.agent.is_hidden?"Khoj":null===(t=u.agent)||void 0===t?void 0:t.name:"Agent"}let B=t=>{t&&(h(e=>e&&t?{...e,chat:e.chat.filter(e=>e.turnId!==t)}:e),e.incomingMessages&&e.setIncomingMessages&&e.setIncomingMessages(e.incomingMessages.filter(e=>e.turnId!==t)))},P=(t,n)=>{var a;t&&(n&&B(n),null===(a=e.onRetryMessage)||void 0===a||a.call(e,t,n))};return e.conversationId||e.publicConversationSlug?(0,a.jsx)(ec.x,{className:"\n h-[calc(100svh-theme(spacing.44))]\n sm:h-[calc(100svh-theme(spacing.44))]\n md:h-[calc(100svh-theme(spacing.44))]\n lg:h-[calc(100svh-theme(spacing.44))]\n ",ref:w,children:(0,a.jsxs)("div",{ref:y,children:[(0,a.jsxs)("div",{className:"print-only-header",children:[(0,a.jsxs)("div",{className:"print-header-content",children:[(0,a.jsx)("div",{className:"print-header-left",children:(0,a.jsx)(eI.S6,{className:"print-logo"})}),(0,a.jsxs)("div",{className:"print-header-right",children:[(0,a.jsx)("h1",{children:(null==u?void 0:u.slug)||"Conversation with Khoj"}),(0,a.jsx)("div",{className:"conversation-meta",children:(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"Agent:"})," ",D()]})})]})]}),(0,a.jsx)("hr",{})]}),(0,a.jsxs)("div",{className:"".concat(r().chatHistory," ").concat(e.customClassName),children:[(0,a.jsx)("div",{ref:j,style:{height:"1px"},children:_&&(0,a.jsx)(et.l,{className:"opacity-50"})}),u&&u.chat&&u.chat.map((t,n)=>{var s,r;return(0,a.jsxs)(l.Fragment,{children:[t.trainOfThought&&"khoj"===t.by&&(0,a.jsx)(eO,{trainOfThought:t.trainOfThought,lastMessage:!1,agentColor:(null==u?void 0:null===(s=u.agent)||void 0===s?void 0:s.color)||"orange",keyId:"".concat(n,"trainOfThought"),completed:!0},"".concat(n,"trainOfThought")),(0,a.jsx)(ej,{ref:n===u.chat.length-2?b:n===u.chat.length-(m-1)*10?N:null,isMobileWidth:R,chatMessage:t,customClassName:"fullHistory",borderLeftColor:"".concat(null==u?void 0:null===(r=u.agent)||void 0===r?void 0:r.color,"-500"),isLastMessage:n===u.chat.length-1,onDeleteMessage:B,onRetryMessage:P,conversationId:e.conversationId},"".concat(n,"fullHistory"))]},"chatMessage-".concat(n))}),e.incomingMessages&&e.incomingMessages.map((t,n)=>{var s,r,o,i,c;let d=null!==(c=null!==(i=t.turnId)&&void 0!==i?i:p)&&void 0!==c?c:void 0;return(0,a.jsxs)(l.Fragment,{children:[(0,a.jsx)(ej,{isMobileWidth:R,chatMessage:{message:t.rawQuery,context:[],onlineContext:{},codeContext:{},created:t.timestamp,by:"you",automationId:"",images:t.images,conversationId:e.conversationId,turnId:d,queryFiles:t.queryFiles},customClassName:"fullHistory",borderLeftColor:"".concat(null==u?void 0:null===(s=u.agent)||void 0===s?void 0:s.color,"-500"),onDeleteMessage:B,onRetryMessage:P,conversationId:e.conversationId,turnId:d},"".concat(n,"outgoing")),t.trainOfThought&&t.trainOfThought.length>0&&(0,a.jsx)(eO,{trainOfThought:t.trainOfThought,lastMessage:n===k,agentColor:(null==u?void 0:null===(r=u.agent)||void 0===r?void 0:r.color)||"orange",keyId:"".concat(n,"trainOfThought"),completed:t.completed},"".concat(n,"trainOfThought-").concat(t.trainOfThought.length,"-").concat(t.trainOfThought.map(e=>e.length).join("-"))),(0,a.jsx)(ej,{isMobileWidth:R,chatMessage:{message:t.rawResponse,context:t.context,onlineContext:t.onlineContext,codeContext:t.codeContext,created:t.timestamp,by:"khoj",automationId:"",rawQuery:t.rawQuery,intent:{type:t.intentType||"",query:t.rawQuery,"memory-type":"","inferred-queries":t.inferredQueries||[]},conversationId:e.conversationId,images:t.generatedImages,queryFiles:t.generatedFiles,mermaidjsDiagram:t.generatedMermaidjsDiagram,turnId:d},conversationId:e.conversationId,turnId:d,onDeleteMessage:B,onRetryMessage:P,customClassName:"fullHistory",borderLeftColor:"".concat(null==u?void 0:null===(o=u.agent)||void 0===o?void 0:o.color,"-500"),isLastMessage:n===e.incomingMessages.length-1},"".concat(n,"incoming"))]},"incomingMessage".concat(n))}),e.pendingMessage&&(0,a.jsx)(ej,{isMobileWidth:R,chatMessage:{message:e.pendingMessage,context:[],onlineContext:{},codeContext:{},created:new Date().getTime().toString(),by:"you",automationId:"",conversationId:e.conversationId,turnId:void 0},conversationId:e.conversationId,onDeleteMessage:B,onRetryMessage:P,customClassName:"fullHistory",borderLeftColor:"".concat(null==u?void 0:null===(t=u.agent)||void 0===t?void 0:t.color,"-500"),isLastMessage:!0},"pendingMessage-".concat(e.pendingMessage.length)),u&&(0,a.jsx)("div",{className:"".concat(r().agentIndicator," pb-4"),children:(0,a.jsx)("div",{className:"relative group mx-2 cursor-pointer",children:(0,a.jsx)(eR,{name:D(),link:u&&u.agent&&(null===(o=u.agent)||void 0===o?void 0:o.slug)?"/agents?agent=".concat(null===(i=u.agent)||void 0===i?void 0:i.slug):"/agents",avatar:(0,M.TI)(null===(n=u.agent)||void 0===n?void 0:n.icon,null===(s=u.agent)||void 0===s?void 0:s.color)||(0,a.jsx)(eS.v,{}),description:u&&u.agent?(null===(c=u.agent)||void 0===c?void 0:c.persona)?null===(d=u.agent)||void 0===d?void 0:d.persona:"You can set a persona for your agent in the Chat Options side panel.":"Your agent is no longer available. You will be reset to the default agent."})})})]}),(0,a.jsx)("div",{className:"".concat(e.customClassName," fixed bottom-[20%] z-10"),children:!E&&(0,a.jsx)("button",{title:"Scroll to bottom",className:"absolute bottom-0 right-0 bg-white dark:bg-[hsl(var(--background))] text-neutral-500 dark:text-white p-2 rounded-full shadow-xl",onClick:()=>{F()},children:(0,a.jsx)(eE.K,{size:24})})})]})}):null}},42501:function(e){e.exports={chatHistory:"chatHistory_chatHistory__CoaVT",agentIndicator:"chatHistory_agentIndicator__wOU1f",trainOfThought:"chatHistory_trainOfThought__mMWSR"}},91499:function(e){e.exports={chatMessageContainer:"chatMessage_chatMessageContainer__sAivf",chatMessageWrapper:"chatMessage_chatMessageWrapper__u5m8A","file-link":"chatMessage_file-link__PL84f",khojfullHistory:"chatMessage_khojfullHistory__NPu2l",youfullHistory:"chatMessage_youfullHistory__ioyfH",you:"chatMessage_you__6GUC4",khoj:"chatMessage_khoj__cjWON",khojChatMessage:"chatMessage_khojChatMessage__BabQz",emptyChatMessage:"chatMessage_emptyChatMessage__J9JRn",imagesContainer:"chatMessage_imagesContainer__HTRjT",imageWrapper:"chatMessage_imageWrapper__DF92M",author:"chatMessage_author__muRtC",chatFooter:"chatMessage_chatFooter__0vR8s",chatButtons:"chatMessage_chatButtons__Lbk8T",codeCopyButton:"chatMessage_codeCopyButton__Y_Ujv",feedbackButtons:"chatMessage_feedbackButtons___Brdy",copyButton:"chatMessage_copyButton__jd7q7",retryButton:"chatMessage_retryButton__Z7Pzk",trainOfThought:"chatMessage_trainOfThought__mR2Gg",primary:"chatMessage_primary__WYPEb",trainOfThoughtElement:"chatMessage_trainOfThoughtElement__le_bC"}},44849:function(e){e.exports={videoPlayer:"trainOfThoughtVideoPlayer_videoPlayer__Dz3mA",screen:"trainOfThoughtVideoPlayer_screen__dvEVh",screenImage:"trainOfThoughtVideoPlayer_screenImage__3SgOQ",textOverlay:"trainOfThoughtVideoPlayer_textOverlay__BGbhO",thoughtText:"trainOfThoughtVideoPlayer_thoughtText__zn_vT",controls:"trainOfThoughtVideoPlayer_controls__HDkO_",timeline:"trainOfThoughtVideoPlayer_timeline__hSpWu",timelineSlider:"trainOfThoughtVideoPlayer_timelineSlider__GQ8dx",frameMarkers:"trainOfThoughtVideoPlayer_frameMarkers__5y3He",frameMarker:"trainOfThoughtVideoPlayer_frameMarker__DBO9Y",hasImage:"trainOfThoughtVideoPlayer_hasImage__GFGAk",textOnly:"trainOfThoughtVideoPlayer_textOnly__okufk",active:"trainOfThoughtVideoPlayer_active__zp6u9",controlButtons:"trainOfThoughtVideoPlayer_controlButtons__rqfIH",controlButton:"trainOfThoughtVideoPlayer_controlButton___RdE_",frameInfo:"trainOfThoughtVideoPlayer_frameInfo__u5nwA"}}}]);
|
@@ -1 +1 @@
|
|
1
|
-
!function(){"use strict";var e,t,n,r,c,o,a,u,f,i={},d={};function b(e){var t=d[e];if(void 0!==t)return t.exports;var n=d[e]={exports:{}},r=!0;try{i[e].call(n.exports,n,n.exports,b),r=!1}finally{r&&delete d[e]}return n.exports}b.m=i,e=[],b.O=function(t,n,r,c){if(n){c=c||0;for(var o=e.length;o>0&&e[o-1][2]>c;o--)e[o]=e[o-1];e[o]=[n,r,c];return}for(var a=1/0,o=0;o<e.length;o++){for(var n=e[o][0],r=e[o][1],c=e[o][2],u=!0,f=0;f<n.length;f++)a>=c&&Object.keys(b.O).every(function(e){return b.O[e](n[f])})?n.splice(f--,1):(u=!1,c<a&&(a=c));if(u){e.splice(o--,1);var i=r();void 0!==i&&(t=i)}}return t},b.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},b.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 c=Object.create(null);b.r(c);var o={};t=t||[null,n({}),n([]),n(n)];for(var a=2&r&&e;"object"==typeof a&&!~t.indexOf(a);a=n(a))Object.getOwnPropertyNames(a).forEach(function(t){o[t]=function(){return e[t]}});return o.default=function(){return e},b.d(c,o),c},b.d=function(e,t){for(var n in t)b.o(t,n)&&!b.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},b.f={},b.e=function(e){return Promise.all(Object.keys(b.f).reduce(function(t,n){return b.f[n](e,t),t},[]))},b.u=function(e){return 4609===e?"static/chunks/4609-33aa487dff03a9fd.js":"static/chunks/"+(({1264:"90542734",6555:"964ecbae",7293:"94ca1967"})[e]||e)+"."+({78:"08169ab541abab4f",297:"4c4c823ff6e3255b",549:"2bd27f59a91a9668",584:"d7ce3505f169b706",764:"dadd316e8e16d191",784:"e03acf460df213d1",1225:"ecac11e7421504c4",1264:"b1a1629065ba199b",1320:"ae930ad00affe685",1626:"15a8acc0d6639ec6",1940:"d082758bd04e08ae",2242:"9a07e19f1a3a8b16",2475:"57a0d0fd93d07af0",2481:"5ce6524ba0a73f90",3353:"1c6d553216a1acae",3855:"f7b8131f78af046e",3973:"dc54a39586ab48be",4241:"c1cd170f7f37ac59",4327:"f3704dc398c67113",4505:"f09454a346269c3f",4610:"196691887afb7fea",4801:"96a152d49742b644",5765:"71b1e1207b76b03f",6240:"34f7c1fa692edd61",6434:"e6cd986d690f2cef",6555:"d5be7c49c320d695",7293:"1b3402358e0e1255",7553:"f5ad54b1f6e92c49",8086:"8d39887215807fcd",8168:"f074ab8c7c16d82d",8223:"1705878fa7a09292",8483:"94f6c9e2bee86f50",8810:"fc0e479de78c7c61",8828:"bc74dc4ce94e78f6",8909:"14ac3f43d0070cf1",9167:"098534184f03fe92",9537:"e934ce37bf314509",9574:"3fe8e26e95bf1c34",9599:"ec50b5296c27dae9",9643:"b34248df52ffc77c",9747:"2fd9065b1435abb1",9922:"98f2b2a9959b4ebe"})[e]+".js"},b.miniCssF=function(e){},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),b.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},c="_N_E:",b.l=function(e,t,n,o){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var a,u,f=document.getElementsByTagName("script"),i=0;i<f.length;i++){var d=f[i];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==c+n){a=d;break}}a||(u=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,b.nc&&a.setAttribute("nonce",b.nc),a.setAttribute("data-webpack",c+n),a.src=b.tu(e)),r[e]=[t];var l=function(t,n){a.onerror=a.onload=null,clearTimeout(s);var c=r[e];if(delete r[e],a.parentNode&&a.parentNode.removeChild(a),c&&c.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=l.bind(null,a.onerror),a.onload=l.bind(null,a.onload),u&&document.head.appendChild(a)},b.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.tt=function(){return void 0===o&&(o={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(o=trustedTypes.createPolicy("nextjs#bundler",o))),o},b.tu=function(e){return b.tt().createScriptURL(e)},b.p="/_next/",a={2272:0,3254:0,3587:0,7400:0,6250:0,4842:0,5638:0,
|
1
|
+
!function(){"use strict";var e,t,n,r,c,o,a,u,f,i={},d={};function b(e){var t=d[e];if(void 0!==t)return t.exports;var n=d[e]={exports:{}},r=!0;try{i[e].call(n.exports,n,n.exports,b),r=!1}finally{r&&delete d[e]}return n.exports}b.m=i,e=[],b.O=function(t,n,r,c){if(n){c=c||0;for(var o=e.length;o>0&&e[o-1][2]>c;o--)e[o]=e[o-1];e[o]=[n,r,c];return}for(var a=1/0,o=0;o<e.length;o++){for(var n=e[o][0],r=e[o][1],c=e[o][2],u=!0,f=0;f<n.length;f++)a>=c&&Object.keys(b.O).every(function(e){return b.O[e](n[f])})?n.splice(f--,1):(u=!1,c<a&&(a=c));if(u){e.splice(o--,1);var i=r();void 0!==i&&(t=i)}}return t},b.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},b.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 c=Object.create(null);b.r(c);var o={};t=t||[null,n({}),n([]),n(n)];for(var a=2&r&&e;"object"==typeof a&&!~t.indexOf(a);a=n(a))Object.getOwnPropertyNames(a).forEach(function(t){o[t]=function(){return e[t]}});return o.default=function(){return e},b.d(c,o),c},b.d=function(e,t){for(var n in t)b.o(t,n)&&!b.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},b.f={},b.e=function(e){return Promise.all(Object.keys(b.f).reduce(function(t,n){return b.f[n](e,t),t},[]))},b.u=function(e){return 4609===e?"static/chunks/4609-33aa487dff03a9fd.js":"static/chunks/"+(({1264:"90542734",6555:"964ecbae",7293:"94ca1967"})[e]||e)+"."+({78:"08169ab541abab4f",297:"4c4c823ff6e3255b",549:"2bd27f59a91a9668",584:"d7ce3505f169b706",764:"dadd316e8e16d191",784:"e03acf460df213d1",1225:"ecac11e7421504c4",1264:"b1a1629065ba199b",1320:"ae930ad00affe685",1626:"15a8acc0d6639ec6",1940:"d082758bd04e08ae",2242:"9a07e19f1a3a8b16",2475:"57a0d0fd93d07af0",2481:"5ce6524ba0a73f90",3353:"1c6d553216a1acae",3855:"f7b8131f78af046e",3973:"dc54a39586ab48be",4241:"c1cd170f7f37ac59",4327:"f3704dc398c67113",4505:"f09454a346269c3f",4610:"196691887afb7fea",4801:"96a152d49742b644",5765:"71b1e1207b76b03f",6240:"34f7c1fa692edd61",6434:"e6cd986d690f2cef",6555:"d5be7c49c320d695",7293:"1b3402358e0e1255",7553:"f5ad54b1f6e92c49",8086:"8d39887215807fcd",8168:"f074ab8c7c16d82d",8223:"1705878fa7a09292",8483:"94f6c9e2bee86f50",8810:"fc0e479de78c7c61",8828:"bc74dc4ce94e78f6",8909:"14ac3f43d0070cf1",9167:"098534184f03fe92",9537:"e934ce37bf314509",9574:"3fe8e26e95bf1c34",9599:"ec50b5296c27dae9",9643:"b34248df52ffc77c",9747:"2fd9065b1435abb1",9922:"98f2b2a9959b4ebe"})[e]+".js"},b.miniCssF=function(e){},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),b.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},c="_N_E:",b.l=function(e,t,n,o){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var a,u,f=document.getElementsByTagName("script"),i=0;i<f.length;i++){var d=f[i];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==c+n){a=d;break}}a||(u=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,b.nc&&a.setAttribute("nonce",b.nc),a.setAttribute("data-webpack",c+n),a.src=b.tu(e)),r[e]=[t];var l=function(t,n){a.onerror=a.onload=null,clearTimeout(s);var c=r[e];if(delete r[e],a.parentNode&&a.parentNode.removeChild(a),c&&c.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=l.bind(null,a.onerror),a.onload=l.bind(null,a.onload),u&&document.head.appendChild(a)},b.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.tt=function(){return void 0===o&&(o={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(o=trustedTypes.createPolicy("nextjs#bundler",o))),o},b.tu=function(e){return b.tt().createScriptURL(e)},b.p="/_next/",a={2272:0,3254:0,3587:0,7400:0,6250:0,4842:0,5638:0,6008:0,2026:0,9346:0},b.f.j=function(e,t){var n=b.o(a,e)?a[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(/^(2026|2272|3254|3587|4842|5638|6008|6250|7400|9346)$/.test(e))a[e]=0;else{var r=new Promise(function(t,r){n=a[e]=[t,r]});t.push(n[2]=r);var c=b.p+b.u(e),o=Error();b.l(c,function(t){if(b.o(a,e)&&(0!==(n=a[e])&&(a[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;o.message="Loading chunk "+e+" failed.\n("+r+": "+c+")",o.name="ChunkLoadError",o.type=r,o.request=c,n[1](o)}},"chunk-"+e,e)}}},b.O.j=function(e){return 0===a[e]},u=function(e,t){var n,r,c=t[0],o=t[1],u=t[2],f=0;if(c.some(function(e){return 0!==a[e]})){for(n in o)b.o(o,n)&&(b.m[n]=o[n]);if(u)var i=u(b)}for(e&&e(t);f<c.length;f++)r=c[f],b.o(a,r)&&a[r]&&a[r][0](),a[r]=0;return b.O(i)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(u.bind(null,0)),f.push=u.bind(null,f.push.bind(f)),b.nc=void 0}();
|
@@ -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}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}}.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.sidePanel_session__EeNjH{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__CUgIn{grid-template-columns:minmax(12rem,100%) 1fr 1fr}div.sidePanel_sessionHover__cf_VO,div.sidePanel_session__EeNjH:hover{background-color:hsla(var(--popover))}div.sidePanel_session__EeNjH:hover{color:hsla(var(--popover-foreground))}div.sidePanel_session__EeNjH a{text-decoration:none}button.sidePanel_button__NzdN_{border:none;outline:none;background-color:transparent;cursor:pointer;color:var(--main-text-color);width:24px}button.sidePanel_showMoreButton__nDt4Z{border-radius:.5rem;padding:8px}div.sidePanel_panel__9offQ{display:flex;flex-direction:column;padding:1rem;overflow-y:auto;max-width:auto;transition:background-color .5s}div.sidePanel_expanded__aHnYV{gap:1rem;background-color:hsla(var(--muted));height:100%}div.sidePanel_collapsed__ewO3e{display:grid;grid-template-columns:1fr;height:-moz-fit-content;height:fit-content;padding:1rem 0 0 1rem}p.sidePanel_session__EeNjH{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;text-align:left;font-size:small}p.sidePanel_compressed__CUgIn{width:11rem}p.sidePanel_expanded__aHnYV{max-width:20rem}div.sidePanel_header__NCT_v{display:grid;grid-template-columns:1fr auto}div.sidePanel_profile__pfAJU{display:grid;grid-template-columns:auto 1fr;gap:1rem;align-items:center;margin-top:auto}div.sidePanel_panelWrapper__cDMvb{display:grid;grid-template-rows:1fr auto auto;height:100%}div.sidePanel_modalSessionsList___u3aa{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___u3aa div.sidePanel_content__z60YO{max-width:80%;max-height:80%;background-color:hsla(var(--frosted-background-color));overflow:auto;padding:20px;border-radius:10px}div.sidePanel_modalSessionsList___u3aa div.sidePanel_session__EeNjH{max-width:100%;text-overflow:ellipsis}@media screen and (max-width:768px){div.sidePanel_panel__9offQ{padding:.25rem;width:100%}div.sidePanel_expanded__aHnYV{z-index:1}div.sidePanel_singleReference__vmXZr{padding:4px}div.sidePanel_panelWrapper__cDMvb{width:100%;padding:0 1rem}div.sidePanel_session__EeNjH.sidePanel_compressed__CUgIn{max-width:100%;display:grid;grid-template-columns:70vw auto;justify-content:space-between}div.sidePanel_session__EeNjH{max-width:100%;grid-template-columns:minmax(auto,70vw) 1fr}}.trainOfThoughtVideoPlayer_videoPlayer__Dz3mA{border:1px solid hsl(var(--border));border-radius:8px;background-color:hsl(var(--background));margin:16px 0;overflow:hidden}.trainOfThoughtVideoPlayer_screen__dvEVh{position:relative;background-color:hsl(var(--muted));min-height:300px;display:flex;align-items:center;justify-content:center}.trainOfThoughtVideoPlayer_screenImage__3SgOQ{max-width:100%;max-height:400px;-o-object-fit:contain;object-fit:contain;border-radius:4px}.trainOfThoughtVideoPlayer_textOverlay__BGbhO{position:absolute;bottom:0;left:0;right:0;background:linear-gradient(transparent,rgba(0,0,0,.8));padding:20px 16px 12px;color:#fff}.trainOfThoughtVideoPlayer_thoughtText__zn_vT{font-size:14px;line-height:1.4;max-height:100px;overflow-y:auto}.trainOfThoughtVideoPlayer_controls__HDkO_{padding:12px 16px;background-color:hsl(var(--card));border-top:1px solid hsl(var(--border))}.trainOfThoughtVideoPlayer_timeline__hSpWu{position:relative;margin-bottom:12px}.trainOfThoughtVideoPlayer_timelineSlider__GQ8dx{width:100%;height:4px;background-color:hsl(var(--muted));border-radius:2px;outline:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}.trainOfThoughtVideoPlayer_timelineSlider__GQ8dx::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;background-color:hsl(var(--primary));cursor:pointer;border:2px solid #fff;box-shadow:0 2px 4px rgba(0,0,0,.2)}.trainOfThoughtVideoPlayer_timelineSlider__GQ8dx::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background-color:hsl(var(--primary));cursor:pointer;border:2px solid #fff;box-shadow:0 2px 4px rgba(0,0,0,.2)}.trainOfThoughtVideoPlayer_frameMarkers__5y3He{position:absolute;top:-2px;left:0;right:0;height:8px;display:flex;justify-content:space-between;pointer-events:none}.trainOfThoughtVideoPlayer_frameMarker__DBO9Y{width:6px;height:8px;border-radius:1px;cursor:pointer;pointer-events:auto;transition:all .2s ease}.trainOfThoughtVideoPlayer_frameMarker__DBO9Y.trainOfThoughtVideoPlayer_hasImage__GFGAk{background-color:hsl(var(--primary))}.trainOfThoughtVideoPlayer_frameMarker__DBO9Y.trainOfThoughtVideoPlayer_textOnly__okufk{background-color:hsl(var(--muted-foreground))}.trainOfThoughtVideoPlayer_frameMarker__DBO9Y.trainOfThoughtVideoPlayer_active__zp6u9{background-color:hsl(var(--accent))!important;transform:scaleY(1.5)}.trainOfThoughtVideoPlayer_frameMarker__DBO9Y:hover{transform:scaleY(1.2)}.trainOfThoughtVideoPlayer_controlButtons__rqfIH{display:flex;align-items:center;gap:8px;margin-bottom:8px}.trainOfThoughtVideoPlayer_controlButton___RdE_{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:1px solid hsl(var(--border));border-radius:4px;background-color:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;transition:all .2s ease}.trainOfThoughtVideoPlayer_controlButton___RdE_:hover:not(:disabled){background-color:hsl(var(--muted))}.trainOfThoughtVideoPlayer_controlButton___RdE_:disabled{opacity:.5;cursor:not-allowed}.trainOfThoughtVideoPlayer_controlButton___RdE_.trainOfThoughtVideoPlayer_active__zp6u9{background-color:hsl(var(--primary));color:hsl(var(--primary-foreground))}.trainOfThoughtVideoPlayer_frameInfo__u5nwA{display:flex;justify-content:center;font-size:12px;color:hsl(var(--muted-foreground))}@media (prefers-color-scheme:dark){.trainOfThoughtVideoPlayer_textOverlay__BGbhO{background:linear-gradient(transparent,rgba(0,0,0,.9))}}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}div.automations_automationsLayout__Atoh_{display:grid;grid-template-columns:1fr 1fr;gap:1rem}div.automations_automationCard__BKidA{display:grid;grid-template-rows:auto 1fr auto}div.automations_pageLayout__OaoYA{max-width:60vw;margin:auto auto 2rem}@media screen and (max-width:768px){div.automations_automationsLayout__Atoh_{grid-template-columns:1fr}div.automations_pageLayout__OaoYA{max-width:90vw}}
|
@@ -0,0 +1 @@
|
|
1
|
+
div.chat_main__8xQu5{height:100%;color:hsla(var(--foreground));margin-left:auto;margin-right:auto}.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:auto}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:1fr;gap:1rem;width:100%}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:100%;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}}@media print{div.chat_chatBoxBody__qT_SC,div.chat_chatBox__FBct_,div.chat_chatLayout__pR203,div.chat_main__8xQu5{height:auto!important;max-height:none!important;width:100%!important;margin:0!important;padding:0!important;overflow:visible!important}div.chat_chatBoxBody__qT_SC,div.chat_chatBox__FBct_,div.chat_chatLayout__pR203{display:block!important;position:static!important}div.chat_chatBodyFull__FfKEK,div.chat_chatBody__sS1LX{display:block!important;width:100%!important;height:auto!important;max-height:none!important;grid-template-columns:none!important;overflow:visible!important;position:static!important}div.chat_inputBox__LOFws{display:none!important}.chat_chatHistory__EzBJM{width:100%!important;max-width:none!important}}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{padding:8px 16px;margin:12px}div.chatHistory_trainOfThought__mMWSR code,div.chatHistory_trainOfThought__mMWSR p,div.chatHistory_trainOfThought__mMWSR pre,div.chatHistory_trainOfThought__mMWSR span{overflow-wrap:anywhere}@media print{div.chatHistory_chatHistory__CoaVT{display:block!important;flex-direction:column!important}div.chatHistory_chatHistory__CoaVT,div.chatHistory_chatHistory__CoaVT>*{height:auto!important;max-height:none!important;overflow:visible!important;position:static!important}div.chatHistory_chatHistory__CoaVT>*{width:100%!important;max-width:none!important}div.chatHistory_agentIndicator__wOU1f{margin-bottom:.5rem!important}div.chatHistory_trainOfThought__mMWSR{border-left:2px solid #ccc!important;margin:.5rem 0!important;padding:.5rem 1rem!important;font-size:.9em!important}}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}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}.chatMessage_chatMessageWrapper__u5m8A a.chatMessage_file-link__PL84f{color:hsl(var(--primary));text-decoration:underline;cursor:pointer;transition:color .2s ease}.chatMessage_chatMessageWrapper__u5m8A a.chatMessage_file-link__PL84f:hover{color:hsl(var(--primary-foreground));background-color:hsl(var(--primary));text-decoration:none;padding:2px 4px;border-radius:4px}.chatMessage_chatMessageWrapper__u5m8A table{border-collapse:collapse;border:1px solid hsl(var(--border));margin:1rem 0;width:100%}.chatMessage_chatMessageWrapper__u5m8A table td,.chatMessage_chatMessageWrapper__u5m8A table th{border:1px solid hsl(var(--border));padding:8px 12px;text-align:left;min-width:120px}.chatMessage_chatMessageWrapper__u5m8A table th{background-color:hsl(var(--muted));font-weight:600}.chatMessage_chatMessageWrapper__u5m8A table tbody tr:nth-child(2n){background-color:hsl(var(--muted)/.3)}.chatMessage_chatMessageWrapper__u5m8A table tbody tr:nth-child(odd){background-color:transparent}.chatMessage_chatMessageWrapper__u5m8A table tbody tr:hover{background-color:hsl(var(--muted)/.5)}div.chatMessage_khojfullHistory__NPu2l{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,button.chatMessage_retryButton__Z7Pzk 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}.chatMessage_chatMessageWrapper__u5m8A table td,.chatMessage_chatMessageWrapper__u5m8A table th{min-width:40px}}@media print{div.chatMessage_chatMessageContainer__sAivf{background:transparent!important;border:1px solid #ccc!important;border-radius:8px!important;margin:.5rem 0!important;padding:.5rem!important;width:100%!important;max-width:none!important}div.chatMessage_chatMessageContainer__sAivf.chatMessage_you__6GUC4{margin:1rem 0 0!important;background:transparent!important;border:none!important}div.chatMessage_chatMessageContainer__sAivf.chatMessage_khoj__cjWON{margin:0!important}div.chatMessage_chatMessageWrapper__u5m8A{padding-left:.5rem!important;padding-bottom:.5rem!important;width:100%!important;max-width:none!important}div.chatMessage_you__6GUC4 div.chatMessage_chatMessageWrapper__u5m8A{padding:0!important}div.chatMessage_you__6GUC4{font-size:16pt!important;font-weight:500!important;padding:.8rem 0 .1rem!important;align-self:flex-start!important;text-align:left!important}div.chatMessage_khoj__cjWON,div.chatMessage_you__6GUC4{background-color:transparent!important;color:#000!important}div.chatMessage_khoj__cjWON{align-self:stretch!important}div.chatMessage_khoj__cjWON,div.chatMessage_khojfullHistory__NPu2l,div.chatMessage_youfullHistory__ioyfH{width:100%!important;max-width:none!important}div.chatMessage_author__muRtC{color:#666!important;font-size:.7rem!important}div.chatMessage_you__6GUC4.chatMessage_chatMessageContainer__sAivf:after{content:"🕐 " attr(data-created)!important;display:block!important;color:#888!important;font-size:9pt!important;font-weight:400!important;margin:.2rem 0 .6rem!important;padding-bottom:.4rem!important}button.chatMessage_codeCopyButton__Y_Ujv,button.chatMessage_copyButton__jd7q7,button.chatMessage_retryButton__Z7Pzk,div.chatMessage_chatButtons__Lbk8T,div.chatMessage_chatFooter__0vR8s,div.chatMessage_feedbackButtons___Brdy{display:none!important}div.chatMessage_imagesContainer__HTRjT{display:block!important;overflow:visible!important;margin-bottom:.5rem!important}div.chatMessage_imageWrapper__DF92M{margin-right:0!important;margin-bottom:.5rem!important}div.chatMessage_imageWrapper__DF92M img,div.chatMessage_khoj__cjWON div.chatMessage_imageWrapper__DF92M img{width:auto!important;height:auto!important;max-width:100%!important;max-height:4in!important;-o-object-fit:contain!important;object-fit:contain!important;page-break-inside:avoid}div.chatMessage_trainOfThought__mR2Gg{border-left:2px solid #ccc!important;margin:.5rem 0!important;padding:.5rem!important;font-size:.9em!important;color:#666!important}div.chatMessage_trainOfThought__mR2Gg strong{color:#000!important}div.chatMessage_trainOfThought__mR2Gg.chatMessage_primary__WYPEb{border-left-color:#000!important}div.chatMessage_trainOfThought__mR2Gg.chatMessage_primary__WYPEb strong{color:#000!important}div.chatMessage_trainOfThoughtElement__le_bC{display:block!important;margin-bottom:.5rem!important}}@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_AMS-Regular.a79f1c31.woff2) format("woff2"),url(/_next/static/media/KaTeX_AMS-Regular.1608a09b.woff) format("woff"),url(/_next/static/media/KaTeX_AMS-Regular.4aafdb68.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/_next/static/media/KaTeX_Caligraphic-Bold.ec17d132.woff2) format("woff2"),url(/_next/static/media/KaTeX_Caligraphic-Bold.b6770918.woff) format("woff"),url(/_next/static/media/KaTeX_Caligraphic-Bold.cce5b8ec.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Caligraphic-Regular.55fac258.woff2) format("woff2"),url(/_next/static/media/KaTeX_Caligraphic-Regular.dad44a7f.woff) format("woff"),url(/_next/static/media/KaTeX_Caligraphic-Regular.07ef19e7.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/_next/static/media/KaTeX_Fraktur-Bold.d42a5579.woff2) format("woff2"),url(/_next/static/media/KaTeX_Fraktur-Bold.9f256b85.woff) format("woff"),url(/_next/static/media/KaTeX_Fraktur-Bold.b18f59e1.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Fraktur-Regular.d3c882a6.woff2) format("woff2"),url(/_next/static/media/KaTeX_Fraktur-Regular.7c187121.woff) format("woff"),url(/_next/static/media/KaTeX_Fraktur-Regular.ed38e79f.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/_next/static/media/KaTeX_Main-Bold.c3fb5ac2.woff2) format("woff2"),url(/_next/static/media/KaTeX_Main-Bold.d181c465.woff) format("woff"),url(/_next/static/media/KaTeX_Main-Bold.b74a1a8b.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/_next/static/media/KaTeX_Main-BoldItalic.6f2bb1df.woff2) format("woff2"),url(/_next/static/media/KaTeX_Main-BoldItalic.e3f82f9d.woff) format("woff"),url(/_next/static/media/KaTeX_Main-BoldItalic.70d8b0a5.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/_next/static/media/KaTeX_Main-Italic.8916142b.woff2) format("woff2"),url(/_next/static/media/KaTeX_Main-Italic.9024d815.woff) format("woff"),url(/_next/static/media/KaTeX_Main-Italic.47373d1e.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Main-Regular.0462f03b.woff2) format("woff2"),url(/_next/static/media/KaTeX_Main-Regular.7f51fe03.woff) format("woff"),url(/_next/static/media/KaTeX_Main-Regular.b7f8fe9b.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/_next/static/media/KaTeX_Math-BoldItalic.572d331f.woff2) format("woff2"),url(/_next/static/media/KaTeX_Math-BoldItalic.f1035d8d.woff) format("woff"),url(/_next/static/media/KaTeX_Math-BoldItalic.a879cf83.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/_next/static/media/KaTeX_Math-Italic.f28c23ac.woff2) format("woff2"),url(/_next/static/media/KaTeX_Math-Italic.5295ba48.woff) format("woff"),url(/_next/static/media/KaTeX_Math-Italic.939bc644.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(/_next/static/media/KaTeX_SansSerif-Bold.8c5b5494.woff2) format("woff2"),url(/_next/static/media/KaTeX_SansSerif-Bold.bf59d231.woff) format("woff"),url(/_next/static/media/KaTeX_SansSerif-Bold.94e1e8dc.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(/_next/static/media/KaTeX_SansSerif-Italic.3b1e59b3.woff2) format("woff2"),url(/_next/static/media/KaTeX_SansSerif-Italic.7c9bc82b.woff) format("woff"),url(/_next/static/media/KaTeX_SansSerif-Italic.b4c20c84.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_SansSerif-Regular.ba21ed5f.woff2) format("woff2"),url(/_next/static/media/KaTeX_SansSerif-Regular.74048478.woff) format("woff"),url(/_next/static/media/KaTeX_SansSerif-Regular.d4d7ba48.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Script-Regular.03e9641d.woff2) format("woff2"),url(/_next/static/media/KaTeX_Script-Regular.07505710.woff) format("woff"),url(/_next/static/media/KaTeX_Script-Regular.fe9cbbe1.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Size1-Regular.eae34984.woff2) format("woff2"),url(/_next/static/media/KaTeX_Size1-Regular.e1e279cb.woff) format("woff"),url(/_next/static/media/KaTeX_Size1-Regular.fabc004a.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Size2-Regular.5916a24f.woff2) format("woff2"),url(/_next/static/media/KaTeX_Size2-Regular.57727022.woff) format("woff"),url(/_next/static/media/KaTeX_Size2-Regular.d6b476ec.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Size3-Regular.b4230e7e.woff2) format("woff2"),url(/_next/static/media/KaTeX_Size3-Regular.9acaf01c.woff) format("woff"),url(/_next/static/media/KaTeX_Size3-Regular.a144ef58.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Size4-Regular.10d95fd3.woff2) format("woff2"),url(/_next/static/media/KaTeX_Size4-Regular.7a996c9d.woff) format("woff"),url(/_next/static/media/KaTeX_Size4-Regular.fbccdabe.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/_next/static/media/KaTeX_Typewriter-Regular.a8709e36.woff2) format("woff2"),url(/_next/static/media/KaTeX_Typewriter-Regular.6258592b.woff) format("woff"),url(/_next/static/media/KaTeX_Typewriter-Regular.d97aaf4a.ttf) format("truetype")}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.22"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}.suggestions_card__fbiZo{border-radius:.5rem}.suggestions_title__vNozc{font-size:1rem}.suggestions_text__J_IfY{padding-top:.2rem;font-size:.9rem;white-space:wrap;padding-right:4px;color:#000}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
<!DOCTYPE html><html lang="en" class="__variable_f36179 __variable_386ca1"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/1d8a05b60287ae6c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/40381518f67e6cb9-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/77c207b095007c34-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/82ef96de0e8f4d8c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/a6ecd16fa044d500-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/c4250770ab8708b6-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/7889a30fe9c83846.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/5c7a72bad47e50b3.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/5b28ced915454767.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/
|
1
|
+
<!DOCTYPE html><html lang="en" class="__variable_f36179 __variable_386ca1"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/1d8a05b60287ae6c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/40381518f67e6cb9-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/77c207b095007c34-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/82ef96de0e8f4d8c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/a6ecd16fa044d500-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/c4250770ab8708b6-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/7889a30fe9c83846.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/5c7a72bad47e50b3.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/5b28ced915454767.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/821d0d60b0b6871d.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-820bd66958a5e279.js"/><script src="/_next/static/chunks/fd9d1056-aa94101ec5388dba.js" async=""></script><script src="/_next/static/chunks/2117-080746c8e170c81a.js" async=""></script><script src="/_next/static/chunks/main-app-de1f09df97a3cfc7.js" async=""></script><script src="/_next/static/chunks/2939-4af3fd24b8ffc9ad.js" async=""></script><script src="/_next/static/chunks/7200-93ab0072359b8028.js" async=""></script><script src="/_next/static/chunks/8667-50b03a89e82e0ba7.js" async=""></script><script src="/_next/static/chunks/1327-e254819a9172cfa7.js" async=""></script><script src="/_next/static/chunks/4447-cd95608f8e93e711.js" async=""></script><script src="/_next/static/chunks/7626-1b630f1654172341.js" async=""></script><script src="/_next/static/chunks/3595-ac8e81e04ecb89cb.js" async=""></script><script src="/_next/static/chunks/2327-438aaec1657c5ada.js" async=""></script><script src="/_next/static/chunks/5427-a95ec748e52abb75.js" async=""></script><script src="/_next/static/chunks/app/agents/page-e291b49977f43880.js" async=""></script><script src="/_next/static/chunks/app/layout-c2de87a25fededbb.js" async=""></script><meta http-equiv="Content-Security-Policy" content="default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';"/><title>Khoj AI - Agents</title><meta name="description" content="Find or create agents with custom knowledge, tools and personalities to help address your specific needs."/><link rel="manifest" href="/static/khoj.webmanifest" crossorigin="use-credentials"/><meta name="keywords" content="research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant"/><meta property="og:title" content="Khoj AI - Agents"/><meta property="og:description" content="Find or create agents with custom knowledge, tools and personalities to help address your specific needs."/><meta property="og:url" content="https://app.khoj.dev/agents/"/><meta property="og:site_name" content="Khoj AI"/><meta property="og:image" content="https://assets.khoj.dev/khoj_hero.png"/><meta property="og:image:width" content="940"/><meta property="og:image:height" content="525"/><meta property="og:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta property="og:image:width" content="256"/><meta property="og:image:height" content="256"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="Khoj AI - Agents"/><meta name="twitter:description" content="Find or create agents with custom knowledge, tools and personalities to help address your specific needs."/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_hero.png"/><meta name="twitter:image:width" content="940"/><meta name="twitter:image:height" content="525"/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta name="twitter:image:width" content="256"/><meta name="twitter:image:height" content="256"/><link rel="icon" href="/static/assets/icons/khoj_lantern.ico"/><link rel="apple-touch-icon" href="/static/assets/icons/khoj_lantern_256x256.png"/><meta name="next-size-adjust"/><script>
|
2
2
|
try {
|
3
3
|
if (localStorage.getItem('theme') === 'dark' ||
|
4
4
|
(!localStorage.getItem('theme') && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
5
5
|
document.documentElement.classList.add('dark');
|
6
6
|
}
|
7
7
|
} catch (e) {}
|
8
|
-
</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><main><div class="agents_agentList__XVx4A"><button class="undefined"><span> <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 256 256" class="inline animate-spin h-5 w-5 mx-3"><path d="M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"></path></svg></span></button> booting up your agents</div></main><script src="/_next/static/chunks/webpack-e572645654c4335e.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/1d8a05b60287ae6c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/40381518f67e6cb9-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/77c207b095007c34-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/media/82ef96de0e8f4d8c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n5:HL[\"/_next/static/media/a6ecd16fa044d500-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n6:HL[\"/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n7:HL[\"/_next/static/media/c4250770ab8708b6-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n8:HL[\"/_next/static/css/7889a30fe9c83846.css\",\"style\"]\n9:HL[\"/_next/static/css/5c7a72bad47e50b3.css\",\"style\"]\na:HL[\"/_next/static/css/5b28ced915454767.css\",\"style\"]\nb:HL[\"/_next/static/css/2945c4a857922f3b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"c:I[12846,[],\"\"]\ne:I[19107,[],\"ClientPageRoot\"]\nf:I[37335,[\"2939\",\"static/chunks/2939-4d4084c5b888b960.js\",\"7200\",\"static/chunks/7200-93ab0072359b8028.js\",\"8667\",\"static/chunks/8667-4b7790573b08c50d.js\",\"1327\",\"static/chunks/1327-511bb0a862efce80.js\",\"4447\",\"static/chunks/4447-d6cf93724d57e34b.js\",\"7626\",\"static/chunks/7626-1b630f1654172341.js\",\"3595\",\"static/chunks/3595-ac8e81e04ecb89cb.js\",\"2327\",\"static/chunks/2327-438aaec1657c5ada.js\",\"5427\",\"static/chunks/5427-a95ec748e52abb75.js\",\"9718\",\"static/chunks/app/agents/page-e291b49977f43880.js\"],\"default\",1]\n10:I[4707,[],\"\"]\n11:I[36423,[],\"\"]\n12:I[85147,[\"7200\",\"static/chunks/7200-93ab0072359b8028.js\",\"3185\",\"static/chunks/app/layout-c2de87a25fededbb.js\"],\"ThemeProvider\"]\n14:I[61060,[],\"\"]\n15:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$Lc\",null,{\"buildId\":\"yBzbL9kxl5BudSA9F4Gr6\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"agents\",\"\"],\"initialTree\":[\"\",{\"children\":[\"agents\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"agents\",{\"children\":[\"__PAGE__\",{},[[\"$Ld\",[\"$\",\"$Le\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$f\"}],[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/2945c4a857922f3b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]]],null],null]},[[null,[\"$\",\"$L10\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"agents\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L11\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/7889a30fe9c83846.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/5c7a72bad47e50b3.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/5b28ced915454767.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_f36179 __variable_386ca1\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n try {\\n if (localStorage.getItem('theme') === 'dark' ||\\n (!localStorage.getItem('theme') \u0026\u0026 window.matchMedia('(prefers-color-scheme: dark)').matches)) {\\n document.documentElement.classList.add('dark');\\n }\\n } catch (e) {}\\n \"}}]}],[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';\"}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L12\",null,{\"children\":[\"$\",\"$L10\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L11\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$L13\"],\"globalErrorComponent\":\"$14\",\"missingSlots\":\"$W15\"}]\n"])</script><script>self.__next_f.push([1,"13:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Agents\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Find or create agents with custom knowledge, tools and personalities to help address your specific needs.\"}],[\"$\",\"link\",\"4\",{\"rel\":\"manifest\",\"href\":\"/static/khoj.webmanifest\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"5\",{\"name\":\"keywords\",\"content\":\"research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:title\",\"content\":\"Khoj AI - Agents\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:description\",\"content\":\"Find or create agents with custom knowledge, tools and personalities to help address your specific needs.\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:url\",\"content\":\"https://app.khoj.dev/agents/\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:site_name\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:title\",\"content\":\"Khoj AI - Agents\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:description\",\"content\":\"Find or create agents with custom knowledge, tools and personalities to help address your specific needs.\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"22\",{\"name\":\"twitter:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"25\",{\"name\":\"twitter:image:height\",\"content\":\"256\"}],[\"$\",\"link\",\"26\",{\"rel\":\"icon\",\"href\":\"/static/assets/icons/khoj_lantern.ico\"}],[\"$\",\"link\",\"27\",{\"rel\":\"apple-touch-icon\",\"href\":\"/static/assets/icons/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"28\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"d:null\n"])</script></body></html>
|
8
|
+
</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><main><div class="agents_agentList__XVx4A"><button class="undefined"><span> <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 256 256" class="inline animate-spin h-5 w-5 mx-3"><path d="M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"></path></svg></span></button> booting up your agents</div></main><script src="/_next/static/chunks/webpack-820bd66958a5e279.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/1d8a05b60287ae6c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/40381518f67e6cb9-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/77c207b095007c34-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/media/82ef96de0e8f4d8c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n5:HL[\"/_next/static/media/a6ecd16fa044d500-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n6:HL[\"/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n7:HL[\"/_next/static/media/c4250770ab8708b6-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n8:HL[\"/_next/static/css/7889a30fe9c83846.css\",\"style\"]\n9:HL[\"/_next/static/css/5c7a72bad47e50b3.css\",\"style\"]\na:HL[\"/_next/static/css/5b28ced915454767.css\",\"style\"]\nb:HL[\"/_next/static/css/821d0d60b0b6871d.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"c:I[12846,[],\"\"]\ne:I[19107,[],\"ClientPageRoot\"]\nf:I[37335,[\"2939\",\"static/chunks/2939-4af3fd24b8ffc9ad.js\",\"7200\",\"static/chunks/7200-93ab0072359b8028.js\",\"8667\",\"static/chunks/8667-50b03a89e82e0ba7.js\",\"1327\",\"static/chunks/1327-e254819a9172cfa7.js\",\"4447\",\"static/chunks/4447-cd95608f8e93e711.js\",\"7626\",\"static/chunks/7626-1b630f1654172341.js\",\"3595\",\"static/chunks/3595-ac8e81e04ecb89cb.js\",\"2327\",\"static/chunks/2327-438aaec1657c5ada.js\",\"5427\",\"static/chunks/5427-a95ec748e52abb75.js\",\"9718\",\"static/chunks/app/agents/page-e291b49977f43880.js\"],\"default\",1]\n10:I[4707,[],\"\"]\n11:I[36423,[],\"\"]\n12:I[85147,[\"7200\",\"static/chunks/7200-93ab0072359b8028.js\",\"3185\",\"static/chunks/app/layout-c2de87a25fededbb.js\"],\"ThemeProvider\"]\n14:I[61060,[],\"\"]\n15:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$Lc\",null,{\"buildId\":\"PcD2gC0kChVzNip15DdDQ\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"agents\",\"\"],\"initialTree\":[\"\",{\"children\":[\"agents\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"agents\",{\"children\":[\"__PAGE__\",{},[[\"$Ld\",[\"$\",\"$Le\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$f\"}],[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/821d0d60b0b6871d.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]]],null],null]},[[null,[\"$\",\"$L10\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"agents\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L11\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/7889a30fe9c83846.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/5c7a72bad47e50b3.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/5b28ced915454767.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_f36179 __variable_386ca1\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n try {\\n if (localStorage.getItem('theme') === 'dark' ||\\n (!localStorage.getItem('theme') \u0026\u0026 window.matchMedia('(prefers-color-scheme: dark)').matches)) {\\n document.documentElement.classList.add('dark');\\n }\\n } catch (e) {}\\n \"}}]}],[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';\"}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L12\",null,{\"children\":[\"$\",\"$L10\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L11\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$L13\"],\"globalErrorComponent\":\"$14\",\"missingSlots\":\"$W15\"}]\n"])</script><script>self.__next_f.push([1,"13:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Agents\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Find or create agents with custom knowledge, tools and personalities to help address your specific needs.\"}],[\"$\",\"link\",\"4\",{\"rel\":\"manifest\",\"href\":\"/static/khoj.webmanifest\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"5\",{\"name\":\"keywords\",\"content\":\"research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:title\",\"content\":\"Khoj AI - Agents\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:description\",\"content\":\"Find or create agents with custom knowledge, tools and personalities to help address your specific needs.\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:url\",\"content\":\"https://app.khoj.dev/agents/\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:site_name\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:title\",\"content\":\"Khoj AI - Agents\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:description\",\"content\":\"Find or create agents with custom knowledge, tools and personalities to help address your specific needs.\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"22\",{\"name\":\"twitter:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"25\",{\"name\":\"twitter:image:height\",\"content\":\"256\"}],[\"$\",\"link\",\"26\",{\"rel\":\"icon\",\"href\":\"/static/assets/icons/khoj_lantern.ico\"}],[\"$\",\"link\",\"27\",{\"rel\":\"apple-touch-icon\",\"href\":\"/static/assets/icons/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"28\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"d:null\n"])</script></body></html>
|