1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2721],{10867:function(n,e,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/ask",function(){return t(90277)}])},99862:function(n,e,t){"use strict";var r=t(85893);e.Z=function(n){let{color:e="black",...t}=n;return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 3H18V6H16V8H18V11H20V8H22V6H20V3ZM10 5H8V10H6V12H3V14H6V16H8V21H10V16H12V14H15V12H12V10H10V5Z",fill:"white"})})}},21518:function(n,e,t){"use strict";var r=t(82729),a=t(85893),i=t(19521),o=t(99862);function _templateObject(){let n=(0,r._)(['\n margin-top: 1rem;\n\n .filters {\n max-width: 850px;\n display: flex;\n flex-wrap: wrap;\n gap: 20px 8px;\n font-family: "Mulish", sans-serif;\n white-space: nowrap;\n\n ::-webkit-scrollbar {\n display: none; /* Safari and Chrome */\n }\n\n '," {\n flex-wrap: nowrap;\n overflow: auto;\n justify-content: start;\n width: 100%;\n }\n "," {\n flex-wrap: wrap;\n justify-content: center;\n width: max-content;\n }\n\n .tag {\n padding: 8px 16px;\n border-radius: 200px;\n border: 2px solid\n ",";\n transition-duration: 0.2s;\n cursor: pointer;\n\n p {\n color: ",";\n text-align: center;\n font-weight: 600;\n user-select: none;\n "," {\n font-size: 14px;\n }\n "," {\n font-size: 14px;\n }\n\n svg {\n path {\n fill: ",";\n }\n }\n }\n\n :hover {\n background: ",";\n }\n }\n }\n"]);return _templateObject=function(){return n},n}let s=i.default.div.withConfig({componentId:"sc-4714f522-0"})(_templateObject(),n=>{let{theme:e}=n;return e.breakpoints.xs},n=>{let{theme:e}=n;return e.breakpoints.sm},n=>{let{theme:e}=n;return"dark"==e.mode?e.colors.palette.grey["600"]:e.colors.palette.grey["300"]},n=>{let{theme:e}=n;return"dark"==e.mode?"#fff":"#020617"},n=>{let{theme:e}=n;return e.breakpoints.xs},n=>{let{theme:e}=n;return e.breakpoints.sm},n=>{let{theme:e}=n;return"dark"==e.mode?"#fff":"#020617"},n=>{let{theme:e}=n;return"dark"==e.mode?e.colors.palette.grey["800"]:e.colors.palette.grey["100"]}),l={sql:[{displayText:"SQL Joins",search:"SQL Joins"},{displayText:"SQL Aggregates",search:"SQL Aggregates"},{displayText:"SQL Subqueries",search:"SQL Subqueries"},{displayText:"SQL Indexing",search:"SQL Indexing"},{displayText:"SQL Constraints",search:"SQL Constraints"},{displayText:"SQL Views",search:"SQL Views"},{displayText:"SQL Triggers",search:"SQL Triggers"},{displayText:"SQL Normalization",search:"SQL Normalization"},{displayText:"SQL Transactions",search:"SQL Transactions"}],search:[{displayText:"Build a To-Do App from Scratch",search:"How do I create a to-do app with JavaScript?"},{displayText:"Personal Website",search:"How can I build and deploy a personal website from scratch?"},{displayText:"Understanding Big O Notation",search:"Can you explain Big O notation with examples?"},{displayText:"Time Complexity Cases",search:"What's the difference between best-case, worst-case, and average-case time complexity?"},{displayText:"REST vs GraphQL",search:"What are the differences between REST and GraphQL, and when should I use each?"},{displayText:"Center a Div",search:"What are the different ways to center a div using CSS?"},{displayText:"Chatbot with Claude 3.5",search:"How do I create a chatbot using Claude 3.5?"}],cpp:[{displayText:"C++ Pointers",search:"C++ Pointers"},{displayText:"C++ References",search:"C++ References"},{displayText:"C++ Classes",search:"C++ Classes"}
1,{displayText:"C++ Inheritance",search:"C++ Inheritance"},{displayText:"C++ Polymorphism",search:"C++ Polymorphism"},{displayText:"C++ Templates",search:"C++ Templates"},{displayText:"C++ STL",search:"C++ STL"},{displayText:"C++ Memory Management",search:"C++ Memory Management"},{displayText:"C++ Multithreading",search:"C++ Multithreading"}],java:[{displayText:"Java Pointers",search:"Java Pointers"},{displayText:"Java Classes",search:"Java Classes"},{displayText:"Java Inheritance",search:"Java Inheritance"},{displayText:"Java Polymorphism",search:"Java Polymorphism"},{displayText:"Java Interfaces",search:"Java Interfaces"},{displayText:"Java Collections",search:"Java Collections"},{displayText:"Java Streams",search:"Java Streams"},{displayText:"Java Lambda Expressions",search:"Java Lambda Expressions"}]},c=(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 20H13V8H15V6H13V4H11V6H9V8H11V20ZM7 10V8H9V10H7ZM7 10V12H5V10H7ZM17 10V8H15V10H17ZM17 10V12H19V10H17Z",fill:"black"})});e.Z=function(n){var e;let{handleSubmit:t,type:r="sql",setInput:i=()=>{}}=n;return(0,a.jsx)(s,{children:(0,a.jsx)("div",{className:"filters",children:null===(e=l[r])||void 0===e?void 0:e.map((n,e)=>(0,a.jsx)("div",{className:"tag nes-pointer",onClick:e=>{"search"===r?i(null==n?void 0:n.search):t(e,null==n?void 0:n.search)},children:(0,a.jsxs)("p",{children:["search"===r?(0,a.jsx)(a.Fragment,{children:c}):(0,a.jsx)(o.Z,{})," ",null==n?void 0:n.displayText]})},e))})})}},90277:function(n,e,t){"use strict";t.r(e),t.d(e,{default:function(){return ask}});var r=t(82729),a=t(85893),i=t(19521),o=t(99428),s=t(3649),l=t(609),c=t(9473),d=t(99862),p=t(73857),h=t(21518),m=t(17596),u=t(67294);function _templateObject(){let n=(0,r._)(["\n max-width: 100%;\n\n p {\n margin: 0px;\n }\n\n .computer-message {\n margin-top: -5rem;\n width: 800px;\n max-width: inherit;\n\n margin-bottom: 2rem;\n "," {\n flex-direction: column;\n }\n ",' {\n flex-direction: row;\n }\n }\n\n .searchbar-copy {\n margin-top: -3rem;\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-bottom: 2rem;\n\n h2 {\n font-size: 32px !important;\n font-family: "PixelGridM";\n color: ',';\n }\n\n .secondary-text {\n font-family: "Mulish", sans-serif;\n color: ',";\n font-size: 18px;\n transition: opacity 1s ease-in-out;\n }\n }\n\n .search-area {\n background-color: ",';\n width: 800px;\n max-width: inherit;\n padding: 12px 16px 40px 16px;\n border-radius: 8px;\n font-family: "Mulish", sans-serif;\n min-height: 50px;\n transition: opacity 1s ease-in-out;\n position: relative;\n\n textarea {\n border: none;\n outline: none;\n -webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none;\n resize: none;\n background: none;\n overflow: hidden;\n color: ',";\n width: inherit;\n ::placeholder {\n color: ",";\n font-weight: 600;\n }\n }\n\n button {\n position: absolute;\n right: 10px;\n bottom: 15px;\n }\n }\n\n .filters {\n width: 800px;\n }\n"]);return _templateObject=function(){return n},n}let x=i.default.div.withConfig({componentId:"sc-9058c872-0"})(_templateObject(),n=>{let{theme:e}=n;return e.breakpoints.xs},n=>{let{theme:e}=n;return e.breakpoints.sm},n=>{let{theme:e}=n;return e.colors.text.primary},n=>{let{theme:e}=n;return e.colors.text.tertiary},n=>{let{theme:e}=n;return e.colors.background.grey.secondary},n=>{let{theme:e}=n;return e.colors.text.primary},n=>{let{theme:e}=n;return e.colors.text.tertiary});var ask_AskSearchArea=function(n){let{setInput:e,input:t,handleSubmit:r,removeCopyies:i=!1,placeholder:o="Question everything..."}=n,f=(0,c.v9)(l.o4)||"dark",g=(0,c.v9)(l.zr),y=g.charAt(0).toUpperCase()+g.slice(1),b=(0,u.useMemo)(()=>["What do you want to learn? :)","Hi ".concat(y,", anything you are confused with?"),"What exciting topic shall we explore today?","Which fascinating subject are we tackling today?","Let's get learning â what's on your mind?","What intriguing idea would you like to explore?"],[y]),w=(0,u.useMemo)(()=>b[Math.floor(Math.random()*b.length)],[b]);return(0,a.jsxs)(x,{children:[!i&&(0,a.jsx)(m.Z,{text:w}),(0,a.jsxs)(s.Z,{borderColor:"dark"===f?"64748B":"CBD5E1",className:"search-area",children:[(0,a.jsx)("textarea",{placeholder:o,onChange:n=>e(n.target.value),value:t}),(0,a.jsxs)(p.Z,{onClick:n=>r(n),size:"small",disabled:0===t.length,children:[(0,a.jsx)(d.Z,{})," Ask"]})]}),!i&&(0,a.jsx)(h.Z,{handleSubmit:r,type:"search",setInput:e})]})},f=t(45024),g=t(32075);
1function AskOutput_templateObject(){let n=(0,r._)(["\n color: ",';\n font-family: "Mulish", sans-serif;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1rem;\n padding: 0rem 0rem 3rem 0rem;\n max-width: 100%;\n\n .content-container {\n width: 800px;\n max-width: inherit;\n padding: 1rem 0rem;\n\n .computer-message {\n margin: 2rem 0rem;\n\n '," {\n flex-direction: column;\n width: 100%;\n }\n "," {\n flex-direction: row;\n width: fit-content;\n }\n }\n\n .markdown {\n transition-duration: 2s;\n margin-bottom: 10rem;\n\n p,\n span,\n h1,\n h2,\n h3 {\n color: ",' !important;\n margin: 1rem 0rem;\n }\n\n ul {\n margin-top: 1rem;\n }\n\n h1 {\n font-family: "PixelGridM";\n letter-spacing: 0.03rem;\n font-size: 28px;\n }\n\n h2 {\n font-size: 22px;\n font-family: "PixelGridS";\n letter-spacing: 0.03rem;\n\n span {\n color: ',' !important;\n }\n }\n\n h3 {\n font-size: 20px;\n font-family: "PixelGridS";\n letter-spacing: 0.03rem;\n\n span {\n color: '," !important;\n }\n }\n\n pre {\n font-family: monospace;\n background-color: ",";\n border-radius: 5px;\n position: relative;\n padding: 8px 10px;\n white-space: pre-wrap;\n color: ",";\n word-break: break-word;\n margin: 5px 0px;\n font-size: 14px;\n\n code {\n display: block;\n font-family: monospace;\n font-size: inherit;\n padding: 1rem 2rem;\n\n .hljs-keyword,\n .hljs-type,\n .hljs-built_in {\n color: #ff7b72 !important;\n }\n }\n }\n word-break: break-word;\n\n .backtick-code-block,\n code {\n background-color: ",";\n color: "," !important;\n padding: 4px 6px 4px 6px;\n border-radius: 5px;\n font-size: 14px;\n font-family: monospace;\n }\n }\n\n table {\n padding: 0px !important;\n width: fit-content;\n /* box-shadow: 10px 7px 5px\n ","; */\n background-color: ",";\n overflow: ",";\n\n table {\n margin: ",";\n }\n\n th {\n text-align: center;\n margin: 10px;\n background-color: ",';\n font-family: "Work Sans", sans-serif;\n border: 2px solid\n ',";\n font-size: 17px;\n padding: 10px;\n /* border-top-right-radius: 7px;\n border-top-left-radius: 7px; */\n min-width: fit-content;\n color: ",' !important;\n line-height: 26px;\n }\n\n td {\n color: #212529;\n font-family: "Work Sans", sans-serif;\n font-size: 17px;\n font-style: normal;\n font-weight: 400;\n line-height: 26px;\n border: 2px solid #212529;\n border: 2px solid\n ',";\n padding: 7px;\n padding-left: 10px;\n color: "," !important;\n }\n }\n }\n\n .absolute-search {\n position: fixed;\n height: 150px;\n bottom: 0px;\n width: 100%;\n display: flex;\n justify-content: center;
1\n align-items: center;\n background-color: ",";\n\n "," {\n padding: 0rem 1rem;\n }\n "," {\n padding: 0rem;\n }\n }\n"]);return AskOutput_templateObject=function(){return n},n}t(48031);let y=i.default.div.withConfig({componentId:"sc-6103dcc-0"})(AskOutput_templateObject(),n=>{let{theme:e}=n;return e.colors.text.primary},n=>{let{theme:e}=n;return e.breakpoints.xs},n=>{let{theme:e}=n;return e.breakpoints.sm},n=>{let{theme:e}=n;return e.colors.text.primary},n=>n.theme.colors.hyperLink,n=>n.theme.colors.hyperLink,n=>{let{theme:e}=n;return e.colors.background.grey.secondary},n=>{let{theme:e}=n;return e.colors.text.tertiary},n=>{let{theme:e}=n;return e.colors.background.grey.secondary},n=>{let{theme:e}=n;return e.colors.text.tertiary},n=>"light"===n.theme.mode?"#b8b8b8":"#0F1524",n=>"light"===n.theme.mode?"":"#1D2332",n=>"light"===n.theme.mode?"":"hidden",n=>"light"===n.theme.mode?"-4px !important":"0px !importnat",n=>"light"===n.theme.mode?"#f9f5fe":"#52A5FF",n=>"light"===n.theme.mode?"black":"#244B71",n=>n.theme.colors.text1,n=>"light"===n.theme.mode?"#212529":"#244C73",n=>n.theme.colors.text1,n=>{let{theme:e}=n;return e.colors.background.grey.primary},n=>{let{theme:e}=n;return e.breakpoints.xs},n=>{let{theme:e}=n;return e.breakpoints.sm});var ask_AskOutput=function(n){let{response:e,setInput:t,input:r,handleSubmit:i}=n,[o,s]=(0,u.useState)(!1);return(0,a.jsxs)(y,{children:[(0,a.jsxs)("div",{className:"content-container",children:[(0,a.jsx)(m.Z,{text:"Heres what I found for you!",typingSpeed:15,setAction:()=>s(!0)}),(0,a.jsx)("div",{className:"markdown",style:{opacity:o?"1":"0"},children:(0,a.jsx)(f.UG,{rehypePlugins:[g.Z],components:{h1:n=>{let{children:e}=n;return(0,a.jsx)("h1",{children:e})},h2:n=>{let{children:e}=n;return(0,a.jsxs)("h2",{children:[(0,a.jsx)("span",{children:"#"})," ",e]})}},children:e})})]}),(0,a.jsx)("div",{className:"absolute-search",children:(0,a.jsx)(ask_AskSearchArea,{setInput:t,input:r,handleSubmit:i,removeCopyies:!0})})]})},b=t(41514);function ask_templateObject(){let n=(0,r._)(["\n min-height: 100vh;\n height: fit-content;\n background-color: ",';\n font-family: "Mulish", sans-serif;\n padding-bottom: 5rem;\n padding: 0px 1rem;\n padding-top: 3.9rem;\n\n display: flex;\n justify-content: center;\n\n .initial-search {\n display: flex;\n align-items: center;\n max-width: calc(100% - 16px);\n overflow: hidden;\n }\n']);return ask_templateObject=function(){return n},n}let w=i.default.div.withConfig({componentId:"sc-43298c2c-0"})(ask_templateObject(),n=>{let{theme:e}=n;return e.colors.background.grey.primary});var ask=function(){let[n,e]=(0,u.useState)(""),[t,r]=(0,u.useState)(""),[i,s]=(0,u.useState)([]),[l,c]=(0,u.useState)(!1),[d,p]=(0,u.useState)(!1);async function handleSubmit(a){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;a.preventDefault(),r(""),e(""),l||c(!0);let d=null===o?n:o,h=[...i,{role:"user",content:d}];s(h);try{(0,b.C3)({eventName:"infinite_course_ai",properties:{message:d}})}catch(n){}let m=await fetch("/api/infiniteCourse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:d,type:"search"})}),u=m.body.getReader(),x=new TextDecoder;for(;;){let{done:n,value:t}=await u.read();if(p(n),window.scrollTo({left:0,top:document.body.scrollHeight+100,behavior:"smooth"}),n){e("");break}r(n=>n+x.decode(t,{stream:!0}))}s([...h,{role:"assistant",content:t}])}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.Z,{}),(0,a.jsxs)(w,{children:[!l&&(0,a.jsx)("div",{className:"initial-search",children:(0,a.jsx)(ask_AskSearchArea,{setInput:e,input:n,handleSubmit:handleSubmit})}),t&&(0,a.jsx)(ask_AskOutput,{response:t,setInput:e,input:n,handleSubmit:handleSubmit})]})]})}},48031:function(){}},function(n){n.O(0,[1272,8700,4153,1622,9280,286,1226,5024,155,2075,9428,9774,2888,179],function(){return n(n.s=10867)}),_N_E=n.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.