PageSourceSearch

https://www.gemphere.com/assets/Team-DAszqvtd.js

js gemphere.com collected 2026-09-24 14:43:44 UTC 135,513 bytes, 38 lines download raw bytes

1import{bt as Gt,u as Nt,r as d,cS as Ga,j as e,P as jt,as as gn,cL as Ia,a as Ka,y as Va,cT as io,T as ro,aP as lo,cU as ka,cV as ge,cW as co,cX as mo,V as Ja,cY as uo,cZ as ho,c_ as po,c$ as fo,cP as yt,co as go,d0 as qt,d1 as Sa,c as yo,d2 as vo,d3 as Ft,d4 as Ot,b5 as No,d5 as jo,d6 as Pa,d7 as xo,d8 as bo,E as $a,d9 as wo,bo as Co,ao as Io,M as ko,cH as So,cI as Po,h as Ta,m as za,cJ as Qa,a9 as $o,aw as Xa,t as To,ag as Eo,ah as Vn,ai as Dt,ap as Ao,al as Ro,cK as Mo,da as Lo,db as Ea,cF as Uo,cO as Fo,az as Oo,dc as Do,dd as Bo,de as qo,df as Ho,dg as Wo,cQ as _o,a7 as Yo,aF as Go,cR as Aa}from"./index-BVpny5eT.js";import{I as Za,C as xt,D as Kt,e as Ko}from"./DrawerExpandCaret-Bwq1QXMJ.js";import{I as Vo}from"./InviteTeammatesModal-Bv8w6UpC.js";import{m as Jo,c as zo,i as Qo,f as bn,C as Xo,a as Ra,A as Zo,b as ei,d as ut,e as ni}from"./AddConnectorModal-DRvcVMqr.js";import{P as Ht,a as dn}from"./ProfileNameTrigger-BwlTTwP1.js";import{R as es,N as ti}from"./GemAI-D96-3JBK.js";import{O as Wt,b as ai,a as si}from"./OfferIntroModal-ZNidNxrZ.js";import{D as pt,a as ft,b as gt,c as ze,d as oi,I as ii,f as ri,g as li,e as ci}from"./InviteContactModal-1V0C4a3t.js";import{u as ns}from"./useConnectorOfferIntro-Bc-ohsVX.js";import{u as ts}from"./use-mobile-BG1-J4Im.js";import{v as Ma}from"./home-checkin-people-DWmgmAZd.js";import{m as di,d as mi}from"./team-account-paths-CUi8cX7V.js";import"./use-resolved-title-company-D550X39m.js";import"./external-link-D8whGH5x.js";import"./IntegrationsModal-CmDwjz79.js";import"./index-CryiGmSX.js";import"./Combination-Dr9KM_H-.js";import"./index-u7baw35J.js";import"./chevron-right-boUotD-7.js";function ui(n,l){return fetch(`${Gt()}/api/gemphere/account/invite-by-email`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(l)})}function hi(n,l){return fetch(`${Gt()}/api/users?ids=${l}`,{headers:{Authorization:`Bearer ${n}`}})}function pi(n){return fetch(`${Gt()}/api/gemphere/profile`,{headers:{Authorization:`Bearer ${n}`}})}const wn={solid:0,strong:1,very_strong:2};function vt(n){return String(n||"?").trim().split(/\s+/).map(s=>s[0]).filter(Boolean).slice(0,2).join("").toUpperCase()||"?"}function _t(n){return n?n.trim().split(/\s+/).map(l=>l&&l[0].toUpperCase()+l.slice(1).toLowerCase()).join(" "):""}const fi=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty"];function gi(n){return fi[n]??String(n)}function yi(n){return n&&n.charAt(0).toUpperCase()+n.slice(1)}function vi(n){if(!n)return"just now";const l=Date.parse(n);if(!Number.isFinite(l))return"just now";const s=Math.max(1,Math.floor((Date.now()-l)/1e3));return s<60?"just now":s<3600?`${Math.floor(s/60)}m`:s<86400?`${Math.floor(s/3600)}h`:`${Math.floor(s/86400)}d`}function La(n){return(n==null?void 0:n.status)==="accepted"?{label:"Request intro",disabled:!1}:(n==null?void 0:n.status)==="requested"?{label:"Intro sent",disabled:!0}:(n==null?void 0:n.status)==="offered"?{label:`Offered · ${vi(n.createdAt)}`,disabled:!0}:{label:"Offer intro",disabled:!1}}function Ni(n){if(n.kind==="person"){const s=(n.targetContactName||n.companyName||"").trim();return s?`person:${Ia(s)}`:`target:${n.id}`}return Ia(n.companyName)||`target:${n.id}`}function ji(n){var l,s,p,u;return n.kind==="person"?((l=n.targetContactName)==null?void 0:l.trim())||((s=n.companyName)==null?void 0:s.trim())||"Target":((p=n.companyName)==null?void 0:p.trim())||((u=n.targetContactName)==null?void 0:u.trim())||"Target"}function xi(n){var p,u;const l=n[0];return l?[(p=l.industry)==null?void 0:p.trim(),(u=l.targetRole)==null?void 0:u.trim()].filter(Boolean).join(" · "):""}function bi(n){return n.reduce((l,s)=>wn[s.path.tier]>wn[l]?s.path.tier:l,n[0].path.tier)}function wi(n){return[...n].sort((l,s)=>{const p=wn[s.path.tier]-wn[l.path.tier];if(p!==0)return p;const u=l.path.contact.name||"",i=s.path.contact.name||"";return u.localeCompare(i)})}function Ci(n){const l=new Map;for(const p of n){const u=Ni(p),i=l.get(u)||[];i.push(p),l.set(u,i)}const s=[];for(const[p,u]of l){const i=wi(u);
1s.push({key:p,label:ji(i[0]),metaLine:xi(i),targets:i,bestTier:bi(i)})}return s.sort((p,u)=>{const i=wn[u.bestTier]-wn[p.bestTier];return i!==0?i:p.label.localeCompare(u.label)})}function Ii(n){return String(n||"").trim().split(/\s+/)[0]||""}function ki({targets:n}){const l=n.map(s=>s.path.contact.name).filter(s=>!!(s!=null&&s.trim())).slice(0,4);return l.length===0?e.jsx("div",{className:"acc-row-stack acc-row-stack--empty","aria-hidden":!0}):e.jsxs("div",{className:"acc-row-stack",children:[e.jsx("div",{className:"acc-stack-avatars",children:l.map((s,p)=>e.jsx("div",{className:"acc-stack-av",style:{zIndex:9-p,marginLeft:p===0?0:-9},children:vt(s)},`stack-${s}-${p}`))}),e.jsxs("span",{className:"acc-stack-count",children:[n.length," path",n.length===1?"":"s"]})]})}function Si({target:n,companyName:l,viaLabel:s,pathAvatar:p,actionLabel:u,onActivate:i,onOpenGemProfile:c,onOpenWebProfile:g,onOpenInvite:N}){var C,R,E,U,J;const y=n.path.contact,h=n.path.tier,j=_t(((C=y.name)==null?void 0:C.trim())||"Contact"),P=((R=y.title)==null?void 0:R.trim())||((E=n.targetRole)==null?void 0:E.trim())||"—",$=Ii((U=n.path.via)==null?void 0:U.name)||(n.path.via?"A teammate":""),S=$?`${$} knows`:s,L=l.trim()||((J=y.company)==null?void 0:J.trim())||"—";return e.jsx("div",{className:"acc-contact-group",children:e.jsxs("div",{className:"contact-row",onClick:i,role:"button",tabIndex:0,onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),i())},children:[e.jsx("div",{className:"contact-row-spacer","aria-hidden":!0}),e.jsx(xt,{userId:y.connectedUserId,name:j,companyName:L,role:P,initials:vt(y.name),onOpen:c,onOpenWebProfile:g,onOpenInvite:N,personChildren:e.jsx("div",{className:"contact-title",children:P})}),e.jsx("div",{className:"contact-row-chips",children:e.jsx("span",{className:"acc-row-tier-label",children:gn(h)})}),e.jsxs("div",{className:"contact-row-connectors",children:[e.jsx("div",{className:"acc-stack-avatars",children:e.jsx("div",{className:`acc-stack-av acc-stack-av--expanded${p.you?" acc-stack-av--you":" acc-stack-av--primary"}`,children:p.initials})}),e.jsx("span",{className:"contact-path-count",children:S})]}),e.jsxs("span",{className:"acc-row-cta contact-row-cta",children:["See paths",e.jsx("span",{"aria-hidden":"true",children:" →"})]})]})})}function Pi({group:n,rowIdx:l,sectionKey:s,viaLabel:p,pathAvatarFor:u,actionLabel:i,actionLabelFor:c,openCompanies:g,onToggleCompany:N,onActivateTarget:y,onOpenGemProfile:h,onOpenWebProfile:j,onOpenInvite:P}){const $=`${s}:${n.key}`,S=!!g[$],L=n.bestTier,C=gn(L),R=n.targets.length;return e.jsxs("div",{className:`acc-row-v2-wrap ${S?"open":""}`,children:[e.jsxs("div",{className:"acc-row-v2",onClick:()=>N($),style:{cursor:"pointer"},role:"button",tabIndex:0,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),N($))},children:[e.jsx("div",{className:"acc-row-rank","aria-hidden":"true",children:String(l+1).padStart(2,"0")}),e.jsxs("div",{className:"acc-row-info",children:[e.jsxs("div",{className:"acc-row-name-line",children:[e.jsx("span",{className:`acc-row-toggle${S?" open":""}`,"aria-hidden":"true",children:S?"−":"+"}),e.jsx("div",{className:"acc-name-v2",children:n.label})]}),n.metaLine?e.jsx("div",{className:"acc-row-meta",children:n.metaLine}):null]}),e.jsx("div",{className:"acc-row-strength",children:e.jsx("div",{className:"acc-path-bar-row",children:e.jsx("span",{className:"acc-row-tier-label",children:C})})}),e.jsx(ki,{targets:n.targets}),e.jsx("div",{className:"acc-row-actions",children:e.jsxs("span",{className:"acc-row-cta",children:[S?"Hide paths":"See paths",e.jsx("span",{"aria-hidden":"true",children:" →"})]})})]}),S?e.jsxs("div",{className:"acc-expanded",children:[e.jsxs("div",{className:"acc-expanded-header",children:[yi(gi(R))," ",R===1?"person":"people"," reachable"]}),e.jsx("div",{className:"acc-expanded-scroll",children:n.targets.map((E,U)=>{const J=E.path.contact,X=`${$}:${J.contactId}:${E.id}:${U}`;return e.jsx(Si,{target:E,companyName:n.label,viaLabel:p,pathAvatar:u(E),actionLabel:c?c(E):i,onActivate:()=>y(E),onOpenGemProfile:h,onOpenWebProfile:j,onOpenInvite:P},X)})})]}):null]})}function $i({variant:n}){return n==="offer"?e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M2 8h10M9 5l3 3-3 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M14 8H4M7 5L4 8l3 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}
1function Ua({variant:n,title:l,subtitle:s,emptyMessage:p,targets:u,sectionKey:i,viaLabel:c,pathAvatarFor:g,actionLabel:N,actionLabelFor:y,actionDisabledFor:h,connectorName:j,viewerName:P,showHeader:$=!0,onAction:S,onOpenGemProfile:L,onOpenWebProfile:C,onOpenInvite:R}){var Me,ke;const E=u??[],U=d.useMemo(()=>Ci(E),[E]),[J,X]=d.useState({}),[B,ie]=d.useState(null),Y=d.useCallback(ee=>{X(we=>({...we,[ee]:!we[ee]}))},[]),ce=n==="offer",z=B?ce?{name:_t(((Me=B.path.via)==null?void 0:Me.name)||"")||P||"You",userId:((ke=B.path.via)==null?void 0:ke.userId)??null,photo:null}:{name:_t(j),userId:null,photo:null}:null;return e.jsxs("section",{className:`conn-reciprocal-col conn-reciprocal-col--${n}`,children:[$?e.jsxs("div",{className:"conn-reciprocal-col-head",children:[e.jsx("div",{className:"conn-reciprocal-col-icon","aria-hidden":"true",children:e.jsx($i,{variant:n})}),e.jsxs("div",{className:"conn-reciprocal-col-head-copy",children:[e.jsx("h4",{className:"conn-reciprocal-col-title",children:l}),e.jsx("p",{className:"conn-reciprocal-col-sub",children:s})]}),e.jsx("span",{className:"conn-reciprocal-col-count","aria-label":`${E.length} matches`,children:E.length})]}):null,e.jsx("div",{className:"conn-reciprocal-col-body",children:U.length?e.jsxs("div",{className:"acc-list conn-target-account-list",children:[e.jsxs("div",{className:"acc-targets-head","aria-hidden":"true",children:[e.jsx("span",{className:"acc-targets-head-rank",children:"#"}),e.jsx("span",{className:"acc-targets-head-account",children:"Account"}),e.jsx("span",{className:"acc-targets-head-path",children:"How warm"}),e.jsx("span",{className:"acc-targets-head-network",children:"Who can introduce you"}),e.jsx("span",{className:"acc-targets-head-actions"})]}),U.map((ee,we)=>e.jsx(Pi,{group:ee,rowIdx:we,sectionKey:i,viaLabel:c,pathAvatarFor:g,actionLabel:N,actionLabelFor:y,openCompanies:J,onToggleCompany:Y,onActivateTarget:S?ie:()=>{},onOpenGemProfile:L,onOpenWebProfile:C,onOpenInvite:R},`${i}:${ee.key}`))]}):e.jsx("div",{className:"conn-reciprocal-empty",children:p})}),B&&z?e.jsx(Za,{target:{name:B.path.contact.name||"Contact",userId:B.path.contact.connectedUserId,title:B.path.contact.title||B.targetRole,company:B.companyName||B.path.contact.company},viewer:{name:P||"You"},mode:ce?"offer":"request",owner:ce?{name:j}:null,options:[{key:"bridge",name:z.name,userId:z.userId,photo:z.photo,strengthLabel:gn(B.path.tier)}],actionLabel:y?y(B):N,actionDisabled:h?h(B):!1,onClose:()=>ie(null),onPick:()=>{const ee=B;ie(null),ee&&S&&S(ee)}}):null]})}function Ti({connectorName:n,viewerName:l="You",youCanHelpThem:s,theyCanHelpYou:p,sectionKeyPrefix:u="",showTheyCanHelpYou:i=!0,onOfferIntro:c,onRequestIntro:g,onOpenGemProfile:N,onOpenWebProfile:y,onOpenInvite:h}){const j=n.split(/\s+/)[0]||n,P=u?`${u}:`:"",$=vt(n);return e.jsx("div",{className:"tm-connectors-targets portco-expand",children:e.jsxs("div",{className:"conn-reciprocal",children:[e.jsx(Ua,{variant:"offer",sectionKey:`${P}offer`,title:"You can help them",subtitle:`Intro ${j} to targets you already know`,emptyMessage:`${j} doesn't have any targets you can currently help with.`,targets:s,viaLabel:"You know",pathAvatarFor:S=>S.path.via?{initials:vt(S.path.via.name||"?"),you:!1}:{initials:"YOU",you:!0},actionLabel:"Offer intro",actionLabelFor:S=>La(S.offer).label,actionDisabledFor:S=>La(S.offer).disabled,connectorName:n,viewerName:l,showHeader:i,onAction:c,onOpenGemProfile:N,onOpenWebProfile:y,onOpenInvite:h}),i?e.jsx(Ua,{variant:"request",sectionKey:`${P}request`,title:"They can help you",subtitle:`Ask ${j} for intros into your targets`,emptyMessage:"No current targets have a matching path through this connector.",targets:p,viaLabel:`${j} knows`,pathAvatarFor:()=>({initials:$,you:!1}),actionLabel:"Request intro",connectorName:n,viewerName:l,onAction:g,onOpenGemProfile:N,onOpenWebProfile:y,onOpenInvite:h}):null]})})}function as({relationshipId:n,connectorName:l,reloadKey:s=0,onOpenGemProfile:p,onOpenWebProfile:u,onOpenInvite:i,onOfferIntro:c,onRequestIntro:g,showTheyCanHelpYou:N=!0}){const{user:y}=Nt(),h=(y==null?void 0:y.accessToken)||"",[j,P]=d.useState({kind:"loading"});if(d.useEffect(()=>{if(!h||!n)return;let L=!1;return P({kind:"loading"}),Ga(h,n).then(C=>{L||P({kind:"loaded",data:C})}).catch(C=>{L||P({kind:"error",message:C instanceof Error?C.message:"Failed to load"})}),()=>{L=!0}},[h,n,s]),j.kind==="loading")return e.jsx(jt,{variant:"inline",message:"Loading connector targets…"});if(j.kind==="error")return e.jsxs("div",{className:"conn-reciprocal-error",children:["Couldn't load connector targets: ",j.message]});const $=j.data.youCanHelpThem??[],S=j.data.theyCanHelpYou??[];return e.jsx(Ti,{connectorName:l,viewerName:(y==null?void 0:y.fullName)||"You",youCanHelpThem:$,theyCanHelpYou:S,showTheyCanHelpYou:N,onOfferIntro:c,onRequestIntro:g,onOpenGemProfile:p,onOpenWebProfile:u,onOpenInvite:i})}function ht(n,l){return(n||l||"?").trim().split(/[\s@.]+/).map(p=>
1p[0]).filter(Boolean).slice(0,2).join("").toUpperCase()||"?"}function Bt(n,l="them"){return(n||"").trim().split(/\s+/)[0]||l}function Fa({connector:n,disabled:l,onSave:s,showHelp:p=!0}){const[u,i]=d.useState(()=>ut(n.role)),[c,g]=d.useState(()=>ut(n.role)==="custom"&&n.role||"");return d.useEffect(()=>{i(ut(n.role)),g(ut(n.role)==="custom"&&n.role||"")},[n.id,n.role]),e.jsx(ni,{selectValue:u,customRole:c,onSelectChange:i,onCustomRoleChange:g,onCommit:N=>{N!==(n.role||"")&&s(n,N)},disabled:l,idPrefix:`connector-role-${n.id}`,showHelp:p})}function Ei({hidePricingBanners:n=!1,proWorkspaceOwner:l=!1,excludedUserIds:s,onCountsChange:p,onConnectorAdded:u,onOpenGemProfile:i,onOpenConnectorProfile:c,onOpenWebProfile:g,onOpenInvite:N,openAddSignal:y=0}){const h=c??i,{user:j}=Nt(),{isTeamMember:P,isProPlan:$}=Ka(),{openUpgrade:S,isInvitedTeamMember:L}=Va(),C=(j==null?void 0:j.accessToken)||"",R=(j==null?void 0:j.userId)||0,E=ts(),U=(r,w)=>E?r:w,[J,X]=d.useState({kind:"loading"}),[B,ie]=d.useState([]),[Y,ce]=d.useState(null),[z,Me]=d.useState(null),[ke,ee]=d.useState(!1),[we,De]=d.useState(null),[Qe,xe]=d.useState(0),[b,Z]=d.useState({}),[ae,ne]=d.useState(null),[re,Te]=d.useState(null),[H,Le]=d.useState(null),[Be,Xe]=d.useState(!1),[se,F]=d.useState(null),{offerIntro:be,setOfferIntro:_,offerIntroSending:Ee,connectorTargetOffers:k,patchConnectorTargetOffer:yn,openOfferIntro:Q,sendOfferIntro:te}=ns({onSent:()=>xe(r=>r+1),onAcceptedOffer:(r,w,x)=>{F(null),Le({target:r,connector:w,mode:"offer_after_accept",connectorIntroOfferId:x})}}),[He,Ae]=d.useState(null),[Ze,We]=d.useState(!1),de=n||L||P||(z==null?void 0:z.team)!=null&&z.isAdmin===!1||io(z),Ke=Y!=null,ye=!de&&Ke&&(l||(z==null?void 0:z.isPro)===!0||$||Y.tier==="pro"),M=Ke&&!de&&!ye&&Y.tier!=="pro",me=Ke&&!de&&Y.tier!=="enterprise",le=ye&&!de,W=(r,w)=>Z(x=>({...x,[r]:w})),ve=d.useCallback(async()=>{if(C)try{const[r,w]=await Promise.all([ro(C),R?lo(C,R).catch(()=>null):Promise.resolve(null)]);ie(r.connectors.filter(x=>!(x.classification==="portfolio_company"&&x.isRequester)&&(x.userId==null||!(s!=null&&s.has(x.userId))))),ce(Jo(r.quota,w==null?void 0:w.connectorQuota)),Me(w),X({kind:"loaded"})}catch(r){X({kind:"error",message:r instanceof Error?r.message:"Failed to load"})}},[C,R,s]);d.useEffect(()=>{ve()},[ve]),d.useEffect(()=>{if(!C)return;let r=!1;return ka(C).then(w=>{r||Ae(w.inviteUrl||null)}).catch(()=>{r||Ae(null)}),()=>{r=!0}},[C]);const en=async()=>{var w;if(Ze)return;let r=He;if(!r&&C)try{r=(await ka(C)).inviteUrl||null,r&&Ae(r)}catch{r=null}if(!r){ge.error("Your connector link isn't ready yet");return}We(!0);try{if((w=navigator.clipboard)!=null&&w.writeText)await navigator.clipboard.writeText(r);else{const x=document.createElement("textarea");x.value=r,document.body.appendChild(x),x.select(),document.execCommand("copy"),document.body.removeChild(x)}ge.success("Connector link copied")}catch{ge.error("Couldn't copy. Try again.")}finally{We(!1)}},{incoming:Cn,outgoing:zn,active:Ce,pending:Ue}=d.useMemo(()=>{const r=B.filter(x=>x.status==="pending"&&x.direction==="incoming"),w=B.filter(x=>x.status==="pending"&&x.direction==="outgoing");return{incoming:r,outgoing:w,pending:[...r,...w],active:B.filter(x=>x.status==="active")}},[B]);d.useEffect(()=>{p==null||p({active:Ce.length,pending:Ue.length})},[Ce.length,Ue.length,p]);const Ne=re!=null?Ce.find(r=>r.id===re)??null:null;d.useEffect(()=>{re!=null&&!Ne&&Te(null)},[re,Ne]);const rn=zo(Y),Qn=Qo(Y),In=d.useCallback(()=>{if(Qn){S((Y==null?void 0:Y.tier)==="pro"?"team":"connectors");return}ee(!0)},[Qn,S,Y==null?void 0:Y.tier]);d.useEffect(()=>{y&&In()},[y]);const bt=async r=>{if(!b[r.id]){W(r.id,!0);try{await co(C,r.id),ge.success(`You're now connected with ${r.name||r.email}.`),await ve()}catch(w){ge.error(w instanceof Error?w.message:"Could not accept request")}finally{W(r.id,!1)}}},wt=async r=>{if(!b[r.id]){W(r.id,!0);try{await mo(C,r.id),await ve()}catch(w){ge.error(w instanceof Error?w.message:"Could not decline request")}finally{W(r.id,!1)}}},Nn=async r=>{if(!b[r.id]){W(r.id,!0);try{await Ja(C,r.id),ge.success(`Removed ${r.name||r.email}.`),we===r.id&&De(null),await ve()}catch(w){ge.error(w instanceof Error?w.message:"Could not remove connector")}finally{W(r.id,!1)}}},Ct=async r=>{if(!b[r.id]){W(r.id,!0);try{await uo(C,r.id),ge.success(`Invite email sent to ${r.name||r.email}.`)}catch(w){ge.error(w instanceof Error?w.message:"Could not send invite email")}finally{W(r.id,!1)}}},It=async r=>{var w;
1if(!b[r.id]){if(!r.inviteUrl){ge.error("No invite link available");return}W(r.id,!0);try{if((w=navigator.clipboard)!=null&&w.writeText)await navigator.clipboard.writeText(r.inviteUrl);else{const x=document.createElement("textarea");x.value=r.inviteUrl,document.body.appendChild(x),x.select(),document.execCommand("copy"),document.body.removeChild(x)}ge.success("Invite link copied")}catch{ge.error("Couldn't copy. Try again.")}finally{W(r.id,!1)}}},Xn=async(r,w)=>{W(r.id,!0);try{await ho(C,r.id,w),await ve(),xe(x=>x+1)}catch(x){ge.error(x instanceof Error?x.message:"Could not update sharing")}finally{W(r.id,!1),ne(null)}},un=r=>{b[r.id]||(r.sharingEnabled?ne(r):Xn(r,!0))},Zn=async(r,w)=>{if(r.classification!==w){W(r.id,!0);try{await po(C,r.id,w),await ve(),xe(x=>x+1),ge.success(`Visibility updated to ${Ra(w)}.`)}catch(x){ge.error(x instanceof Error?x.message:"Could not update visibility")}finally{W(r.id,!1)}}},kn=async(r,w)=>{if((r.role||"")!==w){W(r.id,!0);try{await fo(C,r.id,w),await ve(),ge.success(`Role updated to ${bn(w)}.`)}catch(x){ge.error(x instanceof Error?x.message:"Could not update role")}finally{W(r.id,!1)}}},Sn=r=>r.classification==="portfolio_company"&&r.isRequester,kt=async r=>{if(!(!H||!C||!R)){Xe(!0),F(null);try{const{target:w,connector:x,mode:Se}=H,Ie=w.path.contact,G=`${w.companyName}${w.targetRole?` · ${w.targetRole}`:""}`;if(Se==="offer_after_accept"){const Pn=x.userId&&x.userId>0?x.userId:R;await yt(C,{fromUserID:Pn,fromName:x.name||void 0,fromEmail:r.connectorEmail||x.email||void 0,connectorUserID:R,connectorEmail:r.connectorEmail||(j==null?void 0:j.email)||void 0,toUserID:Ie.connectedUserId&&Ie.connectedUserId>0?Ie.connectedUserId:0,toName:Ie.name,toEmail:r.targetEmail||Ie.email||void 0,note:r.message2.trim()||G,connectorMessage:r.message1.trim()||void 0,blurb:r.message2.trim()||void 0,connectorSubject:r.subject1.trim()||void 0,blurbSubject:r.subject2.trim()||void 0,connectorIntroOfferId:H.connectorIntroOfferId})}else await yt(C,{fromUserID:R,connectorUserID:x.userId??void 0,connectorEmail:r.connectorEmail||x.email||void 0,toUserID:Ie.connectedUserId&&Ie.connectedUserId>0?Ie.connectedUserId:0,toName:Ie.name,toEmail:r.targetEmail||Ie.email||void 0,note:r.message2.trim()||G,connectorMessage:r.message1.trim()||void 0,blurb:r.message2.trim()||void 0,connectorSubject:r.subject1.trim()||void 0,blurbSubject:r.subject2.trim()||void 0});ge.success(Se==="offer_after_accept"?"Intro sent.":"Intro requested."),Le(null),xe(Pn=>Pn+1)}catch(w){F(w instanceof Error?w.message:"Could not send intro")}finally{Xe(!1)}}};return J.kind==="loading"?e.jsx(jt,{variant:"inline",message:"Loading connectors…"}):J.kind==="error"?e.jsxs("div",{className:"tm-roster-empty",style:{color:"#9a3a2a"},children:["Couldn't load connectors: ",J.message]}):e.jsxs(e.Fragment,{children:[Ue.length>0?e.jsx("div",{className:"team-info-section team-pending-section",children:e.jsxs("div",{className:"acc-list-card team-pending-card",children:[e.jsxs("div",{className:"acc-panel-head",children:[e.jsxs("div",{className:"acc-panel-head-left",children:[e.jsx("div",{className:"acc-panel-kicker",children:"Invitations"}),e.jsx("h2",{className:"acc-panel-title",children:"Pending connectors"}),e.jsx("p",{className:"acc-panel-desc",children:U("Nothing is shared until both sides say yes.","Requests waiting on an accept — nothing is shared until both sides say yes.")})]}),e.jsx("div",{className:"acc-panel-head-stats",children:e.jsxs("div",{className:"acc-panel-stat",children:[e.jsx("div",{className:"acc-panel-stat-num",children:Ue.length}),e.jsx("div",{className:"acc-panel-stat-lbl",children:"Waiting"})]})})]}),e.jsxs("div",{className:"team-pending-list",children:[Cn.map((r,w)=>e.jsxs("div",{className:"team-pending-row",children:[e.jsx("div",{className:"team-pending-rank","aria-hidden":"true",children:String(w+1).padStart(2,"0")}),e.jsxs("div",{className:"team-pending-identity",children:[e.jsx("div",{className:"team-pending-avatar",children:ht(r.name,r.email)}),e.jsxs("div",{className:"team-pending-person",children:[e.jsxs("div",{className:"team-pending-name-row",children:[e.jsx("div",{className:"team-pending-name",children:r.name||r.email}),e.jsx("span",{className:"team-pending-status",children:"Request"}),r.role?e.jsx("span",{className:"tm-row-pill tm-row-pill--muted",children:bn(r.role)}):null]}),e.jsxs("div",{className:"team-pending-meta",children:[r.company?`${r.company} · `:"",r.email||"wants to connect",r.note?` · “${r.note}”`:""]})]})]}),e.jsx("div",{className:"team-pending-actions tm-connectors-pending-actions",children:e.jsxs(pt,{children:[e.jsx(ft,{asChild:!0,children:e.jsx("button",{type:"button",className:"tm-row-menu-btn","aria-label":`Actions for ${r.name||r.email||"this request"}`,disabled:!!b[r.id],onClick:x=>x.stopPropagation(),children:b[r.id]?"…":"⋯"})}),e.jsxs(gt,{align:"end",sideOffset:4,className:"nc-card-menu-dropdown gp-m-sheet",children:[e.jsx("div",{className:"gp-m-sheet-title",children:r.name||r.email}),e.jsx(ze,{className:"nc-card-menu-item",onSelect:()=>void bt(r),children:"Accept"}),e.jsx(ze,{className:"nc-card-menu-item",onSelect:()=>void wt(r),children:"Decline"})]})]})})]},r.id)),zn.map((r,w)=>e.jsxs("div",{className:"team-pending-row",children:[e.jsx("div",{className:"team-pending-rank","aria-hidden":"true",children:String(Cn.length+w+1).padStart(2,"0")}),e.jsxs("div",{className:"team-pending-identity",children:[e.jsx("div",{className:"team-pending-avatar",children:ht(r.name,r.email)}),e.jsx("div",{className:"team-pending-person",children:e.jsx("div",{className:"team-pending-name-row",children:e.jsx("div",{className:"team-pending-name",children:r.name||r.email})})})]}),e.jsx("div",{className:"team-pending-actions tm-connectors-pending-actions",children:e.jsxs(pt,{children:[e.jsx(ft,{asChild:!0,children:e.jsx("button",{type:"button",className:"tm-row-menu-btn","aria-label":`Actions for ${r.name||r.email||"this invite"}`,disabled:!!b[r.id],onClick:x=>x.stopPropagation(),children:b[r.id]?"…":"⋯"})}),e.jsxs(gt,{align:"end",sideOffset:4,className:"nc-card-menu-dropdown connector-pending-menu gp-m-sheet",children:[e.jsx("div",{className:"gp-m-sheet-title",children:r.name||r.email}),e.jsxs("div",{className:"connector-pending-menu-meta",children:[U("Waiting for them to accept","Pending — waiting for them to accept"),r.email&&!E?` · ${r.email}`:""]}),r.isRequester?e.jsx("div",{className:"connector-pending-role-edit connector-pending-menu-role",onClick:x=>x.stopPropagation(),onPointerDown:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),children:e.jsx(Fa,{connector:r,disabled:!!b[r.id],onSave:kn,showHelp:!1})}):null,r.inviteUrl?e.jsx(ze,{className:"nc-card-menu-item",onSelect:()=>void It(r),children:"Copy link"}):null,e.jsx(ze,{className:"nc-card-menu-item",onSelect:()=>
1void Ct(r),children:"Send invite"}),e.jsx(ze,{className:"nc-card-menu-item",onSelect:()=>void Nn(r),children:"Cancel invite"})]})]})})]},r.id))]})]})}):null,e.jsxs("div",{className:"acc-list-card tm-roster-card team-accounts-surface tm-connectors-card",children:[e.jsxs("div",{className:"acc-panel-head",children:[e.jsxs("div",{className:"acc-panel-head-left",children:[e.jsx("div",{className:"acc-panel-kicker",children:"External"}),e.jsx("h2",{className:"acc-panel-title",children:"Connectors"}),e.jsxs("p",{className:"acc-panel-desc",children:[U("Outside your company — doors both ways.","People outside your company who can open doors for you — and you for them."),rn?e.jsxs("span",{className:"connector-quota-inline",children:[" ",rn,"."]}):null]})]}),e.jsxs("div",{className:"acc-panel-head-stats tm-connectors-head-actions",children:[e.jsxs("div",{className:"acc-panel-stat",children:[e.jsx("div",{className:"acc-panel-stat-num",children:Ce.length}),e.jsx("div",{className:"acc-panel-stat-lbl",children:"Connected"})]}),e.jsx("button",{type:"button",className:"team-pending-action",disabled:Ze||!He,onClick:()=>void en(),title:"Copy your personal link — anyone can use it to connect with you as a connector",children:Ze?"Copied":U("Copy link","Copy connector link")}),e.jsx("button",{type:"button",className:"gp-btn-solid tm-invite-btn",onClick:In,children:U("+ Add","+ Add connector")})]})]}),Y&&!(de&&Y.tier==="enterprise")?e.jsx("div",{className:"acc-list-card-body",style:{paddingTop:0,paddingBottom:12},children:e.jsx(Xo,{quota:Y,showPro:E?!1:M,showEnterprise:E?!1:me,suppressUpgradeCopy:E||de,alwaysShowUpgradePlans:E?!1:le})}):null,e.jsx("div",{className:"acc-list-card-body",children:Ce.length===0?e.jsxs("div",{className:"tm-roster-empty",children:[B.length===0?U("Add a connector to see path-matched targets.","Add a connector to see reciprocal, path-matched targets — nothing else is shared."):U("None accepted yet — accept a request above.","No accepted connectors yet. Accept a request above, or send a new one."),B.length===0?e.jsx("div",{style:{marginTop:14},children:e.jsx("button",{type:"button",className:"gp-btn-solid tm-invite-btn",onClick:In,children:"Add connector"})}):null]}):e.jsx("div",{className:"tm-teammate-list",children:Ce.map((r,w)=>{const x=we===r.id,Se=r.name||r.email||"Connector",Ie=typeof r.helpableTargetCount=="number"&&r.helpableTargetCount>0?r.helpableTargetCount:null;return e.jsxs("div",{className:`tm-row-wrap ${x?"open":""}`,children:[e.jsxs("div",{className:"tm-row-v2",onClick:()=>De(x?null:r.id),children:[e.jsx("div",{className:"tm-row-rank",children:String(w+1).padStart(2,"0")}),e.jsx(Ht,{userId:r.userId,name:Se,photo:r.profilePhoto,email:r.email,role:r.role,companyName:r.company,className:"profile-popup-trigger tm-row-av-btn",avatarClassName:"tm-row-av",initials:ht(r.name,r.email),onOpen:h,onOpenWebProfile:g,onOpenInvite:N,children:e.jsx("div",{className:"tm-row-av",style:r.profilePhoto?{padding:0,overflow:"hidden"}:void 0,children:r.profilePhoto?e.jsx("img",{src:r.profilePhoto,alt:"",style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%"}}):ht(r.name,r.email)})}),e.jsxs("div",{className:"tm-row-main",children:[E?e.jsx(dn,{userId:r.userId,name:Se,photo:r.profilePhoto,email:r.email,role:r.role,companyName:r.company,className:"tm-row-name",block:!0,onOpen:h,onOpenWebProfile:g,onOpenInvite:N}):e.jsx("span",{className:"tm-row-name",children:Se}),e.jsx("div",{className:"tm-row-role",children:E?r.company||(r.role?bn(r.role):"")||"Connector":r.role?bn(r.role):r.company||r.email||"Connector"}),e.jsxs("div",{className:"tm-row-pills",children:[E?null:e.jsx("span",{className:"tm-row-pill tm-row-pill--green",children:"Connected"}),r.role?e.jsx("span",{className:"tm-row-pill tm-row-pill--muted",children:bn(r.role)}):null,r.classification==="portfolio_company"?e.jsx("span",{className:"tm-row-pill tm-row-pill--muted",children:Ra(r.classification)}):null,Ie!=null?e.jsxs("span",{className:"tm-row-pill",children:[Ie," you can help with"]}):null,Sn(r)?e.jsx("span",{className:"tm-row-pill",children:"One-way"}):E?null:e.jsx("span",{className:"tm-row-pill",children:r.sharingEnabled?"Sharing on":"Sharing off"})]})]}),E?null:e.jsx("div",{className:"tm-row-strength",onClick:G=>G.stopPropagation(),children:Sn(r)?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"tm-row-strength-lbl",children:"One-way"}),e.jsx("div",{className:"tm-row-strength-val connector-one-way-copy",children:"They see your targets — your pipeline stays private."})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"tm-row-strength-lbl",children:"Share my targets"}),e.jsxs("div",{className:"tm-row-strength-val",children:["with ",Bt(r.name)]}),e.jsx("label",{className:"connector-share-toggle",style:{marginTop:10},children:e.jsx("span",{className:`toggle-switch${r.sharingEnabled?" on":""}`,role:"switch","aria-checked":r.sharingEnabled,"aria-label":`Share my targets with ${Se}`,tabIndex:0,onClick:()=>un(r),onKeyDown:G=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),un(r))}})})]})}),e.jsx("div",{className:"tm-row-menu",onClick:G=>G.stopPropagation(),children:e.jsxs(pt,{children:[e.jsx(ft,{asChild:!0,children:e.jsx("button",{type:"button",className:"tm-row-menu-btn","aria-label":`Actions for ${Se}`,disabled:!!b[r.id],onClick:G=>G.stopPropagation(),children:b[r.id]?"…":"⋯"})}),e.jsxs(gt,{align:"end",sideOffset:4,className:"nc-card-menu-dropdown gp-m-sheet",children:[E?e.jsx("div",{className:"gp-m-sheet-title",children:Se}):null,E?e.jsx("div",{className:"gp-m-sheet-switch",onClick:G=>G.stopPropagation(),onPointerDown:G=>G.stopPropagation(),onKeyDown:G=>G.stopPropagation(),children:Sn(r)?e.jsx("span",{className:"gp-m-sheet-switch-lbl",children:"One-way — they see your targets, yours stay private."}):e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"gp-m-sheet-switch-lbl",children:["Share my targets with ",Bt(r.name)]}),e.jsx("span",{className:`toggle-switch${r.sharingEnabled?" on":""}`,role:"switch","aria-checked":r.sharingEnabled,"aria-label":`Share my targets with ${Se}`,tabIndex:0,onClick:()=>un(r),onKeyDown:G=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),un(r))}})]})}):null,e.jsx(ze,{className:"nc-card-menu-item",onSelect:()=>Te(r.id),children:"Edit profile"}),e.jsx(ze,{className:"nc-card-menu-item",onSelect:()=>void Nn(r),children:"Remove"})]})]})}),e.jsx(Kt,{open:x,className:"tm-row-expand"})]}),x?e.jsx("div",{className:"acc-expanded",children:e.jsx(as,{relationshipId:r.id,connectorName:Se,reloadKey:Qe,onOpenGemProfile:i,onOpenWebProfile:g,onOpenInvite:N,onOfferIntro:G=>{F(null),Q(G,r)},onRequestIntro:G=>{F(null),Le({target:G,connector:r,mode:"request"})}})}):null]},r.id)})})})]}),e.jsx(Zo,{open:ke,onClose:()=>ee(!1),quota:Y,onSent:()=>{ve(),u==null||u()},quotaBannerShowPro:M,quotaBannerShowEnterprise:me,suppressQuotaUpgradeCopy:de,alwaysShowQuotaUpgradePlans:le}),Ne?e.jsx("div",{className:"modal-overlay open",onClick:()=>Te(null),children:e.jsxs("div",{className:"modal",onClick:r=>r.stopPropagation(),style:{maxWidth:480},children:[e.jsxs("div",{className:"modal-head",children:[e.jsxs("div",{className:"mod-title",children:["Edit profile — ",Ne.name||Ne.email||"Connector"]}),e.jsx("button",{className:"mod-close",onClick:()=>Te(null),"aria-label":"Close",children:"×"})]}),e.jsx("div",{className:"modal-body",children:Ne.isRequester?e.jsxs("div",{className:"connector-profile-edit",children:[e.jsx(Fa,{connector:Ne,disabled:!!b[Ne.id],onSave:kn}),e.jsx(ei,{value:Ne.classification==="portfolio_company"?"portfolio_company":"connector",onChange:r=>void Zn(Ne,r),disabled:!!b[Ne.id],idPrefix:`connector-${Ne.id}`})]}):e.jsxs("div",{className:"connector-profile-edit",children:[e.jsx("div",{className:"portco-form-lbl",children:"Role"}),e.jsx("div",{className:"connector-role-readonly",children:Ne.role?bn(Ne.role):"They added you, so they set the role."})]})}),e.jsxs("div",{className:"modal-foot",children:[e.jsx("button",{className:"btn-foot",disabled:!!b[Ne.id],onClick:()=>{const r=Ne;Te(null),Nn(r)}
1,children:"Remove connector"}),e.jsx("button",{className:"btn-foot primary",style:{marginLeft:"auto"},onClick:()=>Te(null),children:"Done"})]})]})}):null,ae?e.jsx("div",{className:"modal-overlay open",onClick:()=>ne(null),children:e.jsxs("div",{className:"modal",onClick:r=>r.stopPropagation(),style:{maxWidth:460},children:[e.jsxs("div",{className:"modal-head",children:[e.jsxs("div",{className:"mod-title",children:["Turn off sharing with ",ae.name||ae.email,"?"]}),e.jsx("button",{className:"mod-close",onClick:()=>ne(null),"aria-label":"Close",children:"×"})]}),e.jsx("div",{className:"modal-body",children:e.jsxs("p",{style:{fontSize:13,color:"#5a5040",lineHeight:1.6,margin:0},children:[Bt(ae.name,"They")," won't see when they can introduce you to one of your targets. You'll still see theirs."]})}),e.jsxs("div",{className:"modal-foot",children:[e.jsx("button",{className:"btn-foot",onClick:()=>ne(null),children:"Keep sharing"}),e.jsx("button",{className:"btn-foot primary",disabled:!!b[ae.id],onClick:()=>void Xn(ae,!1),children:"Turn off sharing"})]})]})}):null,be?e.jsx(Wt,{state:be,onChange:_,viewerFullName:(j==null?void 0:j.fullName)||"You",sending:Ee,onClose:()=>!Ee&&_(null),onSend:()=>void te()}):null,H?e.jsx(es,{open:!0,variant:H.mode==="offer_after_accept"?"offer":"request",connectorName:H.connector.name||H.connector.email||"Connector",connectorEmail:H.connector.email,connectorUserId:H.connector.userId,connectorTitle:H.connector.role,connectorCompany:H.connector.company,targetName:H.target.path.contact.name,targetUserId:H.target.path.contact.connectedUserId,targetEmail:H.target.path.contact.email,targetRole:H.target.path.contact.title,targetCompany:H.target.companyName,viewerFullName:(j==null?void 0:j.fullName)||"",viewerEmail:(j==null?void 0:j.email)||null,viewerUserId:R,viewerToken:C,reasoning:H.mode==="offer_after_accept"?`${H.connector.name||"Your connector"} accepted — you have a ${H.target.path.tier.replace("_"," ")} relationship with ${H.target.path.contact.name} at ${H.target.companyName}.`:`${H.connector.name||"Your connector"} has a ${H.target.path.tier.replace("_"," ")} relationship with ${H.target.path.contact.name} at ${H.target.companyName}.`,connectorTargetTier:H.target.path.tier,onClose:()=>Le(null),onSend:kt,sending:Be,error:se}):null]})}function Ai(n){return n?n.trim().split(/\s+/).map(l=>l&&l[0].toUpperCase()+l.slice(1).toLowerCase()).join(" "):""}function Oa(n){return n&&n.trim().split(/\s+/)[0]||""}function Ri(n){const l=(n||"").replace(/\s+/g," ").trim().split(" ").filter(Boolean);return l.length>=2?(l[0][0]+l[l.length-1][0]).toUpperCase():(n||"?").slice(0,2).toUpperCase()||"?"}function Mi(n,l){const s=(l||n.companyName||"").trim(),p=(n.role||"").trim();if(!p&&!s)return{title:"",company:""};if(s&&p.endsWith(` · ${s}`))return{title:p.slice(0,p.length-s.length-3).trim(),company:s};if(p.includes(" · ")){const u=p.split(" · ").map(i=>i.trim()).filter(Boolean);if(u.length>=2)return{title:u[0],company:s||u.slice(1).join(" · ")}}return{title:p,company:s}}function Li({contact:n,viaTeammateName:l,companyName:s,busy:p,onActivate:u,onOpenGemProfile:i,onOpenWebProfile:c,onOpenInvite:g}){const N=n.source==="direct_gem"||n.viaName==="you",y=N?"Direct":l?`via ${Oa(l)||l}`:n.viaName?`via ${Oa(n.viaName)||n.viaName}`:"Warm path",h=N?"direct":"via",{title:j,company:P}=Mi(n,s);return e.jsx("div",{className:"acc-contact-group",children:e.jsxs("div",{className:"contact-row",onClick:u,role:"button",tabIndex:0,onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),u())},children:[e.jsx("div",{className:"contact-row-spacer","aria-hidden":!0}),e.jsx(xt,{userId:n.contactUserId,name:Ai(n.name),photo:n.profilePhoto,linkedinUrl:n.linkedinUrl,companyName:s||n.companyName,role:n.role,email:n.email,initials:Ri(n.name),onOpen:i,onOpenWebProfile:c,onOpenInvite:g}),e.jsx("span",{className:`contact-row-role${j?"":" contact-row-role--none"}`,children:j||"—"}),e.jsx("span",{className:"contact-row-company",children:P}),e.jsxs("div",{className:"contact-row-chips",children:[e.jsx("span",{className:`path-chip path-chip--${h}`,children:y}),n.pct>0?e.jsxs("span",{className:"path-chip path-chip--muted",children:[n.pct,"%"]}):null]}),e.jsx("div",{className:"contact-row-connectors",children:n.pct>0?e.jsx(go,{tier:qt(n)}):null}),e.jsxs("span",{className:"acc-row-cta contact-row-cta",children:[p?"Sending…":"See paths",e.jsx("span",{"aria-hidden":"true",children:" →"})]})]})})}function Vt(n){var N,y;
1const l=n.founder.pct!=null,s=n.yours.pct!=null,p=(((N=n.founder.contact)==null?void 0:N.name)||"").toLowerCase(),u=(((y=n.yours.contact)==null?void 0:y.name)||"").toLowerCase(),i=(n.founder.via||"").toLowerCase(),c=(n.yours.via||"").toLowerCase();return{directHasPath:l,anyHasPath:s,sameIntro:l&&s&&p===u&&i===c}}function Da(n){if(!n)return"just now";const l=new Date(n).getTime();if(!Number.isFinite(l))return"just now";const s=Math.max(1,Math.floor((Date.now()-l)/1e3));return s<60?"just now":s<3600?`${Math.floor(s/60)}m`:s<86400?`${Math.floor(s/3600)}h`:`${Math.floor(s/86400)}d`}function Ba({target:n,onOffer:l,onInviteWeb:s,pending:p}){var $,S;const u=n.founder.pct!=null,i=n.yours.pct!=null,c=n.offer;if((c==null?void 0:c.status)==="accepted")return e.jsx("button",{type:"button",className:"drawer-action-btn primary",onClick:L=>{L.stopPropagation(),l(n)},title:`Founder accepted — request the intro to ${c.contactName||n.companyName}`,children:"Request intro →"});if((c==null?void 0:c.status)==="requested")return e.jsx("div",{className:"stgt-status-sent",title:`Intro request sent to ${c.contactName||n.companyName}`,children:"Intro sent"});if((c==null?void 0:c.status)==="offered")return e.jsxs("div",{className:"stgt-status-offered",title:`You offered an intro ${Da(c.createdAt)} ago${c.contactName?` (via ${c.viaName||"your network"} → ${c.contactName})`:""}. Waiting on the founder.`,children:["Offered · ",Da(c.createdAt)]});const g=(($=n.founder.contact)==null?void 0:$.name)||"",N=((S=n.yours.contact)==null?void 0:S.name)||"",y=n.founder.via||"",h=n.yours.via||"",j=u&&i&&g.toLowerCase()===N.toLowerCase()&&y.toLowerCase()===h.toLowerCase();if(u||i){const L=u?j||!i?"direct connection":`direct or via ${n.yours.via||"your network"}`:`via ${n.yours.via||"your network"}`;return e.jsx("button",{type:"button",className:"drawer-action-btn primary",onClick:C=>{C.stopPropagation(),l(n)},disabled:p,title:`Offer ${n.companyName} intro through your ${L}.`,children:p?"Offering…":"Offer intro →"})}const P=n.web&&n.web.length?n.web[0]:null;if(P){const L=P.role&&P.role!=="—"&&P.role||"",C=(P.name||"?").split(" ").map(R=>R[0]).filter(Boolean).slice(0,2).join("").toUpperCase()||"?";return e.jsxs("div",{className:"stgt-web-card",title:`No warm path either side — ${P.name} was surfaced via web search as someone matching the founder's ICP at ${n.companyName}. Informational only.`,children:[e.jsx("div",{className:"stgt-web-av","aria-hidden":"true",children:C}),e.jsxs("div",{style:{minWidth:0,flex:1},children:[e.jsx("div",{className:"stgt-web-name",children:P.name}),e.jsxs("div",{className:"stgt-web-meta",children:[L?`${L} · `:"",e.jsx("span",{className:"stgt-web-tag",children:"Found online"})]})]})]})}return null}function ss(n){const{directHasPath:l,anyHasPath:s,sameIntro:p}=Vt(n),u=[];if(l&&n.founder.pct!=null){const i=n.founder.contact,c=[i==null?void 0:i.role,n.companyName,"the person you want to reach"].filter(
1Boolean).join(" · ");u.push({key:"direct",name:(i==null?void 0:i.name)||"Direct contact",sub:c,pct:n.founder.pct,isDirect:!0,mode:"direct",userId:(i==null?void 0:i.userId)??null,photo:(i==null?void 0:i.profilePhoto)??null})}if(s&&n.yours.pct!=null&&!p){const i=n.yours.contact,c=[i==null?void 0:i.role,n.companyName].filter(Boolean).join(" · ");u.push({key:"extended",name:n.yours.via||(i==null?void 0:i.name)||"Connector",sub:c||`Can introduce you at ${n.companyName}`,pct:n.yours.pct,isDirect:!1,mode:"chained",userId:n.yours.viaUserId??(i==null?void 0:i.userId)??null,photo:(i==null?void 0:i.profilePhoto)??null})}else if(!l&&s&&n.yours.pct!=null){const i=n.yours.contact,c=[i==null?void 0:i.role,n.companyName].filter(Boolean).join(" · ");u.push({key:"network",name:n.yours.via||(i==null?void 0:i.name)||"Connector",sub:c||`Can introduce you at ${n.companyName}`,pct:n.yours.pct,isDirect:!1,mode:"chained",userId:n.yours.viaUserId??(i==null?void 0:i.userId)??null,photo:(i==null?void 0:i.profilePhoto)??null})}return u.sort((i,c)=>(c.pct??0)-(i.pct??0))}function os({name:n,sub:l,pct:s,isDirect:p,isBest:u,userId:i,photo:c,action:g,onOpenWebProfile:N,onOpenInvite:y}){const h=(n||"?").split(" ").map(S=>S[0]).filter(Boolean).slice(0,2).join("").toUpperCase()||"?",j=s??0,P=l.split(" · ")[0]||"",$=l.split(" · ").slice(1).join(" · ")||"";return e.jsxs("div",{className:`drawer-connector-row contact-row contact-row--static${p?" direct":""}${u?" best":""}`,children:[e.jsx("div",{className:"contact-row-spacer","aria-hidden":!0}),e.jsx(xt,{userId:i,name:n,photo:c,role:P,companyName:$,initials:h,onOpenWebProfile:N,onOpenInvite:y,personChildren:e.jsxs(e.Fragment,{children:[p?e.jsx("span",{className:"drawer-connector-badge",children:"Direct"}):null,l?e.jsx("div",{className:"contact-title",title:l,children:l}):null]})}),e.jsx("div",{className:"contact-row-chips",children:!p&&s!=null?e.jsxs("span",{className:"path-chip path-chip--via",children:[j,"%"]}):p?e.jsx("span",{className:"path-chip path-chip--direct",children:"Direct"}):null}),e.jsx("div",{className:"contact-row-connectors","aria-hidden":!0}),e.jsx("div",{className:"drawer-connector-action",children:g})]})}function Ui(n){const{directHasPath:l,anyHasPath:s,sameIntro:p}=Vt(n);let u=0;return l&&(u+=1),(s&&!p||!l&&s)&&(u+=1),u}function Fi(n){const l=ss(n),s=l.find(p=>!p.isDirect)||l[0];return s!=null&&s.pct?s.isDirect?`${s.pct}% direct`:`${s.pct}% via ${s.name}${l.length>1?" · best":""}`:"Tap to see paths"}function Oi({web:n,onOpenWebProfile:l,onOpenInvite:s}){const p=n.role&&n.role!=="—"?n.role:"",u=p?`${p} · Found online`:"Found online";return e.jsx(os,{name:n.name,sub:u,pct:null,isDirect:!1,action:null,onOpenWebProfile:l,onOpenInvite:s})}function Di({portcoInviteId:n,fallbackFounderName:l,defaultLimit:s=5,expandedLimit:p=50,compact:u=!1,onMetaLoaded:i,onOfferIntro:c,onInviteWebPerson:g,onOpenWebProfile:N,onOpenInvite:y,reloadKey:h=0,initialData:j=null,showSectionDivider:P=!1}){var De,Qe,xe;const{user:$}=Nt(),S=($==null?void 0:$.accessToken)||"",L=($==null?void 0:$.userId)||0,[C,R]=d.useState(j?{kind:"loaded",data:j,showAll:!1}:{kind:"idle"}),E=d.useState({sent:!1})[0],U=async b=>{var Z;if(!(!S||!L||!n)&&!(n<1)){R({kind:"loading"});try{const ne=await Sa(S,L,n,b?p:s);R({kind:"loaded",data:ne,showAll:b}),!E.sent&&i&&(E.sent=!0,i({total:ne.totalTargets,founderName:((Z=ne.founder)==null?void 0:Z.name)||null}))}catch(ae){R({kind:"error",message:ae instanceof Error?ae.message:"Failed to load"})}}};d.useEffect(()=>{if(!u){if(n<1){R({kind:"loaded",showAll:!1,data:{founderJoined:!0,founder:null,portcoCompanyName:"",totalTargets:0,targets:[]}});return}if(j){R({kind:"loaded",data:j,showAll:!1}),j.targets.length<j.totalTargets&&S&&L&&n&&(async()=>{try{const Z=await Sa(S,L,n,p);R({kind:"loaded",data:Z,showAll:!0})}catch{}})();return}U(!0)}},[n,L,h,u,j]);const J=(b,Z,ae)=>{var re;if(!c)return;const ne=C.kind==="loaded"?((re=C.data.founder)==null?void 0:re.name)||l||null:l||null;c(b,Z,ae,ne)},[X,B]=d.useState({});if(u){const b=l||"founder";return e.jsxs("span",{className:"stgt-compact-pill",title:`Expand to see ${b}'s target accounts re-resolved through both networks.`,children:["Shared targets",e.jsxs("span",{className:"stgt-compact-pill-sub",children:["from ",b]})]})}if(C.kind==="idle"||C.kind==="loading")return e.jsx(jt,{variant:"inline",message:"Loading shared targets…"});if(C.kind==="error")return e.jsxs("div",{style:{padding:"14px 18px",color:"#b04848",fontSize:12},children:["Couldn't load shared targets: ",C.message]});const{data:ie}=C;if(!ie.founderJoined)return e.jsx("div",{style:{padding:"14px 18px",color:"#9a9484",fontSize:12},children:"Founder hasn't joined Gemphere yet — once they accept the invite and add target accounts, you'll see them re-resolved through your network here."});if(ie.totalTargets===0)return e.jsxs("div",{style:{padding:"14px 18px",color:"#9a9484",fontSize:12},children:[((De=ie.founder)==null?void 0:De.name)||l||"The founder"," hasn't added any target accounts yet."]});const Y=b=>b.source==="role"||!!(b.targetRole&&b.companyName&&b.targetRole.trim().toLowerCase()===b.companyName.trim().toLowerCase()),ce=ie.targets.filter(b=>!Y(b));if(!ce.length)return null;const z=((Qe=ie.founder)==null?void 0:Qe.name)||l||"Founder",Me=ce.length,ke=ie.totalTargets,ee=C.kind==="loaded"&&!C.showAll&&Me<ke,we=b=>{const Z=b.intents.map(ne=>
1ne.name).filter(Boolean);return Z.length>0?Z.slice(0,2).join(", ")+(Z.length>2?` +${Z.length-2}`:""):[b.industry,b.isF500?"enterprise":null].filter(Boolean).join(" · ")||""};return e.jsxs("div",{className:`portco-expand-block${P?" portco-expand-divider":""}`,children:[e.jsxs("div",{className:"portco-expand-lbl",children:["Shared targets",e.jsxs("span",{className:"stgt-section-meta",children:[" ","· ",e.jsxs("strong",{children:["from"," ",e.jsx(dn,{userId:(xe=ie.founder)==null?void 0:xe.userId,name:z,className:"stgt-founder-name",onOpenWebProfile:N,onOpenInvite:y})]})," ","· ",Me," of ",ke.toLocaleString()]})]}),e.jsx("div",{className:"stgt-list",children:ce.map(b=>{var se;const Z=!!X[b.id],ae=we(b),{directHasPath:ne,anyHasPath:re}=Vt(b),Te=!ne&&!re&&!!(b.web&&b.web.length),H=((se=b.offer)==null?void 0:se.status)==="accepted",Le=Ui(b),Be=ss(b),Xe=Be.filter(F=>!F.isDirect);return e.jsxs("div",{className:`stgt-drawer-wrap${H?" accepted":""}`,children:[e.jsxs("div",{className:`stgt-summary-row acc-row-v2${Z?" open":""}`,onClick:()=>B(F=>({...F,[b.id]:!F[b.id]})),role:"button",tabIndex:0,onKeyDown:F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),B(be=>({...be,[b.id]:!be[b.id]})))},children:[e.jsx("div",{className:"acc-row-rank","aria-hidden":"true",children:(b.companyName||"?").slice(0,1).toUpperCase()}),e.jsxs("div",{className:"acc-row-info",children:[e.jsx("div",{className:"acc-name-v2",children:b.companyName}),ae?e.jsx("div",{className:"acc-row-meta",children:ae}):null,Le>0?e.jsxs("div",{className:"acc-row-meta",children:[Le," path",Le===1?"":"s"," in your network"]}):null]}),e.jsx("div",{className:"acc-row-strength",children:!Z&&!Te?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"acc-row-persona",children:"Your network path"}),e.jsxs("div",{className:"acc-path-bar-row",children:[e.jsx("div",{className:"acc-path-bar",children:e.jsx("div",{className:`acc-path-bar-fill${ne||re?" has-path":""}`,style:{width:ne||re?"100%":"12%"}})}),e.jsx("span",{className:`acc-path-bar-score${ne||re?"":" muted"}`,children:Fi(b)})]})]}):null}),e.jsx("div",{className:"acc-row-stack stgt-collapsed-action-wrap",children:!Z&&!Te?e.jsx("div",{className:"stgt-collapsed-action",onClick:F=>F.stopPropagation(),children:e.jsx(Ba,{target:b,onOffer:J,onInviteWeb:g,pending:!1})}):null}),e.jsx(Kt,{open:Z,className:"stgt-caret"})]}),Z?e.jsx("div",{className:"stgt-drawer-body",children:(()=>{var be;if(Te&&((be=b.web)!=null&&be[0]))return e.jsx(Oi,{web:b.web[0],onOpenWebProfile:N,onOpenInvite:y});if(!Be.length)return e.jsx("div",{className:"drawer-connector-empty",children:"No warm path found yet"});const F=Xe.length||Be.length;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"drawer-section-header",children:[F," people can introduce you · ranked by strength"]}),Be.map((_,Ee)=>e.jsx(os,{name:_.name,sub:_.sub,pct:_.pct,isDirect:_.isDirect,isBest:Ee===0&&!_.isDirect,userId:_.userId,photo:_.photo,onOpenWebProfile:N,onOpenInvite:y,action:Ee===0?e.jsx(Ba,{target:b,onOffer:k=>J(k,_.mode),onInviteWeb:g,pending:!1}):e.jsx("button",{type:"button",className:"drawer-action-btn outline",onClick:k=>{k.stopPropagation(),J(b,_.mode)},children:"Offer intro"})},_.key))]})})()}):null]},b.id)})}),ee?e.jsxs("button",{type:"button",className:"stgt-see-all",onClick:()=>void U(!0),children:["See all ",ke.toLocaleString()," shared targets →"]}):null]})}function Bi(n){return n.source==="role"||!!(n.targetRole&&n.companyName&&n.targetRole.trim().toLowerCase()===n.companyName.trim().toLowerCase())}function qi(n){return(n||"?").split(" ").map(l=>l[0]).filter(Boolean).slice(0,2).join("").toUpperCase()||"?"}function is(n,l=8){var u;if(!((u=n==null?void 0:n.targets)!=null&&u.length))return[];const s=new Set,p=[];for(const i of n.targets){if(!Bi(i))continue;const c=i.targetRole||i.companyName||"Role";for(const g of i.roleMatches||[]){const N=(g.name||"").trim().toLowerCase();!N||s.has(N)||(s.add(N),p.push({...g,roleLabel:c}))}}return p.sort((i,c)=>(c.pct??0)-(i.pct??0)),p.slice(0,l)}function Hi({data:n,label:l="Candidates",onReachOut:s,onOpenWebProfile:p,onOpenInvite:u}){const i=is(n);return i.length?e.jsxs("div",{className:"portco-expand-block",children:[e.jsx("div",{className:"portco-expand-lbl",children:l}),i.map(c=>{const g=(c.via||"").toLowerCase()==="you",N=[c.role,c.companyName].filter(
1Boolean).join(" · "),y=(c.pct??0)<70;return e.jsxs("div",{className:"pcand-row contact-row contact-row--static",children:[e.jsx("div",{className:"contact-row-spacer","aria-hidden":!0}),e.jsx(xt,{userId:c.contactUserId,name:c.name,photo:c.profilePhoto,companyName:c.companyName,role:c.role,initials:qi(c.name),onOpenWebProfile:p,onOpenInvite:u,personChildren:N?e.jsx("div",{className:"contact-title",children:N}):null}),e.jsx("div",{className:"contact-row-chips",children:c.pct!=null?e.jsxs("span",{className:"path-chip path-chip--direct",children:[c.pct,"%",!g&&c.via?` via ${c.via}`:""]}):e.jsx("span",{className:"path-chip path-chip--muted",children:"Scanning…"})}),e.jsx("div",{className:"contact-row-connectors","aria-hidden":!0}),e.jsx("button",{type:"button",className:`contact-row-action contact-row-action--text${y?" ghost":""}`,onClick:h=>{h.stopPropagation(),s(c)},children:"Reach out"})]},`${c.name}-${c.via}`)})]}):null}function qa(){return{team:{name:"Your team",domain:null,memberCount:0,strategy:"none",isAdmin:!1,teamId:null,adminUserId:null},metrics:{introsMade:0,meetingsBooked:0,accountsReached:0,accountsTotal:0,periodFrom:null,periodTo:null},internalRequests:[],topConnectors:[],teammates:[],discoveredTeammates:[],pendingInvites:[],portfolioCompanies:[],portfolioAsks:[],gapCount:0}}function Wi(n){return!(n!=null&&n.allowed)||n.requiresUpgrade===!0?!1:n.paidAccess===!0}const Yt="[email protected]",Ha=["green","amber","purple","teal","blue","red"],_i=[{fullName:"Jeff Ransdell",title:"Founding Partner & Managing Director",email:"[email protected]",linkedin:"https://www.linkedin.com/in/jeffransdell/",notes:"Co-founder. Ex Merrill Lynch SE Division Managing Director. Based Miami."},{fullName:"Maggie Vo, CFA",title:"Managing General Partner & Chief Investment Officer",email:"[email protected]",linkedin:"https://www.linkedin.com/in/maggievo/",notes:"CIO. Leads investment strategy. Recognized as Top VC by Insider."},{fullName:"Selene Casabal",title:"Managing General Partner & Chief Venture Officer",email:"[email protected]",linkedin:"https://www.linkedin.com/in/selenecasabal/",notes:"Joined Oct 2025 to lead Silicon Valley expansion. Ex Sequoia Scout, founder, AI super angel."},{fullName:"Olivia Gaudree",title:"Partner & VP of Operations",email:"[email protected]",linkedin:"https://www.linkedin.com/in/oliviagaudree/",notes:"Heads Operations & Compliance. Forbes 30 Under 30. Joined Fuel in 2018."},{fullName:"Anuj Maheshwari, CFA",title:"Investment Associate",email:"[email protected]",linkedin:"https://www.linkedin.com/in/anujmaheshwari/",notes:"Investment analysis & strategy."},{fullName:"Tempel Ransdell",title:"Head of Investor Relations",email:"[email protected]",linkedin:"https://www.linkedin.com/in/tempelransdell/",notes:"Manages LP relationships."},{fullName:"Dr. Hasnae Taleb",title:"Partner, GCC Region",email:"[email protected]",linkedin:"https://www.linkedin.com/in/hasnaetaleb/",notes:"GCC market lead. Mintiply Capital collaboration."},{fullName:"Juan P. Miró",title:"Latin America Venture Partner",email:"[email protected]",linkedin:"https://www.linkedin.com/in/juanpablomiro/",notes:"LatAm opportunities."},{fullName:"Emilio Escartin",title:"Europe & Middle East Venture Partner",email:"[email protected]",linkedin:"https://www.linkedin.com/in/emilioescartin/",notes:"EU/ME deal sourcing."},{fullName:"Matt Wilkens",title:"Partner & Managing Director, MENA",email:"[email protected]",linkedin:"https://www.linkedin.com/in/mattwilkens/",notes:"MENA region (per Crunchbase team listing)."},{fullName:"Danh Luong",title:"Director of Technology",email:"[email protected]",linkedin:"https://www.linkedin.com/in/danhluong/",notes:"Technology investments oversight."},{fullName:"Jared Shapiro",title:"Branding & Communications (via The Tag Experience)",email:"[email protected]",linkedin:"https://www.linkedin.com/in/jaredshapiro/",notes:"Media contact per BusinessWire press releases."},{fullName:"Mellica Frehner",title:"Fund Operations & Reporting",email:"[email protected]",linkedin:"https://www.linkedin.com/in/mellicafrehner/",notes:"Fund ops & investor reporting."}],Yi=[{fullName:"Aria Patel",title:"Founder & CEO",email:"[email protected]",linkedin:"",notes:"Demo contact — founder persona."},{fullName:"Marcus Chen",title:"Principal Investor",email:"[email protected]",linkedin:"",notes:"Demo contact — investor persona."},{fullName:"Priya Sharma",title:"Head of Operations",email:"[email protected]",linkedin:"",notes:"Demo contact — operator persona."},{fullName:"Liam Rodriguez",title:"Strategic Advisor",email:"[email protected]",linkedin:"",notes:"Demo contact — advisor persona."}],rs="@typeone.vc",Wa=[{fullName:"Tarek Waked",title:"Co-Founder & Managing Partner",email:"[email protected]",linkedin:"https://www.linkedin.com/in/tarek-waked-43991730/",notes:"Co-Founder & Managing Partner. Based Los Angeles, CA."},{fullName:"Abdo John Hajj",title:"Co-Founder & Managing Partner",email:"[email protected]",linkedin:"https://www.linkedin.com/in/abdo-john-hajj-a9041051/",notes:"Co-Founder & Managing Partner. Based Los Angeles, CA."},{fullName:"Sanjeev Gordhan",title:"General Partner",email:"[email protected]",linkedin:"",notes:"General Partner."},{fullName:"Warren Hui",title:"General Partner - APAC",email:"[email protected]",linkedin:"https://www.linkedin.com/in/warren-hui-67b298206/",notes:"General Partner - APAC. Based Singapore."},{fullName:"Ryan Kriser",title:"Partner",email:"[email protected]",linkedin:"https://www.linkedin.com/in/ryankriser/",notes:"Partner. Based West Palm Beach, FL."},{fullName:"Ryutaro Hiroshima",title:"Partner, Head of Japan",email:"[email protected]",linkedin:"https://www.linkedin.com/in/ryutaro-hiroshima-83b31bb6/",notes:"Partner, Head of Japan. Based Japan."},{fullName:"Nina Mahmoudpour",title:"General Counsel & Chief of Staff",email:"[email protected]",linkedin:"https://www.linkedin.com/in/ninamahmoudpour/",notes:"General Counsel & Chief of Staff. Based Los Angeles, CA."}
1,{fullName:"Daniil Chen",title:"Principal",email:"[email protected]",linkedin:"https://www.linkedin.com/in/daniil-chen-75325b139/",notes:"Principal. Based Malibu, CA."},{fullName:"Avantika Gupta",title:"Principal",email:"[email protected]",linkedin:"https://www.linkedin.com/in/avantika-gupta-4a837142/",notes:"Principal. Based London, UK."},{fullName:"Gustav Spangberg",title:"Principal",email:"[email protected]",linkedin:"",notes:"Principal."},{fullName:"Benny So",title:"Principal - APAC",email:"[email protected]",linkedin:"",notes:"Principal - APAC."},{fullName:"Gin Takashi Mizuoka",title:"Venture Partner - Japan",email:"[email protected]",linkedin:"https://www.linkedin.com/in/gin-takashi-mizuoka-21498635/",notes:"Venture Partner - Japan. Based Tokyo, Japan."},{fullName:"Josh Kovac",title:"Principal - APAC",email:"[email protected]",linkedin:"https://www.linkedin.com/in/josh-kovac/",notes:"Principal - APAC. Based Singapore."},{fullName:"Tiffany Sun",title:"Head of Investor Relations - APAC",email:"[email protected]",linkedin:"https://www.linkedin.com/in/tiffany-sunsoulventures/",notes:"Head of Investor Relations - APAC. Based Hong Kong."},{fullName:"Daphne Zhao",title:"Investor Relations - Director APAC",email:"[email protected]",linkedin:"https://www.linkedin.com/in/daphnehaoxingzhao723/",notes:"Investor Relations - Director APAC. Based Hong Kong."},{fullName:"Nate Wilson",title:"Head of Finance & Operations",email:"[email protected]",linkedin:"",notes:"Head of Finance & Operations."},{fullName:"Yasser Mestarihi",title:"Head of Middle East",email:"[email protected]",linkedin:"https://www.linkedin.com/in/yasser-mestarihi-30338b6b/",notes:"Head of Middle East. Based Dubai, UAE."},{fullName:"Clara Kwan",title:"Legal Counsel - APAC",email:"[email protected]",linkedin:"https://www.linkedin.com/in/clara-kwan-b2267653/",notes:"Legal Counsel - APAC. Based Hong Kong."},{fullName:"Cynthia Jean Kember",title:"Head of Media, Content, Platforms and Partnerships",email:"[email protected]",linkedin:"",notes:"Head of Media, Content, Platforms and Partnerships."},{fullName:"Jacob Flores",title:"Head of Research",email:"[email protected]",linkedin:"https://www.linkedin.com/in/jacob-ethan-flores-845973139/",notes:"Head of Research. Based Los Angeles, CA."}],Gi={pageHeading:"Your firm · Type One Ventures",preMappedSourceLabel:"Pre-mapped from typeone.vc",syncedToast:`Synced ${Wa.length} partners from typeone.vc`,syncButtonTitle:"Pull your firm's partner roster from typeone.vc",partnersSectionHeading:"Partners at Type One Ventures",partnerRoleSuffix:" · Type One Ventures",syncLsKey:"gemphere.typeone.sync.v1",invitedLsKey:"gemphere.typeone.invited.v1",partners:Wa},Ki={[Yt]:{ownerEmail:Yt,pageHeading:"Your firm · Fuel Venture Capital",preMappedSourceLabel:"Pre-mapped from fuelventurecapital.com",syncedToast:"Synced 13 partners from fuelventurecapital.com",syncButtonTitle:"Pull your firm's partner roster from fuelventurecapital.com",partnersSectionHeading:"Partners at Fuel Venture Capital",partnerRoleSuffix:" · Fuel Venture Capital",syncLsKey:"gemphere.fuelventure.sync.v1",invitedLsKey:"gemphere.fuelventure.invited.v1",partners:_i},"[email protected]":{ownerEmail:"[email protected]",pageHeading:"Your workspace · Gemphere",preMappedSourceLabel:"Pre-mapped from gemphere.com",syncedToast:"Synced 4 contacts from gemphere.com",syncButtonTitle:"Pull your pre-mapped roster from gemphere.com",partnersSectionHeading:"Contacts at Gemphere",partnerRoleSuffix:" · Gemphere",syncLsKey:"gemphere.demo.gaurangselene.sync.v1",invitedLsKey:"gemphere.demo.gaurangselene.invited.v1",partners:[{fullName:"Gaurang Shukla",title:"Workspace Owner",email:"[email protected]",linkedin:"",notes:"Owner of this pre-mapped demo workspace."},...Yi]}};function Vi(n){const l=n.trim().toLowerCase();if(!l)return null;const s=Ki[l];return s||(l.endsWith(rs)?{...Gi,ownerEmail:l}:null)}function Ji(n){var u,i;const l=n.replace(/[,.]/g,"").split(/\s+/).filter(Boolean),s=((u=l[0])==null?void 0:u[0])||"",p=l.length>1&&((i=l[l.length-1])==null?void 0:i[0])||"";return(s+p).toUpperCase()||"?"}function mn(n){return n&&n.trim().split(/\s+/)[0]||""}async function zi(n,l,s={}){const p=(s.note||"").trim(),u={email:l,...s.name?{name:s.name}:{},...s.resend?{resend:!0}:{},...p?{note:p}:{}},i=await ui(n,u);
1if(!i.ok){let c=`Failed to send invite (${i.status})`;try{const g=await i.json();typeof(g==null?void 0:g.message)=="string"?c=g.message:typeof(g==null?void 0:g.error)=="string"&&(c=g.error)}catch{}throw new Error(c)}}function Qi(n){if(!n)return"—";const l=new Date(n);return Number.isNaN(l.getTime())?"—":l.toLocaleString(void 0,{month:"short",day:"numeric"})}function Xi({value:n,busy:l,onChange:s,ariaLabel:p,className:u}){return e.jsxs("div",{role:"group","aria-label":p,className:`tm-role-toggle${l?" is-busy":""}${u?` ${u}`:""}`,children:[e.jsx("button",{type:"button",className:`tm-role-toggle-btn${n==="member"?" is-active":""}`,disabled:l,onClick:()=>s("member"),children:"Member"}),e.jsx("button",{type:"button",className:`tm-role-toggle-btn${n==="admin"?" is-active":""}`,disabled:l,onClick:()=>s("admin"),children:"Admin"})]})}function Zi({name:n,role:l,roleBusy:s,removeBusy:p,onRoleChange:u,onRemove:i}){const c=s||p;return e.jsxs(pt,{children:[e.jsx(ft,{asChild:!0,children:e.jsx("button",{type:"button",className:"tm-teammate-menu-btn","aria-label":`Manage ${n}`,disabled:c,onPointerDown:g=>g.stopPropagation(),onClick:g=>g.stopPropagation(),children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":!0,children:[e.jsx("circle",{cx:"8",cy:"3",r:"1.35"}),e.jsx("circle",{cx:"8",cy:"8",r:"1.35"}),e.jsx("circle",{cx:"8",cy:"13",r:"1.35"})]})})}),e.jsxs(gt,{align:"end",sideOffset:4,className:"tm-teammate-menu-dropdown gp-m-sheet",children:[e.jsx("div",{className:"gp-m-sheet-title",children:n}),e.jsx(ri,{className:"tm-teammate-menu-label",children:"Role"}),e.jsx(ze,{className:`tm-teammate-menu-item${l==="member"?" is-selected":""}`,disabled:s,onClick:g=>g.stopPropagation(),onSelect:g=>{g.stopPropagation(),u("member")},children:"Member"}),e.jsx(ze,{className:`tm-teammate-menu-item${l==="admin"?" is-selected":""}`,disabled:s,onClick:g=>g.stopPropagation(),onSelect:g=>{g.stopPropagation(),u("admin")},children:"Admin"}),e.jsx(li,{}),e.jsx(ze,{className:"tm-teammate-menu-item tm-teammate-menu-item-danger",disabled:c,onClick:g=>g.stopPropagation(),onSelect:g=>{g.stopPropagation(),i()},children:p?"Removing…":"Remove from team"})]})]})}function er({pct:n}){const l=n>=90?4:n>=65?3:n>=45?2:n>0?1:0;return e.jsx("span",{className:"warmth-meter","aria-hidden":"true",children:[0,1,2,3].map(s=>e.jsx("span",{className:`warmth-seg${s<l?" on":""}`},s))})}function nr(n){return n!=null&&n.trim()?n.trim().split(/\s+/).map(l=>l&&l.charAt(0).toUpperCase()+l.slice(1).toLowerCase()).join(" "):""}async function Jn(n,l){if(!n||!l||l<=0)return null;try{const s=await hi(n,l);if(!s.ok)return null;const p=await s.json().catch(()=>({})),u=(p==null?void 0:p.users)??(p==null?void 0:p.data)??[],i=Array.isArray(u)?u.find(g=>Number(g.id??g.Id)===l):null;return String((i==null?void 0:i.email)??(i==null?void 0:i.Email)??"").trim()||null}catch{return null}}function Jt(n){return!(n.source==="direct_gem"||n.viaName==="you"||!n.viaUserId||!n.viaName||n.viaName.toLowerCase()==="team")}function tr({viewerFullName:n,viewerFirst:l,viewerEmail:s,account:p,contact:u,askerOverride:i}){const c=u.name,g=u.role||"",N=u.companyName||p.companyName||"",y=mn(c)||c,h=l||n,j=u.source==="direct_gem"||u.viaName==="you",P=Jt(u);if(i){const U=i.name,J=mn(U)||U,X=i.companyName||"",B=X?`${U} from ${X}`:U;if(j){const ce=`Quick intro — ${J} <> ${y}`,z=`Hi ${y},
2
3I'd love to introduce you to ${B}.${g?` Given your work as ${g}${N?` at ${N}`:""}, `:" "}I think there's a real fit worth exploring.
4
5Happy to make the email intro if you're open to it — just let me know.
6
7${h}`;return{subject1:ce,message1:z,subject2:"",message2:""}}if(P){const ce=u.viaName,z=n||h,Me=`${h} would like your help reaching ${c||y}`,ke=`Hey ${ce},
8
9${z} is helping out one of their portfolio founders, ${U}, and it looks like you're connected to ${c}${N?` at ${N}`:""}${g?` (${g})`:""}.
10
11Would you be open to a warm intro? Attached below is the email you'd send to ${y} in one click, or you can draft your own.
12
13Thanks either way,
14Gem`,ee=`Intro: ${U} / ${c}`,we=_o(B);return{subject1:Me,message1:ke,subject2:ee,message2:we}}const ie=`Intro: ${U} / ${c}`,Y=`Hi ${y},
15
16I'd like to introduce you to ${B}. There's strong overlap with what you're working on${N?` at ${N}`:""}, and I thought a brief chat could be worthwhile.
17
18If now isn't a good time, no worries at all.
19
20${h}`;return{subject1:ie,message1:Y,subject2:"",message2:""}}if(j){const{subject:U,body:J}=ci(h,y);return{subject1:U,message1:J,subject2:"",message2:""}}if(!P){const U=`Intro: ${h}${N?` / ${N}`:""}`,J=`Hi ${y},
21
22I'm ${n||h}.${N?` I'm reaching out about ${N}`:""}${g?` — saw you're a ${g}`:""} and thought a quick chat could be worthwhile.
23
24If the timing isn't right, no worries at all.
25
26${h}`;return{subject1:U,message1:J,subject2:"",message2:""}}const $=Xa(u.viaName),S=Yo(c),L=`Would you be open to introducing me to ${S}?`,C=`Hi ${$},
27
28Hope you're doing well. I noticed you're connected to ${S} — I'd love an intro if you're open to it.
29
30I've drafted a short blurb below you can forward as-is, or edit however you like. Totally understand if the timing isn't right.
31
32Thanks either way.
33
34${n||"Me"}`,R=`Intro: ${n||"Me"} ↔ ${S}`,E=Go(n,s);return{subject1:L,message1:C,subject2:R,message2:E}}function ar(n){var s,p,u,i;const l=((s=n.founders)==null?void 0:s.find(c=>c.status==="accepted"))??((p=n.founders)==null?void 0:p[0]);return{id:n.connectorRelationshipId,status:"active",direction:"none",classification:"portfolio_company",role:n.founderRole??null,isRequester:!0,userId:(l==null?void 0:l.acceptedUserId)??null,
34name:(l==null?void 0:l.name)||((u=n.founderNames)==null?void 0:u[0])||n.companyName,email:(l==null?void 0:l.email)||((i=n.founderEmails)==null?void 0:i[0])||null,profilePhoto:null,company:n.companyName||null,note:null,sharingEnabled:!1,createdAt:null,acceptedAt:n.acceptedAt??null,lastRequestedAt:null,canReRequest:!1}}function _a(n,l,s){var N,y,h,j,P,$,S,L;const p=(y=(N=l==null?void 0:l.founder)==null?void 0:N.name)==null?void 0:y.trim();if(p)return p;const u=(h=n==null?void 0:n.founders)==null?void 0:h.find(C=>C.status==="accepted"),i=($=(u==null?void 0:u.name)||((P=(j=n==null?void 0:n.founders)==null?void 0:j[0])==null?void 0:P.name))==null?void 0:$.trim();if(i)return i;const c=(L=(S=n==null?void 0:n.founderNames)==null?void 0:S[0])==null?void 0:L.trim();if(c)return c;const g=s==null?void 0:s.trim();return g||"Founder"}function sr(n,l,s){var i,c;const p=(i=l==null?void 0:l.founder)==null?void 0:i.userId;if(p&&p>0)return p;const u=(s||"").trim().toLowerCase();if((c=n==null?void 0:n.founders)!=null&&c.length){const g=u?n.founders.find(N=>N.name.trim().toLowerCase()===u):n.founders.find(N=>N.status==="accepted")||n.founders[0];if(g!=null&&g.acceptedUserId&&g.acceptedUserId>0)return g.acceptedUserId}return null}function Ya(n,l){var i,c,g;const s=(l||"").trim().toLowerCase();if((i=n==null?void 0:n.founders)!=null&&i.length){const N=s?n.founders.find(h=>h.name.trim().toLowerCase()===s):n.founders.find(h=>h.status==="accepted")||n.founders[0],y=(c=N==null?void 0:N.email)==null?void 0:c.trim();if(y)return y}const p=(n==null?void 0:n.founderNames)||[];let u=0;if(s&&p.length){const N=p.findIndex(y=>y.trim().toLowerCase()===s);N>=0&&(u=N)}return(((g=n==null?void 0:n.founderEmails)==null?void 0:g[u])||"").trim()}function or(n,l){const s=new Map;for(const p of[...n,...l]){const u=(p.companyName||"").trim().toLowerCase();if(!u)continue;const i=s.get(u);(!i||(p.acceptedFounderCount||0)>(i.acceptedFounderCount||0))&&s.set(u,p)}return Array.from(s.values())}function ir(n,l){const s=new Map;for(const p of[...n,...l]){const u=(p.companyName||"").trim().toLowerCase();!u||s.has(u)||s.set(u,p)}return Array.from(s.values())}function rr(n){if(!n)return"";const l=new Date(n);if(Number.isNaN(l.getTime()))return"";const s=Math.max(1,Math.round((Date.now()-l.getTime())/1e3));if(s<60)return"just now";const p=Math.round(s/60);if(p<60)return`${p} min${p===1?"":"s"} ago`;const u=Math.round(p/60);if(u<24)return`${u} hr${u===1?"":"s"} ago`;const i=Math.round(u/24);if(i<7)return`${i} day${i===1?"":"s"} ago`;const c=Math.round(i/7);if(c<5)return`${c} week${c===1?"":"s"} ago`;const g=Math.round(i/30);return g<12?`${g} mo${g===1?"":"s"} ago`:`${Math.round(i/365)} yr${Math.round(i/365)===1?"":"s"} ago`}function lr({open:n,account:l,contact:s,viewerFullName:p,viewerUserId:u,viewerEmail:i,viewerToken:c,founderUserId:g,connectorUserId:N,markedConnectorUserIds:y,askerOverride:h,onClose:j,onBack:P,onSend:$,sending:S,error:L}){const C=mn(p),R=d.useMemo(()=>!n||!l||!s?null:tr({viewerFullName:p,viewerFirst:C,viewerEmail:i,account:l,contact:s,askerOverride:h}),[n,l,s,p,C,i,h]),[E,U]=d.useState(""),[J,X]=d.useState(""),[B,ie]=d.useState(""),[Y,ce]=d.useState(""),[z,Me]=d.useState("double"),[ke,ee]=d.useState(""),[we,De]=d.useState(""),[Qe,xe]=d.useState(""),[b,Z]=d.useState(null),[ae,ne]=d.useState(""),[re,Te]=d.useState(""),[H,Le]=d.useState(""),[Be,Xe]=d.useState("");if(d.useEffect(()=>{if(!n||!R)return;U(R.subject1),X(R.message1),ie(R.subject2),ce(R.message2),ee(""),De(""),xe(((s==null?void 0:s.contactEmail)||"").trim());const M=N||(s!=null&&s.viaUserId&&s.viaUserId>0?s.viaUserId:null)||(h?u:null),me=M&&M>0&&(y==null?void 0:y.has(M));Me(me?"single":So(M?{userId:M}:null,{userIds:y??new Set,contactIds:new Set}))},[n,R,N,s==null?void 0:s.viaUserId,s==null?void 0:s.contactEmail,h,u,y]),d.useEffect(()=>{if(!n||!c||!u||h||!s)return;const M=s.source==="direct_gem"||s.viaName==="you",me=s.contactUserId;if(!M||!me||me<=0)return;let le=!1;return Po(c,u,{contactUserId:me}).then(W=>{le||(U(W.defaults.subject),X(W.defaults.body))}).catch(()=>{}),()=>{le=!0}},[n,c,u,h,s==null?void 0:s.contactUserId,s==null?void 0:s.source,s==null?void 0:s.viaName]),d.useEffect(()=>{if(!n||!c)return;let M=!1;return(async()=>{const me=await Ta(c,u,Aa());M||(ne(me.title),Te(me.company));const le=N||(s!=null&&s.viaUserId&&s.viaUserId>0?s.viaUserId:null)||(h?u:null);if(le&&le>0){const W=await Ta(c,le,Aa());M||(Le(W.title),Xe(W.company))}else M||(Le(""),Xe(""))})(),()=>{M=!0}},[n,c,u,N,s==null?void 0:s.viaUserId,h]),d.useEffect(()=>{if(!n||!c)return;let M=!1;return(async()=>{const me=N||(s!=null&&s.viaUserId&&s.viaUserId>0?s.viaUserId:null)||(h?u:null),[le,W]=await Promise.all([Jn(c,me),Jn(c,g??null)]);M||(le&&ee(le),W&&De(W))})(),()=>{M=!0}},[n,c,N,s==null?void 0:s.viaUserId,h,g,u]),d.useEffect(()=>{if(!n||!c)return;const M=h&&g?g:u;if(!M)return;const me=h?h.companyName?`${h.name} from ${h.companyName}`:h.name:null;let le=!1;return za(c,M).then(W=>{if(le)return;const ve=(W||"").trim();ve&&(Z(ve),ce(en=>h?Qa(en,me)?ve:en:$o(en,p,i)?ve:en))}).catch(()=>{}),()=>{le=!0}},[n,c,u,g,h,R==null?void 0:R.message2,p,i]),!n||!l||!s)return null;const se=s.source==="direct_gem"||s.viaName==="you",F=Jt(s),be=!s.contactUserId||s.contactUserId===0,_=Qe.trim(),Ee=ke.trim(),k=we.trim(),yn=s.companyName||l.companyName,Q=mn(s.name)||s.name,te=!!h,He
34=(h==null?void 0:h.name)||"",Ae=mn(He)||He,Ze=(h==null?void 0:h.companyName)||"",We=te&&l.source==="role"&&!!l.targetRole,vn=se&&!te&&!F,de=F&&!te&&!se,Ke=Xa(s.viaName||"",ke),ye=[];if(te&&se)ye.push(`You're directly connected to ${Q} — fastest possible bridge for ${Ae}`);else if(te&&F){ye.push(`${s.viaName} can bridge ${Ae} to ${Q}`);const M=s.warmthTier?Ma(s.warmthTier):"solid";M&&ye.push(`<strong>${gn(M)} relationship</strong>`)}else if(se)ye.push("Direct connection · fastest possible path");else if(F){ye.push(`${s.viaName} is connected to ${Q}`);const M=s.warmthTier?Ma(s.warmthTier):"solid";M&&ye.push(`<strong>${gn(M)} relationship</strong>`)}else s.source==="imported"&&ye.push("Imported contact · known via LinkedIn");return l.aiReason&&ye.push(l.aiReason),To.createPortal(e.jsx("div",{className:"modal-overlay open request-intro-portal",onClick:j,role:"presentation",children:e.jsxs("div",{className:`modal req-modal req-modal--wide${vn?" req-modal-direct":""}${te?" req-modal-portco":""}`,onClick:M=>M.stopPropagation(),children:[e.jsxs("div",{className:"modal-head",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"req-step-kicker",children:[e.jsx("span",{children:F?"Step 2 of 2 · What Gem sends":"What Gem sends"}),e.jsx("span",{className:"req-step-kicker-note",children:F?"Double opt-in · Nothing sends yet":"Nothing sends yet"})]}),e.jsx("div",{className:"mod-title",children:We?se?`Reach out to ${s.name}.`:`Reach out via ${s.viaName||"your connector"}.`:te?`Offer ${Ae||He} an intro to ${s.name}.`:se?`Send a message to ${s.name}.`:`Request an intro to ${s.name}.`}),e.jsx("div",{className:"mod-sub",children:We?se?`Message ${Q} about ${Ae}'s ${l.targetRole} search${Ze?` at ${Ze}`:""}. Edit the note below before sending.`:`Ask ${s.viaName||"your connector"} to intro ${s.name} to ${Ae} for their ${l.targetRole} search. Edit the email below before sending.`:te&&se?`You're directly connected to ${Q} — message them to put ${Ae} in touch.`:te&&F?`Ask ${s.viaName||"your connector"} to bridge ${Ae} to ${Q}. You can edit the forwarded blurb.`:se?"You're directly connected — we'll send a message straight to them.":""})]}),e.jsx("button",{className:"mod-close",onClick:j,"aria-label":"Close",children:"×"})]}),e.jsxs(Eo,{children:[te?e.jsx(Vn,{name:He||"Founder",role:l.targetRole||"Founder",company:Ze||void 0,badge:"founder",avatarTone:"green",compactName:!1}):e.jsx(Vn,{name:p||"You",role:ae||void 0,company:re||void 0,badge:"you",badgeLabel:de?"Asker":void 0,avatarTone:"green",compactName:!1}),te&&se?e.jsxs(e.Fragment,{children:[e.jsx(Dt,{}),e.jsx(Vn,{name:p||"You",role:ae||void 0,company:re||void 0,kindLabel:"You",badge:"you",badgeLabel:"You",avatarTone:"green",compactName:!1})]}):F?e.jsxs(e.Fragment,{children:[e.jsx(Dt,{}),e.jsx(Vn,{name:s.viaName||"Connector",role:H||void 0,company:Be||void 0,kindLabel:"Connector",badge:"connector",badgeLabel:de?"Connector":void 0,avatarTone:"green",compactName:!1})]}):null,e.jsx(Dt,{}),e.jsx(Vn,{name:s.name,photo:s.profilePhoto,role:s.role||void 0,company:yn,kindLabel:"Target",badge:"target",badgeLabel:de?"Target":void 0,avatarTone:"green",compactName:!1})]}),e.jsxs("div",{className:"req-body",children:[!de&&ye.length>0&&e.jsxs("div",{className:"req-reasoning",children:[e.jsx("div",{className:"req-r-lbl",children:se?"Why this works":F?`Why ${s.viaName} is a strong connector`:"Why this path works"}),e.jsx("div",{className:"req-r-txt",dangerouslySetInnerHTML:{__html:ye.join(" · ")}})]}),F?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"req-sec-lbl",children:["What Gem sends",e.jsxs("span",{className:"req-sec-note",children:["Two emails. The second only exists if"," ",Ke||s.viaName||"your connector"," says yes."]})]}),e.jsx(Ao,{connectorName:te&&se?p||"You":s.viaName||"your connector",connectorEmail:Ee||null,...de&&Ee?{}:{onConnectorEmailChange:ee},askerName:te?He||"Founder":p||"Me",askerEmail:te?k||null:i||null,onAskerEmailChange:te?De:void 0,targetName:s.name,targetEmail:_||null,...de&&!be?{}:{onTargetEmailChange:xe},blurb:Y,onBlurbChange:ce,...de?{}:{connectorSubject:E,connectorCoverMessage:J,onConnectorSubjectChange:U,onConnectorCoverMessageChange:X},meta:de?`${i?" - copy sent to you":""}`:i?"Edit delivery addresses and full copy below":void 0,layout:"split",disabled:S})]}):e.jsxs("div",{className:"req-email",children:[be?e.jsx("div",{className:"req-email-missing",children:e.jsx(Ro,{personName:s.name,value:Qe,onCh
34ange:xe,message:`${s.name} isn't on Gemphere — add their email below.`})}):null,e.jsxs("div",{className:"req-email-head",children:[e.jsx("div",{children:e.jsx("strong",{children:"Email"})}),e.jsx("span",{children:be&&_?`To: ${_}`:be?"Add their email above":vn?"Sending from [email protected] on your behalf":"Sent from you"})]}),e.jsx("div",{className:"req-email-label",children:"Subject"}),e.jsx("input",{className:"req-email-subject",type:"text",value:E,onChange:M=>U(M.target.value),disabled:S}),e.jsx("div",{className:"req-email-label",children:"Message"}),e.jsx("textarea",{className:"req-email-textarea",value:J,onChange:M=>X(M.target.value),disabled:S}),vn&&e.jsxs("div",{style:{fontSize:13,color:"#2a2820",marginTop:12,lineHeight:1.55},children:[e.jsx("div",{children:"Best,"}),e.jsx("div",{style:{fontWeight:600},children:"Gem"}),p?e.jsxs("div",{style:{fontSize:12,color:"#9a8a70",marginTop:2},children:["Ecosystem analyst to ",p]}):null]})]}),F&&!vn&&!de?e.jsx(Mo,{mode:z,onChange:Me,disabled:S,compact:!0}):null,L&&e.jsx("div",{className:"req-error",children:L})]}),e.jsxs("div",{className:"modal-foot req-modal-foot--steps",children:[e.jsx("button",{className:"btn-foot primary",disabled:S||F&&!Ee||F&&be&&!_,onClick:()=>$({account:l,contact:s,subject1:E,message1:J,subject2:B,message2:Y,targetEmail:_,connectorEmail:Ee,founderEmail:k,optInMode:z}),children:S?"Sending…":F?`Send to ${Ke||s.viaName||"connector"}`:se&&!te?`Send message to ${Q}`:`Send email to ${Q}`}),P?e.jsx("button",{type:"button",className:"btn-foot req-foot-back",onClick:P,disabled:S,children:"← Back"}):null,F?e.jsxs("span",{className:"req-foot-note",children:[nr(s.name)," hears nothing until"," ",Ke||s.viaName||"your connector"," accepts."]}):null,e.jsx("button",{className:"btn-foot req-foot-cancel",onClick:j,disabled:S,children:"Cancel"})]})]})}),document.body)}function $r(){var Na,ja,xa,ba;const{user:n,refreshTier:l,hasTeam:s,teamPlan:p}=Nt(),u=Ka(),i=(n==null?void 0:n.accessToken)??null,c=(n==null?void 0:n.userId)??null,g=(n==null?void 0:n.fullName)||"",N=ts(),y=(t,a)=>N?t:a,[h,j]=d.useState(null),[P,$]=d.useState(!0),[S,L]=d.useState(null);yo(!!h);const[C,R]=d.useState({});d.useState({});const[E,U]=d.useState({}),[J,X]=d.useState({}),[B,ie]=d.useState({}),[Y,ce]=d.useState(null),[z,Me]=d.useState(""),[ke,ee]=d.useState(null),[we,De]=d.useState(null),[Qe,xe]=d.useState(!1),[b,Z]=d.useState({active:0,pending:0}),ae=d.useCallback(t=>{Z(a=>a.active===t.active&&a.pending===t.pending?a:t)},[]),[ne,re]=d.useState(0),[Te,H]=d.useState({}),[Le,Be]=d.useState(null),[Xe,se]=d.useState({}),[F,be]=d.useState({}),[_,Ee]=d.useState(null),[k,yn]=d.useState(null),[Q,te]=d.useState(null),[He,Ae]=d.useState(!1),[Ze,We]=d.useState(null),[vn,de]=d.useState({}),[Ke,ye]=d.useState(null),[M,me]=d.useState(null),[le,W]=d.useState(""),[ve,en]=d.useState(""),[Cn,zn]=d.useState(!1),{openUpgrade:Ce,needsUpgrade:Ue}=Va(),[Ne,rn]=d.useState(!1),[Qn,In]=d.useState(""),[bt,wt]=d.useState(0),[Nn,Ct]=d.useState(0),[It,Xn]=d.useState({}),{offerIntro:un,setOfferIntro:Zn,offerIntroSending:kn,openOfferIntro:Sn,sendOfferIntro:kt}=ns({onSent:()=>Ct(t=>t+1)}),[r,w]=d.useState([]),[x,Se]=d.useState([]),[Ie,G]=d.useState(!1),Pn=u.canManagePortfolioCompanies,[ls,cs]=d.useState({}),ds=t=>cs(a=>({...a,[t]:!a[t]})),[$n,ms]=d.useState({}),[us,St]=d.useState({}),[K,Tn]=d.useState(null),[zt,Qt]=d.useState(!1),[hs,hn]=d.useState(!1),[ps,Pt]=d.useState(null),[En,$t]=d.useState(null),[nn,et]=d.useState(null),[Ve,nt]=d.useState(null),[Tt,tt]=d.useState(null),[An,at]=d.useState(null),[Xt,Zt]=d.useState(!1),[fs,Rn]=d.useState(null),[,gs]=d.use
34State({}),I=d.useCallback(t=>{De(t),setTimeout(()=>De(a=>a===t?null:a),2400)},[]),Et=vo()||Ne||((Na=h==null?void 0:h.billing)==null?void 0:Na.hasPaidAccess)===!0,ue=d.useCallback(t=>{if(!Ue&&(Et||u.isTeamMember)){t();return}Ce("team")},[Ue,Et,u.isTeamMember,Ce]),st=((n==null?void 0:n.email)||"").trim().toLowerCase(),q=d.useMemo(()=>Vi(st),[st]),ea=q!=null,na=st===Yt||st.endsWith(rs),ta=(q==null?void 0:q.syncLsKey)??null,aa=(q==null?void 0:q.invitedLsKey)??null,[Mn,Ln]=d.useState(()=>{if(typeof window>"u"||!ta)return!1;try{return window.localStorage.getItem(ta)==="1"}catch{return!1}}),[Un,Fn]=d.useState(()=>{if(typeof window>"u")return{};if(!aa)return{};try{const t=window.localStorage.getItem(aa);if(!t)return{};const a=JSON.parse(t);return a&&typeof a=="object"?a:{}}catch{return{}}}),[sa,oa]=d.useState(!1);d.useEffect(()=>{if(!(typeof window>"u")){if(!q){Ln(!1),Fn({});return}try{Ln(window.localStorage.getItem(q.syncLsKey)==="1")}catch{Ln(!1)}try{const t=window.localStorage.getItem(q.invitedLsKey),a=t?JSON.parse(t):null;Fn(a&&typeof a=="object"?a:{})}catch{Fn({})}}},[q]);const[cr,ia]=d.useState(null);d.useCallback(t=>({key:`fuel-partner-${t.email.toLowerCase()}`,userId:0,name:t.fullName,role:`${t.title.split(" & ")[0]}${(q==null?void 0:q.partnerRoleSuffix)??""}`,email:t.email,photo:null,roleKind:0,kind:"contact",isGem:!1}),[q]);const ys=d.useCallback(t=>{ia({partner:t,side:"to"})},[]),vs=d.useCallback(t=>{ia({partner:t,side:"from"})},[]);d.useEffect(()=>{!ea&&Mn&&Ln(!1)},[ea,Mn]);const Ns=d.useCallback(()=>{q&&(oa(!0),window.setTimeout(()=>{Ln(!0);try{window.localStorage.setItem(q.syncLsKey,"1")}catch{}oa(!1),I(q.syncedToast)},700))},[q,I]),js=d.useCallback(async t=>{if(!q)return;if(!i){I("Please sign in again to send invites.");return}const a=q.partners.find(o=>o.email.toLowerCase()===t.toLowerCase());if(a)try{await Ft(i,[{name:a.fullName,email:a.email,role:"member"}],c?{viewerUserId:c}:void 0),Fn(o=>{if(o[t])return o;const m={...o,[t]:!0};try{window.localStorage.setItem(q.invitedLsKey,JSON.stringify(m))}catch{}return m}),I(`Invite sent to ${t}`)}catch(o){const m=o instanceof Error?o.message:"Failed to send invite";/seat[_ ]?limit|exceed your plan|not enough seats|no seats left/i.test(m)?I(`Not enough seats — upgrade your plan to invite ${t}.`):I(`Invite to ${t} failed: ${m}`)}},[q,i,I,c]),xs=d.useCallback(async()=>{if(!q||!i)return;const t=q.partners.filter(m=>m.email.toLowerCase()!==q.ownerEmail&&!Un[m.email]);if(t.length===0){I("Everyone has already been invited.");return}try{await Ft(i,t.map(m=>({name:m.fullName,email:m.email,role:"member"})),c?{viewerUserId:c}:void 0)}catch(m){const v=m instanceof Error?m.message:"Failed to send invites";I(`Bulk invite failed: ${v}`);return}const a={...Un};let o=0;for(const m of t)a[m.email]||(a[m.email]=!0,o+=1);Fn(a);try{window.localStorage.setItem(q.invitedLsKey,JSON.stringify(a))}catch{}I(o>0?`Sent ${o} invite${o===1?"":"s"}`:"All partners already invited")},[q,Un,i,I,c]),ot=((ja=h==null?void 0:h.team)==null?void 0:ja.isAdmin)===!0,ra=s||((xa=h==null?void 0:h.team)==null?void 0:xa.teamId)!=null&&Number(h.team.teamId)>0,it=ot||!u.isTeamMember&&!u.isConnector&&(u.isEnterprise||u.isIndividual&&ra),la=u.canManageConnectors,[bs,ws]=d.useState(0),ca=u.isTeamMember||h!=null&&ra&&!ot&&((ba=h.team)==null?void 0:ba.adminUserId)!=null&&h.team.adminUserId!==c,Cs=!ca&&(ot||h==null&&!u.isTeamMember&&u.isProPlan)&&((p||"").toLowerCase()==="pro"||u.isProPlan),On=(h==null?void 0:h.discoveredTeammates)??[],jn=u.isTeamMember||!u.isPaidSolo||ot||On.length>0,_e=d.useCallback(async(t,a=!1)=>{var o,m;if(!(!i||!c)){$(!0),L(null);try{const v=await Ot(i,c,{useAi:t,bypassCache:a});if(j(v),(o=v.team)!=null&&o.teamId&&l(),((m=v.billing)==null?void 0:m.hasPaidAccess)===!0?rn(!0):v.billing&&rn(!1),v.teammates.length&&Object.keys(C).length===0){const f=v.teammates.find(T=>T.subContacts.length>0)||v.teammates[0];f&&R({[f.userId]:!0})}}catch(v){L(v instanceof Error?v.message:"Failed to load team overview")}finally{$(!1)}}},[i,c,l]);d.useEffect(()=>{if(!i||!c)return;const t=()=>{_e(!1,!0)},a=()=>{document.visibilityState==="visible"&&t()};return window.addEventListener("focus",t),document.addEventListener("visibilitychange",a),()=>{window.removeEventListener("focus",t),document.removeEventListener("visibilitychange",a)}},[i,c,_e]),d.useEffect(()=>{if(!i||!c)return;let t=!1;return $(!0),L(null),No(i,c).catch(()=>{}),jo(i,c).then(a=>
34{t||rn(Wi(a))}).catch(()=>{}),Pa(i,c).then(a=>{t||j(o=>{var m,v,f,T,A,V,O,he,Ge,pe,Fe,pn;return{...o??qa(),team:{...(o==null?void 0:o.team)??qa().team,name:((m=a.team)==null?void 0:m.name)??((v=o==null?void 0:o.team)==null?void 0:v.name)??"Your team",domain:((f=a.team)==null?void 0:f.domain)??((T=o==null?void 0:o.team)==null?void 0:T.domain)??null,memberCount:((A=a.team)==null?void 0:A.memberCount)??((V=o==null?void 0:o.team)==null?void 0:V.memberCount)??0,isAdmin:((O=a.team)==null?void 0:O.isAdmin)===!0,teamId:((he=a.team)==null?void 0:he.teamId)??((Ge=o==null?void 0:o.team)==null?void 0:Ge.teamId)??null,adminUserId:((pe=a.team)==null?void 0:pe.adminUserId)??((Fe=o==null?void 0:o.team)==null?void 0:Fe.adminUserId)??null,strategy:((pn=o==null?void 0:o.team)==null?void 0:pn.strategy)??"none"},portfolioCompanies:a.portfolioCompanies??[],portfolioAsks:a.portfolioAsks??[]}})}).catch(()=>{}),Ot(i,c,{useAi:!1}).then(a=>{var o,m;if(!t&&(j(a),(o=a.team)!=null&&o.teamId&&l(),((m=a.billing)==null?void 0:m.hasPaidAccess)===!0?rn(!0):a.billing&&rn(!1),a.teammates.length&&Object.keys(C).length===0)){const v=a.teammates.find(f=>f.subContacts.length>0)||a.teammates[0];v&&R({[v.userId]:!0})}}).catch(a=>{t||L(a instanceof Error?a.message:"Failed to load team overview")}).finally(()=>{t||$(!1)}),()=>{t=!0}},[i,c,l]);const da=d.useRef(!1);d.useEffect(()=>{!i||!na||da.current||(da.current=!0,xo(i).catch(()=>{}))},[i,na]),d.useEffect(()=>{if(!i||!c)return;let t=!1;return Pa(i,c).then(a=>{var o;t||(w(a.portfolioCompanies??[]),Se(a.portfolioAsks??[]),G(((o=a.team)==null?void 0:o.isAdmin)===!0))}).catch(a=>console.warn("[Team] portcos-only fetch failed:",a)),Ot(i,c,{useAi:!1}).then(a=>{t||(Array.isArray(a.portfolioCompanies)&&a.portfolioCompanies.length&&w(o=>or(o,a.portfolioCompanies)),Array.isArray(a.portfolioAsks)&&a.portfolioAsks.length&&Se(o=>ir(o,a.portfolioAsks)),a.team&&G(a.team.isAdmin===!0))}).catch(a=>console.warn("[Team] team-overview (portfolio) fetch failed (non-fatal):",a)),()=>{t=!0}},[i,c,bt]),d.useEffect(()=>{if(!i||!c||!r.length)return;let t=!1;return bo(i,c,5).then(a=>{t||ms(a)}).catch(a=>{console.warn("[Team] batched shared-targets fetch failed:",a)}),()=>{t=!0}},[i,c,r.map(t=>t.id).join(",")]),d.useEffect(()=>{if(!i)return;const t=r.filter(o=>o.source==="connector"&&o.connectorRelationshipId).map(o=>o.connectorRelationshipId);if(!t.length)return;let a=!1;return Promise.all(t.map(o=>Ga(i,o).then(m=>[o,(m.youCanHelpThem??[]).length]).catch(()=>[o,0]))).then(o=>{a||Xn(Object.fromEntries(o))}),()=>{a=!0}},[i,r.map(t=>t.connectorRelationshipId??0).join(","),Nn]),d.useEffect(()=>{if(!i)return;let t=!1;return(async()=>{try{const a=await pi(i);if(!a.ok)return;const o=await a.json().catch(()=>null),m=o!=null&&o.data&&typeof o.data=="object"?o.data:o,v=m!=null&&m.user&&typeof m.user=="object"?m.user:m,f=m!=null&&m.founder&&typeof m.founder=="object"?m.founder:{},T=m!=null&&m.investor&&typeof m.investor=="object"?m.investor:{},A={...v,...f,...T},V=(...he)=>{for(const Ge of he){const pe=A[Ge];if(typeof pe=="string"&&pe.trim())return pe.trim()}return""},O=V("companyName","company")||V("fundName","fund");!t&&O&&In(O)}catch{}})(),()=>{t=!0}},[i]);const Is=t=>R(a=>({...a,[t]:!a[t]})),ma=d.useMemo(()=>{const t=(h==null?void 0:h.teammates)??[],a=z.trim().toLowerCase();return a?t.filter(o=>o.name.toLowerCase().includes(a)||(o.role||"").toLowerCase().includes(a)||(o.strongestIn||"").toLowerCase().includes(a)):t},[h,z]),ks=d.useMemo(()=>new Set(((h==null?void 0:h.teammates)??[]).map(t=>t.userId)),[h==null?void 0:h.teammates]),Ss=(t,a)=>{ue(()=>{We(null),yn({teammate:t,contact:a})})},Ps=()=>{He||(yn(null),We(null))},$s=(t,a)=>{ue(()=>{We(null),te({teammate:t,contact:a})})},At=d.useMemo(()=>{if(!Q)return[];const t=Q.contact,a=m=>t.contactUserId&&m.contactUserId?m.contactUserId===t.contactUserId:t.contactImportId&&m.contactImportId?m.contactImportId===t.contactImportId:(m.name||"").trim().toLowerCase()===(t.name||"").trim().toLowerCase(),o=[];for(const m of(h==null?void 0:h.teammates)??[]){const v=m.subContacts.find(a);v&&o.push({teammate:m,contact:v})}return o.some(m=>m.teammate.userId===Q.teammate.userId)||o.unshift(Q),o.sort((m,v)=>(v.contact.pct||0)-(m.contact.pct||0))},[Q,h==null?void 0:h.teammates]),Ts=d.useMemo(()=>At.map(({teammate:t,contact:a})=>{const o=qt(a);return{key:`teammate-${t.userId}`,name:t.name,title:t.role,userId:t.userId,photo:t.profilePhoto,strengthLabel:o?gn(o):""}}),[At]),Es=t=>{const a=At.find(o=>`teammate-${o.teammate.userId}`===t.key);te(null),a&&Ss(a.teammate,a.contact)},As=async t=>{if(!k||!i||!c)return;if(!Et&&!u.isTeamMember){Ce("team");return}const{teammate:a,contact:o}=k,m=`${a.userId}:${o.contactUserId??o.contactImportId??o.name}`;ee(m),Ae(!0),We(null);try{await yt(i,{fromUserID:c,toUserID:o.contactUserId&&o.source!=="imported"?o.contactUserId:0,connectorUserID:a.userId,note:t.message2.trim()||`Intro request via ${a.name}`,connectorMessage:t.message1.trim(),connectorSubject:t.subject1.trim()||void 0,blurb:t.message2.trim(),blurbSubject:t.subject2.trim()||void 0,connectorEmail:t.connectorEmail||a.email||void 0,fromName:g,toName:o.name,...o.source==="imported"||!o.contactUserId?{toEmail:t.targetEmail||void 0}:{}}),I(`Asked ${mn(a.name)||a.name} to intro you to ${o.name}`),yn(null),_e(!1)}catch(v){const f=v instanceof Error?v.message:"Failed to send intro request";We(f)}finally{ee(null),Ae(!1)}},Rs=async(t,a)=>{if(!i)return;if(Ue){Ce("portfolio");return}const o=t.id,m=t.source==="connector"&&t.connectorRelationshipId!=null;if(window.confirm(`Remove ${a||"this portfolio company"} from your workspace?
35
36This also removes any open asks for this company. Accepted founders keep their Gemphere accounts.`))try{const f=m?{companyName:a}:await Lo(i,o);m&&await Ja(i,t.connectorRelationshipId),w(T=>T.filter(A=>A.id!==o)),Se(T=>T.filter(A=>(A.companyName||"").trim().toLowerCase()!==(a||"").trim().toLowerCase())),I(`Removed ${f.companyName||a||"portfolio company"}`)}catch(f){I(f instanceof Error?f.message:"Failed to remove portfolio company")}},Ms=(t,a,o,m,v,f)=>{var cn,sn;if(Ue){Ce("accounts");return}const T=a.offer,A=a.founder,V=a.yours;if((T==null?void 0:T.status)==="accepted"){Ls(t,a,o,m,T);return}if((T==null?void 0:T.status)==="offered"){I("Waiting on the founder to respond to your offer.");return}if((T==null?void 0:T.status)==="requested"){I("Intro request already sent for this target.");return}if((T==null?void 0:T.status)==="declined"){I(T.declineReason==="already_in_touch"?"Founder is already in touch with this contact.":"Founder declined this intro offer.");return}let O=null;if(f){const D=!!(f.via&&f.via.toLowerCase()==="you");O={contactName:f.name,contactRole:f.role,contactCompanyName:f.companyName,contactUserId:f.contactUserId??null,contactProfilePhoto:f.profilePhoto??null,contactLinkedin:f.linkedinUrl??null,via:f.via,viaUserId:f.viaUserId,pct:f.pct,isDirect:D}}else{let D;if(v==="chained"&&V.pct!=null&&V.contact?D=V:v==="direct"&&A.pct!=null&&A.contact?D=A:D=A.pct!=null&&A.contact?A:V,D.pct==null||!D.contact){I("No warm path to offer from your side yet.");return}const on=D===A;O={contactName:D.contact.name||"",contactRole:D.contact.role||null,contactCompanyName:a.companyName,contactUserId:D.contact.userId??null,contactProfilePhoto:D.contact.profilePhoto??null,contactLinkedin:D.c
36ontact.linkedinUrl??null,via:on?"you":D.via,viaUserId:on?null:D.viaUserId,pct:D.pct,isDirect:on}}const he=ai({founderName:(o==null?void 0:o.trim())||"Founder",investorName:g||"Your investor",targetName:O.contactName||a.companyName,targetCompany:O.contactCompanyName||a.companyName,targetRole:O.contactRole,pct:O.pct,isDirect:O.isDirect,viaName:O.isDirect?null:O.via}),Ge=si({investorName:g||"Your investor",investorFirst:mn(g)||"Your investor",founderName:(o==null?void 0:o.trim())||"Founder",targetName:O.contactName||a.companyName,targetRole:O.contactRole,targetCompany:O.contactCompanyName||a.companyName,connectorName:O.isDirect?g||"You":O.via||"Connector"}),pe=((sn=(cn=$n[t])==null?void 0:cn.founder)==null?void 0:sn.userId)??null,Fe=r.find(D=>D.id===t),pn=Ya(Fe,o),je=m?`${(o==null?void 0:o.trim())||"Founder"} from ${m}`:(o==null?void 0:o.trim())||"Founder";Tn({kind:"portfolio",portcoInviteId:t,target:a,founderName:(o==null?void 0:o.trim())||"Founder",founderCompanyName:m,founderUserId:pe,chosen:O,note:"",emailSubject:he.subject,emailMessage:he.message,founderEmail:pn,investorEmail:(n==null?void 0:n.email)||"",connectorEmail:O.isDirect&&(n==null?void 0:n.email)||"",targetEmail:"",connectorSubject:Ge.subject,connectorMessage:Ge.message,forwardBlurb:Ge.forwardBlurb}),(async()=>{if(!i)return;const D=O.isDirect?c:O.viaUserId,[on,$e,oe,fn]=await Promise.all([Jn(i,pe),Jn(i,D),Jn(i,O.contactUserId),pe?za(i,pe):Promise.resolve("")]);Tn(Re=>{if(!Re||Re.portcoInviteId!==t||Re.target.id!==a.id)return Re;const _n=O.isDirect?(n==null?void 0:n.email)||$e||"":$e,Yn=on||pn||Re.founderEmail,Gn=(fn||"").trim(),xn=Gn&&Qa(Re.forwardBlurb,je)?Gn:Re.forwardBlurb;return{...Re,founderEmail:Yn,connectorEmail:_n||Re.connectorEmail,targetEmail:oe||Re.targetEmail,investorEmail:Re.investorEmail||(n==null?void 0:n.email)||"",forwardBlurb:xn}})})()},Ls=(t,a,o,m,v)=>{var O,he;if(Ue){Ce("accounts");return}const f=!v.viaName||v.viaName.toLowerCase()==="you",T=v.targetCompanyName||a.companyName,A={id:a.id,companyName:T,companyUrl:a.companyUrl,industry:a.industry,isF500:a.isF500,kind:"company",source:a.source||"company",aiReason:null,createdAt:new Date().toISOString(),contacts:[],contactCount:0,bestPathPct:v.pct,bestPathVia:v.viaName,pathLabel:null,pathStroke:null,intents:a.intents||[],icp:a.icp,targetRole:a.targetRole,targetUserId:null},V={name:v.contactName||"Target",role:v.contactRole||"",companyName:T,contactUserId:v.contactUserId??null,viaName:f?"you":v.viaName||null,viaUserId:f?null:v.viaUserId??null,pct:v.pct??null,source:f?"direct_gem":"gem_at_company",profilePhoto:null,linkedinUrl:null};et({portcoInviteId:t,targetAccountId:a.id,companyName:T}),nt({name:(o==null?void 0:o.trim())||"Founder",companyName:m}
36),tt(v.founderUserId??((he=(O=$n[t])==null?void 0:O.founder)==null?void 0:he.userId)??null),at(v.id),Pt(A),$t(V),Rn(null),hn(!0)},Us=async()=>{if(!(!K||!i||!c)){if(Ue){Ce("accounts");return}Qt(!0);try{const t={targetAccountId:K.target.id,contactName:K.chosen.contactName,contactUserId:K.chosen.contactUserId,contactRole:K.chosen.contactRole,contactLinkedin:K.chosen.contactLinkedin,viaName:K.chosen.via,viaUserId:K.chosen.viaUserId,pct:K.chosen.pct,targetCompanyName:K.chosen.contactCompanyName||K.target.companyName,emailSubject:K.emailSubject.trim(),emailMessage:K.emailMessage.trim(),founderEmail:K.founderEmail.trim()||null,ownerEmail:K.founderEmail.trim()||null,investorEmail:K.investorEmail.trim()||null,connectorEmail:K.connectorEmail.trim()||null,targetEmail:K.targetEmail.trim()||null,connectorSubject:K.connectorSubject.trim()||null,connectorCoverMessage:K.connectorMessage.trim()||null,forwardBlurb:K.forwardBlurb.trim()||null},a=await Ea(i,c,K.portcoInviteId,t);St(o=>({...o,[K.portcoInviteId]:(o[K.portcoInviteId]||0)+1})),a.emailSent===!1&&a.emailError?I(`Offer saved but email to ${K.founderName} failed: ${a.emailError}`):a.emailSent===!1?I(`Offer saved — the heads-up email to ${K.founderName} may not have delivered.`):I(`Offer sent to ${K.founderName} — they'll decide if it goes further.`),Tn(null)}catch(t){I(t instanceof Error?t.message:"Failed to send offer")}finally{Qt(!1)}}},Fs=(t,a,o)=>{var T,A;if(Ue){Ce("accounts");return}const m=(a.via||"").toLowerCase()==="you",v={id:-(t.id*1e4+1),kind:"company",targetUserId:null,companyName:a.roleLabel||a.companyName||t.companyName||"Role",companyUrl:null,industry:null,isF500:!1,source:"role",aiReason:null,createdAt:new Date().toISOString(),bestPathPct:a.pct,bestPathVia:m?"you":a.via,pathLabel:null,pathStroke:null,contacts:[],contactCount:0,targetRole:a.roleLabel},f={name:a.name,role:a.role||a.roleLabel||"",companyName:a.companyName||"",contactUserId:a.contactUserId??null,contactImportId:null,viaName:m?"you":a.via,viaUserId:m?null:a.viaUserId,pct:a.pct,source:m?"direct_gem":"gem_at_company",profilePhoto:a.profilePhoto,linkedinUrl:a.linkedinUrl};if(et(null),at(null),nt({name:o,companyName:t.companyName||null}),tt(((A=(T=$n[t.id])==null?void 0:T.founder)==null?void 0:A.userId)??null),Pt(v),$t(f),Rn(null),!m&&!Jt(f)&&f.contactUserId&&i&&c){(async()=>{try{const V=await Uo(i,f.contactUserId,c);gs(O=>({...O,[f.contactUserId]:V.connectors})),V.connectors.length===1?Ds(v,f,V.connectors[0]):V.connectors.length>1?I(`Expand ${f.name} on the target account to choose an intro path`):I("No connectors found for an intro yet")}catch(V){I(V instanceof Error?V.message:"Failed to load connectors")}})();return}hn(!0)},Os=async({account:t,contact:a,subject1:o,message1:m,subject2:v,message2:f,targetEmail:T,connectorEmail:A,founderEmail:V,optInMode:O})=>{if(!(!i||!c)){if(Ue){hn(!1),Ce("accounts");return}Zt(!0),Rn(null);try{const he=a.source==="direct_gem"||a.viaName==="you";if(he&&!Ve&&!nn){const oe=(T||"").trim(),fn=a.contactUserId&&a.contactUserId>0?a.contactUserId:0;await Fo(i,{...fn>0?{toUserID:fn}:{},toName:a.name,...oe?{toEmail:oe}:{},subject:o.trim(),message:m.trim()}),hn(!1),I(`Message sent to ${a.name}`);return}let pe=!he&&a.viaUserId?a.viaUserId:void 0;he&&An&&c&&(pe=c);const Fe=a.contactUserId&&a.source!=="imported"?a.contactUserId:0,je={fromUserID:Ve&&Tt?Tt:c,toUserID:Fe,note:m.trim()||"I'd love an intro!",connectorMessage:m.trim(),blurb:f.trim(),fromName:(Ve==null?void 0:Ve.name)||g,connectorSubject:o.trim(),blurbSubject:v.trim()};pe&&(je.connectorUserID=pe),An&&(je.portfolioIntroOfferId=An);const cn=(A||"").trim(),sn=(V||"").trim();if(cn&&(je.connectorEmail=cn),sn&&(je.fromEmail=sn),!Fe||Fe===0){je.toName=a.name;const oe=(T||"").trim();oe&&(je.toEmail=oe)}Object.assign(je,Oo(O)),await yt(i,je);const D=!!An,on=(Ve==null?void 0:Ve.name)||"the founder",$e=nn==null?void 0:nn.portcoInviteId;if(nn&&c&&!An)try{await Ea(i,c,nn.portcoInviteId,{targetAccountId:nn.targetAccountId,contactName:a.name,contactUserId:a.contactUserId||null,viaName:a.viaName||null,viaUserId:a.viaUserId||null,pct:a.pct}),St(oe=>({...oe,[nn.portcoInviteId]:(oe[nn.portcoInviteId]||0)+1}))}catch(oe){console.warn("[shared-target offer record] failed:",oe)}D&&$e&&St(oe=>({...oe,[$e]:(oe[$e]||0)+1})),et(null),at(null),tt(null),nt(null),hn(!1),I(D?`Intro request sent on behalf of ${on}`:pe?`Asked ${a.viaName||"connector"} to intro you to ${a.name}`:`Intro request sent to ${a.name}`)}catch(he){Rn(he instanceof Error?he.message:"Failed to send intro request")}finally{Zt(!1)}}},Ds=(t,a,o)=>{const m=String(o.fullname||"").trim()||null,v={...a,viaUserId:o.userId,viaName:m,pct:o.isMutual?Math.max(a.pct||0,80):Math.max(a.pct||0,50)};Pt(t),$t(v),Rn(null),hn(!0)},ln=(t,a)=>{H(o=>{const m={...o};return a==null?delete m[t]:m[t]=a,m})},Bs=t=>{if(!i||!c){I("Please sign in again to manage invites.");return}const a=Number(t.id);if(!Number.isFinite(a)||a<1){I("Couldn't cancel this invite — refresh the page and try again.");return}Be(a)},qs=async t=>{if(!i||!c)return;const a=Number(t.id);if(!Number.isFinite(a)||a<1){I("Couldn't cancel this invite — refresh the page and try again.");return}ln(a,"cancel");try{await Do(i,c,a),Be(o=>
36o===a?null:o),j(o=>o&&{...o,pendingInvites:o.pendingInvites.filter(m=>Number(m.id)!==a)}),I(`Cancelled invite for ${t.name||t.email}`),re(o=>o+1),_e(!1,!0)}catch(o){I(o instanceof Error?o.message:"Failed to cancel invite")}finally{ln(a,null)}},Hs=async t=>{!i||!c||ue(()=>{(async()=>{ln(t.id,"resend");try{await Bo(i,c,t.id),I(`Re-sent invite to ${t.email}`),_e(!1,!0)}catch(a){I(a instanceof Error?a.message:"Failed to resend invite")}finally{ln(t.id,null)}})()})},Ws=async t=>{!i||!c||t.userId!==c&&ue(()=>{(async()=>{if(window.confirm(`Remove ${t.name} from your team?
37
38They'll lose access to this workspace and one seat will be freed for a new invite.`)){be(o=>({...o,[t.userId]:!0}));try{await qo(i,c,t.userId),I(`Removed ${t.name} — 1 seat is now available`),re(o=>o+1),await _e(!1,!0)}catch(o){I(o instanceof Error?o.message:"Failed to remove teammate")}finally{be(o=>{const m={...o};return delete m[t.userId],m})}}})()})},_s=async(t,a)=>{!i||!c||ue(()=>{(async()=>{const o=t.teamRole||"member";if(o!==a&&!(o==="admin"&&a==="member"&&!window.confirm(`Demote ${t.name} from Admin to Member? They'll lose admin permissions immediately.`))){se(m=>({...m,[t.userId]:!0}));try{await Ho(i,c,t.userId,a),I(a==="admin"?`${t.name} is now an admin`:`${t.name} is now a member`),await _e(!1,!0)}catch(m){I(m instanceof Error?m.message:"Failed to update role")}finally{se(m=>{const v={...m};return delete v[t.userId],v})}}})()})},Ys=async(t,a)=>{!i||!c||ue(()=>{(async()=>{if((String(t.role||"member").toLowerCase()==="admin"?"admin":"member")!==a){ln(t.id,"role");try{await Wo(i,c,t.id,a),I(a==="admin"?`Invite for ${t.email} will join as Admin`:`Invite for ${t.email} will join as Member`),await _e(!1,!0)}catch(m){I(m instanceof Error?m.message:"Failed to update invite role")}finally{ln(t.id,null)}}})()})},Gs=async t=>{ue(()=>{(async()=>{var a;if(!t.inviteUrl){I("No invite link available");return}ln(t.id,"copy");try{if((a=navigator.clipboard)!=null&&a.writeText)await navigator.clipboard.writeText(t.inviteUrl);else{const o=document.createElement("textarea");o.value=t.inviteUrl,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o)}I("Invite link copied")}catch{I("Couldn't copy. Long-press the link instead.")}finally{ln(t.id,null)}})()})},Ks=t=>{ue(()=>Ee(t))},tn=(t,a)=>{Ks({userId:t,name:a.name,photo:a.photo??null})},Vs=(t,a)=>{Ee({userId:t,name:a.name,photo:a.photo??null})},Je=d.useCallback(t=>{ye({name:t.name||"",fullname:t.name||"",title:t.title||"",companyName:t.companyName||"",linkedinUrl:t.linkedinUrl||null,isNonGem:!0,source:t.linkedinUrl?"linkedin":"import"})},[]),Ye=d.useCallback((t,a)=>{en(oi(g||"You")),W((a||"").trim()),me({name:(t||"").trim()||"This contact",email:(a||"").trim()})},[g]),Js=d.useCallback(async()=>{if(!i||!M)return;const t=le.trim();if(t){zn(!0);try{await zi(i,t,{name:M.name,note:ve}),me(null),W(""),I(`Invite sent to ${t}.`)}catch(a){I(a instanceof Error?a.message:"Failed to send invite")}finally{zn(!1)}}},[i,M,le,ve,I]);d.useCallback(t=>{de(a=>({...a,[t]:!a[t]}))},[]);const zs=t=>{i&&ue(()=>{(async()=>{const a=(t.email||"").trim();if(!a){I(`No email on file for ${t.name}. Add their email manually to invite.`);return}try{await Ft(i,[{name:t.name,email:a,role:"member"}],{viewerUserId:c}),I(`Invite sent to ${t.name}`),re(o=>o+1),_e(!1,!0)}catch(o){I(o instanceof Error?o.message:"Failed to send invite")}})()})},[ua,ha]=d.useState($a);d.useEffect(()=>{if(!i||!c)return;let t=!1;return wo(i,c).then(a=>{t||ha(a)}).catch(()=>{t||ha($a)}),()=>{t=!0}},[i,c]);const pa=d.useMemo(()=>({emailSignals:{},signalTiersByEmail:{},emailByUserId:{},emailByImportId:{},strongRelationships:ua}),[ua]);d.useMemo(()=>{if(!c)return null;const t=(g||"You").trim().split(/\s+/).map(a=>a[0]).filter(Boolean).slice(0,2).join("").toUpperCase()||"YO";return{userId:c,name:g||"You",email:(n==null?void 0:n.email)??null,initials:t,cls:"green",role:"You",profilePhoto:(n==null?void 0:n.profilePhoto)??null,linkedinUrl:null,contactsCount:0,contactsInTargetsCount:0,activeIntrosCount:0,introsMade:0,introsMadeRecent:0,strongestIn:"",topConnector:!1,bestPathPct:null,bestPathVia:null,subLabel:"",subContacts:[]}},[c,g,n==null?void 0:n.email,n==null?void 0:n.profilePhoto]),d.useCallback(t=>{if(!i||!c)return;const a=t.mergeKey;J[a]||B[a]||(ie(o=>({...o,[a]:!0})),Promise.all(t.accounts.map(o=>Co(i,c,o.id))).then(o=>{const m=di(o).sort((v,f)=>Ko(v,f,pa));d.startTransition(()=>
38{U(v=>({...v,[a]:m})),X(v=>({...v,[a]:!0}))})}).catch(o=>{console.warn("[Team] target account hydrate failed:",o),X(m=>{const v={...m};return delete v[a],v})}).finally(()=>{ie(o=>{const m={...o};return delete m[a],m})}))},[i,c,J,B,pa]);const Qs=d.useCallback(t=>({key:`team-target-${t.contactImportId??t.contactUserId??t.name}`,userId:t.contactUserId&&t.contactUserId>0?t.contactUserId:0,name:t.name,role:t.role||"",email:null,photo:t.profilePhoto,roleKind:0,kind:t.contactUserId&&t.contactUserId>0?"user":"contact",isGem:!!(t.contactUserId&&t.contactUserId>0)}),[]);if(!n)return e.jsx("div",{className:"page active page-team",children:e.jsx("div",{className:"top-header",children:e.jsxs("div",{className:"header-left",children:[e.jsx("div",{className:"page-h",children:"Team"}),e.jsx("div",{className:"page-sub",children:"Sign in to see your team's combined graph."})]})})});const Dn=!!(q&&Mn),Pe=q,Xs=Pe?Pe.partners.filter(t=>t.email.toLowerCase()!==Pe.ownerEmail):[],rt=Pe?Xs.filter(t=>!Un[t.email]).length:0,fa=0,Zs=Dn&&Pe?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"team-status-card",children:[e.jsxs("div",{className:"tsc-left",children:[e.jsxs("div",{className:"tsc-pulse-row",children:[e.jsx("div",{className:"tsc-pulse"}),e.jsx("div",{className:"tsc-pulse-lbl",children:Pe.preMappedSourceLabel})]}),e.jsxs("div",{className:"tsc-headline",children:[Pe.partners.length," partners found · ",fa," on Gemphere yet"]}),e.jsx("div",{className:"tsc-sub",children:"Invite even one teammate to start combining graphs. Their gmail joins yours and warm paths multiply."})]}),e.jsxs("div",{className:"tsc-stats",children:[e.jsxs("div",{className:"tsc-stat",children:[e.jsx("div",{className:"tsc-stat-num",children:Pe.partners.length}),e.jsx("div",{className:"tsc-stat-lbl",children:"Partners"})]}),e.jsxs("div",{className:"tsc-stat",children:[e.jsx("div",{className:"tsc-stat-num accent",children:fa}),e.jsx("div",{className:"tsc-stat-lbl",children:"Joined"})]})]})]}),e.jsxs("div",{className:"sec-head",style:{marginTop:24},children:[e.jsxs("div",{className:"sec-h",children:[Pe.partnersSectionHeading,e.jsxs("span",{style:{fontSize:12,color:"#888",fontWeight:500,marginLeft:6},children:[Pe.partners.length," partners"]})]}),e.jsx("button",{className:"thesis-edit-btn",onClick:()=>I("List is locked to the firm roster pulled from your website."),children:"✏ Edit list"})]}),e.jsx("div",{className:"partner-grid",children:Pe.partners.map((t,a)=>{const o=t.email.toLowerCase()===Pe.ownerEmail,m=Ha[a%Ha.length],v=Ji(t.fullName),f=!!Un[t.email];return e.jsxs("div",{className:`partner-card ${o?"you":"ghost"}`,children:[e.jsxs("div",{className:"partner-card-head",children:[e.jsx("div",{className:`av md ${m} no-border`,children:v}),e.jsxs("div",{className:"partner-info",children:[e.jsxs("div",{className:"partner-name",children:[t.fullName,o?e.jsx("span",{className:"partner-you-pill",children:"YOU"}):e.jsx("span",{className:"partner-dot",title:"Not on Gemphere yet"})]}),e.jsxs("div",{className:"partner-role",children:[t.title.split(" & ")[0],Pe.partnerRoleSuffix]}),!o&&e.jsx("div",{className:"partner-email",children:t.email}),o&&e.jsx("div",{className:"partner-email",style:{color:"#0F6E56"},children:"On Gemphere · your network is mapped"})]})]}),e.jsxs("div",{className:"partner-actions-row",children:[e.jsx("button",{className:"nc-action-btn",disabled:o,onClick:()=>{if(o){I("That's you — you make intros for your teammates.");return}ue(()=>ys(t))},children:"Make an intro"}),e.jsx("button",{className:"nc-action-btn primary",disabled:o,onClick:()=>{if(o){I("You can't request intros from yourself.");return}ue(()=>vs(t))},children:"Request intro"})]}),!o&&e.jsx("div",{className:"partner-invite-row",children:f?e.jsx("span",{className:"partner-invite-sent",children:"✓ Invite sent"}):e.jsx("button",{className:"partner-invite-link",onClick:()=>{ue(()=>{js(t.email)})},children:"Invite →"})}),o&&e.jsx("div",{className:"partner-invite-row",children:e.jsx("span",{className:"partner-on-gemphere",children:"✓ On Gemphere"})})]},t.email)})}),rt>0&&e.jsxs("div",{className:"bulk-invite-card",children:[e.jsxs("div",{className:"bic-left",children:[e.jsxs("div",{className:"bic-h",children:["Send all ",rt," invite",rt===1?"":"s"," at once"]}),e.jsx("div",{className:"bic-sub",children:"Bulk email with your personal note. Each partner gets a one-click join link."})]}),e.jsxs("button",{className:"bic-btn",onClick:()=>{ue(()=>{xs()})},children:["+ Invite all ",rt," →"]})]})]}):null,qe=h==null?void 0:h.team,an=h==null?void 0:h.metrics,Rt=(h==null?void 0:h.internalRequests)??[],Mt=(h==null?void 0:h.gapCount)??0,ga=Qn||(qe==null?void 0:qe.name)||"Your team",ya=(qe==null?void 0:qe.memberCount)??0,lt=(h==null?void 0:h.pendingInvites)??[],ct=(h==null?void 0:h.teamTargetAccounts)??[];d.useMemo(()=>mi(ct),[ct]),h==null||h.teammates;const Lt=(qe==null?void 0:qe.isAdmin)===!0;qe!=null&&qe.teamId&&ya>1,d.useMemo(()=>new Set(ct.map(a=>Number(a.ownerUserId)).filter(a=>Number.isInteger(a)&&a>0)).size>1,[ct]);const eo=((h==null?void 0:h.teammates)??[]).reduce((t,a)=>t+(a.contactsCount||0),0),Ut=(an==null?void 0:an.combinedNetwork)??eo,Bn=(h==null?void 0:h.teammates.length)??ya,qn=b.active,va=Bn+qn,no=P?y("Counting…","Counting your colleagues and connectors…"):va===0?y("Nobody yet","Nobody yet — inv
38ite a colleague or add a connector"):y(`${Bn} colleague${Bn===1?"":"s"} · ${qn} connector${qn===1?"":"s"}`,`${Bn} colleague${Bn===1?"":"s"} and ${qn} connector${qn===1?"":"s"}`),Hn=(an==null?void 0:an.accountsReached)??0,Wn=(an==null?void 0:an.accountsTotal)??0,to=Wn===0?y("No targets yet","Add target accounts to see who can reach them"):Hn===0?y("No way in yet","Nobody has a way into them yet"):Hn>=Wn?y("All covered","Every account has a warm path"):y(`${Wn-Hn} need a path`,`${Wn-Hn} still need a warm path`),ao=Ut===0?y("Import to combine","Networks combine as your team imports contacts"):y("Contacts pooled","Contacts your team has pooled together");return e.jsxs("div",{className:`page active page-team${Dn?" fuel-team-page":""}`,children:[e.jsxs("div",{className:"top-header",children:[e.jsxs("div",{className:"header-left",children:[e.jsx("div",{className:"page-h",children:Dn&&Pe?Pe.pageHeading:"Your team"}),(Dn||P)&&e.jsx("div",{className:"page-sub",children:Dn?y("Partners pulled from your firm's site — invite them to combine networks.","We pulled your partners from your firm's website. Invite them to combine networks, and manage your team below."):y("Loading…","Loading your team…")})]}),e.jsxs("div",{className:"header-right",style:{display:"flex",gap:8,alignItems:"center"},children:[q&&!Mn&&e.jsx("button",{className:"make-intro-btn",onClick:()=>ue(Ns),disabled:sa,title:q.syncButtonTitle,children:sa?"Syncing…":"↻ Sync"}),q&&Mn&&e.jsx("span",{className:"acc-action-sm",title:"Your roster is already synced.",style:{background:"#E7F3EF",color:"#0F6E56",border:"1px solid #BFE0D5",fontWeight:600,padding:"8px 14px",borderRadius:8,cursor:"default"},children:"✓ Synced"}),it&&e.jsx("button",{type:"button",className:"gp-btn-solid tm-invite-btn",onClick:()=>xe(!0),children:y("+ Invite","+ Invite teammate")}),la&&e.jsx("button",{type:"button",className:"gp-btn-solid tm-invite-btn",onClick:()=>ws(t=>t+1),children:y("+ Connector","+ Add connector")})]})]}),S&&e.jsxs("div",{style:{background:"#FCEAE8",border:"1px solid #f3c4bd",color:"#8a1d12",padding:"10px 14px",borderRadius:10,margin:"6px 0 14px",fontSize:13},children:[S,e.jsx("button",{style:{marginLeft:12,border:"none",background:"transparent",color:"#8a1d12",fontWeight:600,cursor:"pointer"},onClick:()=>void _e(!1,!0),children:"Retry"})]}),Zs,e.jsxs("div",{className:"team-metrics ta-metrics team-metrics--v3",children:[e.jsxs("div",{className:"ta-metric",children:[e.jsx("div",{className:"ta-metric-lbl",children:y("Helping you","People helping you")}),e.jsx("div",{className:"ta-metric-num ta-metric-num--green",children:va}),e.jsx("div",{className:"tm-metric-sub",children:no})]}),e.jsxs("div",{className:"ta-metric",children:[e.jsx("div",{className:"ta-metric-lbl",children:y("Can reach","Companies they can reach")}),e.jsxs("div",{className:"ta-metric-num",children:[Hn,e.jsxs("span",{className:"tm-metric-ratio",children:["of ",Wn]})]}),e.jsx("div",{className:"tm-metric-sub",children:to})]}),e.jsxs("div",{className:"ta-metric",children:[e.jsx("div",{className:"ta-metric-lbl",children:y("Network","Combined network")}),e.jsx("div",{className:`ta-metric-num${Ut===0?" ta-metric-num--dim":""}`,children:Ut.toLocaleString()}),e.jsx("div",{className:"tm-metric-sub",children:ao})]})]}),Rt.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sec-head",children:[e.jsx("div",{className:"sec-h",children:"🔔 Teammates need intros from you"}),e.jsxs("div",{className:"sec-link",children:[Rt.length," pending"]})]}),Rt.map(t=>e.jsxs("div",{className:"ireq-card",children:[e.jsxs("div",{className:"ireq-head",children:[e.jsx(Ht,{userId:t.teammate.userId,name:t.teammate.name,photo:t.teammate.profilePhoto,className:"profile-popup-trigger tm-row-av-btn",avatarClassName:`av md ${t.teammate.cls}`,initials:t.teammate.initials,onOpen:tn,onOpenWebProfile:Je,onOpenInvite:Ye}),e.jsxs("div",{className:"ireq-body",children:[e.jsxs("div",{className:"ireq-from",children:[e.jsx(dn,{userId:t.teammate.userId,name:t.teammate.name,photo:t.teammate.profilePhoto,onOpen:tn,onOpenWebProfile:Je,onOpenInvite:Ye})," · ",t.teammate.role]}),e.jsxs("div",{className:"ireq-from",style:{marginTop:3},children:["Wants to reach"," ",e.jsx(dn,{userId:t.target.userId,name:t.target.name,onOpen:tn,onOpenWebProfile:Je,onOpenInvite:Ye})]})]}),e.jsx("span",{className:"ireq-tag",children:"Internal ask"})]}),t.message&&e.jsx("div",{className:"ireq-msg",children:t.message.length>260?t.message.slice(0,260)+"…":t.message}),e.jsxs("div",{className:"ireq-actions",children:[e.jsx("button",{className:"ireq-btn",onClick:()=>ue(()=>I("Declining an intro here is a no-op until the review flow ships.")),children:"Decline"}),e.jsx("button",{className:"ireq-btn primary",onClick:()=>ue(()=>I(`Open the connector review link in the email we sent you to approve the intro to ${t.target.name}.`)),children:"See draft & approve →"})]})]},t.introId))]}),(r.length>0||x.length>0||Pn&&Ie)&&e.jsx(e.Fragment,{children:(()=>{const t=new Map;for(const o of r){const m=(o.companyName||"").trim().toLowerCase();m&&t.set(m,{key:`pc-${o.id||m}`,companyName:o.companyName,portco:o,addedAt:o.acceptedAt||o.updatedAt||null})}for(const o of x){const m=(o.companyName||"").trim().toLowerCase();if(!m)continue;const v=t.get(m);v?(v.ask||(v.ask=o),v.addedAt||(v.addedAt=o.createdAt)):t.set(m,{key:`ask-${o.id}`,companyName:o.companyName,ask:o,addedAt:o.createdAt})}const a=Array.from(t.values()).sort((o,m)=>{const v=o.addedAt?new Date(o.addedAt).getTime():0;return(m.addedAt?new Date(m.addedAt).getTime():0)-v});return e.jsxs("div",{className:"acc-list-card acc-list-card--portfolio tm-roster-card",children:[e.jsxs("div",{className:"acc-panel-head",children:[e.jsxs("div",{className:"acc-panel-head-left",children:[e.jsx("div",{className:"acc-panel-kicker",children:"Portfolio"}),e.jsx("h2",{className:"acc-panel-title",children:"Portfolio companies"}),e.jsx("p",{className:"acc-panel-desc",children:y("Founders in your graph and their targets.","Founders in your firm's warm-intro graph and the targets they're working.")})]}),e.jsx("div",{className:"acc-panel-head-stats",children:e.jsxs("div",{className:"acc-panel-stat",children:[e.jsx("div",{className:"acc-panel-stat-num",children:a.length}),e.jsx("div",{className:"acc-panel-stat-lbl",children:"Companies"})]})})]}),e.jsx("div",{className:"acc-list acc-list--portfolio acc-list-card-body",children:a.length===0?e.jsx("div",{className:"acc-list-empty",children:"Add a portfolio company to invite its founder into your firm's warm-intro graph."}):a.map((o,m)=>{var wa,Ca;const{ask:v,portco:f}=o,T=v?v.askType||"other":null,A=(v==null?void 0:v.founderContact)||((wa=f==null?void 0:f.founderNames)==null?void 0:wa[0])||
38((Ca=f==null?void 0:f.founderEmails)==null?void 0:Ca[0])||(v==null?void 0:v.createdByName)||"",V=rr(o.addedAt),O=!!(f&&(f.acceptedFounderCount>0||f.status==="accepted")),he=f?O?"Active":"Invited":null,Ge=(()=>{const Oe=(f==null?void 0:f.onboardingAsks)||[],dt=new Set,Kn=[];for(const fe of Oe){const mt=`${fe.createdByUserId||0}-${fe.goalType}`;dt.has(mt)||(dt.add(mt),Kn.push(fe))}return Kn})(),pe=(f==null?void 0:f.companyOneLiner)||null,Fe=f!=null&&f.id?!!ls[f.id]:!1,je=Ge[0]||null||(v?{goalType:v.askType,summary:v.details}:null),cn=(()=>{if(!je)return null;const Oe=(je.goalType||"").toLowerCase();return Oe.includes("fund")||Oe.includes("raise")?{label:"Fundraising"}:Oe.includes("hire")?{label:"Hiring"}:Oe.includes("sell")||Oe.includes("customer")?{label:"Customer intro"}:Oe.includes("partner")?{label:"Partners"}:{label:"Other"}})(),sn=je&&(je.summary||"")||pe,D=f?_a(f,$n[f.id]||null,A):A,on=Ya(f,D),$e=f!=null&&f.id&&$n[f.id]||null,oe=($e==null?void 0:$e.totalTargets)??null,fn=oe!=null&&oe>0,Re=sr(f,$e,D),_n=[he,on,V?`Added ${V}`:null].filter(Boolean),Yn=!!(f!=null&&f.id),Gn=(f==null?void 0:f.source)==="connector"&&!!f.connectorRelationshipId,xn=Gn?It[f.connectorRelationshipId]??0:0;return e.jsxs("div",{className:`acc-row-v2-wrap portco-row-wrap${Fe?" open":""}`,children:[e.jsxs("div",{className:"acc-row-v2",onClick:()=>{f!=null&&f.id&&ds(f.id)},style:{cursor:Yn?"pointer":"default"},children:[e.jsx("div",{className:"acc-row-rank","aria-hidden":"true",children:String(m+1).padStart(2,"0")}),e.jsxs("div",{className:"acc-row-info",children:[e.jsx("div",{className:"acc-name-v2",children:o.companyName}),D||_n.length>0?e.jsxs("div",{className:"acc-row-meta",children:[D?e.jsx(dn,{userId:Re,name:D,className:"acc-row-meta-person"}):null,D&&_n.length>0?" · ":null,_n.join(" · ")]}):null,sn&&sn!==o.companyName?e.jsx("div",{className:"acc-row-meta acc-row-meta--summary",children:sn}):null,Yn?e.jsx("span",{className:"acc-row-caret-mobile","aria-hidden":"true",children:Fe?"−":"+"}):null]}),e.jsxs("div",{className:"acc-row-strength",children:[e.jsx("div",{className:"acc-row-strength-slot acc-row-strength-slot--label",children:cn?e.jsx("span",{className:"acc-row-persona",children:cn.label}):D?e.jsx(dn,{userId:Re,name:D,className:"acc-row-persona"}):null}),e.jsx("div",{className:"acc-row-strength-slot acc-row-strength-slot--chip","aria-hidden":!0}),Gn?e.jsx("div",{className:"acc-path-bar-row",children:e.jsx("span",{className:`acc-path-bar-score${xn?"":" muted"}`,children:xn?`${xn} target${xn===1?"":"s"}`:"No targets yet"})}):e.jsxs("div",{className:"acc-path-bar-row",children:[e.jsx(er,{pct:fn?100:0}),e.jsx("span",{className:`acc-path-bar-score${fn?"":" muted"}`,children:oe!=null?`${oe} shared target${oe===1?"":"s"}`:"No targets yet"})]})]}),e.jsx("div",{className:"acc-row-stack acc-row-stack--empty","aria-hidden":!0}),e.jsx("div",{className:"acc-row-actions",onClick:Oe=>Oe.stopPropagation(),children:Ie&&(f!=null&&f.id)?e.jsx("button",{type:"button",className:"acc-remove-btn",onClick:()=>{Rs(f,o.companyName)},title:"Remove this portfolio company from your workspace","aria-label":`Remove ${o.companyName}`,children:"✕"}):null}),Yn?e.jsx("div",{className:"acc-row-caret","aria-hidden":"true",children:Fe?"−":"+"}):e.jsx("div",{className:"acc-row-caret acc-row-caret--empty","aria-hidden":"true"})]}),Fe&&(f!=null&&f.id)?e.jsx("div",{className:"portco-expand acc-expanded",children:(()=>{var Kn;const Oe=D,dt=(()=>{const fe=((je==null?void 0:je.goalType)||T||"").toLowerCase();return fe.includes("hire")?"Candidates":fe.includes("sell")||fe.includes("customer")?"Buyers in your network":"Matches in your network"})();return(f==null?void 0:f.source)==="connector"&&f.connectorRelationshipId?e.jsx(as,{relationshipId:f.connectorRelationshipId,connectorName:D||A||"Founder",reloadKey:Nn,showTheyCanHelpYou:!1,onOpenGemProfile:tn,onOpenWebProfile:Je,onOpenInvite:Ye,onOfferIntro:fe=>Sn(fe,ar(f))}):e.jsxs(e.Fragment,{children:[e.jsx(Hi,{data:$e,label:dt,onReachOut:fe=>Fs(f,fe,Oe),onOpenWebProfile:Je,onOpenInvite:Ye}),e.jsx(Di,{portcoInviteId:f.id,fallbackFounderName:((Kn=f.founderNames)==null?void 0:Kn[0])||"",reloadKey:us[f.id]||0,initialData:$e,showSectionDivider:is($e).length>0,onOpenWebProfile:Je,onOpenInvite:Ye,onOfferIntro:(fe,mt,so,oo)=>Ms(f.id,fe,oo||_a(f,$e,A),f.companyName||null,mt,so),onInviteWebPerson:fe=>{ye({name:fe.name,fullname:fe.name,title:fe.role||"",companyName:fe.companyName||"",linkedinUrl:fe.linkedinUrl,isNonGem:!0,source:"google_search"})}})]})})()}):null]},o.key)})})]})})()}),e.jsxs("div",{className:"tm-pane",children:[!jn&&e.jsxs("div",{className:"acc-list-card tm-roster-card team-accounts-surface",children:[e.jsx("div",{className:"acc-panel-head",children:e.jsxs("div",{className:"acc-panel-head-left",children:[e.jsx("div",{className:"acc-panel-kicker",children:"Roster"}),e.jsx("h2",{className:"acc-panel-title",children:"Your colleagues"}),e.jsx("p",{className:"acc-panel-desc",children:y(`People at ${ga}.`,`People at ${ga} whose networks join yours.`)})]})}),e.jsx("div",{className:"acc-list-card-body",children:e.jsxs("div",{className:"tm-roster-empty",children:[y("Just you so far — inv
38ite a colleague.","It's just you so far. Colleagues show up here automatically when someone with your work email joins — or you can invite them yourself."),it?e.jsx("div",{style:{marginTop:14},children:e.jsx("button",{type:"button",className:"gp-btn-solid tm-invite-btn",onClick:()=>ue(()=>xe(!0)),children:y("+ Invite","+ Invite a colleague")})}):null]})})]}),jn&&On.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sec-head",style:{marginTop:8},children:[e.jsx("div",{className:"sec-h",children:"Discovered from your firm"}),e.jsxs("div",{className:"sec-link",children:[On.length," from enrichment"]})]}),e.jsx("div",{style:{background:"#faf8f4",border:"1px solid #ede8e0",borderRadius:14,padding:"14px 16px",marginBottom:18,fontSize:13,color:"#5a5040"},children:y("Found from your work email and firm site — invite them to combine networks.","These teammates were found from your work email and firm website. Invite them to combine networks on Gemphere.")}),e.jsx("div",{className:"acc-list tm-teammate-list",style:{marginBottom:22},children:On.map((t,a)=>{const o=t.inviteStatus==="pending",m=[t.title,t.company].filter(Boolean).join(" · ")||"Team member";return e.jsx("div",{className:"acc-row-v2-wrap tm-row-wrap",children:e.jsxs("div",{className:"acc-row-v2",children:[e.jsx("div",{className:"acc-check-v2"}),e.jsxs("div",{className:"acc-main",children:[e.jsx("div",{className:`av lg ${t.cls} no-border`,children:t.initials}),e.jsxs("div",{className:"acc-main-info",children:[e.jsxs("div",{className:"acc-name-row",children:[e.jsx(dn,{userId:t.gemphereUserId,name:t.name,className:"acc-name-v2",onOpen:tn}),t.onGemphere&&e.jsx("span",{className:"acc-pill",children:"ON GEMPHERE"})]}),e.jsx("div",{className:"acc-industry",children:m}),t.reasonText&&e.jsxs("div",{className:"tm-spec-line",children:[e.jsx("span",{className:"tm-spec-lbl",children:"Found via:"})," ",t.reasonText]})]})]}),e.jsx("div",{className:"acc-row-actions tm-col-action",children:e.jsx("div",{className:"tm-action-cluster",children:o?e.jsx("span",{className:"partner-invite-sent",children:"✓ Invite sent"}):e.jsx("button",{className:"acc-action primary",type:"button",onClick:()=>zs(t),children:"Invite →"})})}),e.jsx("div",{className:"acc-expand-col hidden","aria-hidden":"true",children:"▼"})]})},`discovered-${t.edgeId??t.contactId??a}`)})})]}),jn&&e.jsxs("div",{className:"acc-list-card tm-roster-card team-accounts-surface",children:[e.jsxs("div",{className:"acc-panel-head",children:[e.jsxs("div",{className:"acc-panel-head-left",children:[e.jsx("div",{className:"acc-panel-kicker",children:"Roster"}),e.jsx("h2",{className:"acc-panel-title",children:"All teammates"}),e.jsx("p",{className:"acc-panel-desc",children:y("Who they can introduce you to.","Who's on the graph, and who each of them can introduce you to.")})]}),e.jsx("div",{className:"acc-panel-head-stats",children:e.jsxs("div",{className:"acc-panel-stat",children:[e.jsx("div",{className:"acc-panel-stat-num",children:(h==null?void 0:h.teammates.length)??0}),e.jsx("div",{className:"acc-panel-stat-lbl",children:"On Gemphere"})]})})]}),e.jsxs("div",{className:"acc-list-card-body",children:[P&&!h&&e.jsx(jt,{variant:"page",message:"Loading teammates from your Gemphere network…"}),!P&&ma.length===0&&e.jsx("div",{className:"tm-roster-empty",children:h&&h.teammates.length===0&&On.length===0?y("Teammates appear once colleagues on your work-email domain join.","Teammates from your firm will appear here after work-email enrichment, or when colleagues on the same email domain join Gemphere."):h&&h.teammates.length===0?y("None accepted yet — invite from the list above.","No accepted teammates yet — invite someone from the discovered list above."):"No teammates yet."}),e.jsx("div",{className:"tm-teammate-list",children:ma.map((t,a)=>{const o=!!C[t.userId];return e.jsxs("div",{className:`tm-row-wrap ${o?"open":""}`,children:[e.jsxs("div",{className:"tm-row-v2",onClick:()=>Is(t.userId),children:[e.jsx("div",{className:"tm-row-rank",children:String(a+1).padStart(2,"0")}),e.jsx(Ht,{userId:t.userId,name:t.name,photo:t.profilePhoto,className:"profile-popup-trigger tm-row-av-btn",avatarClassName:`tm-row-av ${t.cls}`,initials:t.initials,onOpen:tn,onOpenWebProfile:Je,onOpenInvite:Ye,children:e.jsx("div",{className:`tm-row-av ${t.cls}`,style:t.profilePhoto?{padding:0,overflow:"hidden"}:void 0,children:t.profilePhoto?e.jsx("img",{src:t.profilePhoto,alt:"",style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%"},onError:m=>{m.currentTarget.style.display="none"}}):t.initials})}),e.jsxs("div",{className:"tm-row-main",children:[e.jsx(dn,{userId:t.userId,name:t.name,photo:t.profilePhoto,className:"tm-row-name",block:!0,onOpen:tn,onOpenWebProfile:Je,onOpenInvite:Ye}),e.jsx("div",{className:"tm-row-role",children:t.role}),e.jsxs("div",{className:"tm-row-pills",children:[e.jsxs("span",{className:"tm-row-pill",children:[t.contactsInTargetsCount," contact",t.contactsInTargetsCount===1?"":"s"," in your targets"]}),t.activeIntrosCount>0&&e.jsxs("span",{className:"tm-row-pill tm-row-pill--green",children:[t.activeIntrosCount," active intro",t.activeIntrosCount===1?"":"s"]})]})]}),e.jsxs("div",{className:"tm-row-strength",onClick:m=>m.stopPropagation(),children:[e.jsx("div",{className:"tm-row-strength-lbl",children:"Strongest in"}),e.jsx("div",{className:"tm-row-strength-val",children:t.strongestIn}
38),e.jsxs("div",{className:"tm-row-strength-meta",children:[t.contactsCount.toLocaleString()," contacts"]})]}),e.jsx(Kt,{open:o,className:"tm-row-expand"})]}),o?t.subContacts.length>0?e.jsxs("div",{className:"acc-expanded",children:[Lt&&t.userId!==c&&e.jsx("div",{className:"tm-row-admin-bar",children:e.jsx(Zi,{name:t.name,role:t.teamRole==="admin"?"admin":"member",roleBusy:!!Xe[t.userId],removeBusy:!!F[t.userId],onRoleChange:m=>void _s(t,m),onRemove:()=>void Ws(t)})}),e.jsx("div",{className:"acc-expanded-header",children:t.subLabel}),t.subContacts.map((m,v)=>{const f=`${t.userId}:${m.contactUserId??m.contactImportId??m.name}`,T=`roster-${f}-${v}`;return e.jsx(Li,{drawerKey:T,contact:m,viaTeammateName:t.name,companyName:m.companyName,busy:ke===f,onActivate:()=>$s(t,m),onOpenGemProfile:tn,onOpenWebProfile:Je,onOpenInvite:Ye},T)})]}):e.jsx("div",{className:"acc-expanded",children:e.jsx("div",{className:"acc-expanded-empty",children:"No overlap with your current targets yet. Add accounts to discover matches."})}):null]},t.userId)})})]})]}),jn&&it&&e.jsxs("div",{className:"tm-coverage-gap",children:[e.jsxs("div",{className:"tm-coverage-gap-copy",children:[e.jsx("div",{className:"tm-coverage-kicker",children:"Coverage gap"}),e.jsx("div",{className:"tm-coverage-title",children:Mt>0?`${Mt} target account${Mt===1?"":"s"} have no warm path yet`:"Every target account has a warm path"}),e.jsx("div",{className:"tm-coverage-desc",children:"Each teammate who imports LinkedIn unlocks ~20 new accounts on average."})]}),e.jsx("button",{type:"button",className:"gp-btn-solid tm-invite-btn tm-coverage-btn",onClick:()=>ue(()=>xe(!0)),children:"+ Invite teammate"})]})]}),la&&e.jsx("div",{className:"tm-pane tm-connectors-section",children:e.jsx(Ei,{openAddSignal:bs,onCountsChange:ae,onConnectorAdded:()=>wt(t=>t+1),hidePricingBanners:ca,proWorkspaceOwner:Cs,excludedUserIds:ks,onOpenGemProfile:tn,onOpenConnectorProfile:Vs,onOpenWebProfile:Je,onOpenInvite:Ye})}),e.jsxs("div",{className:"tm-pane tm-invites-section",children:[jn&&Lt&&lt.length>0&&e.jsx("div",{className:"team-info-section team-pending-section",children:e.jsxs("div",{className:"acc-list-card team-pending-card",children:[e.jsxs("div",{className:"acc-panel-head",children:[e.jsxs("div",{className:"acc-panel-head-left",children:[e.jsx("div",{className:"acc-panel-kicker",children:"Invitations"}),e.jsx("h2",{className:"acc-panel-title",children:"Pending invites"}),e.jsx("p",{className:"acc-panel-desc",children:y("Not joined yet — resend or cancel anytime.","Teammates who haven't joined yet — change their role, resend, or cancel anytime.")})]}),e.jsx("div",{className:"acc-panel-head-stats",children:e.jsxs("div",{className:"acc-panel-stat",children:[e.jsx("div",{className:"acc-panel-stat-num",children:lt.length}),e.jsx("div",{className:"acc-panel-stat-lbl",children:"Waiting"})]})})]}),e.jsx("div",{className:"team-pending-list",children:lt.map((t,a)=>{const o=Number(t.id),m=Te[o],v=Le===o,f=(t.name||t.email||"?").split(/[\s@.]+/).filter(Boolean).slice(0,2).map(A=>{var V;return((V=A[0])==null?void 0:V.toUpperCase())||""}).join("")||"?",T=t.sentAt||t.createdAt;return e.jsxs("div",{className:"team-pending-row",children:[e.jsx("div",{className:"team-pending-rank","aria-hidden":"true",children:String(a+1).padStart(2,"0")}),e.jsxs("div",{className:"team-pending-identity",children:[e.jsx("div",{className:"team-pending-avatar",children:f}),e.jsxs("div",{className:"team-pending-person",children:[e.jsxs("div",{className:"team-pending-name-row",children:[e.jsx("div",{className:"team-pending-name",children:t.name||t.email}),e.jsx("span",{className:"team-pending-status",children:"Pending"})]}),e.jsxs("div",{className:"team-pending-meta",children:[t.email,T?` · Sent ${Qi(T)}`:""]})]})]}),e.jsx(Xi,{className:"team-pending-role",value:String(t.role||"member").toLowerCase()==="admin"?"admin":"member",busy:m==="role",onChange:A=>void Ys(t,A),ariaLabel:`Set role for ${t.email}`}),e.jsx("div",{className:"team-pending-actions",children:v?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"team-pending-action team-pending-action--danger",disabled:m==="cancel",onClick:A=>{A.stopPropagation(),qs(t)},children:m==="cancel"?"Cancelling…":"Yes, cancel"}),e.jsx("button",{type:"button",className:"team-pending-action",disabled:m==="cancel",onClick:A=>{A.stopPropagation(),Be(null)},children:"Keep invite"})]}):e.jsxs(e.Fragment,{children:[t.inviteUrl?e.jsx("button",{type:"button",className:"team-pending-action",disabled:!!m,onClick:A=>{A.stopPropagation(),Gs(t)},title:"Copy a one-time signup link this teammate can use",children:m==="copy"?"Copied":"Copy link"}):null,e.jsx("button",{type:"button",className:"team-pending-action",disabled:!!m,onClick:A=>{A.stopPropagation(),Hs(t)},children:m==="resend"?"Resending…":"Resend"}),e.jsx("button",{type:"button",className:"team-pending-action team-pending-action--danger",disabled:!!m,onClick:A=>{A.stopPropagation(),Bs(t)},children:"Cancel"})]})})]},t.id)})})]})}),(!jn||!Lt||lt.length===0)&&e.jsxs("div",{className:"acc-list-card tm-roster-card team-accounts-surface",children:[e.jsx("div",{className:"acc-panel-head",children:e.jsxs("div",{className:"acc-panel-head-left",children:[e.jsx("div",{className:"acc-panel-kicker",children:"Invitations"}),e.jsx("h2",{className:"acc-panel-title",children:"Waiting to accept"}),e.jsx("p",{className:"acc-panel-desc",children:y("Nothing is shared until they say yes.","People you've invited show up here. Nothing of yours is shared until they say yes.")})]})}),e.jsx("div",{className:"acc-list-card-body",children:e.jsxs("div",{className:"tm-roster-empty",children:[b.pending>0?y("Pending requests are in Connectors above.","Your pending connector requests are in the Connectors section above."):y("No invites waiting.","No invites are waiting right now."),it?e.jsx("div",{style:{marginTop:14},children:e.jsx("button",{type:"button",className:"gp-btn-solid tm-invite-btn",onClick:()=>ue(()=>xe(!0)),children:y("+ Invite","+ Invite teammate")})}):null]})})]})]}),we&&e.jsx("div",{style:{position:"fixed",bottom:24,left:"50%",transform:"translateX(-50%)",background:"#1a1a1a",color:"#fff",padding:"10px 18px",borderRadius:999,fontSize:13,zIndex:9999,boxShadow:"0 8px 22px rgba(0,0,0,0.2)"},children:we}),e.jsx(Vo,{open:Qe,onClose:()=>xe(!1),seatRefreshKey:ne,onSent:t=>{I(`Sent ${t} invite${t===1?"":"s"}`),re(a=>a+1),_e(!1,!0)}}),e.jsx(Io,{open:_!=null,onClose:()=>Ee(null),userId:(_==null?void 0:_.userId)??null,fallbackName:_==null?void 0:_.name,fallbackPhoto:(_==null?void 0:_.photo)??null}),Ke&&e.jsx(ti,{profile:Ke,onClose:()=>ye(null),onInvite:(t,a)=>{ye(null),Ye(t,a)}}),e.jsx(ii,{open:M!=null,name:(M==null?void 0:M.name)||"",email:le,onEmailChange:W,mode:le.trim()?"send":"no_email",inviterName:g||"You",personalNote:ve,onPersonalNoteChange:en,sending:Cn,onClose:()=>{Cn||(me(null),W(""))},onSendInvite:Js}
38),Q?e.jsx(Za,{target:{name:Q.contact.name,photo:Q.contact.profilePhoto,userId:Q.contact.source!=="imported"?Q.contact.contactUserId:null,title:(Q.contact.role||"").split(" · ")[0],company:Q.contact.companyName},viewer:{name:g||"You",userId:c},options:Ts,actionLabel:"Read what Gem sends",actionDisabled:!!Q.contact.status,onClose:()=>te(null),onPick:Es}):null,e.jsx(es,{open:k!=null,connectorName:(k==null?void 0:k.teammate.name)||"",connectorPhoto:(k==null?void 0:k.teammate.profilePhoto)??null,connectorEmail:(k==null?void 0:k.teammate.email)??null,connectorUserId:(k==null?void 0:k.teammate.userId)??null,connectorTitle:(k==null?void 0:k.teammate.role)??null,targetName:(k==null?void 0:k.contact.name)||"",targetUserId:(k==null?void 0:k.contact.source)!=="imported"&&(k!=null&&k.contact.contactUserId)?k.contact.contactUserId:null,targetEmail:(k==null?void 0:k.contact.email)??null,targetRole:(k==null?void 0:k.contact.role)??null,targetCompany:(k==null?void 0:k.contact.companyName)??null,targetPhoto:(k==null?void 0:k.contact.profilePhoto)??null,viewerFullName:g,viewerEmail:(n==null?void 0:n.email)??null,viewerUserId:c,viewerToken:i,reasoning:k?(()=>{const t=mn(k.contact.name)||k.contact.name,a=[`${k.teammate.name} is connected to ${t}`],o=qt(k.contact);return o&&a.push(`${gn(o)} relationship`),a.join(" · ")})():null,onClose:Ps,onSend:As,sending:He,error:Ze}),e.jsx(ko,{open:Y!=null,onClose:()=>ce(null),onSent:t=>I(t),preselectedTo:Y?Qs(Y):null}),un?e.jsx(Wt,{state:un,onChange:Zn,viewerFullName:(n==null?void 0:n.fullName)||"You",sending:kn,onClose:()=>!kn&&Zn(null),onSend:()=>void kt()}):null,e.jsx(lr,{open:hs,account:ps,contact:En,viewerFullName:g,viewerUserId:c??0,viewerEmail:n==null?void 0:n.email,viewerToken:i,askerOverride:Ve,founderUserId:Tt,connectorUserId:Ve&&En?En.viaName==="you"||En.source==="direct_gem"?c:En.viaUserId??null:null,onClose:()=>{Xt||(hn(!1),et(null),nt(null),tt(null),at(null))},onSend:Os,sending:Xt,error:fs}),K?e.jsx(Wt,{state:K,onChange:Tn,viewerFullName:g,sending:zt,onClose:()=>!zt&&Tn(null),onSend:()=>void Us()}):null]})}export{$r 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.