1"use strict";(self.webpackChunkreact_saas_template=self.webpackChunkreact_saas_template||[]).push([[757],{60757:(e,t,o)=>{o.r(t),o.d(t,{default:()=>He});var n=o(89379),s=o(57528),a=o(65043),i=o(93222),r=o(96446),l=o(72949),c=o(85865),d=o(18483),x=o(17392),p=o(67784),h=o(19252),g=o(75678),m=o(53753),f=o(19280),u=o(25007),k=o(48625),b=o(42841),y=o(89611),A=o(83290),j=o(40854),S=o.n(j),w=o(58991),R=o(92686),v=o(688),T=o(32143),C=o(60295),z=o(74802),F=o(22505),W=o(98082),D=o(54977),I=o(57235),_=o(17022),M=o(10697),P=o(70579);function B(e){if(!e)return"";const t=new Date(e).getTime();if(!Number.isFinite(t))return"";const o=Date.now()-t,n=6e4,s=60*n,a=24*s;return o<2*n?"just now":o<s?"".concat(Math.round(o/n),"m"):o<a?"".concat(Math.round(o/s),"h"):o<2*a?"yesterday":o<7*a?"".concat(Math.round(o/a),"d"):new Date(e).toLocaleDateString("en-GB",{month:"short",day:"numeric"})}const H=e=>{let{thread:t,active:o,onSelect:n,onRename:s,onTogglePin:i,onDelete:d}=e;const[h,g]=(0,a.useState)(null),[m,f]=(0,a.useState)(!1),[u,k]=(0,a.useState)(t.title||""),b=(0,a.useRef)(null);(0,a.useEffect)((()=>{m&&setTimeout((()=>{b.current&&b.current.focus()}),0)}),[m]);const y=()=>g(null),A=()=>{const e=u.trim();f(!1),e&&e!==t.title?s(t.sessionId,e):k(t.title||"")};return(0,P.jsxs)(r.A,{sx:{position:"relative",borderBottom:"1px solid ".concat(w.tokens.colorRoles.light.border),bgcolor:o?w.tokens.colorRoles.light.brandSubtle:"transparent",transition:"background-color 140ms ".concat(w.tokens.easing.standard),"&:hover":{bgcolor:o?w.tokens.colorRoles.light.brandSubtle:w.tokens.colorRoles.light.surfaceMuted},"&:hover .threadRowMenu":{opacity:1},"&::before":o?{content:'""',position:"absolute",top:8,bottom:8,left:0,width:3,borderRadius:"0 ".concat(w.tokens.radius.pill,"px ").concat(w.tokens.radius.pill,"px 0"),backgroundColor:w.tokens.palette.brand[500]}:void 0},children:[(0,P.jsxs)(l.A,{onClick:()=>!m&&n(t.sessionId),focusRipple:!0,disabled:m,sx:{display:"block",width:"100%",textAlign:"left",padding:"".concat(w.tokens.space[3],"px ").concat(w.tokens.space[4],"px"),paddingRight:"".concat(w.tokens.space[8],"px")},children:[(0,P.jsxs)(r.A,{sx:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"".concat(w.tokens.space[2],"px"),marginBottom:"2px"},children:[m?(0,P.jsx)(p.A,{inputRef:b,value:u,onChange:e=>k(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),A()):"Escape"===e.key&&(e.preventDefault(),k(t.title||""),f(!1))},onBlur:A,onClick:e=>e.stopPropagation(),variant:"standard",fullWidth:!0,InputProps:{disableUnderline:!1,sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.sm,fontWeight:w.tokens.fontWeight.semibold,color:w.tokens.colorRoles.light.textPrimary}}}):(0,P.jsxs)(c.A,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:"6px",fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.sm,fontWeight:w.tokens.fontWeight.semibold,color:o?w.tokens.palette.brand[700]:w.tokens.colorRoles.light.textPrimary,letterSpacing:"-0.005em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0,flex:1},children:[t.pinned&&(0,P.jsx)(D.A,{sx:{fontSize:12,color:w.tokens.palette.brand[500],transform:"rotate(35deg)",flexShrink:0}}),t.title||"Untitled"]}),!m&&(0,P.jsx)(c.A,{component:"span",sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.xs,color:w.tokens.colorRoles.light.textSecondary,flexShrink:0},children:B(t.updatedAt)})]}),!m&&t.lastMessagePreview&&(0,P.jsx)(c.A,{component:"span",sx:{display:"block",fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.xs,color:w.tokens.colorRoles.light.textSecondary,lineHeight:1.4,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.lastMessagePreview})]}),(0,P.jsx)(x.A,{className:"threadRowMenu",size:"small",onClick:e=>{e.stopPropagation(),g(e.currentTarget)},"aria-label":"Thread actions",sx:{position:"absolute",top:8,right:6,opacity:0,transition:"opacity 140ms ".concat(w.tokens.easing.standard),color:w.tokens.colorRoles.light.textSecondary,"@media (hover: none)":{opacity:1}},children:(0,P.jsx)(W.A,{sx:{fontSize:18}})}),(0,P.jsxs)(v.A,{anchorEl:h,open:!!h,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[(0,P.jsxs)(T.A,{dense:!0,onClick:()=>{y(),f(!0)},children:[(0,P.jsx)(_.A,{sx:{fontSize:16,mr:1,color:w.tokens.colorRoles.light.textSecondary}}),"Rename"]}),(0,P.jsxs)(T.A,{dense:!0,onClick:()=>{y(),i(t.sessionId,!t.pinned)},children:[t.pinned?(0,P.jsx)(I.A,{sx:{fontSize:16,mr:1,color:w.tokens.colorRoles.light.textSecondary}}):(0,P.jsx)(D.A,{sx:{fontSize:16,mr:1,color:w.tokens.colorRoles.light.textSecondary,transform:"rotate(35deg)"}}),t.pinned?"Unpin":"Pin"]}),(0,P.jsxs)(T.A,{dense:!0,onClick:()=>{y(),d(t.sessionId)},sx:{color:"#C53030"},children:[(0,P.jsx)(M.A,{sx:{fontSize:16,mr:1,color:"#C53030"}}),"Delete"]})]})]})},E=e=>{let{onNewThread:t,onCloseMobile:o}=e;return(0,P.jsxs)(r.A,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"".concat(w.tokens.space[2],"px"),padding:"".concat(w.tokens.space[4],"px ").concat(w.tokens.space[4],"px ").concat(w.tokens.space[3],"px"),borderBottom:"1px solid ".concat(w.tokens.colorRoles.light.border)},children:[(0,P.jsx)(r.A,{component:"img",src:"/images/hugo-wordmark.svg",alt:"Hugo",sx:{height:22,width:"auto"}}),(0,P.jsxs)(r.A,{sx:{display:"flex",alignItems:"center",gap:"".concat(w.tokens.space[1],"px")},children:[(0,P.jsxs)(l.A,{onClick:t,focusRipple:!0,sx:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"6px ".concat(w.tokens.space[3],"px"),borderRadius:"".concat(w.tokens.radius.pill,"px"),fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.xs,fontWeight:w.tokens.fontWeight.semibold,letterSpacing:"-0.005em",color:w.tokens.colorRoles.light.textPrimary,bgcolor:"transparent",border:"1px solid ".concat(w.tokens.colorRoles.light.border),transition:"background-color 140ms ".concat(w.tokens.easing.standard,", color 140ms ").concat(w.tokens.easing.standard,", border-color 140ms ").concat(w.tokens.easing.standard),"&:hover":{bgcolor:w.tokens.colorRoles.light.brandSubtle,color:w.tokens.palette.brand[700],borderColor:w.tokens.palette.brand[300]||w.tokens.palette.brand[400]}},children:[(0,P.jsx)(F.A,{sx:{fontSize:14}}),"New"]}),o&&(0,P.jsx)(x.A,{size:"small",onClick:o,"aria-label":"Close threads",sx:{color:w.tokens.colorRoles.light.textSecondary},children:(0,P.jsx)(z.A,{sx:{fontSize:18}})})]})]})},O=e=>{let{threads:t,loading:o,activeSessionId:n,onSelect:s,onRename:a,onTogglePin:i,onDelete:l}=e;
1return o&&0===t.length?(0,P.jsx)(r.A,{sx:{padding:"".concat(w.tokens.space[4],"px")},children:[0,1,2].map((e=>(0,P.jsx)(r.A,{sx:{height:32,borderRadius:"".concat(w.tokens.radius.sm||6,"px"),bgcolor:w.tokens.colorRoles.light.surfaceMuted,marginBottom:"".concat(w.tokens.space[2],"px"),opacity:.6}},e)))}):o||0!==t.length?(0,P.jsx)(r.A,{sx:{overflowY:"auto",flex:1},children:t.map((e=>(0,P.jsx)(H,{thread:e,active:e.sessionId===n,onSelect:s,onRename:a,onTogglePin:i,onDelete:l},e.sessionId)))}):(0,P.jsx)(r.A,{sx:{padding:"".concat(w.tokens.space[6],"px ").concat(w.tokens.space[4],"px")},children:(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.serif,fontStyle:"italic",fontSize:w.tokens.fontSize.sm,color:w.tokens.colorRoles.light.textSecondary,lineHeight:1.45},children:"No conversations yet \u2014 start one."})})},N=e=>{let{threads:t,loading:o,activeSessionId:n,onSelect:s,onNewThread:a,onCloseMobile:i,onRename:l,onTogglePin:c,onDelete:d}=e;return(0,P.jsxs)(r.A,{sx:{display:"flex",flexDirection:"column",width:268,maxWidth:"100vw",height:"100vh",bgcolor:w.tokens.colorRoles.light.surface,borderRight:"1px solid ".concat(w.tokens.colorRoles.light.border)},children:[(0,P.jsx)(E,{onNewThread:a,onCloseMobile:i}),(0,P.jsx)(O,{threads:t,loading:o,activeSessionId:n,onSelect:s,onRename:l,onTogglePin:c,onDelete:d})]})},U=e=>{let{activeSessionId:t,onSelect:o,onNewThread:s,refreshKey:i,mobileOpen:r,onMobileClose:l}=e;const[c,d]=(0,a.useState)([]),[x,p]=(0,a.useState)(!0),h=(0,a.useCallback)((async()=>{p(!0);try{var e;const t=await S().get("/api/chatbot/hugo/threads");d(Array.isArray(null===(e=t.data)||void 0===e?void 0:e.threads)?t.data.threads:[])}catch(t){}finally{p(!1)}}),[]);(0,a.useEffect)((()=>{h()}),[h,i]);const g=(0,a.useCallback)((async(e,t)=>{const o=c;d((o=>o.map((o=>o.sessionId===e?(0,n.A)((0,n.A)({},o),{},{title:t}):o))));try{await S().patch("/api/chatbot/hugo/threads/".concat(encodeURIComponent(e)),{customTitle:t})}catch(s){console.warn("rename thread failed:",(null===s||void 0===s?void 0:s.message)||s),d(o)}}),[c]),m=(0,a.useCallback)((async(e,t)=>{const o=c;d((o=>o.map((o=>o.sessionId===e?(0,n.A)((0,n.A)({},o),{},{pinned:t}):o)).sort(((e,t)=>e.pinned&&!t.pinned?-1:!e.pinned&&t.pinned?1:new Date(t.updatedAt)-new Date(e.updatedAt)))));try{await S().patch("/api/chatbot/hugo/threads/".concat(encodeURIComponent(e)),{pinned:t})}catch(s){console.warn("pin thread failed:",(null===s||void 0===s?void 0:s.message)||s),d(o)}}),[c]),f=(0,a.useCallback)((async e=>{if("undefined"!==typeof window&&!window.confirm("Delete this thread?"))return;const t=c;d((t=>t.filter((t=>t.sessionId!==e))));try{await S().delete("/api/chatbot/hugo/threads/".concat(encodeURIComponent(e)))}catch(o){console.warn("delete thread failed:",(null===o||void 0===o?void 0:o.message)||o),d(t)}}),[c]);return(0,P.jsx)(C.Ay,{anchor:"left",open:!!r,onClose:l,sx:{"& .MuiDrawer-paper":{border:"none",bgcolor:"transparent",boxShadow:"0 20px 40px -16px rgba(15, 12, 26, 0.18)"}},children:(0,P.jsx)(N,{threads:c,loading:x,activeSessionId:t,onSelect:e=>{o(e),l&&l()},onNewThread:()=>{s(),l&&l()},onCloseMobile:l,onRename:g,onTogglePin:m,onDelete:f})})};var L=o(30279),V=o(54536),Y=o(24914);const q={width:"100%",padding:"".concat(w.tokens.space[4],"px ").concat(w.tokens.space[5],"px"),borderRadius:"".concat(w.tokens.radius.lg,"px"),bgcolor:w.tokens.colorRoles.light.surface,border:"1px solid ".concat(w.tokens.colorRoles.light.border),textAlign:"left"},G={fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.base,fontWeight:w.tokens.fontWeight.semibold,letterSpacing:"-0.012em",color:w.tokens.colorRoles.light.textPrimary,lineHeight:1.25},K={fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.sm,fontWeight:w.tokens.fontWeight.regular,color:w.tokens.colorRoles.light.textTertiary,marginTop:"2px"},J={fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.sm,lineHeight:1.55,color:w.tokens.colorRoles.light.textPrimary,whiteSpace:"pre-wrap"},Q={fontFamily:w.tokens.fontFamily.sans,fontSize:"10px",fontWeight:w.tokens.fontWeight.semibold,letterSpacing:"0.1em",textTransform:"uppercase",color:w.tokens.colorRoles.light.textTertiary},$={borderTop:"1px solid ".concat(w.tokens.colorRoles.light.border)},X="".concat(w.tokens.space[3],"px");function Z(e){let{title:t,subtitle:o,right:n}=e;return(0,P.jsxs)(r.A,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"".concat(w.tokens.space[3],"px"),marginBottom:"".concat(o?w.tokens.space[3]:w.tokens.space[2],"px")},children:[(0,P.jsxs)(r.A,{sx:{flex:1,minWidth:0},children:[(0,P.jsx)(c.A,{sx:G,children:t}),o&&(0,P.jsx)(c.A,{sx:K,children:o})]}),n]})}function ee(e){let{getText:t,label:o="Copy"}=e;const[n,s]=(0,a.useState)(!1);return(0,P.jsxs)(l.A,{onClick:async()=>{try{await navigator.clipboard.writeText(t()),s(!0),setTimeout((()=>s(!1)),1500)}catch(e){}},sx:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"4px 8px",borderRadius:"".concat(w.tokens.radius.sm,"px"),fontFamily:w.tokens.fontFamily.sans,fontSize:"11px",fontWeight:w.tokens.fontWeight.semibold,color:w.tokens.colorRoles.light.textSecondary,border:"1px solid ".concat(w.tokens.colorRoles.light.border),bgcolor:w.tokens.colorRoles.light.surfaceMuted,"&:hover":{color:w.tokens.palette.brand[600]}},children:[(0,P.jsx)(Y.A,{sx:{fontSize:12}}),n?"Copied":o]})}
1function te(e){let{summary:t,detail:o,defaultOpen:s=!1}=e;const[i,d]=(0,a.useState)(s);return(0,P.jsxs)(r.A,{sx:{borderRadius:"".concat(w.tokens.radius.md,"px"),border:"1px solid ".concat(w.tokens.colorRoles.light.border),bgcolor:w.tokens.colorRoles.light.surfaceMuted},children:[(0,P.jsxs)(l.A,{onClick:()=>d((e=>!e)),sx:{width:"100%",padding:"".concat(w.tokens.space[3],"px ").concat(w.tokens.space[4],"px"),textAlign:"left",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"".concat(w.tokens.space[2],"px")},children:[(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{fontWeight:w.tokens.fontWeight.semibold,flex:1}),children:t}),(0,P.jsx)(V.A,{sx:{fontSize:18,color:w.tokens.colorRoles.light.textSecondary,transform:i?"rotate(180deg)":"rotate(0deg)",transition:"transform 160ms ".concat(w.tokens.easing.standard)}})]}),(0,P.jsx)(L.A,{in:i,children:(0,P.jsx)(r.A,{sx:{padding:"0 ".concat(w.tokens.space[4],"px ").concat(w.tokens.space[4],"px")},children:o})})]})}function oe(e){let{label:t,score:o}=e;const n=o>=8?w.tokens.palette.brand[600]:o>=5?w.tokens.colorRoles.light.textSecondary:"#c0392b";return(0,P.jsxs)(r.A,{sx:{display:"inline-flex",alignItems:"baseline",gap:"6px",padding:"4px 10px",borderRadius:"".concat(w.tokens.radius.pill,"px"),bgcolor:w.tokens.colorRoles.light.surfaceMuted,border:"1px solid ".concat(w.tokens.colorRoles.light.border)},children:[(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:"11px",color:w.tokens.colorRoles.light.textTertiary,textTransform:"uppercase",letterSpacing:"0.08em"},children:t}),(0,P.jsxs)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.base,fontWeight:w.tokens.fontWeight.semibold,color:n},children:[o,(0,P.jsx)(r.A,{component:"span",sx:{opacity:.5,fontSize:"11px",marginLeft:"2px"},children:"/10"})]})]})}function ne(e){let{p:t}=e;return(0,P.jsxs)(r.A,{sx:q,children:[(0,P.jsx)(Z,{title:t.title||"".concat((t.answers||[]).length," drafted answers"),subtitle:t.subtitle}),(0,P.jsx)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"".concat(w.tokens.space[2],"px")},children:(t.answers||[]).map(((e,t)=>(0,P.jsx)(te,{defaultOpen:0===t,summary:e.question,detail:(0,P.jsxs)(r.A,{sx:{display:"flex",flexDirection:"column",gap:X,paddingTop:X},children:[(0,P.jsx)(c.A,{sx:J,children:e.draft}),Array.isArray(e.cv_evidence)&&e.cv_evidence.length>0&&(0,P.jsxs)(r.A,{sx:(0,n.A)((0,n.A)({},$),{},{paddingTop:X}),children:[(0,P.jsx)(c.A,{sx:Q,children:"Drawn from your CV"}),(0,P.jsx)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"4px",marginTop:"6px"},children:e.cv_evidence.map(((e,t)=>(0,P.jsxs)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{color:w.tokens.colorRoles.light.textSecondary}),children:["\xb7 ",e]},t)))})]}),e.notes&&(0,P.jsxs)(r.A,{sx:(0,n.A)((0,n.A)({},$),{},{paddingTop:X}),children:[(0,P.jsx)(c.A,{sx:Q,children:"Sharpen before submitting"}),(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{color:w.tokens.colorRoles.light.textSecondary,marginTop:"4px"}),children:e.notes})]}),(0,P.jsx)(r.A,{sx:{display:"flex",justifyContent:"flex-end",paddingTop:"2px"},children:(0,P.jsx)(ee,{getText:()=>e.draft,label:"Copy answer"})})]})},t)))})]})}function se(e){let{p:t}=e;const o=t.scores||{};return(0,P.jsxs)(r.A,{sx:q,children:[(0,P.jsx)(Z,{title:t.title||"Graded \xb7 ".concat(t.overall,"/10"),subtitle:t.subtitle}),(0,P.jsx)(r.A,{sx:{display:"flex",flexWrap:"wrap",gap:"8px"},children:["clarity","structure","specificity","judgement"].map((e=>{var t,n;return(0,P.jsx)(oe,{label:e,score:null!==(t=null===(n=o[e])||void 0===n?void 0:n.score)&&void 0!==t?t:"\u2014"},e)}))}),(0,P.jsx)(r.A,{sx:(0,n.A)((0,n.A)({},$),{},{marginTop:X,paddingTop:X,display:"flex",flexDirection:"column",gap:"6px"}),children:["clarity","structure","specificity","judgement"].map((e=>{var t;return null!==(t=o[e])&&void 0!==t&&t.reason?(0,P.jsxs)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{color:w.tokens.colorRoles.light.textSecondary}),children:[(0,P.jsxs)(r.A,{component:"span",sx:{fontWeight:w.tokens.fontWeight.semibold,color:w.tokens.colorRoles.light.textPrimary},children:[e,":"]})," ",o[e].reason]},e):null}))}),t.weakest_line&&(0,P.jsxs)(r.A,{sx:(0,n.A)((0,n.A)({},$),{},{marginTop:X,paddingTop:X}),children:[(0,P.jsx)(c.A,{sx:Q,children:"Weakest line"}),(0,P.jsxs)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{fontStyle:"italic",marginTop:"4px"}),children:['"',t.weakest_line,'"']}),t.why_weak&&(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{color:w.tokens.colorRoles.light.textSecondary,marginTop:"4px"}),children:t.why_weak}),t.rewrite&&(0,P.jsxs)(r.A,{sx:{marginTop:X},children:[(0,P.jsx)(c.A,{sx:Q,children:"Rewrite"}),(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{marginTop:"4px"}),children:t.rewrite})]})]})]})}function ae(e){let{p:t}=e;return(0,P.jsxs)(r.A,{sx:q,children:[(0,P.jsx)(Z,{title:t.title||"Three rewrites",subtitle:t.original?'Original: "'.concat((t.original||"").slice(0,80),'\u2026"'):void 0}),(0,P.jsx)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"".concat(w.tokens.space[3],"px")}
1,children:(t.variants||[]).map(((e,t)=>(0,P.jsxs)(r.A,{sx:{padding:"".concat(w.tokens.space[3],"px ").concat(w.tokens.space[4],"px"),borderRadius:"".concat(w.tokens.radius.md,"px"),border:"1px solid ".concat(w.tokens.colorRoles.light.border),bgcolor:w.tokens.colorRoles.light.surfaceMuted},children:[(0,P.jsxs)(r.A,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"6px"},children:[(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},Q),{},{color:w.tokens.palette.brand[600]}),children:e.label}),(0,P.jsx)(ee,{getText:()=>e.text})]}),(0,P.jsx)(c.A,{sx:J,children:e.text}),e.use_when&&(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{color:w.tokens.colorRoles.light.textTertiary,marginTop:"6px",fontStyle:"italic"}),children:e.use_when})]},t)))})]})}function ie(e){let{p:t}=e;return(0,P.jsxs)(r.A,{sx:q,children:[(0,P.jsx)(Z,{title:t.title||"CV vs JD",subtitle:t.subtitle}),(0,P.jsxs)(r.A,{sx:{display:"flex",flexDirection:"column",gap:X},children:[Array.isArray(t.strengths)&&t.strengths.length>0&&(0,P.jsxs)(r.A,{children:[(0,P.jsx)(c.A,{sx:Q,children:"Lean on"}),t.strengths.map(((e,t)=>(0,P.jsxs)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"2px",marginTop:0===t?"6px":"10px"},children:[(0,P.jsxs)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{fontWeight:w.tokens.fontWeight.semibold}),children:["\xb7 ",e.bullet]}),e.why_it_matches&&(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{color:w.tokens.colorRoles.light.textSecondary,paddingLeft:"12px"}),children:e.why_it_matches})]},t)))]}),Array.isArray(t.gaps)&&t.gaps.length>0&&(0,P.jsxs)(r.A,{sx:(0,n.A)((0,n.A)({},$),{},{paddingTop:X}),children:[(0,P.jsx)(c.A,{sx:Q,children:"Gaps to address"}),t.gaps.map(((e,t)=>(0,P.jsxs)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"2px",marginTop:0===t?"6px":"10px"},children:[(0,P.jsxs)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{fontWeight:w.tokens.fontWeight.semibold}),children:["\xb7 ",e.missing]}),e.how_to_address&&(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{color:w.tokens.colorRoles.light.textSecondary,paddingLeft:"12px"}),children:e.how_to_address})]},t)))]}),t.positioning_line&&(0,P.jsxs)(r.A,{sx:(0,n.A)((0,n.A)({},$),{},{paddingTop:X}),children:[(0,P.jsx)(c.A,{sx:Q,children:"Positioning"}),(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{marginTop:"6px"}),children:t.positioning_line})]})]})]})}function re(e){let{p:t}=e;return(0,P.jsxs)(r.A,{sx:q,children:[(0,P.jsx)(Z,{title:t.title||"Recent mocks"}),(0,P.jsx)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"".concat(w.tokens.space[2],"px")},children:(t.mocks||[]).map(((e,t)=>{var o,s;return(0,P.jsx)(te,{summary:"".concat((null===(o=e.question)||void 0===o?void 0:o.slice(0,90))||"Question"," \xb7 ").concat(null!==(s=e.overall)&&void 0!==s?s:"?","/10"),detail:(0,P.jsxs)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"6px",paddingTop:X},children:[(0,P.jsxs)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{color:w.tokens.colorRoles.light.textSecondary}),children:['Your answer (excerpt): "',(e.answer||"").slice(0,240),'\u2026"']}),e.feedback&&(0,P.jsxs)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{marginTop:"4px"}),children:[(0,P.jsx)(r.A,{component:"span",sx:{fontWeight:w.tokens.fontWeight.semibold},children:"Hugo's feedback: "}),e.feedback]})]})},t)}))})]})}function le(e){let{p:t}=e;const o=Object.keys(t.byStage||{});return(0,P.jsxs)(r.A,{sx:q,children:[(0,P.jsx)(Z,{title:t.title||"Tracker"}),(0,P.jsx)(r.A,{sx:{display:"flex",flexDirection:"column",gap:X},children:o.map((e=>(0,P.jsxs)(r.A,{children:[(0,P.jsx)(c.A,{sx:Q,children:e}),(0,P.jsx)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"4px",marginTop:"4px"},children:t.byStage[e].map(((e,t)=>(0,P.jsxs)(c.A,{sx:J,children:["\xb7 ",(0,P.jsx)("b",{children:e.company}),e.role?" \u2014 ".concat(e.role):"",e.nextDate?" \xb7 ".concat(new Date(e.nextDate).toLocaleDateString("en-GB")):""]},t)))})]},e)))})]})}function ce(e){let{p:t}=e;return(0,P.jsxs)(r.A,{sx:q,children:[(0,P.jsx)(Z,{title:t.title||"Saved jobs"}),(0,P.jsx)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"6px"},children:(t.jobs||[]).map(((e,t)=>(0,P.jsxs)(c.A,{sx:J,children:["\xb7 ",(0,P.jsx)("b",{children:e.company}),e.role?" \u2014 ".concat(e.role):"",e.location?" \xb7 ".concat(e.location):""]},t)))})]})}function de(e){let{p:t}=e;return(0,P.jsxs)(r.A,{sx:q,children:[(0,P.jsx)(Z,{title:t.title||"Prep plan",subtitle:t.summary}),(0,P.jsx)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"".concat(w.tokens.space[3],"px")}
1,children:(t.days||[]).map(((e,t)=>(0,P.jsxs)(r.A,{sx:{padding:"".concat(w.tokens.space[3],"px ").concat(w.tokens.space[4],"px"),borderRadius:"".concat(w.tokens.radius.md,"px"),border:"1px solid ".concat(w.tokens.colorRoles.light.border),bgcolor:w.tokens.colorRoles.light.surfaceMuted},children:[(0,P.jsxs)(r.A,{sx:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:"6px"},children:[(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},Q),{},{color:w.tokens.palette.brand[600]}),children:e.label}),(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{fontWeight:w.tokens.fontWeight.semibold}),children:e.theme})]}),(0,P.jsx)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:(e.steps||[]).map(((e,t)=>(0,P.jsxs)(c.A,{sx:J,children:["\xb7 ",(0,P.jsx)("b",{children:e.kind}),": ",e.what,e.why?" \u2014 ".concat(e.why):""]},t)))})]},t)))})]})}function xe(e){let{p:t}=e;return(0,P.jsxs)(r.A,{sx:q,children:[(0,P.jsx)(Z,{title:t.title||"Job post",subtitle:t.subtitle}),t.summary&&(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{marginTop:"6px"}),children:t.summary}),t.url&&(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{color:w.tokens.colorRoles.light.textTertiary,marginTop:"8px",fontSize:"11px"}),children:t.url})]})}function pe(e){let{p:t}=e;return(0,P.jsxs)(r.A,{sx:q,children:[(0,P.jsx)(Z,{title:t.title||"STAR story",right:(0,P.jsx)(ee,{getText:()=>"Situation: ".concat(t.situation,"\n\nTask: ").concat(t.task,"\n\nAction: ").concat(t.action,"\n\nResult: ").concat(t.result),label:"Copy all"})}),[["Situation",t.situation],["Task",t.task],["Action",t.action],["Result",t.result]].map((e=>{let[t,o]=e;return o?(0,P.jsxs)(r.A,{sx:{marginTop:X},children:[(0,P.jsx)(c.A,{sx:Q,children:t}),(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{marginTop:"4px"}),children:o})]},t):null})),t.deploys_well_for&&Array.isArray(t.deploys_well_for)&&t.deploys_well_for.length>0&&(0,P.jsxs)(r.A,{sx:(0,n.A)((0,n.A)({},$),{},{marginTop:X,paddingTop:X}),children:[(0,P.jsx)(c.A,{sx:Q,children:"Deploys well for"}),(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{color:w.tokens.colorRoles.light.textSecondary,marginTop:"4px"}),children:t.deploys_well_for.join(" \xb7 ")})]}),t.watch_for&&(0,P.jsxs)(r.A,{sx:{marginTop:X},children:[(0,P.jsx)(c.A,{sx:Q,children:"Watch for"}),(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{marginTop:"4px"}),children:t.watch_for})]})]})}function he(e){let{p:t}=e;return(0,P.jsxs)(r.A,{sx:q,children:[(0,P.jsx)(Z,{title:t.title||"Top 3 weaknesses",subtitle:t.headline}),(0,P.jsx)(r.A,{sx:{display:"flex",flexDirection:"column",gap:X},children:(t.weaknesses||[]).map(((e,t)=>(0,P.jsxs)(r.A,{sx:{padding:"".concat(w.tokens.space[3],"px ").concat(w.tokens.space[4],"px"),borderRadius:"".concat(w.tokens.radius.md,"px"),border:"1px solid ".concat(w.tokens.colorRoles.light.border),bgcolor:w.tokens.colorRoles.light.surfaceMuted},children:[(0,P.jsxs)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{fontWeight:w.tokens.fontWeight.semibold}),children:[t+1,". ",e.name]}),e.pattern&&(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{color:w.tokens.colorRoles.light.textSecondary,marginTop:"4px"}),children:e.pattern}),e.drill&&(0,P.jsxs)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{marginTop:"6px"}),children:[(0,P.jsx)(r.A,{component:"span",sx:{fontWeight:w.tokens.fontWeight.semibold},children:"Drill: "}),e.drill]})]},t)))})]})}function ge(e){let{p:t}=e;const o=[["Concise (60s spoken)",t.concise],["Detailed (written)",t.detailed],["Contrarian",t.contrarian]];return(0,P.jsxs)(r.A,{sx:q,children:[(0,P.jsx)(Z,{title:t.title||"Why this company"}),(0,P.jsx)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"".concat(w.tokens.space[3],"px")},children:o.map((e=>{let[t,o]=e;return null!==o&&void 0!==o&&o.text?(0,P.jsxs)(r.A,{sx:{padding:"".concat(w.tokens.space[3],"px ").concat(w.tokens.space[4],"px"),borderRadius:"".concat(w.tokens.radius.md,"px"),border:"1px solid ".concat(w.tokens.colorRoles.light.border),bgcolor:w.tokens.colorRoles.light.surfaceMuted},children:[(0,P.jsxs)(r.A,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"6px"},children:[(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},Q),{},{color:w.tokens.palette.brand[600]}),children:t}),(0,P.jsx)(ee,{getText:()=>o.text})]}),(0,P.jsx)(c.A,{sx:J,children:o.text}),o.use_when&&(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{color:w.tokens.colorRoles.light.textTertiary,marginTop:"6px",fontStyle:"italic"}),children:o.use_when})]},t):null}))})]})}function me(e){let{p:t}=e;return(0,P.jsxs)(r.A,{sx:q,children:[(0,P.jsx)(Z,{title:t.title||"Thank-you email",right:(0,P.jsx)(ee,{getText:()=>"Subject: ".concat(t.subject,"\n\n").concat(t.body),label:"Copy email"})}),t.subject&&(0,P.jsxs)(r.A,{sx:{marginTop:"6px"},children:[(0,P.jsx)(c.A,{sx:Q,children:"Subject"}),(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{marginTop:"4px",fontWeight:w.tokens.fontWeight.semibold}),children:t.subject})]}),t.body&&(0,P.jsxs)(r.A,{sx:(0,n.A)((0,n.A)({},$),{},{marginTop:X,paddingTop:X}),children:[(0,P.jsx)(c.A,{sx:Q,children:"Body"}),(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{marginTop:"4px"}),children:t.body})]})]})}function fe(e){let{p:t}=e;return(0,P.jsxs)(r.A,{sx:q,children:[(0,P.jsx)(Z,{title:t.title||"Story matches",subtitle:t.question?"For: ".concat(t.question.slice(0,100),"\u2026"):void 0}),(0,P.jsx)(r.A,{sx:{display:"flex",flexDirection:"column",gap:X},children:(t.matches||[]).map(((e,t)=>(0,P.jsxs)(r.A,{sx:{padding:"".concat(w.tokens.space[3],"px ").concat(w.tokens.space[4],"px"),borderRadius:"".concat(w.tokens.radius.md,"px"),border:"1px solid ".concat(w.tokens.colorRoles.light.border),bgcolor:w.tokens.colorRoles.light.surfaceMuted},children:[(0,P.jsxs)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{fontWeight:w.tokens.fontWeight.semibold}),children:[t+1,". ",e.experience]}),e.why_it_fits&&(0,P.jsx)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{color:w.tokens.colorRoles.light.textSecondary,marginTop:"4px"}),children:e.why_it_fits}),e.lead_with&&(0,P.jsxs)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{marginTop:"6px"}),children:[(0,P.jsx)(r.A,{component:"span",sx:{fontWeight:w.tokens.fontWeight.semibold},children:"Lead with: "}),e.lead_with]})]},t)))})]})}function ue(e){let{p:t}=e;return(0,P.jsxs)(r.A,{sx:q,children:[(0,P.jsx)(Z,{title:t.title||"Likely questions",subtitle:t.subtitle}),(0,P.jsx)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"".concat(w.tokens.space[2],"px")},children:(t.questions||[]).map(((e,t)=>(0,P.jsx)(te,{summary:"".concat(t+1,". ").concat(e.q),detail:(0,P.jsxs)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"4px",paddingTop:X},children:[e.why_asked&&(0,P.jsxs)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{color:w.tokens.colorRoles.light.textSecondary}),children:[(0,P.jsx)(r.A,{component:"span",sx:{fontWeight:w.tokens.fontWeight.semibold},children:"Why asked: "}),e.why_asked]}),e.what_theyre_testing&&(0,P.jsxs)(c.A,{sx:(0,n.A)((0,n.A)({},J),{},{color:w.tokens.colorRoles.light.textSecondary}),children:[(0,P.jsx)(r.A,{component:"span",sx:{fontWeight:w.tokens.fontWeight.semibold},children:"Testing: "}),e.what_theyre_testing]})]})},t)))})]})}function ke(e){let{payload:t}=e;if(!t)return null;switch(t.type){case"drafted_answers":return(0,P.jsx)(ne,{p:t});case"graded_answer":return(0,P.jsx)(se,{p:t});case"rewrite_variants":return(0,P.jsx)(ae,{p:t});case"cv_vs_jd":return(0,P.jsx)(ie,{p:t});
1case"recent_mocks":return(0,P.jsx)(re,{p:t});case"tracker_state":return(0,P.jsx)(le,{p:t});case"saved_jobs":return(0,P.jsx)(ce,{p:t});case"prep_plan":return(0,P.jsx)(de,{p:t});case"fetched_jd":return(0,P.jsx)(xe,{p:t});case"star_story":return(0,P.jsx)(pe,{p:t});case"weakness_audit":return(0,P.jsx)(he,{p:t});case"why_company":return(0,P.jsx)(ge,{p:t});case"thank_you_email":return(0,P.jsx)(me,{p:t});case"story_matches":return(0,P.jsx)(fe,{p:t});case"likely_questions":return(0,P.jsx)(ue,{p:t});default:return null}}var be,ye,Ae;const je=(0,A.i7)(be||(be=(0,s.A)(["\n 0% { transform: translateX(-100%); }\n 100% { transform: translateX(100%); }\n"]))),Se=(0,A.i7)(ye||(ye=(0,s.A)(["\n 0% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.4; transform: scale(0.85); }\n 100% { opacity: 1; transform: scale(1); }\n"]))),we=(0,A.i7)(Ae||(Ae=(0,s.A)(["\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n"]))),Re="undefined"!==typeof window?window.SpeechRecognition||window.webkitSpeechRecognition:null,ve=!!Re;let Te=null;function Ce(e){if(!e)return null;return String(e).replace(/(^|\n)\s*\*\*?\s*/g,"$1").replace(/\s*\*\*\s*(\n|$)/g,"$1").split(/(\*[^*\n]+\*)/g).map(((e,t)=>{if(e.startsWith("*")&&e.endsWith("*")&&e.length>2){const o=e.slice(1,-1);return o.length>40?(0,P.jsx)(a.Fragment,{children:o},t):(0,P.jsx)(r.A,{component:"span",sx:{fontFamily:w.tokens.fontFamily.serif,fontStyle:"italic",color:w.tokens.palette.brand[700]},children:o},t)}return(0,P.jsx)(a.Fragment,{children:e},t)}))}const ze=e=>{let{children:t}=e;return(0,P.jsx)(r.A,{component:"span",sx:{display:"inline-flex",alignItems:"center",padding:"2px ".concat(w.tokens.space[2],"px"),borderRadius:"".concat(w.tokens.radius.pill,"px"),bgcolor:w.tokens.colorRoles.light.brandSubtle,fontFamily:w.tokens.fontFamily.sans,fontSize:"11px",fontWeight:w.tokens.fontWeight.semibold,letterSpacing:"-0.005em",color:w.tokens.palette.brand[700],whiteSpace:"nowrap"},children:t})},Fe=e=>{let{payload:t,onNavigate:o}=e;const n=(s=t.logoDomain)?"https://img.logo.dev/".concat(encodeURIComponent(s),"?token=").concat("pk_BjbEHkgvTA222AhVVaecPQ","&format=png&size=64"):null;var s;const a=Array.isArray(t.meta)&&t.meta.length?t.meta:t.subtitle?String(t.subtitle).split(" \xb7 ").slice(0,4).filter(Boolean):[];return(0,P.jsxs)(l.A,{onClick:()=>o(t.route),focusRipple:!0,sx:{display:"block",textAlign:"left",width:"100%",padding:"".concat(w.tokens.space[4],"px ").concat(w.tokens.space[5],"px"),borderRadius:"".concat(w.tokens.radius.lg,"px"),bgcolor:w.tokens.colorRoles.light.surface,border:"1px solid ".concat(w.tokens.colorRoles.light.border),transition:"border-color 180ms ".concat(w.tokens.easing.standard,", transform 180ms ").concat(w.tokens.easing.standard,", box-shadow 180ms ").concat(w.tokens.easing.standard),"&:hover":{borderColor:w.tokens.palette.brand[400],transform:"translateY(-1px)",boxShadow:"0 12px 28px -16px ".concat(w.tokens.palette.brand[600],"55")},"&:hover .ctaOpen":{color:w.tokens.palette.brand[600]}},children:[(0,P.jsxs)(r.A,{sx:{display:"flex",alignItems:"flex-start",gap:"".concat(w.tokens.space[3],"px")},children:[n&&(0,P.jsx)(r.A,{component:"img",src:n,alt:"",sx:{width:40,height:40,borderRadius:"".concat(w.tokens.radius.md,"px"),objectFit:"contain",bgcolor:w.tokens.colorRoles.light.surfaceMuted,border:"1px solid ".concat(w.tokens.colorRoles.light.border),flexShrink:0},onError:e=>{e.currentTarget.style.display="none"}}),(0,P.jsxs)(r.A,{sx:{flex:1,minWidth:0},children:[(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.base,fontWeight:w.tokens.fontWeight.semibold,letterSpacing:"-0.012em",color:w.tokens.colorRoles.light.textPrimary,lineHeight:1.25},children:t.title}),t.tagline&&(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.serif,fontStyle:"italic",fontSize:w.tokens.fontSize.sm,color:w.tokens.colorRoles.light.textSecondary,lineHeight:1.4,marginTop:"2px"},children:t.tagline})]}
1),(0,P.jsxs)(r.A,{className:"ctaOpen",sx:{display:"inline-flex",alignItems:"center",gap:"4px",fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.xs,fontWeight:w.tokens.fontWeight.semibold,letterSpacing:"-0.005em",color:w.tokens.colorRoles.light.textSecondary,flexShrink:0,transition:"color 180ms ".concat(w.tokens.easing.standard)},children:[t.cta||"Open",(0,P.jsx)(b.A,{sx:{fontSize:14}})]})]}),a.length>0&&(0,P.jsx)(r.A,{sx:{display:"flex",flexWrap:"wrap",gap:"6px",marginTop:"".concat(w.tokens.space[3],"px"),paddingTop:"".concat(w.tokens.space[3],"px"),borderTop:"1px solid ".concat(w.tokens.colorRoles.light.border)},children:a.map(((e,t)=>(0,P.jsx)(ze,{children:e},t)))})]})},We=e=>{let{jobs:t,onNavigate:o}=e;return(0,P.jsx)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"".concat(w.tokens.space[2],"px")},children:t.map((e=>(0,P.jsx)(l.A,{onClick:()=>{e.slug?window.open("/c/jobs/".concat(encodeURIComponent(e.slug)),"_blank","noopener,noreferrer"):o("/c/job-search")},sx:{display:"flex",alignItems:"flex-start",gap:"".concat(w.tokens.space[3],"px"),padding:"".concat(w.tokens.space[3],"px ").concat(w.tokens.space[4],"px"),borderRadius:"".concat(w.tokens.radius.md,"px"),border:"1px solid ".concat(w.tokens.colorRoles.light.border),bgcolor:w.tokens.colorRoles.light.surface,textAlign:"left",transition:"border-color 160ms ".concat(w.tokens.easing.standard,", transform 160ms ").concat(w.tokens.easing.standard),"&:hover":{borderColor:w.tokens.palette.brand[400],transform:"translateY(-1px)"}},children:(0,P.jsxs)(r.A,{sx:{flexGrow:1,minWidth:0},children:[(0,P.jsxs)(r.A,{sx:{display:"flex",justifyContent:"space-between",gap:"".concat(w.tokens.space[2],"px")},children:[(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.sm,fontWeight:w.tokens.fontWeight.semibold,color:w.tokens.colorRoles.light.textPrimary},children:e.company}),e.salaryRange&&(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.mono,fontSize:w.tokens.fontSize.xs,color:w.tokens.palette.brand[700]},children:e.salaryRange})]}),(0,P.jsxs)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.xs,color:w.tokens.colorRoles.light.textSecondary,marginTop:"2px"},children:[e.jobTitle,e.location?" \xb7 ".concat(e.location):""]})]})},e.id)))})};function De(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";let o=t.getHours();const n=t.getMinutes(),s=o>=12?"pm":"am";return o=o%12||12,"".concat(o,":").concat(n.toString().padStart(2,"0")).concat(s)}const Ie=e=>{let{role:t,text:o,ts:n,attachments:s,onNavigate:i}=e;const l="hugo"===t,[p,h]=(0,a.useState)("idle");return(0,P.jsx)(r.A,{sx:{animation:"".concat(we," 240ms ").concat(w.tokens.easing.standard," both")},children:(0,P.jsxs)(r.A,{sx:{position:"relative",padding:"".concat(w.tokens.space[4],"px ").concat(w.tokens.space[5],"px"),borderRadius:"".concat(w.tokens.radius.lg,"px"),bgcolor:w.tokens.colorRoles.light.surface,border:"1px solid ".concat(w.tokens.colorRoles.light.border),"&::before":l?{content:'""',position:"absolute",top:12,bottom:12,left:-1,width:3,borderRadius:"0 ".concat(w.tokens.radius.pill,"px ").concat(w.tokens.radius.pill,"px 0"),backgroundColor:w.tokens.palette.brand[500]}:void 0},children:[(0,P.jsxs)(r.A,{sx:{display:"flex",alignItems:"center",gap:"".concat(w.tokens.space[2],"px"),marginBottom:"".concat(w.tokens.space[2],"px")},children:[(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:"11px",fontWeight:w.tokens.fontWeight.semibold,letterSpacing:"0.1em",textTransform:"uppercase",color:l?w.tokens.palette.brand[600]:w.tokens.colorRoles.light.textSecondary},children:l?"Hugo \xb7 Coach":"You"}),n&&(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.xs,color:w.tokens.colorRoles.light.textTertiary},children:De(n)}),l&&o&&(0,P.jsx)(d.A,{title:"playing"===p?"Stop":"Hear Hugo say this",children:(0,P.jsx)(x.A,{size:"small",onClick:()=>{"playing"===p&&Te?(Te.pause(),h("idle")):async function(e,t){try{Te&&(Te.pause(),Te=null),t("loading");const o=await fetch("/api/chatbot/tts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e})});if(!o.ok){const e=await o.json().catch((()=>({})));throw new Error(e.message||"TTS failed")}const n=await o.blob(),s=URL.createObjectURL(n),a=new Audio(s);Te=a,a.onended=()=>{t("idle"),URL.revokeObjectURL(s)},a.onpause=()=>t("idle"),a.onerror=()=>{t("idle"),URL.revokeObjectURL(s)},t("playing"),await a.play()}catch(o){console.error("Hugo TTS playback failed:",o),t("idle")}}(o,h)},sx:{marginLeft:"auto",color:"idle"===p?w.tokens.colorRoles.light.textTertiary:w.tokens.palette.brand[600],padding:"2px"},children:"loading"===p?(0,P.jsx)(r.A,{sx:{width:14,height:14,borderRadius:"50%",border:"2px s
1olid ".concat(w.tokens.palette.brand[200]||"#E0D8FF"),borderTopColor:w.tokens.palette.brand[600],animation:"".concat(Se," 800ms linear infinite")}}):(0,P.jsx)(u.A,{sx:{fontSize:16}})})})]}),(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:{xs:"16px",md:"17px"},lineHeight:1.55,color:w.tokens.colorRoles.light.textPrimary,whiteSpace:"pre-wrap"},children:Ce(o)}),l&&Array.isArray(s)&&s.length>0&&(0,P.jsxs)(r.A,{sx:{marginTop:"".concat(w.tokens.space[4],"px"),paddingTop:"".concat(w.tokens.space[3],"px"),borderTop:"1px solid ".concat(w.tokens.colorRoles.light.border),display:"flex",flexDirection:"column",gap:"".concat(w.tokens.space[2],"px")},children:[(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:"10px",fontWeight:w.tokens.fontWeight.semibold,letterSpacing:"0.1em",textTransform:"uppercase",color:w.tokens.colorRoles.light.textTertiary},children:"Hugo opened for you"}),s.map(((e,t)=>{const o=null===e||void 0===e?void 0:e.payload;return o?"cta"===o.type?(0,P.jsx)(Fe,{payload:o,onNavigate:i},t):"jobs"===o.type?(0,P.jsx)(We,{jobs:o.jobs||[],onNavigate:i},t):(0,P.jsx)(ke,{payload:o},t):null}))]})]})})},_e=e=>{let{label:t="Thinking"}=e;return(0,P.jsxs)(r.A,{sx:{padding:"".concat(w.tokens.space[4],"px ").concat(w.tokens.space[5],"px"),borderRadius:"".concat(w.tokens.radius.lg,"px"),bgcolor:w.tokens.colorRoles.light.surface,border:"1px solid ".concat(w.tokens.colorRoles.light.border),animation:"".concat(we," 200ms ").concat(w.tokens.easing.standard," both"),display:"flex",alignItems:"center",gap:"".concat(w.tokens.space[3],"px")},children:[(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:"11px",fontWeight:w.tokens.fontWeight.semibold,letterSpacing:"0.1em",textTransform:"uppercase",color:w.tokens.palette.brand[600]},children:"Hugo \xb7 Coach"}),(0,P.jsx)(r.A,{sx:{display:"flex",gap:"3px"},children:[0,200,400].map((e=>(0,P.jsx)(r.A,{sx:{width:5,height:5,borderRadius:"50%",bgcolor:w.tokens.palette.brand[500],animation:"".concat(Se," 1200ms ").concat(w.tokens.easing.standard," infinite"),animationDelay:"".concat(e,"ms")}},e)))}),(0,P.jsxs)(c.A,{sx:{fontFamily:w.tokens.fontFamily.serif,fontStyle:"italic",fontSize:w.tokens.fontSize.sm,color:w.tokens.colorRoles.light.textSecondary},children:[t,"\u2026"]})]})};function Me(e){const t=String(e||"").toLowerCase();return/\bjob|role|hiring|apply\b/.test(t)?"Searching live UK roles":/\bbrief|company|culture|about\b/.test(t)?"Pulling the brief":/\bpractise|mock|interview|behavioural|case|rehearse\b/.test(t)?"Setting up the mock":/\bresume|cv|bullet\b/.test(t)?"Opening your CV":/\btracker|application|pipeline\b/.test(t)?"Checking your tracker":"Thinking"}const Pe=e=>{let{input:t,setInput:o,handleSend:n,sending:s,listening:a,startVoice:i,stopVoice:l,voiceSupported:h,voiceError:u,variant:k="anchored"}=e;return(0,P.jsxs)(r.A,{sx:{width:"100%"},children:[(0,P.jsxs)(r.A,{sx:{display:"flex",alignItems:"flex-end",gap:"".concat(w.tokens.space[2],"px"),padding:"hero"===k?"".concat(w.tokens.space[4],"px ").concat(w.tokens.space[5],"px"):"".concat(w.tokens.space[3],"px ").concat(w.tokens.space[4],"px"),borderRadius:"".concat(w.tokens.radius.xl||20,"px"),border:"1.5px solid ".concat(a?w.tokens.palette.brand[500]:w.tokens.colorRoles.light.border),bgcolor:w.tokens.colorRoles.light.surface,boxShadow:a?"0 0 0 6px ".concat(w.tokens.colorRoles.light.brandSubtle,", 0 12px 32px -12px ").concat(w.tokens.palette.brand[600],"66"):"0 8px 24px -12px ".concat(w.tokens.palette.brand[600],"33, 0 2px 4px ").concat(w.tokens.palette.brand[600],"11"),transition:"border-color 160ms ".concat(w.tokens.easing.standard,", box-shadow 160ms ").concat(w.tokens.easing.standard)},children:[(0,P.jsx)(p.A,{value:t,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),n())},placeholder:a?"I'm listening \u2014 go ahead.":"Tell Hugo what's on your mind.",multiline:!0,maxRows:6,variant:"standard",fullWidth:!0,disabled:s,autoFocus:!0,InputProps:{disableUnderline:!0,sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:{xs:"16px",md:"17px"},lineHeight:1.5,padding:"".concat("hero"===k?w.tokens.space[2]:w.tokens.space[1],"px 0")}}}),h&&(0,P.jsx)(d.A,{title:a?"Stop listening":"Speak to Hugo",children:(0,P.jsx)(x.A,{onClick:a?l:i,size:"medium",sx:{color:a?"#E53E3E":w.tokens.colorRoles.light.textSecondary,bgcolor:a?"#FED7D7":w.tokens.colorRoles.light.brandSubtle,padding:"10px","&:hover":{bgcolor:a?"#FEB2B2":w.tokens.palette.brand[100]||"#E0D8FF",color:a?"#C53030":w.tokens.palette.brand[700]}},children:a?(0,P.jsx)(f.A,{sx:{fontSize:20}}):(0,P.jsx)(m.A,{sx:{fontSize:20}})})}),(0,P.jsx)(d.A,{title:"Send (Enter)",children:(0,P.jsx)("span",{children:(0,P.jsx)(x.A,{onClick:n,disabled:!t.trim()||s,size:"medium",sx:{bgcolor:t.trim()&&!s?w.tokens.palette.brand[600]:w.tokens.colorRoles.light.surfaceMuted,color:t.trim()&&!s?"#fff":w.tokens.colorRoles.light.textTertiary,padding:"10px",boxShadow:t.trim()&&!s?"0 4px 12px -4px ".concat(w.tokens.palette.brand[600],"66"):"none","&:hover":{bgcolor:t.trim()&&!s?w.tokens.palette.brand[700]:w.tokens.colorRoles.light.surfaceMuted,transform:t.trim()&&!s?"translateY(-1px)":"none"},"&.Mui-disabled":{bgcolor:w.tokens.colorRoles.light.surfaceMuted,color:w.tokens.colorRoles.light.textTertiary},transition:"transform 160ms ".concat(w.tokens.easing.standard,", background-color 160ms")},children:(0,P.jsx)(g.A,{sx:{fontSize:20}})})})})]}),u&&(0,P.jsx)(c.A,{sx:{marginTop:"8px",fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.xs,color:"#C53030",textAlign:"center"},children:u})]})},Be="hugo:chat:session:v3",He=()=>{var e;const t=(0,i.useHistory)(),[o,s]=(0,a.useState)(null),[p,g]=(0,a.useState)((()=>{try{return sessionStorage.getItem(Be)||null}catch(e){return null}})),[m,f]=(0,a.useState)([]),[u,A]=(0,a.useState)(""),[j,v]=(0,a.useState)(!1),[T,C]=(0,a.useState)(""),[z,F]=(0,a.useState)(0),[W,D]=(0,a.useState)(!1),[I,_]=(0,a.useState)(!1),M=(0,a.useRef)(null),{listening:B,error:H,start:E,stop:O,supported:N}=function(e){let{onTranscript:t}=e;const o=(0,a.useRef)(null),[n,s]=(0,a.useState)(!1),[i,r]=(0,a.useState)(""),l=(0,a.useCallback)((()=>
1{if(o.current)try{o.current.stop()}catch(e){}}),[]),c=(0,a.useCallback)((()=>{if(!ve)return void r("Voice input isn't supported in this browser. Try Chrome on desktop.");if(o.current)try{o.current.stop()}catch(n){}const e=new Re;e.lang="en-GB",e.interimResults=!0,e.continuous=!1,e.maxAlternatives=1,e.onresult=e=>{let o="",n="";for(let t=e.resultIndex;t<e.results.length;t++){const s=e.results[t][0].transcript;e.results[t].isFinal?o+=s:n+=s}t({final:o,interim:n})},e.onerror=e=>{r("not-allowed"===(null===e||void 0===e?void 0:e.error)?"Mic permission was blocked \u2014 allow it in your browser.":"Couldn't hear you. Try again or just type."),s(!1)},e.onend=()=>s(!1),e.onstart=()=>{r(""),s(!0)},o.current=e;try{e.start()}catch(n){r("Couldn't start the mic \u2014 already listening?")}}),[t]);return(0,a.useEffect)((()=>()=>l()),[l]),{listening:n,error:i,start:c,stop:l,supported:ve}}({onTranscript:e=>{let{final:t,interim:o}=e;A(t||o||"")}});(0,a.useEffect)((()=>{let e=!1;return(0,R.l2)().then((t=>{e||s(t||null)})).catch((()=>{e||s(null)})),()=>{e=!0}}),[]),(0,a.useEffect)((()=>{var e;null===(e=M.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})}),[m,j]);const L=(0,a.useMemo)((()=>function(e){var t;let{name:o,role:n,industry:s,targetCompanies:a}=e;const i=o?String(o).trim().split(/\s+/)[0]:null,r=Array.isArray(a)&&a.length?"string"===typeof a[0]?a[0]:null===(t=a[0])||void 0===t?void 0:t.name:null;let l,c;return r&&i?(l="Back to *".concat(r,"*, ").concat(i,"?"),c="Or pivot \u2014 pick what we sharpen tonight."):r?(l="Ready for *".concat(r,"*?"),c="Or pivot \u2014 pick what we sharpen tonight."):i?(l="Ready when *".concat(i,"* is."),c="What's the interview?"):(l="Ready when *you* are.",c="What's the interview?"),{headline:l,subline:c}}({name:null===o||void 0===o?void 0:o.name,role:null===o||void 0===o?void 0:o.role,industry:null===o||void 0===o?void 0:o.industry,targetCompanies:null===o||void 0===o?void 0:o.targetCompanies})),[o]),V=(0,a.useMemo)((()=>function(e){var t;let{role:o,industry:n,targetCompanies:s}=e;const a=o||"Solutions Engineer",i=n||"tech",r=(Array.isArray(s)&&s.length?"string"===typeof s[0]?s[0]:null===(t=s[0])||void 0===t?void 0:t.name:null)||"Stripe";return[{label:"Practise a ".concat(r," interview"),hint:"Behavioural, with pushback",send:"Run me through a ".concat(a," behavioural at ").concat(r,". Push back like a real interviewer would.")},{label:"Show me ".concat(i," jobs"),hint:"Live UK roles matched to your profile",send:"Show me live ".concat(i," roles that match my profile.")},{label:"Brief me on ".concat(r),hint:"Culture, prompts, what they actually care about",send:"Brief me on ".concat(r," \u2014 culture, interview style, what they actually care about.")},{label:"Review my CV",hint:"One change you'd ship tonight",send:"Open my resume review and tell me the one thing I'd fix tonight."}]}({role:null===o||void 0===o?void 0:o.role,industry:null===o||void 0===o?void 0:o.industry,targetCompanies:null===o||void 0===o?void 0:o.targetCompanies})),[o]),Y=(0,a.useCallback)((async e=>{const t=(e||u).trim();if(!t||j)return;B&&O(),A(""),C(""),f((e=>[...e,{role:"user",text:t,ts:Date.now()}]));const o=Date.now()+1;f((e=>[...e,{role:"hugo",text:"",attachments:[],ts:o,streaming:!0}])),v(!0);try{const e=await fetch("/api/chatbot/hugo/stream",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({message:t,sessionId:p||void 0}),credentials:"include"});if(!e.ok||!e.body)throw new Error("HTTP ".concat(e.status));const s=e.body.getReader(),a=new TextDecoder("utf-8");let i="";const r=e=>{f((t=>t.map((t=>t.ts===o?(0,n.A)((0,n.A)({},t),e(t)):t))))},l=(e,t)=>{let o=null;try{o=JSON.parse(t)}catch(n){return}switch(e){case"status":default:break;case"tool":"done"===o.phase&&o.attachment&&r((e=>({attachments:[...e.attachments||[],o.attachment]})));break;case"delta":"string"===typeof o.text&&r((e=>({text:(e.text||"")+o.text})));break;case"done":if(r((()=>({text:o.message||"(no reply)",attachments:o.attachments||[],streaming:!1}))),o.sessionId&&o.sessionId!==p){g(o.sessionId);try{sessionStorage.setItem(Be,o.sessionId)}catch(s){}}F((e=>e+1));break;case"error":C(o.error||"Hugo's offline \u2014 try again in a moment."),r((()=>({streaming:!1})))}};for(;;){const{done:e,value:t}=await s.read();if(e)break;let o;for(i+=a.decode(t,{stream:!0});-1!==(o=i.indexOf("\n\n"));){const e=i.slice(0,o);if(i=i.slice(o+2),!e.trim())continue;let t="message",n=[];e.split("\n").forEach((e=>{e.startsWith("event:")?t=e.slice(6).trim():e.startsWith("data:")&&n.push(e.slice(5).trim())})),n.length>0&&l(t,n.join("\n"))}}}catch(s){console.error("Hugo stream failed:",s),C((null===s||void 0===s?void 0:s.message)||"Hugo's offline \u2014 try again in a moment."),f((e=>e.map((e=>e.ts===o?(0,n.A)((0,n.A)({},e),{},{streaming:!1}):e))))}finally{v(!1)}}),[u,j,B,p,O]),q=(0,a.useCallback)((async e=>{if(e&&e!==p){D(!0),C("");try{const o=(await S().get("/api/chatbot/hugo/threads/".concat(encodeURIComponent(e)))).data||{},n=(Array.isArray(o.messages)?o.messages:[]).map((e=>({role:"hugo"===e.role?"hugo":"user",text:e.text||"",ts:e.ts?new Date(e.ts).getTime():Date.now(),attachments:[]})));f(n),g(e);try{sessionStorage.setItem(Be,e)}catch(t){}}catch(o){console.error("Hugo loadThread failed:",o),C("Couldn't load that conversation \u2014 try another?")}finally{D(!1)}}}),[p]),G=()=>{f([]),g(null);try{sessionStorage.removeItem(Be)}catch(e){}C("")},K=e=>{e&&t.push(e)},J=0===m.length;return(0,P.jsxs)(r.A,{sx:{display:"flex",flexDirection:"row",alignItems:"stretch",minHeight:"100vh",bgcolor:w.tokens.colorRoles.light.bg},children:[(0,P.jsx)(U,{activeSessionId:p,onSelect:q,onNewThread:G,refreshKey:z,mobileOpen:I,onMobileClose:()=>_(!1)}),(0,P.jsxs)(r.A,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",position:"relative"},children:[W&&(0,P.jsx)(r.A,{sx:{position:"absolute",top:0,left:0,right:0,height:2,overflow:"hidden",zIndex:20,bgcolor:w.tokens.colorRoles.light.brandSubtle},children:(0,P.jsx)(r.A,{sx:{width:"40%",height:"100%",background:"linear-gradient(90deg, transparent, ".concat(w.tokens.palette.brand[500],", transparent)"),animation:"".concat(je," 1100ms ").concat(w.tokens.easing.standard," infinite")}})}),!J&&(0,P.jsx)(r.A,{sx:{position:"sticky",top:0,zIndex:10,bgcolor:"".concat(w.tokens.colorRoles.light.bg,"E6"),backdropFilter:"blur(8px)",borderBottom:"1px solid ".concat(w.tokens.colorRoles.light.border),padding:"".concat(w.tokens.space[3],"px 0")},children:(0,P.jsx)(h.A,{maxWidth:"md",children:(0,P.jsxs)(r.A,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,P.jsxs)(l.A,{onClick:()=>_(!0),focusRipple:!0,sx:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px ".concat(w.tokens.space[3],"px"),borderRadius:"".concat(w.tokens.radius.pill,"px"),border:"1px solid ".concat(w.tokens.colorRoles.light.border),fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.xs,fontWeight:w.tokens.fontWeight.semibold,letterSpacing:"-0.005em",color:w.tokens.colorRoles.light.textSecondary,transition:"background-color 140ms ".concat(w.tokens.easing.standard,", color 140ms ").concat(w.tokens.easing.standard,", border-color 140ms ").concat(w.tokens.easing.standard),"&:hover":{bgcolor:w.tokens.colorRoles.light.brandSubtle,color:w.tokens.palette.brand[700],borderColor:w.tokens.palette.brand[300]||w.tokens.palette.brand[400]}}
1,children:[(0,P.jsx)(y.A,{sx:{fontSize:14}}),"Threads"]}),(0,P.jsx)(d.A,{title:"Start a new conversation",children:(0,P.jsx)(x.A,{size:"small",onClick:G,sx:{color:w.tokens.colorRoles.light.textSecondary},children:(0,P.jsx)(k.A,{sx:{fontSize:20}})})})]})})}),J?(0,P.jsxs)(h.A,{maxWidth:"md",sx:{flexGrow:1,display:"flex",flexDirection:"column",paddingTop:{xs:"".concat(w.tokens.space[6],"px"),md:"".concat(w.tokens.space[8],"px")},paddingBottom:"".concat(w.tokens.space[8],"px"),gap:"".concat(w.tokens.space[6],"px")},children:[(0,P.jsx)(r.A,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:(0,P.jsxs)(l.A,{onClick:()=>_(!0),focusRipple:!0,sx:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px ".concat(w.tokens.space[3],"px"),borderRadius:"".concat(w.tokens.radius.pill,"px"),border:"1px solid ".concat(w.tokens.colorRoles.light.border),fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.xs,fontWeight:w.tokens.fontWeight.semibold,letterSpacing:"-0.005em",color:w.tokens.colorRoles.light.textSecondary,transition:"background-color 140ms ".concat(w.tokens.easing.standard,", color 140ms ").concat(w.tokens.easing.standard,", border-color 140ms ").concat(w.tokens.easing.standard),"&:hover":{bgcolor:w.tokens.colorRoles.light.brandSubtle,color:w.tokens.palette.brand[700],borderColor:w.tokens.palette.brand[300]||w.tokens.palette.brand[400]}},children:[(0,P.jsx)(y.A,{sx:{fontSize:14}}),"Threads"]})}),(0,P.jsxs)(r.A,{sx:{borderTop:"1px solid ".concat(w.tokens.colorRoles.light.border),paddingTop:"".concat(w.tokens.space[5],"px")},children:[(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:"11px",fontWeight:w.tokens.fontWeight.semibold,letterSpacing:"0.1em",textTransform:"uppercase",color:w.tokens.palette.brand[600],marginBottom:"".concat(w.tokens.space[3],"px")},children:"Your interview coach"}),(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.display,fontSize:{xs:"32px",sm:"40px",md:"44px"},fontWeight:w.tokens.fontWeight.semibold,lineHeight:1.1,letterSpacing:"-0.022em",color:w.tokens.colorRoles.light.textPrimary,marginBottom:"".concat(w.tokens.space[2],"px")},children:Ce(L.headline)}),(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:{xs:"16px",md:"17px"},lineHeight:1.5,color:w.tokens.colorRoles.light.textSecondary,maxWidth:"560px"},children:L.subline})]}),(0,P.jsxs)(r.A,{sx:{borderTop:"1px solid ".concat(w.tokens.colorRoles.light.border),paddingTop:"".concat(w.tokens.space[5],"px")},children:[(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:"11px",fontWeight:w.tokens.fontWeight.semibold,letterSpacing:"0.1em",textTransform:"uppercase",color:w.tokens.palette.brand[600],marginBottom:"".concat(w.tokens.space[2],"px")},children:"Quick starts"}),(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.serif,fontStyle:"italic",fontSize:w.tokens.fontSize.sm,color:w.tokens.colorRoles.light.textSecondary,marginBottom:"".concat(w.tokens.space[4],"px")},children:"One tap. Hugo runs the agent for you."}),(0,P.jsx)(r.A,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr"},gap:"".concat(w.tokens.space[3],"px")},children:V.map((e=>(0,P.jsx)(l.A,{onClick:()=>Y(e.send),disabled:j,focusRipple:!0,sx:{display:"block",textAlign:"left",padding:"".concat(w.tokens.space[4],"px ").concat(w.tokens.space[5],"px"),borderRadius:"".concat(w.tokens.radius.lg,"px"),border:"1px solid ".concat(w.tokens.colorRoles.light.border),bgcolor:w.tokens.colorRoles.light.surface,position:"relative",transition:"border-color 160ms ".concat(w.tokens.easing.standard,", transform 160ms ").concat(w.tokens.easing.standard,", box-shadow 160ms ").concat(w.tokens.easing.standard),"&:hover":{borderColor:w.tokens.palette.brand[400],transform:"translateY(-1px)",boxShadow:"0 8px 24px -16px ".concat(w.tokens.palette.brand[600],"55")},"&:hover .actionArrow":{color:w.tokens.palette.brand[600],transform:"translate(2px, -2px)"}},children:(0,P.jsxs)(r.A,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"".concat(w.tokens.space[3],"px")},children:[(0,P.jsxs)(r.A,{sx:{minWidth:0},children:[(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.base,fontWeight:w.tokens.fontWeight.semibold,letterSpacing:"-0.01em",color:w.tokens.colorRoles.light.textPrimary,marginBottom:"4px"},children:e.label}),(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.serif,fontStyle:"italic",fontSize:w.tokens.fontSize.sm,color:w.tokens.colorRoles.light.textSecondary,lineHeight:1.4},children:e.hint})]}),(0,P.jsx)(b.A,{className:"actionArrow",sx:{fontSize:16,color:w.tokens.colorRoles.light.textTertiary,flexShrink:0,transition:"transform 160ms ".concat(w.tokens.easing.standard,", color 160ms ").concat(w.tokens.easing.standard)}})]})},e.label)))})]}),(0,P.jsx)(Pe,{input:u,setInput:A,handleSend:()=>Y(),sending:j,listening:B,startVoice:E,stopVoice:O,voiceSupported:N,voiceError:H,variant:"hero"}),T&&(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.sm,color:"#C53030"},children:T})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(h.A,{maxWidth:"md",sx:{flexGrow:1,paddingTop:"".concat(w.tokens.space[6],"px"),paddingBottom:"".concat(w.tokens.space[8],"px")}
1,children:(0,P.jsxs)(r.A,{sx:{display:"flex",flexDirection:"column",gap:"".concat(w.tokens.space[3],"px")},children:[m.map(((e,t)=>(0,P.jsx)(Ie,{role:e.role,text:e.text,ts:e.ts,attachments:e.attachments,onNavigate:K},t))),j&&(0,P.jsx)(_e,{label:Me(null===(e=m.slice().reverse().find((e=>"user"===e.role)))||void 0===e?void 0:e.text)}),T&&(0,P.jsx)(c.A,{sx:{fontFamily:w.tokens.fontFamily.sans,fontSize:w.tokens.fontSize.sm,color:"#C53030"},children:T}),(0,P.jsx)(r.A,{ref:M,sx:{height:1}})]})}),(0,P.jsx)(r.A,{sx:{position:"sticky",bottom:0,zIndex:10,bgcolor:"".concat(w.tokens.colorRoles.light.bg,"E6"),backdropFilter:"blur(8px)",borderTop:"1px solid ".concat(w.tokens.colorRoles.light.border),paddingTop:"".concat(w.tokens.space[3],"px"),paddingBottom:"".concat(w.tokens.space[5],"px")},children:(0,P.jsx)(h.A,{maxWidth:"md",children:(0,P.jsx)(Pe,{input:u,setInput:A,handleSend:()=>Y(),sending:j,listening:B,startVoice:E,stopVoice:O,voiceSupported:N,voiceError:H,variant:"anchored"})})})]})]})]})}}}]); 2//# sourceMappingURL=757.0e813e26.chunk.js.map
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.