PageSourceSearch

https://www.sheldonbarnes.com/_next/static/chunks/0auy.iagow2dh.js?dpl=dpl_FGuhecCtS1kvFNaEDSi1BrK61Cjh

js sheldonbarnes.com collected 2026-10-09 22:57:00 UTC 4,815 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,56194,e=>{"use strict";var t=e.i(18050),s=e.i(71645),r=e.i(46932),a=e.i(88653);e.s(["default",0,function(){let[e,o]=(0,s.useState)(!1),[l,n]=(0,s.useState)([{role:"assistant",content:"Hi! I'm Sheldon's AI assistant. Ask me anything about his background, books, frameworks, or what he's looking for in his next role."}]),[i,d]=(0,s.useState)(""),[c,u]=(0,s.useState)(!1),h=(0,s.useRef)(null),m=(0,s.useRef)(null);(0,s.useEffect)(()=>{h.current?.scrollIntoView({behavior:"smooth"})},[l]),(0,s.useEffect)(()=>{e&&m.current?.focus()},[e]);let x=async()=>{let e=i.trim();if(!e||c)return;let t={role:"user",content:e};n(e=>[...e,t]),d(""),u(!0);try{let e=await fetch("/api/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[...l,t].map(e=>({role:e.role,content:e.content}))})});if(!e.ok)throw Error("Failed to get response");let s=await e.json();n(e=>[...e,{role:"assistant",content:s.response}])}catch{n(e=>[...e,{role:"assistant",content:"Sorry, I'm having trouble connecting right now. Please try again later, or reach out to Sheldon directly via the contact section."}])}finally{u(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.motion.button,{onClick:()=>o(!e),className:"fixed bottom-6 right-6 z-50 w-14 h-14 rounded-full bg-primary text-background flex items-center justify-center shadow-lg hover:bg-primary-light transition-colors glow-orange",whileHover:{scale:1.1},whileTap:{scale:.95},"aria-label":"Toggle chat",children:e?(0,t.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,t.jsx)("path",{d:"M6 18L18 6M6 6l12 12"})}):(0,t.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,t.jsx)("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})})}),(0,t.jsx)(a.AnimatePresence,{children:e&&(0,t.jsxs)(r.motion.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},transition:{duration:.2},className:"fixed bottom-24 right-6 z-50 w-[380px] max-w-[calc(100vw-3rem)] h-[500px] max-h-[70vh] rounded-2xl bg-background border border-surface-light shadow-2xl flex flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-4 border-b border-surface-light bg-surface flex items-center gap-3",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-full bg-primary/20 flex items-center justify-center",children:(0,t.jsx)("span",{className:"text-primary text-sm font-bold",children:"SB"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-semibold",children:"Ask Sheldon's AI"}),(0,t.jsx)("p",{className:"text-xs text-muted",children:"Powered by Claude"})]}),(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-green-500 inline-block"})})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[l.map((e,s)=>(0,t.jsx)("div",{className:`flex ${"user"===e.role?"justify-end":"justify-start"}`,children:(0,t.jsx)("div",{className:`max-w-[85%] px-4 py-2.5 rounded-2xl text-sm leading-relaxed ${"user"===e.role?"bg-primary text-background rounded-br-md":"bg-surface text-foreground rounded-bl-md"}`,children:e.content})},s)),c&&(0,t.jsx)("div",{className:"flex justify-start",children:(0,t.jsx)("div",{className:"bg-surface px-4 py-3 rounded-2xl rounded-bl-md",children:(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-muted animate-bounce",style:{animationDelay:"0ms"}}),(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-muted animate-bounce",style:{animationDelay:"150ms"}}),(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-muted animate-bounce",style:{animationDelay:"300ms"}})]})})}),(0,t.jsx)("div",{ref:h})]}),(0,t.jsx)("div",{className:"p-3 border-t border-surface-light",children:(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),x()},className:"flex gap-2",children:[(0,t.jsx)("input",{ref:m,type:"text",value:i,onChange:e=>d(e.target.value),placeholder:"Ask about Sheldon or his books...",className:"flex-1 px-4 py-2.5 rounded-xl bg-surface border border-surface-light text-foreground text-sm placeholder:text-muted focus:outline-none focus:border-primary transition-colors",disabled:c}),(0,t.jsx)("button",{type:"submit",disabled:c||!i.trim(),className:"px-4 py-2.5 rounded-xl bg-primary text-background text-sm font-semibold disabled:opacity-50 hover:bg-primary-light transition-colors",children:(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,t.jsx)("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4z"})})})]})})]})})]})}])}]);

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.