PageSourceSearch

https://nyanza.ai/assets/Network-BSc32nQj.js

js nyanza.ai collected 2026-10-02 01:12:36 UTC 15,605 bytes, 6 lines download raw bytes

1import{m as W,r as i,j as e,L as D}from"./react-TITiJaTY.js";import{a as Y,c as H,e as q,g as G,bP as z,bQ as M,bR as J,ad as T,bS as U,ba as K,bT as Q,bU as V,ai as X,ar as Z}from"./App-Dli7sJFM.js";import{a5 as ee}from"./llm-CdWZ4qgd.js";import{I as h}from"./shared-lite-BOZiOCY1.js";import{A as ae}from"./AppHeader-Bv7bfOUu.js";import{S as se}from"./SectionTabs-DD1NeLsB.js";import{P as ne}from"./PageHow-C48AC2is.js";import{A as te}from"./AgentActivity-ClnQdxzU.js";import oe from"./ReferralPaths-ldDS1CtP.js";import{m as C,A as _}from"./motion-DheP8iPc.js";import"./index-D0VpW5-F.js";import"./memory-BnxUEnat.js";import"./podcastDeviceState-B0NlAIS7.js";import"./Skeleton-BCU2RlMF.js";const F=[{key:"reconnect",label:"Reconnect"},{key:"referral",label:"Ask for a referral"},{key:"intro",label:"Nice to meet"},{key:"thanks",label:"Say thanks"},{key:"update",label:"Share an update"}],le=s=>{var t;return((t=z.find(l=>l.key===s))==null?void 0:t.label)||"Contact"},L=s=>String(s||"").split(/\s+/).filter(Boolean).slice(0,2).map(t=>{var l;return(l=t[0])==null?void 0:l.toUpperCase()}).join("")||"?";function re(s){var l;const t=[];return s.resumeText&&t.push(s.resumeText),(l=s.learnedSkills)!=null&&l.length&&t.push("Skills: "+s.learnedSkills.join(", ")),t.join(`
2`).slice(0,2e3)}function O(s){const t=Q(s.lastContact);return t===1/0?"No contact yet":t<=0?"Today":t===1?"Yesterday":t<30?`${t}d ago`:`${Math.round(t/30)}mo ago`}function ie({initial:s,onSave:t,onCancel:l}){const[o,c]=i.useState(()=>({name:"",email:"",company:"",role:"",type:"recruiter",met:"",notes:"",lastContact:K(Date.now()),followUpDue:"",...s})),m=r=>j=>c(w=>({...w,[r]:j.target.value})),u=r=>{r.preventDefault(),o.name.trim()&&t(o)};return e.jsxs(C.form,{className:"nw-form card",onSubmit:u,initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsxs("div",{className:"nw-form-grid",children:[e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Name *"}),e.jsx("input",{value:o.name,onChange:m("name"),placeholder:"e.g. Sarah Chen",autoFocus:!0})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Company"}),e.jsx("input",{value:o.company,onChange:m("company"),placeholder:"e.g. Netflix"})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Their role"}),e.jsx("input",{value:o.role,onChange:m("role"),placeholder:"e.g. Eng Manager"})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Relationship"}),e.jsx("select",{value:o.type,onChange:m("type"),children:z.map(r=>e.jsx("option",{value:r.key,children:r.label},r.key))})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Email"}),e.jsx("input",{type:"email",value:o.email,onChange:m("email"),placeholder:"optional - for drafts"})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"How you met"}),e.jsx("input",{value:o.met,onChange:m("met"),placeholder:"e.g. AWS re:Invent 2025"})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Last spoke"}),e.jsx("input",{type:"date",value:o.lastContact,onChange:m("lastContact")})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Follow up by"}),e.jsx("input",{type:"date",value:o.followUpDue,onChange:m("followUpDue")})]}),e.jsxs("label",{className:"field nw-form-notes",children:[e.jsx("span",{children:"Notes"}),e.jsx("textarea",{rows:2,value:o.notes,onChange:m("notes"),placeholder:"What you talked about, what they care about..."})]})]}),e.jsxs("div",{className:"nw-form-actions",children:[e.jsx("button",{type:"button",className:"btn btn-ghost",onClick:l,children:"Cancel"}),e.jsx("button",{type:"submit",className:"btn btn-primary",disabled:!o.name.trim(),children:s!=null&&s.id?"Save":"Add contact"})]})]})}function ce({contact:s,profile:t,user:l,onClose:o}){var b;const[c,m]=i.useState("reconnect");i.useEffect(()=>{try{const n=JSON.parse(sessionStorage.getItem("nemo_network_handoff")||"null");n!=null&&n.intent&&m(n.intent),n&&sessionStorage.removeItem("nemo_network_handoff")}catch{}},[]);const[u,r]=i.useState(!1),[j,w]=i.useState(!1),[d,x]=i.useState(null),[g,S]=i.useState(!1),[N,k]=i.useState(!1),f=i.useRef(null),$=t.fullName||(l==null?void 0:l.name)||"me";i.useEffect(()=>{var P;
2const n=(P=f.current)==null?void 0:P.closest(".nw-modal-back"),p=n==null?void 0:n.parentElement,v=(p?[...p.children].filter(y=>y!==n):[]).map(y=>({node:y,inert:y.hasAttribute("inert")}));for(const{node:y}of v)y.setAttribute("inert","");return()=>{for(const{node:y,inert:B}of v)B||y.removeAttribute("inert")}},[]),X({open:!0,onClose:o,ref:f});const I=async n=>{const p=n||c;r(!0),w(!1),x(null);try{const A=[re(t),Z(t)].filter(Boolean).join(`
3
4`),v=await ee({name:$,role:t.targetRole||"",resume:A,contact:s,intent:p});if(!v.body)throw new Error("empty");x(v)}catch{w(!0)}finally{r(!1)}},R=()=>{const n=encodeURIComponent(s.email||""),p=encodeURIComponent((d==null?void 0:d.subject)||""),A=encodeURIComponent((d==null?void 0:d.body)||"");window.open(`mailto:${n}?subject=${p}&body=${A}`,"_blank")},E=async()=>{var n;k(!1);try{if(!((n=navigator.clipboard)!=null&&n.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(`${d.subject}
5
6${d.body}`),S(!0)}catch{k(!0)}},a=()=>{U(s.id),T({source:"network",event:`Reached out to ${s.name}${s.company?` at ${s.company}`:""}`,worked:"Kept a relationship warm",change:"Wait for a reply, then log it",signal:"building",confidence:5}),o()};return e.jsx(C.div,{className:"nw-modal-back",initial:{opacity:0}
6,animate:{opacity:1},exit:{opacity:0},onClick:o,children:e.jsxs(C.div,{ref:f,className:"nw-modal card",role:"dialog","aria-modal":"true","aria-labelledby":"nw-draft-title",initial:{opacity:0,y:18,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10},onClick:n=>n.stopPropagation(),children:[e.jsx("button",{type:"button",className:"nw-modal-x",onClick:o,"aria-label":"Close message draft",children:e.jsx(h,{name:"x",size:16})}),e.jsxs("h3",{id:"nw-draft-title",className:"nw-modal-title",children:["Message ",s.name]}),e.jsx("p",{className:"nw-modal-sub",children:"Grounded in your background - pick the goal, edit before you send."}),e.jsx("div",{className:"nw-intents",children:F.map(n=>e.jsx("button",{type:"button",className:`nw-intent ${c===n.key?"on":""}`,"aria-pressed":c===n.key,onClick:()=>{m(n.key),I(n.key)},disabled:u,children:n.label},n.key))}),u&&e.jsx(te,{compact:!0,title:`Writing a ${(b=F.find(n=>n.key===c))==null?void 0:b.label.toLowerCase()} message`,skeletonLines:3}),j&&!u&&e.jsx("p",{className:"nw-offline",role:"alert",children:"Couldn't reach the AI - open Profile → AI engine and check your API key, then pick a goal again."}),d&&!u&&e.jsxs(C.div,{className:"nw-draft",initial:{opacity:0}
6,animate:{opacity:1},children:[e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Subject"}),e.jsx("input",{value:d.subject,onChange:n=>x(p=>({...p,subject:n.target.value}))})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Message"}),e.jsx("textarea",{rows:9,value:d.body,onChange:n=>x(p=>({...p,body:n.target.value}))})]}),e.jsxs("div",{className:"nw-draft-actions",children:[e.jsxs("button",{type:"button",className:"btn btn-ghost",onClick:E,children:[e.jsx(h,{name:"doc",size:14})," ",g?"Copied":"Copy"]}),e.jsxs("button",{type:"button",className:"btn btn-ghost",onClick:R,children:[e.jsx(h,{name:"chat",size:14})," Open in email"]}),e.jsxs("button",{type:"button",className:"btn btn-primary",onClick:a,children:[e.jsx(h,{name:"check",size:14})," Mark as sent"]})]}),N&&e.jsx("p",{className:"nw-offline",role:"alert",children:"Clipboard access is unavailable. Select the message and copy it manually."})]}),!d&&!u&&!j&&e.jsx("p",{className:"nw-draft-hint",children:"Pick a goal above to draft a message."})]})})}function de({c:s,onDraft:t,onEdit:l}){const o=V(s);return e.jsxs("div",{id:`nw-contact-${encodeURIComponent(s.id)}`,tabIndex:-1,className:`nw-card card st-${o}`,children:[e.jsxs("div",{className:"nw-card-top",children:[e.jsx("span",{className:"nw-avatar",children:L(s.name)}),e.jsxs("div",{className:"nw-card-id",children:[e.jsx("strong",{className:"nw-card-name",children:s.name}),e.jsxs("span",{className:"nw-card-meta",children:[s.role?`${s.role}`:le(s.type),s.company?` · ${s.company}`:""]})]}),e.jsx("span",{className:`nw-dot st-${o}`,role:"img","aria-label":`Relationship status: ${o}`})]}),s.met&&e.jsx("p",{className:"nw-card-met",children:s.met}),e.jsxs("div",{className:"nw-card-foot",children:[e.jsxs("span",{className:"nw-card-touch",children:[e.jsx(h,{name:"prep",size:12})," ",O(s)]}),e.jsxs("div",{className:"nw-card-acts",children:[e.jsx("button",{type:"button",className:"nw-icon-btn",onClick:()=>l(s),"aria-label":`Edit ${s.name}`,children:e.jsx(h,{name:"edit",size:14})}),e.jsxs("button",{className:"btn btn-ghost nw-draft-btn",onClick:()=>t({...s,_status:o}),children:[e.jsx(h,{name:"chat",size:13})," Draft"]})]})]})]})}function Ce(){const[s,t]=W(),{profile:l}=Y(),{user:o}=H(),{items:c}=q(),[m,u]=i.useState(!1),[r,j]=i.useState(null),[w,d]=i.useState(null),[x,g]=i.useState("all"),S=i.useRef(""),[N,k]=i.useState(()=>{var a;try{return((a=JSON.parse(sessionStorage.getItem("nemo_network_handoff")||"null"))==null?void 0:a.company)||""}catch{return""}}),f=i.useMemo(()=>G(c),[c]),$=i.useMemo(()=>x==="all"?c:c.filter(a=>a.type===x),[c,x]),I=i.useMemo(()=>String(l.targetCompanies||"").split(",").map(a=>a.trim()).filter(Boolean).slice(0,4),[l.targetCompanies]);i.useEffect(()=>{const a=s.get("contact")||"";if(!a||S.current===a||!c.some(n=>n.id===a))return;S.current=a,g("all");const b=requestAnimationFrame(()=>{const n=document.getElementById(`nw-contact-${encodeURIComponent(a)}`);n==null||n.scrollIntoView({behavior:"smooth",block:"center"}),n==null||n.focus({preventScroll:!0});const p=new URLSearchParams(s);p.delete("contact"),t(p,{replace:!0})});return()=>cancelAnimationFrame(b)},[c,s,t]);const R=a=>{if(r!=null&&r.id){J(r.id,a),j(null);return}M(a),T({source:"network",event:`Added ${a.name}${a.company?` (${a.company})`:""} to your network`,worked:"Network is growing",change:"Follow up to keep it warm",signal:"building",confidence:5}),u(!1)},E=a=>{U(a.id),T({source:"network",event:`Caught up with ${a.name}`,worked:"Kept a relationship warm",change:"",signal:"building",confidence:5})};return e.jsxs("div",{className:"nw",children:[e.jsx(ae,{}),e.jsxs("main",{className:"nw-main",children:[e.jsx(se,{}),e.jsxs(C.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5},children:[e.jsx("span",{className:"eyebrow",children:"Career CRM"}),e.jsxs("h1",{className:"nw-title",children:["Your network, ",e.jsx("span",{className:"gradient-text",children:"working for you"}),"."]}),e.jsx("p",{className:"nw-sub",children:"Every recruiter, referral, and mentor in one place - Nyanza tells you who's going cold and drafts the message so you never let a relationship lapse."}),e.jsx(ne,{steps:["Add the people who matter - manager, peers, recruiters, referrers.","Nyanza flags who's going cold and when a follow-up is due.","One click drafts the check-in message, grounded in your real background."]})]}),e.jsxs("div",{className:"nw-stats",children:[e.jsxs("div",{className:"nw-stat card",children:[e.jsx("strong",{children:f.total}),e.jsx("span",{children:"People"})]}),e.jsxs("div",{className:"nw-stat card",children:[e.jsx("strong",{children:f.warm}),e.jsx("span",{children:"Warm"})]}),e.jsxs("div",{className:"nw-stat card accent",children:[e.jsx("strong",{children:f.due}),e.jsx("span",{children:"Need attention"})]}),e.jsxs("button",{className:"nw-add-btn btn btn-primary",onClick:()=>{u(a=>!a),j(null)},children:[e.jsx(h,{name:"spark",size:15})," Add contact"]})]}),e.jsx(_,{children:(m||r)&&e.jsx(ie,{initial:r,onSave:R,onCancel:()=>{u(!1),j(null)}},(r==null?void 0:r.id)||"new")}),c.length>0&&e.jsxs("section",{className:"nw-refer card",children:[e.jsxs("h2",{className:"nw-h2",children:[e.jsx(h,{name:"handshake",size:16})," Find a referral path"]}),e.jsx("p",{className:"nw-h2-sub",children:"A relevant introduction can add context, but it does not guarantee a response. Start with truthful shared ground: school, past employers, or the team itself."}),e.jsxs("div",{className:"nw-refer-input",children:[e.jsx("input",{value:N,onChange:a=>k(a.target.value),placeholder:"Target company, e.g. Stripe","aria-label":"Target company"}),I.map(a=>e.jsx("button",{type:"button",className:"jm-recent-chip",onClick:()=>k(a),children:a},a))]}),N.trim()&&e.jsx(oe,{company:N.trim()})]}),f.needsAttention.length>0&&e.jsxs("section",{className:"nw-attention",children:[e.jsxs("h2",{className:"nw-h2",children:[e.jsx(h,{name:"flag",size:16})," Reconnect now"]}),e.jsx("p",{className:"nw-h2-sub",children:"These relationships are due for a touch - strike while they're still warm."}),e.jsx("ul",{className:"nw-attn-list",children:f.needsAttention.map(a=>e.jsxs("li",{className:`nw-attn card st-${a._status}`,children:[e.jsx("span",{className:"nw-avatar",children:L(a.name)}),e.jsxs("div",{className:"nw-attn-id",children:[e.jsx("strong",{children:a.name}),e.jsxs("span",{children:[a._status==="due"?"Follow-up due":`Out of touch · ${O(a)}`,a.company?` · ${a.company}`:""]})]}),e.jsxs("div",{className:"nw-attn-acts",children:[e.jsxs("button",{className:"btn btn-ghost",onClick:()=>E(a),title:"I reached out",children:[e.jsx(h,{name:"check",size:14})," Logged"]}),e.jsxs("button",{className:"btn btn-primary",onClick:()=>d({...a,_status:a._status}),children:[e.jsx(h,{name:"chat",size:14})," Draft message"]})]})]},a.id))})]}),c.length>0?e.jsxs("section",{className:"nw-book",children:[e.jsxs("div",{className:"nw-book-head",children:[e.jsxs("h2",{className:"nw-h2",children:[e.jsx(h,{name:"search",size:15})," Your contacts"]}),e.jsxs("div",{className:"nw-filters",role:"group","aria-label":"Filter contacts by relationship",children:[e.jsx("button",{type:"button",className:`nw-filter ${x==="all"?"on":""}`,"aria-pressed":x==="all",onClick:()=>g("all"),children:"All"}),z.map(a=>c.some(b=>b.type===a.key)&&e.jsx("button",{type:"button",className:`nw-filter ${x===a.key?"on":""}`,"aria-pressed":x===a.key,onClick:()=>g(a.key),children:a.label},a.key))]})]}),e.jsx("div",{className:"nw-grid",children:$.map(a=>e.jsx(de,{c:a,onDraft:d,onEdit:b=>{j(b),u(!1),window.scrollTo({top:0,behavior:"smooth"})}},a.id))})]}):!m&&e.jsxs("div",{className:"nw-empty card",children:[e.jsx("div",{className:"empty-orb"}),e.jsx("h2",{children:"Start your career network"}),e.jsx("p",{children:"Add the people who can open doors - recruiters you've spoken to, referrals, mentors. Nyanza keeps them warm and drafts your outreach."}),(l.recommendations||[]).filter(a=>a.name).length>0&&e.jsxs("div",{className:"nw-seed",children:[e.jsx("p",{className:"nw-seed-label",children:"Already in your corner (from your recommendations):"}),(l.recommendations||[]).filter(a=>a.name).slice(0,4).map(a=>e.jsxs("button",{type:"button",className:"nw-seed-chip",onClick:()=>M({name:a.name,role:a.role||"",notes:a.quote?`"${a.quote}"`:""}),children:["+ ",a.name,a.role?` · ${a.role}`:""]},a.name))]}),e.jsxs("button",{className:"btn btn-primary",onClick:()=>u(!0),children:[e.jsx(h,{name:"spark",size:15})," Add your first contact"]})]}),e.jsxs("p",{className:"nw-foot",children:["Your network feeds the ",e.jsx(D,{to:"/app/health",children:"Network strength"})," on your Career Health Score. ",e.jsx(D,{to:"/app/persona",children:"See the persona →"})]})]}),e.jsx(_,{children:w&&e.jsx(ce,{contact:w,profile:l,user:o,onClose:()=>d(null)})})]})}export{Ce as default};

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.