1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87758,e=>{"use strict";var t=e.i(79375),a=e.i(96967),n=e.i(48274),s=e.i(17562),r=e.i(99890),o=e.i(27531),i=e.i(48355),l=e.i(13392),c=e.i(9268),d=e.i(28227),u=e.i(91061),m=e.i(85637),h=e.i(48843),x=e.i(87878),p=e.i(60830),g=e.i(27717),f=e.i(80082),v=e.i(55957);let y=[{icon:i.MessageSquare,headline:"Remember every conversation",tagline:"Coffee chats, Zoom calls, chance encounters. Log them all in seconds so nothing slips away.",details:["Log meetings with date, time, type (coffee, video, phone, in-person, conference), and attendees","Add rich notes and attach files for full context","Quick-capture modal lets you log from anywhere in the app","Lightweight interaction logging for brief touchpoints","Full timeline view, searchable by contact, type, or notes"]},{icon:h.Mic,headline:"Turn recordings into notes",tagline:"Paste a transcript or drop in an audio file. Speakers are identified and everything links to your meeting.",details:["Supports VTT, SRT, and raw text formats, auto-detected on paste or upload","Upload audio files (MP3, WAV, M4A) for automatic speech-to-text","Speaker resolver matches transcript speakers to meeting attendees","Parsed segments stored with speaker labels for easy review","AI fallback handles unusual formats automatically"]},{icon:l.ListChecks,headline:"Never forget a promise",tagline:'Turn "I\'ll send you that intro" into a tracked task with a due date, tied to the conversation where you said it.',details:["Create action items from meeting notes with due dates and linked contacts","Dashboard shows pending items front and center, overdue flagged in red","Mark done with one click; optionally log a follow-up right after","Completed items are archived but never lost. Review them anytime","Every item links back to its source meeting for original context"]},{icon:x.Heart,headline:"Know who needs your attention",tagline:"Set a follow-up cadence for each contact and see at a glance who's overdue and who's thriving.",details:["Assign follow-up frequencies: every 7, 14, 30, 90 days, or custom","Color-coded health indicators from green (on track) to red (critically overdue)",'"Reach Out Today" section highlights who needs attention now',"Network health grid gives a bird's-eye view of your entire network","Health updates automatically as you log conversations"]},{icon:c.Users,headline:"Your whole network, organized",tagline:"Rich profiles with work history, education, tags, and a full interaction timeline for everyone you know.",details:["Store name, company, title, location, LinkedIn, emails, and phone numbers","Track work experience and education with full details","Tag contacts for easy filtering: investors, alumni, mentors, or custom labels","Each contact has a timeline showing every meeting, email, and action item","Quick-add form lets you save someone in seconds"]},{icon:d.Mail,headline:"Smarter email, built in",tagline:"Connect Gmail and manage your inbox, compose with AI templates, and set up automated follow-up sequences.",details:["Full inbox with tabs for Inbox, Sent, Drafts, Scheduled, and Follow-ups","Emails automatically linked to contacts so you can see every thread per person","AI-powered templates for intros, follow-ups, thank-yous, and custom drafts","Schedule emails to send at the right time","Multi-stage follow-up sequences that auto-send and auto-cancel on reply"]},{icon:u.Calendar,headline:"Schedule meets network",tagline:"See your calendar in CareerVine, create meetings that sync to Google Calendar, and share your availability.",details:["Week view with time grid and list view for quick scanning","Drag-to-create: select a time slot to pre-fill a new meeting","Auto-create Google Calendar events with attendee invites and Meet links","RSVP statuses sync back so you always know who's confirmed","Availability profiles with per-day working hours and buffer times"]},{icon:m.Chrome,headline:"One-click LinkedIn import",tagline:"Visit a LinkedIn profile and click import. Name, company, education, and photo are saved instantly.",details:["Floating button appears on LinkedIn profile pages","Scrapes n
1ame, headline, company, and education automatically","One-click import saves the contact with all scraped data","Duplicate detection checks LinkedIn URLs before importing","Profile photos are downloaded and stored with the contact"],cta:{label:"Install from the Chrome Web Store",href:v.EXTENSION_STORE_URL}}],b=[[0,1,2],[3,4],[5,6,7]];function j({feature:e,onClose:n}){let s=(0,a.useRef)(null);return(0,a.useEffect)(()=>{s.current?.scrollIntoView({behavior:"smooth",block:"nearest"})},[]),(0,t.jsx)("div",{ref:s,className:"col-span-full rounded-2xl border border-primary/20 bg-surface-container-low overflow-hidden",children:(0,t.jsxs)("div",{className:"px-8 py-6 flex flex-col sm:flex-row gap-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 sm:w-64 shrink-0",children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-primary text-on-primary flex items-center justify-center shrink-0",children:(0,t.jsx)(e.icon,{className:"h-5 w-5"})}),(0,t.jsx)("h3",{className:"text-lg font-medium text-foreground",children:e.headline})]}),(0,t.jsxs)("div",{className:"flex-1 space-y-3",children:[(0,t.jsx)("ul",{className:"space-y-2.5",children:e.details.map((e,a)=>(0,t.jsxs)("li",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-primary mt-[7px] shrink-0"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground leading-relaxed",children:e})]},a))}),e.cta&&(0,t.jsxs)("a",{href:e.cta.href,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"inline-flex items-center gap-1.5 text-sm font-medium text-primary hover:underline",children:[e.cta.label,(0,t.jsx)(p.ArrowRight,{className:"h-3.5 w-3.5"})]})]}),(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),n()},className:"self-start text-muted-foreground hover:text-foreground transition-colors text-xl leading-none px-2 py-1 rounded-lg hover:bg-surface-container","aria-label":"Close details",children:"Ã"})]})})}function w({feature:e,isActive:a,onClick:n}){return(0,t.jsxs)("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),n())},className:` 2 group relative rounded-2xl border cursor-pointer overflow-hidden 3 flex flex-col transition-all duration-300 ease-out outline-none focus-visible:ring-2 focus-visible:ring-primary 4 ${a?"border-primary/40 shadow-lg ring-1 ring-primary/20":"border-outline-variant hover:border-primary/20 hover:shadow-md hover:-translate-y-1"} 5 `,children:[(0,t.jsxs)("div",{className:"px-6 pt-6 pb-4 flex-1",children:[(0,t.jsx)("h3",{className:"text-[17px] font-semibold text-foreground leading-snug mb-2",children:e.headline}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:e.tagline})]}),(0,t.jsx)("div",{className:"relative h-40 mx-4 mb-4 rounded-xl bg-surface-container flex items-center justify-center overflow-hidden",children:(0,t.jsx)(e.icon,{className:` 6 h-16 w-16 transition-all duration-300 7 ${a?"text-primary/70 scale-110":"text-muted-foreground/30 group-hover:text-muted-foreground/50 group-hover:scale-105"} 8 `,strokeWidth:1.2})})]})}function N(){let[e,n]=(0,a.useState)(null),[s,r]=(0,a.useState)(null);return e?(0,t.jsx)(f.default,{initialMode:e,onBack:()=>n(null)}):(0,t.jsxs)("div",{className:"min-h-screen bg-background flex flex-col",children:[(0,t.jsxs)("header",{className:"sticky top-0 z-50 w-full border-b border-outline-variant bg-background/95 backdrop-blur px-6 py-3 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Sprout,{className:"h-7 w-7 text-primary"}),(0,t.jsx)("span",{className:"text-lg font-medium text-foreground",children:"CareerVine"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(g.Button,{variant:"text",size:"sm",onClick:()=>n("signin"),children:"Sign in"}),(0,t.jsx)(g.Button,{size:"sm",onClick:()=>n("signup"),children:"Get started"})]})]}),(0,t.jsx)("section",{className:"px-6 py-20 sm:py-28 text-center",children:(0,t.jsxs)("div",{className:"max-w-3xl mx-auto",children:[(0,t.jsx)(o.Sprout,{className:"mx-auto h-14 w-14 text-primary mb-6"}),(0,t.jsxs)("h1",{className:"text-[36px] sm:text-[48px] leading-[1.15] font-normal text-foreground mb-5",children:["Your conversations build your career."," ",(0,t.jsx)("span",{className:"text-primary",children:"Don't let them disappear."})]}),(0,t.jsx)("p",{className:"text-base sm:text-lg text-muted-foreground leading-relaxed max-w-xl mx-auto mb-10",children:"Every coffee chat, every âlet's circle back,â every promise to make an intro. CareerVine makes sure you follow through on all of it."}),(0,t.jsxs)(g.Button,{size:"lg",onClick:()=>n("signup"),children:["Get started for free ",(0,t.jsx)(p.ArrowRight,{className:"h-4 w-4"})]})]})}),(0,t.jsx)("section",{className:"px-6 py-16",children:(0,t.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,t.jsx)("h2",{className:"text-center text-[24px] sm:text-[32px] font-normal text-foreground mb-3",children:"Everything you need, nothing you don't"}),(0,t.jsx)("p",{className:"text-center text-sm text-muted-foreground mb-14 max-w-lg mx-auto",children:"Click any card to learn more."}),(0,t.jsx)("div",{className:"flex flex-col gap-5",children:b.map((e,a)=>{let n=e.find(e=>s===e);return(0,t.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,t.jsx)("div",{className:`grid gap-5 ${3===e.length?"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3":"grid-cols-1 sm:grid-cols-2"}`,children:e.map(e=>(0,t.jsx)(w,{feature:y[e],isActive:s===e,onClick:()=>{r(s===e?null:e)}},e))}),void 0!==n&&(0,t.jsx)(j,{feature:y[n],onClose:()=>r(null)})]},a)})})]})}),(0,t.jsx)("section",{className:"px-6 py-20 bg-primary-container/20",children:(0,t.jsxs)("div",{className:"max-w-lg mx-auto text-center",children:[(0,t.jsxs)("h2",{className:"text-[24px] sm:text-[28px] font-normal text-foreground mb-3",children:["Your network is your biggest asset.",(0,t.jsx)("br",{}),"Start treating it like one."]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-8",children:"Free to use. Set up in under a minute."}),(0,t.jsxs)(g.Button,{size:"lg",onClick:()=>n("signup"),children:["Create your free account ",(0,t.jsx)(p.ArrowRight,{className:"h-4 w-4"})]})]})}),(0,t.jsxs)("footer",{className:"border-t border-outline-variant px-6 py-4 flex items-center justify-between text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{children:["© ",new Date().getFullYear()," CareerVine"]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("a",{href:"https://docs.careervine.app",className:"hover:underline",children:"Docs"}),(0,t.jsx)("a",{href:"mailto:[email protected]",className:"hover:underline",children:"[email protected]"}),(0,t.jsx)("a",{href:"/privacy",className:"hover:underline",children:"Privacy"}),(0,t.jsx)("a",{href:"/terms",className:"hover:underline",children:"Terms"})]})]})]})}var k=e.i(97398),C=e.i(36036);e.i(65051);var S=e.i(52141),M=e.i(32180),I=e.i(19706),_=e.i(33949),D=e.i(56265),T=e.i(66579),E=e.i(97914),L=e.i(45770),$=e.i(65527),A=e.i(50688),R=e.i(51842),O=e.i(95860);let P="Log conversation";function H({onClick:e}){let[n,s]=(0,a.useState)(!1),[r,o]=(0,a.useState)(0),i=(0,a.useRef)(0),[l,c]=(0,a.useState)(!1),d=(0,a.useRef)(null),[u,m]=(0,a.useState)(0),h=(0,a.useRef)(null),x=(0,a.useRef)(null);(0,a.useEffect)(()=>{d.current&&m(66+d.current.scrollWidth+24)},[]);let p=(0,a.useCallback)(()=>{c(!0),x.current&&clearInterval(x.current),x.current=setInterval(()=>{c(e=>!e)},530);let e=i.current;if(e>=P.length)return;let t=()=>{i.current=++e,o(e),e<P.length?h.current=setTimeout(t,40):(x.current&&clearInterval(x.current),c(!0))};h.current=setTimeout(t,0===e?250:40)},[]),[g,f]=(0,a.useState)(!1),v=(0,a.useRef)(null),y=(0,a.useCallback)(()=>{h.current&&clearTimeout(h.current),f(!0),c(!0);let e=()=>{o(t=>{let a=t-1;return(i.current=a,a<=0)?(f(!1),c(!1),x.current&&clearInterval(x.current),0):(v.current=setTimeout(e,25),a)})};v.current=setTimeout(e,25)},[]);(0,a.useEffect)(()=>(n?(v.current&&clearTimeout(v.current),f(!1),p()):y(),()=>{h.current&&clearTimeout(h.current),x.current&&clearInterval(x.current),v.current&&clearTimeout(v.current)}),[n,p,y]);let b=n||g,j=b&&u>0?u:72,w=b?24:20;return(0,t.jsx)("button",{type:"button",onClick:e,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{width:j,transition:"width 500ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 300ms ease"},className:"fixed bottom-10 right-10 z-40 flex items-center bg-primary text-primary-foreground rounded-full shadow-lg hover:shadow-xl cursor-pointer h-[72px] overflow-hidden",children:(0,t.jsxs)("div",{className:"flex items-center shrink-0",style:{paddingLeft:w,paddingRight:24*!!b,gap:10*!!b,transition:"padding-left 500ms cubic-bezier(0.4, 0, 0.2, 1), padding-right 500ms cubic-bezier(0.4, 0, 0.2, 1), gap 500ms cubic-bezier(0.4, 0, 0.2, 1)"},children:[(0,t.jsx)(O.Plus,{className:"shrink-0",style:{width:32,height:32}}),(0,t.jsx)("span",{ref:d,className:"text-lg font-medium whitespace-nowrap absolute opacity-0 pointer-events-none","aria-hidden":!0,
8children:P}),(0,t.jsxs)("span",{className:"text-lg font-medium whitespace-nowrap",children:[P.slice(0,r),b&&r>0&&(0,t.jsx)("span",{className:"inline-block w-[2px] h-[1.1em] bg-primary-foreground align-middle ml-[1px]",style:{opacity:+!!l}})]})]})})}var U=e.i(79420),z=e.i(95434),F=e.i(32647),Y=e.i(40813),B=e.i(83082),G=e.i(39707),V=e.i(53863),q=e.i(10160),K=e.i(77840),W=e.i(28051);function J({icon:e,label:n,color:s,onClick:r,...o}){let[i,l]=(0,a.useState)(!1);return(0,t.jsxs)("div",{className:"relative flex flex-col items-center",...o,children:[(0,t.jsx)("button",{type:"button",onClick:r,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:"p-3 rounded-full transition-colors duration-150 cursor-pointer",style:{color:i?s:"var(--color-muted-foreground)",backgroundColor:i?`${s}12`:"transparent"},children:(0,t.jsx)("span",{className:"block h-6 w-6",children:e})}),(0,t.jsx)("span",{className:"absolute top-full mt-0.5 text-[11px] font-medium whitespace-nowrap pointer-events-none transition-all duration-150",style:{color:s,opacity:+!!i,transform:i?"translateY(0)":"translateY(-4px)"},children:n})]})}function X({icon:e,label:n,color:s,href:r}){let[o,i]=(0,a.useState)(!1);return(0,t.jsxs)("div",{className:"relative flex flex-col items-center",children:[(0,t.jsx)(U.default,{href:r,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),className:"p-3 rounded-full transition-colors duration-150",style:{color:o?s:"var(--color-muted-foreground)",backgroundColor:o?`${s}12`:"transparent"},children:(0,t.jsx)("span",{className:"block h-6 w-6",children:e})}),(0,t.jsx)("span",{className:"absolute top-full mt-0.5 text-[11px] font-medium whitespace-nowrap pointer-events-none transition-all duration-150",style:{color:s,opacity:+!!o,transform:o?"translateY(0)":"translateY(-4px)"},children:n})]})}function Q({onSave:e,onCancel:n}){let[s,r]=(0,a.useState)(""),[o,i]=(0,a.useState)(!1),l=(0,a.useRef)(null),c=(0,a.useRef)(null);(0,a.useEffect)(()=>{setTimeout(()=>c.current?.focus(),50)},[]),(0,a.useEffect)(()=>{let e=e=>{l.current&&!l.current.contains(e.target)&&n()},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[n]),(0,a.useEffect)(()=>{let e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[n]);let d=(0,a.useRef)(!1),u=async()=>{if(!d.current&&s.trim()){d.current=!0,i(!0);try{await e(s.trim())}finally{d.current=!1,i(!1)}}};return(0,t.jsx)("div",{ref:l,className:"absolute right-0 top-full mt-1 z-50 bg-surface-container-high rounded-xl shadow-lg border border-outline-variant w-[280px] animate-in fade-in zoom-in-95 duration-150",children:(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsx)("textarea",{ref:c,value:s,onChange:e=>r(e.target.value),placeholder:"Add a quick note...",className:"w-full h-20 px-3 py-2 text-sm bg-surface-container-low text-foreground rounded-lg border border-outline-variant/50 placeholder:text-muted-foreground/50 focus:outline-none focus:border-primary resize-none"}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 mt-2",children:[(0,t.jsx)("button",{type:"button",onClick:n,className:"px-3 py-1.5 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors cursor-pointer rounded-full",children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:u,disabled:!s.trim()||o,className:"px-4 py-1.5 text-xs font-medium bg-primary text-primary-foreground rounded-full hover:bg-primary/90 transition-colors cursor-pointer disabled:opacity-50",children:o?"Saving...":"Save"})]})]})})}let Z={action_item:{badgeBg:"bg-[#fef3c7]",badgeText:"text-[#92400e]",label:"ACTION ITEM"},reach_out:{badgeBg:"bg-[#fee2e2]",badgeText:"text-[#991b1b]",label:"REACH OUT"},suggestion:{badgeBg:"bg-[#bcebf1]",badgeText:"text-[#001f23]",label:"SUGGESTION"},recently_added:{badgeBg:"bg-[#e8e0ff]",badgeText:"text-[#3b1f7a]",label:"RECENTLY ADDED"},onboarding:{badgeBg:"bg-[#d8e8da]",badgeText:"text-[#1e3a21]",label:"GET STARTED"}};function ee({onLogConversation:e,calendarConnected:a,hideExtension:n=!1,dismissedGettingStarted:s,onDismissGettingStarted:r}){let o=[{id:"getting-started-bundle",icon:(0,t.jsx)(c.Users,{className:"h-6 w-6 text-primary"}),title:"Add the curated target database",subtitle:"PMs, product leaders, and recruiters at companies that hire new grads",onClick:()=>window.location.assign("/settings?tab=data")},{id:"getting-started-company",icon:(0,t.jsx)(W.Building2,{className:"h-6 w-6 text-[#39656b]"}),title:"Pick a target company",subtitle:"Companies where you already know people are the warmest place to start",onClick:()=>window.location.assign("/companies")},...a?[]:[{id:"getting-started-calendar",icon:(0,t.jsx)(u.Calendar,{className:"h-6 w-6 text-[#e8a838]"}
8),title:"Connect Gmail & Google Calendar",subtitle:"Send outreach and see meetings with contact context",onClick:()=>window.location.assign("/settings?tab=integrations")}],...n?[]:[{id:"getting-started-extension",icon:(0,t.jsx)(m.Chrome,{className:"h-6 w-6 text-[#39656b]"}),title:"Install the Chrome extension",subtitle:"Add contacts from LinkedIn in one click",onClick:()=>window.open(v.EXTENSION_STORE_URL,"_blank","noopener")}],{id:"getting-started-log",icon:(0,t.jsx)(O.Plus,{className:"h-6 w-6 text-primary"}),title:"Log your first conversation",subtitle:"Capture a recent interaction before details fade",onClick:e}].filter(e=>!s.includes(e.id));return 0===o.length?(0,t.jsx)("p",{className:"py-8 text-center text-base text-muted-foreground",children:"You're all set. Add a contact whenever you're ready."}):(0,t.jsx)("div",{className:"divide-y divide-outline-variant/50",children:o.map(e=>(0,t.jsxs)("div",{className:`group flex items-center gap-4 py-5 px-5 transition-colors ${e.onClick?"cursor-pointer hover:bg-surface-container-low":""}`,onClick:e.onClick,children:[(0,t.jsx)("div",{className:"w-14 h-14 rounded-full bg-surface-container-high flex items-center justify-center shrink-0",children:e.icon}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-lg font-medium text-foreground",children:e.title}),(0,t.jsx)("p",{className:"text-base text-muted-foreground",children:e.subt
8itle})]}),(0,t.jsx)("button",{type:"button","aria-label":`Dismiss "${e.title}"`,title:"Dismiss",onClick:t=>{t.stopPropagation(),r(e.id)},className:"shrink-0 p-2 rounded-full text-muted-foreground opacity-0 group-hover:opacity-100 focus-visible:opacity-100 hover:bg-surface-container-high hover:text-foreground transition-opacity cursor-pointer",children:(0,t.jsx)(K.X,{className:"h-5 w-5"})}),(0,t.jsx)(p.ArrowRight,{className:"h-5 w-5 text-muted-foreground shrink-0"})]},e.id))})}function et({items:e,loading:n,onComplete:s,onSnooze:r,onDismiss:o,onSave:i,onLogInteraction:l,onDraftEmail:c,onNote:d,onIntro:u,onOpenOnboarding:m,isEmpty:h,onLogConversation:x,calendarConnected:p,dismissedGettingStarted:g,onDismissGettingStarted:f}){let[v,y]=(0,a.useState)("all"),[b,j]=(0,a.useState)(null),[w,N]=(0,a.useState)(null),[k,C]=(0,a.useState)(0);(0,a.useEffect)(()=>{if(!b?.showMenu)return;let e=e=>{e.target.closest("[data-snooze-menu]")||j(null)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[b?.showMenu]);let S=(0,a.useMemo)(()=>{let t={action_item:0,reach_out:0,suggestion:0,recently_added:0,onboarding:0};for(let a of e)t[a.type]++;return t},[e]),M=(0,a.useMemo)(()=>"all"===v?e:e.filter(e=>e.type===v),[e,v]),I=Math.ceil(M.length/5),_=I>0?Math.min(k,I-1):0,D=M.slice(5*_,(_+1)*5);_!==k&&C(_);let T=(0,a.useCallback)(e=>{y(e),C(0)},[]),E=[{key:"all",label:"All"},{key:"action_item",label:`Action Items (${S.action_item})`},{key:"reach_out",label:`Reach Out (${S.reach_out})`},{key:"suggestion",label:`Suggestions (${S.suggestion})`},...S.recently_added>0?[{key:"recently_added",label:`Recently Added (${S.recently_added})`}]:[]];return(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{className:"text-[28px] font-medium text-foreground mb-5",children:"Up Next"}),!h&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mb-5",children:E.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>T(e.key),className:`px-5 py-2.5 rounded-full text-base font-medium transition-colors cursor-pointer ${v===e.key?"bg-primary text-primary-foreground":"bg-surface-container-high text-foreground hover:bg-surface-container-highest"}`,children:e.label},e.key))}),n&&(0,t.jsx)("div",{className:"space-y-2",children:[1,2,3].map(e=>(0,t.jsx)("div",{className:"h-[88px] rounded-xl bg-surface-container-highest animate-pulse"},e))}),!n&&h&&(0,t.jsxs)("div",{className:"rounded-xl border border-outline-variant overflow-hidden",children:[e.filter(e=>"onboarding"===e.type).map(e=>(0,t.jsx)(ea,{item:e,onOpen:m},e.id)),(0,t.jsx)(ee,{onLogConversation:x,calendarConnected:p,hideExtension:e.some(e=>"onboarding"===e.type),dismissedGettingStarted:g,onDismissGettingStarted:f})]}),!n&&!h&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"rounded-xl border border-outline-variant overflow-hidden divide-y divide-outline-variant/50",children:0===M.length?(0,t.jsx)("div",{className:"py-10 text-center text-base text-muted-foreground",children:"No items in this category"}):D.map(e=>"onboarding"===e.type?(0,t.jsx)(ea,{item:e,onOpen:m},e.id):(0,t.jsx)(en,{item:e,onComplete:s,onSnooze:r,onDismiss:o,onSave:i,onLogInteraction:l,onDraftEmail:c,onNote:d,onIntro:u,snoozeState:b,setSnoozeState:j,notePopoverItemId:w,setNotePopoverItemId:N},e.id))}),I>1&&(0,t.jsxs)("div",{className:"flex items-center justify-between mt-3 px-1",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:`${5*_+1} - ${Math.min((_+1)*5,M.length)} of ${M.length}`}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>C(e=>Math.max(0,e-1)),disabled:0===_,className:"p-2 rounded-full text-muted-foreground hover:text-foreground hover:bg-surface-container-highest transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-default",children:(0,t.jsx)(Y.ChevronLeft,{className:"h-5 w-5"})}),(0,t.jsx)("button",{type:"button",onClick:()=>C(e=>Math.min(I-1,e+1)),disabled:_>=I-1,className:"p-2 rounded-full text-muted-foreground hover:text-foreground hover:bg-surface-container-highest transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-default",children:(0,t.jsx)(B.ChevronRight,{className:"h-5 w-5"})})]})]})]})]})}function ea({item:e,onOpen:a}){let n=Z.onboarding;return(0,t.jsxs)("button",{type:"button",onClick:()=>a?.(e),className:"flex w-full items-center gap-5 py-5 px-6 text-left group hover:bg-surface-container-low transition-colors cursor-pointer",children:[(0,t.jsx)("div",{className:"w-[60px] h-[60px] shrink-0 rounded-full bg-primary/10 flex items-center justify-center",children:(0,t.jsx)(m.Chrome,{className:"h-7 w-7 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-xl font-medium text-foreground truncate",children:e.contactName}),(0,t.jsx)("p",{className:"text-lg text-muted-foreground mt-0.5 line-clamp-2",children:e.primaryText}),(0,t.jsx)("span",{className:`inline-block mt-1 px-3 py-1 rounded text-sm font-medium uppercase tracking-wide ${n.badgeBg} ${n.badgeText}`,children:n.label})]}),(0,t.jsx)(p.ArrowRight,{className:"h-6 w-6 text-muted-foreground shrink-0 group-hover:text-foreground transition-colors"})]})}function en({item:e,onComplete:a,onSnooze:n,onDismiss:s,onSave:r,onLogInteraction:o,onDraftEmail:l,onNote:c,onIntro:u,snoozeState:m,setSnoozeState:h,notePopoverItemId:x,setNotePopoverItemId:g}){let f=Z[e.type],v=m?.itemId===e.id&&m.showMenu;return(0,t.jsxs)("div",{className:"flex items-center gap-5 py-5 px-6 group hover:bg-surface-container-low transition-colors",children:[(0,t.jsx)(U.default,{href:`/contacts/${e.contactId}`,className:"shrink-0",children:(0,t.jsx)(z.ContactAvatar,{name:e.contactName,photoUrl:e.contactPhotoUrl,className:"w-[60px] h-[60px] text-lg"})}),(0,t.jsxs)(U.default,{href:`/contacts/${e.contactId}`,className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("p",{className:"text-xl font-medium text-foreground truncate",children:e.contactName}),(0,t.jsx)("span",{className:"text-base text-muted-foreground shrink-0",children:e.lastContactedLabel})]}),(0,t.jsx)("p",{className:"text-lg text-muted-foreground mt-0.5 line-clamp-2",ref:t=>{t&&(t.scrollHeight>t.clientHeight?t.title=e.primaryText:t.removeAttribute("title"))},children:e.primaryText}),(0,t.jsx)("span",{className:`inline-block mt-1 px-3 py-1 rounded text-sm font-medium uppercase tracking-wide ${f.badgeBg} ${f.badgeText}`,children:f.label})]}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:["recently_added"!==e.type&&(0,t.jsx)(J,{icon:(0,t.jsx)(F.Check,{className:"h-6 w-6"}),label:"suggestion"===e.type?"Did this":"Done",color:"#16a34a",onClick:()=>a(e)}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(J,{icon:(0,t.jsx)(G.Clock,{className:"h-6 w-6"}),label:"Snooze",color:"#d97706",onClick:()=>h(v?null:{itemId:e.id,showMenu:!0})}),v&&(0,t.jsxs)("div",{"data-snooze-menu":!0,className:"absolute right-0 top-full mt-1 z-50 bg-surface-container-high rounded-xl shadow-lg border border-outline-variant py-1.5 min-w-[180px]",children:[[{action:{type:"days",days:1},label:"1 day"},{action:{type:"days",days:3},label:"3 days"},{action:{type:"days",days:7},label:"1 week"}].map(a=>(0,t.jsx)("button",{type:"button",onClick:()=>{n(e,a.action),h(null)},className:"w-full text-left px-4 py-2 text-sm text-foreground hover:bg-surface-container-highest transition-colors cursor-pointer",children:a.label},a.label)),"recently_added"===e.type?(0,t.jsx)("button",{type:"button",onClick:()=>{n(e,{type:"skip_contact"}),h(null)},className:"w-full text-left px-4 py-2 text-sm text-muted-foreground hover:bg-surface-container-highest transition-colors cursor-pointer border-t border-outline-variant/50 mt-1 pt-2",children:"Skip Contact"}):(0,t.jsx)("button",{type:"button",onClick:()=>{n(e,{type:"until_next_followup"}),h(null)},className:"w-full text-left px-4 py-2 text-sm text-muted-foreground hover:bg-surface-container-highest transition-colors cursor-pointer border-t border-outline-variant/50 mt-1 pt-2",children:"Until next follow-up"})]})]}),"action_item"===e.type&&(0,t.jsx)(X,{icon:(0,t.jsx)(p.ArrowRight,{className:"h-6 w-6"}),label:"Profile",color:"#475569",href:`/contacts/${e.contactId}`}),"reach_out"===e.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J,{icon:(0,t.jsx)(i.MessageSquare,{className:"h-6 w-6"}),label:"Log",color:"#2563eb",onClick:()=>o(e.contactId)}),e.hasEmail&&(0,t.jsx)(J,{icon:(0,t.jsx)(d.Mail,{className:"h-6 w-6"}),label:"Email",color:"#0d9488",onClick:()=>l(e.contactId)})]}),"suggestion"===e.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J,{icon:(0,t.jsx)(V.Bookmark,{className:"h-6 w-6"}),label:"Save",color:"#2d6a30",onClick:()=>r(e)}),(0,t.jsx)(J,{icon:(0,t.jsx)(K.X,{className:"h-6 w-6"}),label:"Dismiss",color:"#dc2626",onClick:()=>s(e)})]}),"recently_added"===e.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J,{icon:(0,t.jsx)(i.MessageSquare,{className:"h-6 w-6"}),label:"Log",color:"#2563eb",onClick:()=>o(e.contactId)}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(J,{icon:(0,t.jsx)(q.Pencil,{className:"h-6 w-6"}),label:"Note",color:"#7c3aed",onClick:()=>g(x===e.id?null:e.id)}),x===e.id&&(0,t.jsx)(Q,{onSave:async t=>{await c(e.contactId,t),g(null)},onCancel:()=>g(null)})]}),e.hasEmail&&(0,t.jsx)(J,{icon:(0,t.jsx)(d.Mail,{className:"h-6 w-6"}),label:"Intro",color:"#0d9488",onClick:()=>u(e.contactId)})]})]})]})}
8var es=e.i(49114),er=e.i(76659),eo=e.i(79111),ei=e.i(65226);function el(e){let t=Math.floor(e),a=Math.round((e-t)*60);return 0===t||24===t?`12:${String(a).padStart(2,"0")} AM`:`${t>12?t-12:t}:${String(a).padStart(2,"0")} ${t>=12?"PM":"AM"}`}function ec({event:e,onClose:n,onLogConversation:s}){var r,o;let i,l,d,m=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=e=>{m.current&&!m.current.contains(e.target)&&n()},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[n]),(0,a.useEffect)(()=>{let e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[n]);let h=e.meet_link,x=(e.attendees||[]).filter(e=>e.email);return(0,t.jsxs)("div",{ref:m,"data-popover":!0,className:"absolute z-50 bg-surface-container-high rounded-xl shadow-lg border border-outline-variant w-[300px] overflow-hidden animate-in fade-in zoom-in-95 duration-150",style:{right:"calc(100% + 8px)",top:0},children:[(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1 px-3 pt-3 pb-1",children:[s&&(0,t.jsx)("button",{type:"button",onClick:()=>{s({contactId:e.contact?.id??e.contact_id??void 0,title:e.title??void 0,startAt:e.start_at,endAt:e.end_at,meetLink:e.meet_link}),n()},className:"p-2 rounded-full text-muted-foreground hover:text-foreground hover:bg-surface-container-highest transition-colors cursor-pointer",title:"Log conversation",children:(0,t.jsx)(u.Calendar,{className:"h-4 w-4"})}),h&&(0,t.jsx)("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"p-2 rounded-full text-muted-foreground hover:text-foreground hover:bg-surface-container-highest transition-colors",title:"Join meeting",children:(0,t.jsx)(er.Video,{className:"h-4 w-4"})}),(0,t.jsx)("button",{type:"button",onClick:n,className:"p-2 rounded-full text-muted-foreground hover:text-foreground hover:bg-surface-container-highest transition-colors cursor-pointer",title:"Close",children:(0,t.jsx)(K.X,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"px-4 pb-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2.5 mb-2",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded-sm bg-primary mt-1.5 shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-base font-medium text-foreground leading-snug",children:e.title||"Untitled event"}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground mt-0.5",children:[new Date(e.start_at).toLocaleDateString([],{weekday:"long",month:"long",day:"numeric"})," · ",(r=e.start_at,o=e.end_at,i=new Date(r),l=new Date(o),d=e=>e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}),`${d(i)} â ${d(l)}`)]})]})]}),e.location&&(0,t.jsxs)("div",{className:"flex items-start gap-2.5 mt-3",children:[(0,t.jsx)(es.MapPin,{className:"h-4 w-4 text-muted-foreground mt-0.5 shrink-0"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.location})]}),h&&(0,t.jsxs)("div",{className:"flex items-start gap-2.5 mt-2",children:[(0,t.jsx)(er.Video,{className:"h-4 w-4 text-muted-foreground mt-0.5 shrink-0"}),(0,t.jsx)("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline truncate",children:"Join Google Meet"})]}),x.length>0&&(0,t.jsxs)("div",{className:"flex items-start gap-2.5 mt-3",children:[(0,t.jsx)(c.Users,{className:"h-4 w-4 text-muted-foreground mt-0.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[x.slice(0,5).map((e,a)=>(0,t.jsxs)("p",{className:"text-sm text-muted-foreground truncate",children:[e.name||e.email,"declined"===e.responseStatus&&(0,t.jsx)("span",{className:"text-xs text-destructive ml-1.5",children:"declined"}),"tentative"===e.responseStatus&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-1.5",children:"maybe"})]},a)),x.length>5&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-0.5",children:["+",x.length-5," more"]})]})]}),e.description&&(0,t.jsx)("div",{className:"mt-3 pt-3 border-t border-outline-variant/50",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-4 whitespace-pre-wrap",children:e.description})}),e.contact&&(0,t.jsx)("div",{className:"mt-3 pt-3 border-t border-outline-variant/50",children:(0,t.jsxs)(U.default,{href:`/contacts/${e.contact.
8id}`,className:"flex items-center gap-2 hover:bg-surface-container-low rounded-lg p-1.5 -mx-1.5 transition-colors",children:[(0,t.jsx)(z.ContactAvatar,{name:e.contact.name,photoUrl:e.contact.photo_url,className:"w-7 h-7 text-xs"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground truncate",children:e.contact.name}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.contact.lastTouchLabel})]})]})})]})]})}function ed({draft:e,onSave:n,onCancel:s}){let[r,o]=(0,a.useState)(""),[i,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)(!1),[u,m]=(0,a.useState)(""),h=(0,a.useRef)(null),x=(0,a.useRef)(null);(0,a.useEffect)(()=>{setTimeout(()=>h.current?.focus(),50)},[]),(0,a.useEffect)(()=>{let e=e=>{x.current&&!x.current.contains(e.target)&&s()},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[s]),(0,a.useEffect)(()=>{let e=e=>{"Escape"===e.key&&s()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s]);let p=(0,a.useRef)(!1),g=async()=>{if(!p.current){p.current=!0,d(!0),m("");try{await n(r||"(No title)",i)}catch{m("Failed to create event")}finally{p.current=!1,d(!1)}}};return(0,t.jsxs)("div",{ref:x,"data-popover":!0,className:"absolute z-50 bg-surface-container-high rounded-xl shadow-lg border border-outline-variant w-[280px] overflow-hidden animate-in fade-in zoom-in-95 duration-150",style:{right:"calc(100% + 8px)",top:0},children:[(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)("input",{ref:h,type:"text",value:r,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"===e.key&&g()},placeholder:"Add title",className:"w-full text-lg font-medium text-foreground bg-transparent border-b-2 border-primary pb-2 placeholder:text-muted-foreground/50 focus:outline-none"}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-3 text-sm text-muted-foreground",children:[(0,t.jsx)(G.Clock,{className:"h-4 w-4 shrink-0"}),(0,t.jsxs)("span",{children:[el(e.startHour)," â ",el(e.endHour)]})]}),(0,t.jsxs)("label",{className:"flex items-center gap-2 mt-2.5 text-sm text-muted-foreground cursor-pointer",children:[(0,t.jsx)(er.Video,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1",children:"Add Google Meet"}),(0,t.jsx)("input",{type:"checkbox",checked:i,onChange:e=>l(e.target.checked),className:"w-4 h-4 accent-primary cursor-pointer"})]})]}),u&&(0,t.jsx)("p",{className:"text-xs text-destructive px-4 pb-1",children:u}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 px-4 pb-3",children:[(0,t.jsx)("button",{type:"button",onClick:s,className:"px-4 py-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors cursor-pointer rounded-full",children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:g,disabled:c,className:"px-5 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-full hover:bg-primary/90 transition-colors cursor-pointer disabled:opacity-60",children:c?"Savingâ¦":"Save"})]})]})}function eu({events:e,loading:n,loadFailed:s=!1,onRetry:r,calendarConnected:o,availableHeight:i,onLogConversation:l,onEventCreated:c}){let[d,m]=(0,a.useState)(new Date),[h,x]=(0,a.useState)(null),{error:p}=(0,$.useToast)(),g=(0,a.useRef)(null),[f,v]=(0,a.useState)(null),[y,b]=(0,a.useState)(null),j=(0,a.useRef)(null);(0,a.useEffect)(()=>{j.current=y},[y]),(0,a.useEffect)(()=>{let e=setInterval(()=>m(new Date),6e4);return()=>clearInterval(e)},[]);let[w,N]=(0,a.useMemo)(()=>(function(e){if(0===e.length){let e=new Date().getHours();return[Math.max(0,e-1),Math.min(24,e+4)]}let t=24,a=0;for(let n of e){let e=new Date(n.start_at),s=new Date(n.end_at),r=e.getHours(),o=s.getHours()+ +(s.getMinutes()>0);o<=r&&(o=24),t=Math.min(t,r),a=Math.max(a,o)}return[Math.max(0,t-1),Math.min(24,a+1)]})(e),[e]),k=Math.max(0,i-48),[S,M]=(0,a.useMemo)(()=>(function(e,t,a){let n=Math.ceil(a/52),s=e,r=t,o=Math.min(7,e),i=Math.max(22,t);for(;r-s<n&&r<i;)r++;for(;r-s<n&&s>o;)s--;return[s,r]})(w,N,k),[w,N,k]),I=(M-S)*52,_=d.getHours()+d.getMinutes()/60,D=_>=S&&_<=M,T=(_-S)*52,E=(0,a.useMemo)(()=>{let t=e.map(e=>{let t=new Date(e.start_at),a=new Date(e.end_at),n=t.getHours()+t.getMinutes()/60,s=a.getHours()+a.getMinutes()/60;s<=n&&(s=24);let r=(n-S)*52,o=Math.max((s-n)*52,28),i=t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});return{...e,top:r,height:o,timeLabel:i,startMs:t.getTime(),endMs:a.getTime()}}),a=(0,eo.packOverlappingEvents)(t.map(e=>({id:e.id,startMs:e.startMs,endMs:e.endMs})));return t.map(e=>{let t=a.get(e.id)??{columnIndex:0,columnCount:1};return{...e,columnIndex:t.columnIndex,columnCount:t.columnCount}})},[e,S]),L=(0,a.useCallback)(e=>{if(!g.current)return S;let t=15*Math.round(60*(S+(e-g.current.getBoundingClientRect().top)/52)/15)/60;return Math.max(S,Math.min(M,t))},[S,M]),A=(0,a.useCallback)(e=>{let t=e.target;if(t.closest("[data-event-block]")||t.closest("[data-popover]"))return;if(y)return void b(null);e.preventDefault(),x(null);let a=L(e.clientY);v({startY:e.clientY,currentY:e.clientY,startH:a,currentH:a,isDragging:!1})},[y,L]),R=(0,a.useCallback)(e=>{!f||Math.abs(e.clientY-f.startY)>4&&v({...f,currentY:e.clientY,currentH:L(e.clientY),isDragging:!0})},[f,L]),O=(0,a.useCallback)(e=>{if(f){if(f.isDragging){let t=L(f.startY),a=L(e.clientY),n=Math.min(t,a),s=Math.max(t,a);b({startHour:n,endHour:s-n<.25?n+.25:s})}v(null)}},[f,L]),P=(0,a.useMemo)(()=>
8{if(!f?.isDragging)return null;let e=Math.min(f.startH,f.currentH),t=Math.max(f.startH,f.currentH),a=t-e<.25?e+.25:t;return{top:(e-S)*52,height:(a-e)*52,label:`${el(e)} â ${el(a)}`}},[f,S]),H=(0,a.useRef)(null),F=(0,a.useCallback)(async(e,t)=>{if(!y||H.current===y)return;H.current=y;let a=new Date,n=new Date(a.getFullYear(),a.getMonth(),a.getDate()),s=n.getTime()+60*y.startHour*6e4,r=n.getTime()+60*y.endHour*6e4;try{await (0,ei.apiSend)("/api/calendar/create-event",(0,ei.jsonBody)({summary:e,startTime:new Date(s).toISOString(),endTime:new Date(r).toISOString(),conferenceType:t?"meet":"none"})),b(e=>e===y?null:e),c?.()}catch(e){if(j.current!==y)return void p("Couldn't create that event. Please try again.");throw e}finally{H.current===y&&(H.current=null)}},[y,c,p]);return n?(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-[28px] font-medium text-foreground mb-8",children:"Today"}),(0,t.jsx)("div",{className:"space-y-2",children:[1,2].map(e=>(0,t.jsx)("div",{className:"h-16 rounded-lg bg-surface-container-highest animate-pulse"},e))})]}):s?(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-[28px] font-medium text-foreground mb-8",children:"Today"}),(0,t.jsx)(C.LoadErrorState,{message:"Couldn't load today's schedule.",onRetry:()=>r?.()})]}):(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-[28px] font-medium text-foreground mb-8",children:"Today"}),!o&&!n&&(0,t.jsxs)(U.default,{href:"/settings?tab=integrations",className:"block rounded-xl border border-dashed border-outline-variant p-5 text-center hover:bg-surface-container-low transition-colors",children:[(0,t.jsx)(u.Calendar,{className:"h-8 w-8 text-muted-foreground mx-auto mb-2"}),(0,t.jsx)("p",{className:"text-lg text-muted-foreground",children:"Connect Google Calendar to see your schedule"})]}),o&&(0,t.jsxs)("div",{ref:g,"data-hour-grid":!0,className:"relative select-none",style:{height:I,cursor:f?.isDragging?"ns-resize":void 0},onMouseDown:A,onMouseMove:R,onMouseUp:O,onMouseLeave:()=>{f&&v(null)},children:[Array.from({length:M-S+1},(e,a)=>{let n=S+a;return(0,t.jsx)("div",{className:"absolute left-0 right-0",style:{to
8p:52*a},children:(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground/60 tabular-nums shrink-0 -translate-y-1/2",style:{width:48},children:n<24?0===n||24===n?"12 AM":12===n?"12 PM":n<12?`${n} AM`:`${n-12} PM`:""}),(0,t.jsx)("div",{className:"flex-1 border-t border-outline-variant/30"})]})},n)}),D&&(0,t.jsxs)("div",{className:"absolute right-0 z-20 flex items-center",style:{top:T,left:44},children:[(0,t.jsx)("div",{className:"w-2 h-2 rounded-full bg-destructive"}),(0,t.jsx)("div",{className:"flex-1 border-t-2 border-destructive"})]}),E.map(e=>{let a=e.columnCount,n=e.columnIndex;return(0,t.jsxs)("div",{"data-event-block":!0,className:"absolute",style:{top:e.top,height:e.height,left:`calc(52px + (100% - 52px) * ${n} / ${a})`,width:`calc((100% - 52px) / ${a} - 2px)`},children:[(0,t.jsxs)("div",{onClick:()=>{x(h===e.id?null:e.id)},className:`h-full rounded-lg border-l-[3px] border-primary px-3 py-1.5 overflow-hidden transition-colors cursor-pointer ${h===e.id?"bg-primary/20":"bg-primary/10 hover:bg-primary/15"}`,children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground truncate leading-tight",children:e.title||"Untitled event"}),e.height>=40&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.timeLabel}),e.contact&&e.height>=56&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[(0,t.jsx)(z.ContactAvatar,{name:e.contact.name,photoUrl:e.contact.photo_url,className:"w-5 h-5 text-[10px]"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:e.contact.name})]})]}),h===e.id&&(0,t.jsx)(ec,{event:e,onClose:()=>x(null),onLogConversation:l})]},e.id)}),P&&(0,t.jsx)("div",{className:"absolute rounded-lg bg-primary/20 border-2 border-dashed border-primary/50 px-3 py-1.5 pointer-events-none",style:{top:P.top,height:P.height,left:52,right:0},children:(0,t.jsx)("p",{className:"text-xs font-medium text-primary",children:P.label})}),y&&(0,t.jsxs)("div",{className:"absolute",style:{top:(y.startHour-S)*52,height:(y.endHour-y.startHour)*52,left:52,right:0},children:[(0,t.jsxs)("div",{className:"h-full rounded-lg bg-primary/15 border-l-[3px] border-primary px-3 py-1.5",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-primary",children:"(No title)"}),(0,t.jsxs)("p",{className:"text-xs text-primary/70",children:[el(y.startHour)," â ",el(y.endHour)]})]}),(0,t.jsx)(ed,{draft:y,onSave:F,onCancel:()=>b(null)})]})]})]})}var em=e.i(60863);function eh(){let[e,n]=(0,a.useState)([]);return((0,a.useEffect)(()=>{let e=!1;return(0,ei.apiFetch)("/api/discovery/candidates").then(t=>{if(e||!t?.candidates)return;let a=new Map;for(let e of t.candidates){let t=a.get(e.company_id);t?t.count+=1:a.set(e.company_id,{companyId:e.company_id,companyName:e.companies?.name??"a target company",count:1})}n([...a.values()].sort((e,t)=>t.count-e.count))}).catch(()=>{}),()=>{e=!0}},[]),0===e.length)?null:(0,t.jsxs)("div",{className:"mt-10",children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-foreground",children:"Discovery"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-0.5 mb-4",children:"New PMs at your target companies"}),(0,t.jsx)("div",{className:"rounded-xl border border-outline-variant/40 divide-y divide-outline-variant/30 overflow-hidden",children:e.map(e=>(0,t.jsxs)(U.default,{href:`/companies/${e.companyId}`,className:"flex items-center justify-between gap-2 px-4 py-3 text-sm text-foreground hover:bg-surface-container-low transition-colors",children:[(0,t.jsxs)("span",{className:"min-w-0 truncate",children:[(0,t.jsxs)("span",{className:"font-medium",children:[e.count," new PM",1===e.count?"":"s"]})," ","just joined ",e.companyName]}),(0,t.jsx)(B.ChevronRight,{className:"w-4 h-4 text-muted-foreground shrink-0"})]},e.companyId))})]})}var ex=e.i(53651),ep=e.i(60317);let eg=(0,ep.default)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]),ef=(0,ep.default)("trending-down",[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]);var ev=e.i(40304),ey=e.i(3887);function eb({current:e,previous:a}){let n=e-a;return n>0?(0,t.jsx)(eg,{className:"h-6 w-6 text-primary"}):n<0?(0,t.jsx)(ef,{className:"h-6 w-6 text-destructive"}):(0,t.jsx)(ev.Minus,{className:"h-6 w-6 text-muted-foreground"})}function ej({stats:e}){let[n,s]=(0,a.useState)(null),[r,o]=(0,a.useState)({x:0,y:0}),{tooltipRef:i,handleMouseMove:l}=(0,ey.useCursorTooltip)();return(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:e.map(e=>{let a=e.value-e.previousValue,c=e.tooltipLines&&e.tooltipLines.length>0;return(0,t.jsxs)("div",{className:`rounded-xl bg-surface-container-low px-7 py-6 relative ${c?"cursor-default":""}`,onMouseEnter:t=>{c&&(o({x:t.clientX,y:t.clientY}),s(e.label))},onMouseLeave:()=>s(null),onMouseMove:c?l:void 0,children:[n===e.label&&e.tooltipLines&&(0,ex.createPortal)((0,t.jsx)("div",{ref:i,className:"fixed z-[9999] px-4 py-3 rounded-xl bg-surface-container-highest border border-outline-variant shadow-lg min-w-[220px] pointer-events-none",style:{left:r.x+14,top:r.y-60},children:e.tooltipLines.map((e,a)=>(0,t.jsx)("p",{className:"text-sm text-foreground whitespace-nowrap",children:e},a))}),document.body),(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsxs)("span",{className:"text-5xl font-semibold text-foreground tabular-nums",children:[e.value,e.isPercentage?"%":""]}),(0,t.jsx)(eb,{current:e.value,previous:e.previousValue})]}),(0,t.jsx)("p",{className:"text-lg text-muted-foreground mt-1.5",children:e.label}),0!==a&&(0,t.jsxs)("p",{className:`text-base mt-0.5 ${a>0?"text-primary":"text-destructive"}`,children:[a>0?"+":"",a,e.isPercentage?"%":""," vs prior 7 days"]})]},e.label)})})}let ew=["#ebedf0","#d4e8d0","#94d58f","#4caf50","#2d6a30"],eN=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ek({data:e}){let[n,s]=(0,a.useState)(null),{weeks:r,maxCount:o,monthLabels:i}=(0,a.useMemo)(()=>
8{if(0===e.length)return{weeks:[],maxCount:1,monthLabels:[]};let t=Math.max(...e.map(e=>e.count),1),a=[],n=[];for(let t=0;t<e.length;t++)n.push(e[t]),(6===e[t].dayOfWeek||t===e.length-1)&&(a.push(n),n=[]);let s=[],r=-1;for(let e=0;e<a.length;e++){let t=a[e][0];if(!t)continue;let n=new Date(t.date+"T12:00:00").getMonth();n!==r&&(s.push({label:eN[n],weekIndex:e}),r=n)}return{weeks:a,maxCount:t,monthLabels:s}},[e]);return 0===e.length?null:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"flex",style:{paddingLeft:40,height:22},children:(0,t.jsx)("div",{className:"relative w-full",children:i.map(e=>(0,t.jsx)("span",{className:"absolute text-sm text-muted-foreground",style:{left:21*e.weekIndex},children:e.label},`${e.label}-${e.weekIndex}`))})}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("div",{className:"flex flex-col shrink-0",style:{width:40,height:143},children:["","Mon","","Wed","","Fri",""].map((e,a)=>(0,t.jsx)("span",{className:"text-sm text-muted-foreground leading-none",style:{height:17,marginBottom:4*(a<6),display:"flex",alignItems:"center"},children:e},a))}),(0,t.jsx)("div",{className:"flex overflow-x-auto",style:{gap:4},children:r.map((e,a)=>(0,t.jsxs)("div",{className:"flex flex-col",style:{gap:4},children:[0===a&&Array.from({length:e[0]?.dayOfWeek||0}).map((e,a)=>(0,t.jsx)("div",{style:{width:17,height:17}},`pad-${a}`)),e.map(e=>(0,t.jsx)("div",{className:"rounded-[2px] cursor-default",style:{width:17,height:17,backgroundColor:function(e,t){if(0===e)return ew[0];let a=e/Math.max(t,8);return a<=.25?ew[1]:a<=.5?ew[2]:a<=.75?ew[3]:ew[4]}(e.count,o)},onMouseEnter:t=>{let a=t.currentTarget.getBoundingClientRect();s({date:e.date,count:e.count,conversations:e.conversations||0,actions:e.actions||0,contacts:e.contacts||0,x:a.left+a.width/2,y:a.top})},onMouseLeave:()=>s(null)},e.date)),a===r.length-1&&e[e.length-1]&&Array.from({length:6-e[e.length-1].dayOfWeek}).map((e,a)=>(0,t.jsx)("div",{style:{width:17,height:17}},`pad-end-${a}`))]},a))})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-2",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Less"}),ew.map((e,a)=>(0,t.jsx)("div",{className:"rounded-[3px]",style:{width:14,height:14,backgroundColor:e}},a)),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"More"})]}),n&&(0,t.jsxs)("div",{className:"fixed z-50 px-3 py-2 rounded-lg bg-foreground text-background text-xs pointer-events-none",style:{left:n.x,top:n.y-8,transform:"translate(-50%, -100%)"},children:[(0,t.jsx)("p",{className:"font-medium mb-0.5",children:new Date(n.date+"T12:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),0===n.count?(0,t.jsx)("p",{className:"text-background/70",children:"No activity"}):(0,t.jsxs)("div",{className:"space-y-0.5 text-background/90",children:[n.conversations>0&&(0,t.jsxs)("p",{children:[n.conversations," conversation",1!==n.conversations?"s":""," held"]}),n.actions>0&&(0,t.jsxs)("p",{children:[n.actions," action",1!==n.actions?"s":""," taken"]}),n.contacts>0&&(0,t.jsxs)("p",{children:[n.contacts," contact",1!==n.contacts?"s":""," added"]})]})]})]})}let eC=[{key:"healthy",color:"#4caf50",label:"Healthy",description:"Contacted on schedule"},{key:"dueSoon",color:"#ff9800",label:"Due soon",description:"Check-in coming up"},{key:"overdue",color:"#e05555",label:"Overdue",description:"Past their check-in date"},{key:"neverContacted",color:"#9e9e9e",label:"Never contacted",description:"Added but never reached out to"},{key:"noCadence",color:"#e0e0e0",label:"No cadence",description:"No check-in schedule set"}];function eS({data:e}){let[n,s]=(0,a.useState)(null),[r,o]=(0,a.useState)({x:0,y:0}),{tooltipRef:i,handleMouseMove:l}=(0,ey.useCursorTooltip)();if(0===e.total)return null;let c=2*Math.PI*70,d=eC.map(t=>{let a=e[t.key],n=e.total>0?a/e.total:0;return{...t,value:a,pct:n,dashLength:n*c}}).filter(e=>e.value>0),u=d.map((e,t)=>{let a=-d.slice(0,t).reduce((e,t)=>e+t.dashLength,0);return{...e,dashOffset:a}}),m=n?u.find(e=>e.key===n):null;return(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,t.jsxs)("div",{className:"relative",style:{width:160,height:160},onMouseMove:l,children:[(0,t.jsx)("svg",{width:160,height:160,className:"-rotate-90 overflow-visible",children:u.map(e=>(0,t.jsx)("circle",{cx:80,cy:80,r:70,fill:"none",stroke:e.color,strokeWidth:n===e.ke
8y?24:20,strokeDasharray:`${e.dashLength} ${c-e.dashLength}`,strokeDashoffset:e.dashOffset,className:"transition-all duration-200 cursor-default",onMouseEnter:t=>{o({x:t.clientX,y:t.clientY}),s(e.key)},onMouseLeave:()=>s(null)},e.key))}),(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,t.jsx)("span",{className:"text-2xl font-semibold text-foreground",children:e.total})}),m&&(0,ex.createPortal)((0,t.jsxs)("div",{ref:i,className:"fixed z-[9999] px-4 py-2.5 rounded-xl bg-surface-container-highest border border-outline-variant shadow-lg pointer-events-none",style:{left:r.x+14,top:r.y-60},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"w-3 h-3 rounded-full",style:{backgroundColor:m.color}}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:m.label})]}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground mt-0.5",children:[m.value," contact",1!==m.value?"s":""," · ",Math.round(100*m.pct),"%"]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/70 mt-0.5",children:m.description})]}),document.body)]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 justify-center",children:u.map(e=>(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"inline-block w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),Math.round(100*e.pct),"% ",e.label]},e.key))})]})}function eM({contacts:e}){let[n,s]=(0,a.useState)(0);if(0===e.length)return(0,t.jsxs)("div",{className:"rounded-xl bg-surface-container-low p-4 text-center",children:[(0,t.jsx)("p",{className:"text-lg text-primary font-medium",children:"All caught up"}),(0,t.jsx)("p",{className:"text-base text-muted-foreground mt-0.5",children:"No relationships need urgent attention"})]});let r=Math.ceil(e.length/20),o=e.slice(20*n,(n+1)*20);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsxs)("p",{className:"text-lg font-medium text-foreground",children:["Needs Attention",(0,t.jsx)("span",{className:"text-base text-muted-foreground font-normal ml-2",children:e.length})]}),r>1&&(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("button",{onClick:()=>s(e=>Math.max(0,e-1)),disabled:0===n,className:"p-1 rounded-md hover:bg-surface-container-highest disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:(0,t.jsx)(Y.ChevronLeft,{className:"h-4 w-4 text-muted-foreground"})}),(0,t.jsxs)("span",{className:"text-sm text-muted-foreground tabular-nums min-w-[3ch] text-center",children:[n+1,"/",r]}),(0,t.jsx)("button",{onClick:()=>s(e=>Math.min(r-1,e+1)),disabled:n===r-1,className:"p-1 rounded-md hover:bg-surface-container-highest disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:(0,t.jsx)(B.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"w-3 h-3 rounded-full ring-[2.5px] ring-[#e05555] bg-transparent"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"w-3 h-3 rounded-full ring-[2.5px] ring-[#9e9e9e] bg-transparent"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Never contacted"})]})]}),(0,t.jsx)("div",{className:"grid grid-cols-5 gap-3",children:o.map(e=>{let a,{label:n,borderClass:s}=(a=e.follow_up_frequency_days?` \xb7 every ${e.follow_up_frequency_days}d`:"",null===e.days_since_touch?{label:`Never contacted${a}`,borderClass:"ring-[#9e9e9e]"}:{label:`${e.days_since_touch}d since contact${a}`,borderClass:"ring-[#e05555]"});return(0,t.jsxs)(U.default,{href:`/contacts/${e.id}`,className:"group relative flex flex-col items-center",children:[(0,t.jsx)(z.ContactAvatar,{name:e.name,photoUrl:e.photo_url,className:"w-14 h-14 text-lg group-hover:scale-110 transition-transform",ringClassName:s}),(0,t.jsxs)("div",{className:"absolute -bottom-1 translate-y-full opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10 bg-surface-container-highest text-foreground text-sm rounded-lg px-3 py-1.5 shadow-lg whitespace-nowrap text-center",children:[(0,t.jsx)("p",{className:"font-medium",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n})]})]},e.id)})})]})}let eI=(0,ep.default)("flame",[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",ke
8y:"1slcih"}]]);function e_({stats:e,heatmapData:a,healthSummary:n,neglectedContacts:s,relationshipsOnTrack:r,streak:o,loading:i}){if(i)return(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-[28px] font-medium text-foreground mb-3",children:"Network Overview"}),(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4 mb-6",children:[1,2,3].map(e=>(0,t.jsx)("div",{className:"h-24 rounded-xl bg-surface-container-highest animate-pulse"},e))}),(0,t.jsx)("div",{className:"h-36 rounded-xl bg-surface-container-highest animate-pulse"})]});if(!e)return null;let l=r?[`${r.onTrack} of ${r.total} relationships on track`,`${r.breakdown.withCadenceOnTrack} contacted on schedule`,`${r.breakdown.withCadenceOverdue} past their check-in date`,...r.breakdown.noCadence>0?[`${r.breakdown.noCadence} have no check-in schedule`]:[],...r.breakdown.neverContactedPast7d>0?[`${r.breakdown.neverContactedPast7d} never contacted`]:[]]:[],c=(e,t,a)=>`${e} ${1===e?t:a??t+"s"}`,d=(e,t,a,n)=>{if(0===e&&0===t)return[];let s=e-t,r=Math.abs(s),o=1===r?a:n;return s>0?[`â ${r} more ${o} than prior 7 days`]:s<0?[`â ${r} fewer ${o} than prior 7 days`]:["Same as prior 7 days"]},u=[{label:"Meetings (7 days)",value:e.meetings.current,previousValue:e.meetings.previous,tooltipLines:[`${c(e.meetings.current,"meeting")} logged`,...e.emailsSent.current>0?[`${c(e.emailsSent.current,"email")} sent`]:[],...e.completedItems.current>0?[`${c(e.completedItems.current,"action item")} completed`]:[],...d(e.meetings.current,e.meetings.previous,"meeting","meetings")]},{label:"Relationships on track",value:r?.percentage??0,previousValue:r?.percentage??0,isPercentage:!0,tooltipLines:l},{label:"Contacts added",value:e.contactsAdded.current,previousValue:e.contactsAdded.previous,tooltipLines:[`${c(e.contactsAdded.current,"new contact")} in the last 7 days`,...d(e.contactsAdded.current,e.contactsAdded.previous,"contact","contacts")]}],m=e.completedItems.current+e.touchpoints.current,h=e.completedItems.previous+e.touchpoints.previous,x=h>0?Math.round((m-h)/h*100):100*(m>0);return(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-[28px] font-medium text-foreground mb-3",children:"Network Overview"}),(0,t.jsxs)("div",{className:"flex flex-col lg:flex-row gap-8 items-start",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)(ej,{stats:u}),(0,t.jsxs)("div",{className:"mt-6 flex flex-col lg:flex-row gap-12 items-start",children:[(0,t.jsxs)("div",{className:"min-w-0 shrink-0",children:[(0,t.jsx)(ek,{data:a}),(0,t.jsxs)("div",{className:"mt-3 flex items-center justify-between",children:[(m>0||h>0)&&(0,t.jsxs)("div",{className:"flex items-center gap-2.5 text-lg text-muted-foreground",children:[x>0?(0,t.jsx)(eg,{className:"h-4 w-4 text-primary"}):x<0?(0,t.jsx)(ef,{className:"h-4 w-4 text-destructive"}):(0,t.jsx)(ev.Minus,{className:"h-4 w-4"}),(0,t.jsxs)("span",{children:["vs prior 7 days:"," ",(0,t.jsxs)("span",{className:x>0?"text-primary":x<0?"text-destructive":"",children:[x>0?"+":"",x,"% ",x>0?"more":x<0?"less":""," active"]})]})]}),o>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-base text-muted-foreground",children:[(0,t.jsx)(eI,{className:"h-4 w-4 text-tertiary"}),(0,t.jsx)("span",{className:"font-medium tabular-nums",children:o}),(0,t.jsxs)("span",{children:["day",1!==o?"s":""]})]})]})]}),n&&n.total>0&&(0,t.jsx)("div",{className:"shrink-0",children:(0,t.jsx)(eS,{data:n})})]})]}),(0,t.jsx)("div",{className:"shrink-0 w-full lg:w-auto",children:(0,t.jsx)(eM,{contacts:s})})]})]})}var eD=e.i(2912),eT=e.i(70316);function eE(e){return null===e?"Never contacted":0===e?"Contacted today":1===e?"1 day ago":`${e}d ago`}e.s(["default",0,function(){let{user:e,loading:o}=(0,s.useAuth)(),{open:i}=(0,T.useQuickCapture)(),{open:l}=(0,E.useExtensionOnboarding)(),{openCompose:c}=(0,L.useCompose)(),{toast:d}=(0,$.useToast)(),{calendarConnected:u,loading:m}=(0,R.useGmailConnection)(),h=e?`careervine-home:${e.id}`:null,x=(0,a.useMemo)(()=>{if(!h)return null;try{let e=localStorage.getItem(h);if(!e)return null;let t=JSON.parse(e);if(t._ts&&Date.now()-t._ts>3e5)return null;return t}catch{return null}},[h]),[p,g]=(0,a.useState)(x?.actionItems??[]),[f,v]=(0,a.useState)(x?.followUps??[]),[y,b]=(0,a.useState)(x?.contactHealth??[]),[j,w]=(0,a.useState)(!!x),[O,P]=(0,a.useState)(!1),[U,z]=(0,a.useState)(!!x),[F,Y]=(0,a.useState)([]),[B,G]=(0,a.useState)(!0),[V,q]=(0,a.useState)(!1),[K,W]=(0,a.useState)(x?.newContacts??[]),[J,X]=(0,a.useState)(null),[Q,Z]=(0,a.useState)([]),[ee,ea]=(0,a.useState)(null),[en,es]=(0,a.useState)([]),[er,eo]=(0,a.useState)(!0),[el,ec]=(0,a.useState)(null),[ed,ex]=(0,a.useState)(!1),[ep,eg]=(0,a.useState)(0),[ef,ev]=(0,a.useState)([]),[ey,eb]=(0,a.useState)(0),[ej,ew]=(0,a.useState)(!1),eN=(0,a.useRef)(null),[ek,eC]=(0,a.useState)(0);(0,a.useEffect)(()=>{ej&&j&&eN.current&&eC(eN.current.clientHeight)},[ej,j]);let eS=ej&&ek>0?ek:ey,{suggestions:eM,loading:eI,loadFailed:eL,load:e$,save:eA,complete:eR,dismiss:eO,triggerOnce:eP}=(0,A.useSuggestions)({onDismissFailed:()=>d("Couldn't dismiss that suggestion. Please try again.",{variant:"error"})}),eH=(0,a.useMemo)(()=>{let e=new Map;
8for(let t of y)e.set(t.id,t.days_since_touch);return e},[y]),eU=(0,a.useRef)(eH);(0,a.useEffect)(()=>{eU.current=eH},[eH]);let ez=(0,a.useCallback)(async()=>{if(e){P(!1);try{let t=await (0,S.getHomeCoreData)(e.id),a=t.actionItems.slice(0,15),n=t.recentlyAdded.map(e=>({id:e.id,name:e.name,photo_url:e.photo_url,emails:e.emails,created_at:e.created_at??null}));if(g(a),v(t.followUps),b(t.contactHealth),W(n),ea(t.networkHealth),es(t.neglectedContacts),ec(t.relationshipsOnTrack),z(!0),h)try{localStorage.setItem(h,JSON.stringify({_ts:Date.now(),actionItems:a,followUps:t.followUps,contactHealth:t.contactHealth,newContacts:n}))}catch{}}catch{P(!0)}w(!0),ex(!0)}},[e,h]),eF=(0,a.useCallback)(async()=>{if(e&&!m){if(!u)return void G(!1);q(!1);try{await (0,ei.apiSend)("/api/calendar/sync",{method:"POST"}).catch(()=>{});let t=new Date,a=new Date(t.getFullYear(),t.getMonth(),t.getDate()).toISOString(),n=new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59).toISOString(),[s,r]=await Promise.all([(0,ei.apiFetch)(`/api/calendar/events?start=${encodeURIComponent(a)}&end=${encodeURIComponent(n)}`),(0,M.getContactEmailLookup)(e.id)]);Y((s.events||[]).map(e=>{let t,a=(0,em.parseCalendarAttendees)(e.attendees);for(let e of a){if(!e.email)continue;let a=r.get(e.email.toLowerCase());if(a){let e=eU.current.get(a.id);t={id:a.id,name:a.name,photo_url:a.photo_url,lastTouchLabel:eE(e??null)};break}}if(!t&&e.contact_id){for(let a of r.values())if(a.id===e.contact_id){let e=eU.current.get(a.id);t={id:a.id,name:a.name,photo_url:a.photo_url,lastTouchLabel:eE(e??null)};break}}return{id:e.id,title:e.title,start_at:e.start_at,end_at:e.end_at,description:e.description||null,location:e.location||null,meet_link:e.meet_link||null,attendees:a,contact:t,contact_id:e.contact_id??null}}))}catch{q(!0)}finally{G(!1)}}},[e,u,m]),eY=(0,a.useCallback)(async()=>{if(e)try{let t=await Promise.allSettled([(0,S.getHomeStats)(e.id),(0,S.getHomeActivity)(e.id)]);"fulfilled"===t[0].status&&X(t[0].value),"fulfilled"===t[1].status&&(Z(t[1].value.heatmap),eg(t[1].value.streak))}catch{}finally{eo(!1)}},[e]),eB=(0,a.useCallback)(async()=>{if(e)try{let t=await (0,S.getActionListCounts)(e.id),a=t.actionItems+t.reachOut+t.recentlyAdded;a<3?(ew(!0),eb(120+(a+2)*120)):eb(720+52*(a>5))}catch{}},[e]);(0,a.useEffect)(()=>{e&&(eB(),ez(),eY())},[e,eB,ez,eY]),(0,a.useEffect)(()=>{if(!e)return;let t=!1;return(0,D.getDismissedGettingStarted)(e.id).then(e=>{t||ev(e)}).catch(()=>{}),()=>{t=!0}},[e]),(0,a.useEffect)(()=>{j&&eF()},[j,eF]),(0,a.useEffect)(()=>{let e=()=>{ez(),eY()},t=[(0,n.onUiEvent)(n.UI_EVENTS.conversationLogged,e),(0,n.onUiEvent)(n.UI_EVENTS.emailSent,e),(0,n.onUiEvent)(n.UI_EVENTS.onboardingTodoChanged,e)];return()=>t.forEach(e=>e())},[ez,eY]),(0,a.useEffect)(()=>{if(!e)return;let t=Date.now(),a=()=>{t=Date.now(),ez(),eY()},n=setInterval(()=>{"visible"===document.visibilityState&&a()},3e5),s=()=>{"visible"===document.visibilityState&&Date.now()-t>=3e5&&a()};return document.addEventListener("visibilitychange",s),()=>{clearInterval(n),document.removeEventListener("visibilitychange",s)}},[e,ez,eY]),(0,a.useEffect)(()=>{j&&eP()},[j,eP]);let eG=(0,a.useCallback)(async e=>{try{await (0,I.updateActionItem)(e,{is_completed:!0,completed_at:new Date().toISOString()}),g(t=>t.filter(t=>t.id!==e)),d("Action item completed",{variant:"success"})}catch{d("Failed to complete action item",{variant:"error"})}},[d]),eV=(0,a.useCallback)(t=>{if(!e||ef.includes(t))return;let a=[...ef,t];ev(a),(0,D.setDismissedGettingStarted)(e.id,a).catch(()=>{ev(ef),d("Couldn't dismiss that item",{variant:"error"})})},[e,ef,d]),eq=(0,a.useCallback)(async e=>{await eA(e)?(d("Saved to action items",{variant:"success"}),ez()):d("Failed to save",{variant:"error"})},[eA,d,ez]),eK=(0,a.useCallback)(async e=>{await eR(e)?d("Marked as done",{variant:"success"}):d("Failed to mark as done",{variant:"error"})},[eR,d]),eW=(0,a.useMemo)(()=>{let e=[],t=(0,eD.todayDateKey)();for(let a of p){if("waiting_on"===a.direction)continue;if("onboarding"===a.source){e.push({id:`ob-${a.id}`,type:"onboarding",contactId:0,contactName:"Getting started",contactPhotoUrl:null,primaryText:a.title,secondaryText:a.description||"",lastContactedLabel:"",priority:90,actionItemId:a.id});continue}let n=(0,eD.dueDateKey)(a.due_at),s=null!==n&&n<t,r=n?s?`Overdue \xb7 Due ${(0,eD.formatDueDate)(a.due_at)}`:`Due ${(0,eD.formatDueDate)(a.due_at)}`:"No due date",o=a.contacts?.name||"Unknown",i=a.contacts?.id||0,l=eU.current.get(i)??null;e.push({id:`ai-${a.id}`,type:"action_item",contactId:i,contactName:o,contactPhotoUrl:a.contacts?.photo_url||null,primaryText:`${a.title} \xb7 ${r}`,secondaryText:a.description||"",lastContactedLabel:eE(l),priority:s?100:n?50:10,actionItemId:a.id,dueAt:a.due_at||void 0,isOverdue:s})}for(let t of f){let a,n=t.last_touch?(0,eT.daysBetweenDateKeys)((0,eT.dateKeyOf)(new Date(t.last_touch)),(0,eD.todayDateKey)()):null;a=t.no_cadence?t.never_contacted?"No cadence set · Never contacted":"No cadence set"
8:t.never_contacted?t.days_overdue>0?`Send first message \xb7 ${t.days_overdue}d overdue`:"Send first message · Due today":t.days_overdue>0?`${t.days_overdue}d overdue`:"Due today",e.push({id:`ro-${t.id}`,type:"reach_out",contactId:t.id,contactName:t.name,contactPhotoUrl:t.photo_url,primaryText:a,secondaryText:"",lastContactedLabel:t.never_contacted?"Never contacted":eE(n),priority:60+Math.min(t.days_overdue,30),daysOverdue:t.days_overdue,hasEmail:t.emails.length>0})}for(let t of eM){let a;a=null!=t.changeEventId?t.score>=85?95:45:5+t.score/10,e.push({id:`sg-${t.id}`,type:"suggestion",contactId:t.contactId,contactName:t.contactName,contactPhotoUrl:t.contactPhotoUrl,primaryText:t.headline.length>80?t.headline.slice(0,77)+"â¦":t.headline,secondaryText:t.suggestedTitle.length>90?t.suggestedTitle.slice(0,87)+"â¦":t.suggestedTitle,lastContactedLabel:eE(t.daysSinceContact),priority:a,daysSinceContact:t.daysSinceContact,suggestion:t})}for(let t of K){let a=t.created_at?Math.floor((Date.now()-new Date(t.created_at).getTime())/864e5):0,n=0===a?"Added today":1===a?"Added yesterday":`Added ${a}d ago`;e.push({id:`nc-${t.id}`,type:"recently_added",contactId:t.id,contactName:t.name,contactPhotoUrl:t.photo_url,primaryText:n,secondaryText:"",lastContactedLabel:"Never contacted",priority:30,hasEmail:t.emails.length>0})}return e.sort((e,t)=>t.priority-e.priority),e},[p,f,eM,K]),eJ=(0,a.useCallback)(e=>{"action_item"===e.type&&e.actionItemId?eG(e.actionItemId):"reach_out"===e.type?i(e.contactId):"suggestion"===e.type&&e.suggestion&&eK(e.suggestion)},[eG,i,eK]),eX=(0,a.useCallback)(async(e,t)=>{try{let a,n;if("skip_contact"===t.type){await (0,_.skipContactFirstOutreach)(e.contactId),W(t=>t.filter(t=>t.id!==e.contactId)),d("Contact skipped",{variant:"info"});return}if("until_next_followup"===t.type){let t="action_item"===e.type?(0,eD.dueDateKey)(e.dueAt):null;if(null!==t&&t>(0,eD.todayDateKey)())a=(0,eT.localMidnightIso)(t);else{let t=f.find(t=>t.id===e.contactId),n=t?.follow_up_frequency_days||30,s=new Date;s.setDate(s.getDate()+n),a=s.toISOString()}n="Snoozed until next follow-up"}else{let e=new Date;e.setDate(e.getDate()+t.days),a=e.toISOString(),n=`Snoozed for ${t.days} day${t.days>1?"s":""}`}if("action_item"===e.type&&e.actionItemId)await (0,I.snoozeActionItem)(e.actionItemId,a),g(t=>t.filter(t=>t.id!==e.actionItemId));else if("reach_out"===e.type)await (0,_.snoozeContact)(e.contactId,a),v(t=>t.filter(t=>t.id!==e.contactId));else if("recently_added"===e.type)await (0,_.snoozeContact)(e.contactId,a),W(t=>t.filter(t=>t.id!==e.contactId));else if("suggestion"===e.type&&e.suggestion){if(!await eA(e.suggestion))return void d("Couldn't snooze that suggestion. Please try again.",{variant:"error"});await (0,_.setSuggestionCooldown)(e.contactId),await (0,_.snoozeContact)(e.contactId,a)}d(n,{variant:"info"})}catch{d("Failed to snooze",{variant:"error"})}},[d,f,eA]),eQ=(0,a.useCallback)(async e=>{if(e.suggestion&&await eO(e.suggestion))try{await (0,_.setSuggestionCooldown)(e.contactId)}catch{}},[eO]),eZ=(0,a.useCallback)(e=>{e.suggestion&&eq(e.suggestion)},[eq]),e0=(0,a.useCallback)(e=>i(e),[i]),e1=(0,a.useCallback)(e=>{let t=f.find(t=>t.id===e);t&&c({to:t.emails[0]||"",name:t.name,subject:"",bodyHtml:"",isIntro:t.never_contacted,contactId:e})},[f,c]),e5=(0,a.useCallback)(async(e,t)=>{try{await (0,M.appendContactNote)(e,t),d("Note saved",{variant:"success"})}catch{d("Failed to save note",{variant:"error"})}},[d]),e2=(0,a.useCallback)(e=>{let t=K.find(t=>t.id===e);t&&c({to:t.emails[0]||"",name:t.name,subject:"",bodyHtml:"",isIntro:!0,contactId:e})},[K,c]);if(o)return(0,t.jsx)("div",{className:"min-h-screen bg-background flex items-center justify-center",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,t.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-primary border-t-transparent"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]})});if(!e)return(0,t.jsx)(N,{});let e4=p.length>0||f.length>0||y.length>0||K.length>0;if(O&&!e4&&!U)return(0,t.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,t.jsx)(k.default,{}),(0,t.jsx)("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-10",children:(0,t.jsx)(C.LoadErrorState,{message:"We could not load your dashboard",onRetry:()=>{w(!1),eB(),ez(),eY()}})})]});let e6=j&&0===y.length,e3=p.filter(e=>"onboarding"!==e.source),e7=e6&&0===e3.length&&0===f.length&&0===eM.length;return(0,t.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,t.jsx)(k.default,{}),(0,t.jsx)(H,{onClick:()=>i()}),(0,t.jsxs)("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-10",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_340px] gap-8 mb-8",children:[(0,t.jsxs)("div",{ref:eN,children:[eL&&!eI&&(0,t.jsx)(C.LoadErrorBanner,{className:"mb-4",message:"Couldn't load your suggestions.",onRetry:()=>{e$()}}),(0,t.jsx)(et,{items:eW,loading:!j||eI,onComplete:eJ,onSnooze:eX,onDismiss:eQ,onSave:eZ,onLogInteraction:e0,onDraftEmail:e1,onNote:e5,onIntro:e2,onOpenOnboarding:e=>l(e.actionItemId),isEmpty:e7,onLogConversation:()=>i(),calendarConnected:u,dismissedGettingStarted:ef,onDismissGettingStarted:eV})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eu,{events:F,loading:B,loadFailed:V,onRetry:()=>{G(!0),eF()},calendarConnected:u,availableHeight:eS,onLogConversation:e=>{let t=e.startAt?new Date(e.startAt):null;i({contactId:e.contactId,title:e.title,date:t?`${t.getFullYear()}
8-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`:void 0,time:t?`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`:void 0,meetingType:e.meetLink?r.ConversationType.Coffee:void 0})},onEventCreated:eF}),(0,t.jsx)(eh,{})]})]}),j&&!e6&&(0,t.jsx)(e_,{stats:J,heatmapData:Q,healthSummary:ee,neglectedContacts:en,relationshipsOnTrack:el,streak:ep,loading:er||!ed})]})]})}],87758)}]);
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.