PageSourceSearch

https://www.gemphere.com/assets/Settings-CX0nnhVf.js

js gemphere.com collected 2026-10-02 01:30:06 UTC 75,887 bytes, 1 lines download raw bytes

1import{u as cs,r as t,j as e,aG as et,z as Rs,c as Bs,aH as Fs,aI as st,aJ as tt,aK as nt,aL as at,aM as it,aN as lt,aO as ot,aP as os,aQ as rt,aR as ct,aS as dt,aT as ut,P as rs,aU as Ps,aV as mt,aW as ht,aX as pt,af as ft,aY as gt,a as vt,y as bt,aZ as xt,a_ as yt,a$ as Ts,b0 as Es,b1 as jt,b2 as Nt,b3 as wt,b4 as kt,b5 as vs,b6 as St,L as Ct,b7 as Pt,b8 as Tt,b9 as Et,ba as Lt,bb as It,bc as At,bd as Rt,be as Bt,bf as Ft,bg as $t}from"./index-t4UNL-er.js";import{r as Wt,u as Ut,s as Ot}from"./linkedin-csv-upload-flow-D1etFt0g.js";import{I as Mt,s as Dt,a as Gt}from"./IntegrationsModal-CihhAZhY.js";import{Q as _t}from"./QrSheet-CzugcYO3.js";import{m as Kt,r as Yt}from"./api-DzEwHsS8.js";import{u as Vt}from"./use-mobile-DyHfV21u.js";import"./external-link-GaWiUDyf.js";import"./QrCode-Bvvwo3ZD.js";const $s={digestCadence:"weekly"};function zt(l){return`gemphere:prefs:${l}`}function Ht(l){try{const h=window.localStorage.getItem(zt(l));if(!h)return null;const f=JSON.parse(h);return f&&typeof f=="object"?f:null}catch{return null}}function qt(l){const f=(l&&typeof l=="object"?l:{}).digestCadence;return{digestCadence:f==="biweekly"||f==="weekly"?f:$s.digestCadence}}async function Qt(l){return qt({...$s,...Ht(l)??{}})}const ce={firmo:{label:"Sector & stage",help:"What you invest in: sectors, stages, check sizes, geographies. Type and press Enter to add.",placeholder:"Add a tag (e.g. Fintech, Series B+, deeptech)…"},persona:{label:"Founder profile",help:"Backgrounds and traits you look for in founders. Type and press Enter to add.",placeholder:"Add a profile trait…"},signal:{label:"Signals",help:'Triggers that say "this is a deal worth chasing" — funding moments, team strength, technical depth. Type and press Enter to add.',placeholder:"Add a signal (e.g. PMF, breakout growth)…"}};function bs({values:l,onChange:h,placeholder:f,disabled:p}){const[b,B]=t.useState(""),S=()=>{const r=b.trim();r&&(l.includes(r)||h([...l,r]),B(""))},D=r=>{(r.key==="Enter"||r.key===",")&&b.trim()?(r.preventDefault(),S()):r.key==="Backspace"&&b===""&&l.length&&h(l.slice(0,-1))},P=b.trim().length>0;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"icp-input-row",onClick:r=>{const o=r.currentTarget.querySelector("input.icp-chip-input");o==null||o.focus()},children:[l.map((r,o)=>e.jsxs("span",{className:"icp-chip",children:[r,e.jsx("button",{type:"button",className:"icp-chip-x",onClick:W=>{W.stopPropagation(),h(l.filter((I,F)=>F!==o))},disabled:p,"aria-label":`Remove ${r}`,children:"×"})]},`${r}-${o}`)),e.jsx("input",{type:"text",className:"icp-chip-input",placeholder:f,value:b,onChange:r=>B(r.target.value),onKeyDown:D,onBlur:S,disabled:p}),P?e.jsx("button",{type:"button",className:"icp-chip-add",onMouseDown:r=>{r.preventDefault(),S()},disabled:p,"aria-label":"Add tag",children:"+ Add"}):null]}),e.jsx("div",{className:`icp-chip-hint${P?" active":""}`,children:P?e.jsxs(e.Fragment,{children:["Press ",e.jsx("kbd",{children:"Enter"})," to add ",e.jsxs("strong",{children:['"',b.trim(),'"']})]}):e.jsxs(e.Fragment,{children:["Tip: type a tag and press ",e.jsx("kbd",{children:"Enter"})," to add it."]})})]})}function Xt({open:l,onClose:h,initial:f,onSaved:p}){const{user:b}=cs(),B=(b==null?void 0:b.accessToken)||"",[S,D]=t.useState([]),[P,r]=t.useState([]),[o,W]=t.useState([]),[I,F]=t.useState(!1),[X,O]=t.useState(null);if(t.useEffect(()=>{l&&(D((f==null?void 0:f.firmo)??[]),r((f==null?void 0:f.persona)??[]),W((f==null?void 0:f.signal)??[]),F(!1),O(null))},[l,f]),!l)return null;const R=()=>{I||h()},ie=async()=>{if(!B){O("Please sign in again to save the thesis.");return}F(!0),O(null);try{const y=await et(B,{firmo:S,persona:P,signal:o});p==null||p(y),h()}catch(y){O(y instanceof Error?y.message:"Failed to save thesis")}finally{F(!1)}};return e.jsx("div",{className:"modal-overlay open",onClick:R,children:e.jsxs("div",{className:"modal",onClick:y=>y.stopPropagation(),children:[e.jsxs("div",{className:"modal-head",children:[e.jsxs("div",{children:[e.jsx("div",{className:"mod-title",children:"Edit your investment thesis"}),e.jsx("div",{className:"mod-sub",children:"The clearer your thesis, the better we can rank warm paths and surface deals that fit."})]}),e.jsx("button",{className:"mod-close",onClick:R,"aria-label":"Close",children:"×"})]}),e.jsxs("div",{className:"modal-body",children:[e.jsxs("div",{className:"icp-edit-section",children:[e.jsx("div",{className:"icp-edit-lbl",children:ce.firmo.label}),e.jsx("div",{className:"icp-edit-help",children:ce.firmo.help}),e.jsx(bs,{values:S,onChange:D,placeholder:ce.firmo.placeholder,disabled:I})]}),e.jsxs("div",{className:"icp-edit-section",children:[e.jsx("div",{className:"icp-edit-lbl",children:ce.persona.label}),e.jsx("div",{className:"icp-edit-help",children:ce.persona.help}),e.jsx(bs,{values:P,onChange:r,placeholder:ce.persona.placeholder,disabled:I})]}),e.jsxs("div",{className:"icp-edit-section",children:[e.jsx("div",{className:"icp-edit-lbl",children:ce.signal.label}),e.jsx("div",{className:"icp-edit-help",children:ce.signal.help}),e.jsx(bs,{values:o,onChange:W,placeholder:ce.signal.placeholder,disabled:I})]}),X?e.jsx("div",{className:"portco-error",children:X}):null]}),e.jsxs("div",{className:"modal-foot",children:[e.jsx("button",{className:"btn-foot",onClick:R,disabled:I,children:"Cancel"}),e.jsx("button",{className:"btn-foot primary",onClick:ie,disabled:I,children:I?"Saving…":"Save thesis"})]})]})})}function Zt({className:l="",label:h="My code",side:f="show",onLinked:p}){const{user:b}=cs(),B=(b==null?void 0:b.accessToken)||null,[S,D]=t.useState(!1),[P,r]=t.useState(null);t.useEffect(()=>{if(!S||P||!B)return;let W=!1;return Kt(B).then(I=>{W||r({token:I.token,url:I.url})}).catch(()=>{}),()=>{W=!0}},[S,P,B]);const o=t.useCallback(async W=>{if(!B)return{linked:!1,reason:"Sign in first.",person:null};const I=await Yt(B,{token:W});return{linked:I.linked,reason:I.reason,person:I.person}},[B]);return B?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:l,onClick:()=>D(!0),children:h}),e.jsx(_t,{open:S,side:f,onClose:()=>D(!1),myCode:P,onScan:o,onLinked:()=>p==null?void 0:p()})]}):null}function Jt(l,h){return l===2?"investor":h==="operator"?"operator":l===3?"scout":"founder"}const en={investor:{orgTitle:"Firm details",orgNameLabel:"Firm name",orgNameField:"fundName",titleLabel:"Your title",titlePlaceholder:"e.g. Partner, Principal",overview:{label:"Investment thesis",field:"commonAdvice",placeholder:"Early-stage B2B SaaS, pre-seed to Series A, US & Europe."},showRevenue:!1,about:null,edge:null,showThesis:!0},founder:{orgTitle:"Company details",orgNameLabel:"Company name",orgNameField:"companyName",titleLabel:"Your title",titlePlaceholder:"e.g. CEO / Founder",overview:{label:"Company overview",field:"companyOverview",placeholder:"One line on what you're building."}
1,showRevenue:!0,about:{hint:"Background info — helps Gemphere match you with the right connectors.",school:!0,experience:!0,traction:!0},edge:{title:"Why you & superpower",hint:"These show up on your profile and in warm intro blurbs.",superpower:!0,why:!0,motivation:!1},showThesis:!1},operator:{orgTitle:"Where you work",orgNameLabel:"Company name",orgNameField:"companyName",titleLabel:"Your title",titlePlaceholder:"e.g. Head of Sales, Staff Engineer",overview:{label:"What your company does",field:"companyOverview",placeholder:"One line on what the company does."},showRevenue:!1,about:{hint:"Background info — helps Gemphere match you with the right connectors.",school:!1,experience:!0,traction:!1},edge:{title:"What drives you",hint:"This shows up on your profile and in warm intro blurbs.",superpower:!1,why:!1,motivation:!0},showThesis:!1},scout:{orgTitle:"Company details",orgNameLabel:"Company name",orgNameField:"companyName",titleLabel:"Your title",titlePlaceholder:"e.g. Scout, Advisor",overview:null,showRevenue:!1,about:{hint:"Background info — helps Gemphere match you with the right connectors.",school:!1,experience:!0,traction:!1},edge:{title:"What drives you",hint:"This shows up on your profile and in warm intro blurbs.",superpower:!1,why:!1,motivation:!0},showThesis:!1}};function Ws(l){const h=(l||"").replace(/\s+/g," ").trim().split(" ").filter(Boolean);return h.length>=2?(h[0][0]+h[h.length-1][0]).toUpperCase():(l||"?").slice(0,2).toUpperCase()||"?"}const Ls=["purple","green","amber","blue","red","teal"];function sn(l){let h=0;for(let f=0;f<l.length;f++)h=(h+l.charCodeAt(f))%997;return Ls[h%Ls.length]}const Is={fullname:"",email:"",phoneNumber:"",linkedinProfile:"",role:1,profilePhoto:null,companyRole:"",companyName:"",companyOverview:"",traction:"",superpower:"",why:"",motivation:"",revenue:"",school:"",experience:"",title:"",fundName:"",commonAdvice:"",whatThey:"",favPitchStyle:"",selectedSectorIds:[],selectedAskIds:[],introBlurb:"",goals:[],whoIKnow:[]};function As(l){if(l==null)return[];const h=String(l).trim();return!h||h==="-1,-1,-1"||h==="-1"?[]:h.split(",").map(f=>parseInt(f.trim(),10)).filter(f=>Number.isFinite(f)&&f>0)}function U(l,...h){for(const f of h){const p=l[f];if(p==null)continue;const b=typeof p=="string"?p:String(p);if(b.trim()&&b.trim()!=="Not provided")return b}return""}function tn(){const l="(max-width: 900px)",[h,f]=t.useState(()=>typeof window<"u"&&window.matchMedia(l).matches);return t.useEffect(()=>{const p=window.matchMedia(l),b=()=>f(p.matches);return b(),p.addEventListener("change",b),()=>p.removeEventListener("change",b)},[]),h}function Y({label:l,value:h,empty:f,placeholder:p,readOnly:b=!1,readOnlyNote:B,multiline:S=!1,maxLength:D,type:P="text",open:r,onToggle:o,onChange:W,onBlur:I,hint:F,footer:X}){const O=h.trim()?h:f||p||"Not added yet";return e.jsxs("div",{className:`mp-row${r?" open":""}${b?" ro":""}`,children:[e.jsxs("button",{type:"button",className:"mp-row-head",onClick:b?void 0:o,"aria-expanded":b?void 0:r,disabled:b,children:[e.jsxs("span",{className:"mp-row-grow",children:[e.jsx("span",{className:"mp-row-nm",children:l}),e.jsx("span",{className:`mp-row-val${h.trim()?"":" empty"}`,children:O}),b&&B?e.jsx("span",{className:"mp-row-sub",children:B}):null]}),b?null:e.jsx("span",{className:"mp-row-act",children:r?"Done":h.trim()?"Edit":"Add"})]}),r&&!b?e.jsxs("div",{className:"mp-row-edit",children:[S?e.jsx("textarea",{className:"mp-input mp-textarea",autoFocus:!0,placeholder:p,maxLength:D,value:h,onChange:R=>W(R.target.value),onBlur:I?R=>I(R.target.value):void 0}
1):e.jsx("input",{className:"mp-input",autoFocus:!0,type:P,placeholder:p,maxLength:D,value:h,onChange:R=>W(R.target.value),onBlur:I?R=>I(R.target.value):void 0}),F?e.jsx("div",{className:"mp-row-hint",children:F}):null,X]}):null]})}function nn({embedded:l=!1}={}){var Fe;const{user:h,logout:f}=cs(),p=h==null?void 0:h.accessToken,b=Rs(),B=tn(),[S,D]=t.useState(()=>new Set),P=t.useCallback(a=>{D(c=>{const j=new Set(c);return j.has(a)?j.delete(a):j.add(a),j})},[]),[r,o]=t.useState(!0);Bs(!r);const[W,I]=t.useState(null),[F,X]=t.useState(!1),[O,R]=t.useState(null),[ie,y]=t.useState(!1),[_,te]=t.useState(!1),[Z,ue]=t.useState(!1),[be,xe]=t.useState(null),Ee=t.useCallback(async()=>{if(!p){xe("Please sign in again to delete your account.");return}ue(!0),xe(null);try{await Fs(p),f(),b("/",{replace:!0})}catch(a){xe(a instanceof Error?a.message:"Couldn't delete account."),ue(!1)}},[p,f,b]),[G,Oe]=t.useState([]),[E,me]=t.useState([]),[n,le]=t.useState(Is),V=t.useRef(Is),[Me,De]=t.useState(!1),[ys,Ge]=t.useState(null),[q,he]=t.useState({firmo:[],persona:[],signal:[]}),[_e,ye]=t.useState(!1);t.useState(!1),t.useState(""),t.useState(!1),t.useState(null);const[je,Ke]=t.useState(!1),[Ye,Ve]=t.useState(!1),[ds,Ne]=t.useState(!1),[us,ne]=t.useState(null),[ze,Le]=t.useState(!1),[He,qe]=t.useState(""),[pe,Qe]=t.useState([]),[we,Ie]=t.useState(null),[z,ms]=t.useState({name:"",role:"",email:"",linkedinUrl:""}),Xe=t.useCallback(async()=>{if(p){o(!0),I(null);try{const[a,c,j,x,d,C,u]=await Promise.all([st(p),tt(p),nt(p),at(p),it(p),lt(p),ot(p).catch(()=>null)]);if(!a.ok)throw new Error(`Couldn't load profile (${a.status})`);const w=await a.json(),Q=c.ok?await c.json():{data:[]},J=j.ok?await j.json():{data:[]},ee=(Array.isArray(Q)?Q:(Q==null?void 0:Q.data)??[]).map(v=>({id:Number(v==null?void 0:v.id),name:String((v==null?void 0:v.name)||"")})).filter(v=>Number.isFinite(v.id)&&v.id>0&&!!v.name),M=(Array.isArray(J)?J:(J==null?void 0:J.data)??[]).map(v=>({id:Number(v==null?void 0:v.id),name:String((v==null?void 0:v.name)||"")})).filter(v=>Number.isFinite(v.id)&&v.id>0&&!!v.name);Oe(ee),me(M);const A=w!=null&&w.data&&typeof w.data=="object"?w.data:w,ts=A!=null&&A.user&&typeof A.user=="object"?A.user:A,ns=A!=null&&A.founder&&typeof A.founder=="object"?A.founder:{},$e=A!=null&&A.investor&&typeof A.investor=="object"?A.investor:{},L={...ts,...ns,...$e},as=Number(U(L,"role"))||1,ve=U(L,"title"),K=U(L,"companyRole","company_role"),Pe=K||ve,We=as===2?ve||K:ve,de={fullname:U(L,"fullname","Fullname"),email:U(L,"email"),phoneNumber:U(L,"phoneNumber","phone"),linkedinProfile:U(L,"linkedinProfile","linkedinUrl","linkedin_url"),role:as,profilePhoto:U(L,"profilePhoto","photo")||null,companyRole:Pe,companyName:U(L,"companyName","company"),companyOverview:U(L,"companyOverview"),traction:U(L,"traction"),superpower:U(L,"superpower"),why:U(L,"why","Why"),motivation:U(L,"motivation"),revenue:U(L,"revenue","revenueString"),school:U(L,"school"),experience:U(L,"experience"),title:We,fundName:U(L,"fundName","fund")||U(L,"companyName","company"),commonAdvice:U(L,"commonAdvice")||U(L,"companyOverview"),whatThey:U(L,"whatThey"),favPitchStyle:U(L,"favPitchStyle"),selectedSectorIds:As(L.sectorIndustryFocus??L.sector),selectedAskIds:As(L.askInitialCheck??L.checkSize),introBlurb:"",goals:[],whoIKnow:[]};if(x.ok){const v=await x.json().catch(()=>null),ae=Array.isArray(v==null?void 0:v.goals)?v.goals:[];de.goals=ae.map(T=>({id:Number(T==null?void 0:T.id),goal:String((T==null?void 0:T.goal)||"")})).filter(T=>Number.isInteger(T.id)&&T.goal)}if(d.ok){const v=await d.json().catch(()=>null),ae=Array.isArray(v==null?void 0:v.people)?v.people:[];de.whoIKnow=ae.map(T=>({id:Number(T==null?void 0:T.id),name:String((T==null?void 0:T.name)||""),role:(T==null?void 0:T.role)??null,email:(T==null?void 0:T.email)??null,linkedinUrl:(T==null?void 0:T.linkedinUrl)??null,contactUserId:(T==null?void 0:T.contactUserId)??null})).filter(T=>Number.isInteger(T.id)&&T.name)}if(C.ok){const v=await C.json().catch(()=>null);de.introBlurb=String((v==null?void 0:v.blurb)||"")}if(u!=null&&u.ok){const v=await u.json().catch(()=>null);Ge(v!=null&&v.persona?String(v.persona):null)}le(de),V.current=de}catch(a){I(a instanceof Error?a.message:"Failed to load profile")}finally{o(!1)}}},[p]);t.useEffect(()=>{Xe()},[Xe]),t.useEffect(()=>{if(!p)return;const a=Number(h==null?void 0:h.userId);if(!Number.isFinite(a)||a<=0)return;let c=!1;return(async()=>{try{const[j,x]=await Promise.all([os(p,a).catch(()=>null),rt(p).catch(()=>null)]);if(c)return;
1De(!!(j!=null&&j.portfolioTrial)),x&&he({firmo:x.firmo??[],persona:x.persona??[],signal:x.signal??[]})}catch{}})(),()=>{c=!0}},[p,h==null?void 0:h.userId]);const k=(a,c)=>{le(j=>({...j,[a]:c})),R(null)},Ze=()=>{le(V.current),R(null)},Je=async a=>{if(p&&a!==V.current.introBlurb){y(!0);try{const c=await Ps(p,a);if(!c.ok)throw new Error(`Couldn't save blurb (${c.status})`);V.current={...V.current,introBlurb:a}}catch(c){R({kind:"err",msg:c instanceof Error?c.message:"Couldn't save blurb"})}finally{y(!1)}}};t.useCallback(async()=>{if(p){Ve(!0),ne(null);try{const[a,c]=await Promise.all([ct(p),dt(p)]),j=[];if(a.ok){const x=await a.json().catch(()=>null),d=Array.isArray(x)?x:Array.isArray(x==null?void 0:x.data)?x.data:[];for(const C of d){const u=C!=null&&C.user&&typeof C.user=="object"?C.user:C,w=u!=null&&u.user&&typeof u.user=="object"?u.user:u,Q=Number((w==null?void 0:w.id)||0);if(!Q)continue;const J=String((w==null?void 0:w.fullname)||(w==null?void 0:w.email)||"").trim()||`User ${Q}`,ee=u!=null&&u.founder&&typeof u.founder=="object"?u.founder:null,M=u!=null&&u.investor&&typeof u.investor=="object"?u.investor:null;let A="";ee&&(ee.title||ee.companyName)?A=[ee.title,ee.companyName].filter(Boolean).join(" · "):M&&(M.title||M.fundName)?A=[M.title,M.fundName].filter(Boolean).join(" · "):w!=null&&w.title&&(A=String(w.title)),j.push({key:`u-${Q}`,source:"connection",userId:Q,name:J,role:A||"Gemphere user",email:(w==null?void 0:w.email)!=null?String(w.email):null,linkedinUrl:(w==null?void 0:w.linkedinProfile)!=null?String(w.linkedinProfile):(w==null?void 0:w.linkedinUrl)!=null?String(w.linkedinUrl):null})}}if(c.ok){const x=await c.json().catch(()=>null),d=(x==null?void 0:x.data)??x,C=Array.isArray(d)?d:(d==null?void 0:d.contacts)??(x==null?void 0:x.contacts)??[];for(const u of C||[]){const w=Number((u==null?void 0:u.id)||0);if(!w)continue;const Q=String((u==null?void 0:u.fullName)||(u==null?void 0:u.displayName)||(u==null?void 0:u.name)||"").trim()||(u!=null&&u.email?String(u.email):"Contact"),J=u!=null&&u.title?String(u.title):"",ee=u!=null&&u.company?String(u.company):"",M=[J,ee].filter(Boolean).join(" · ")||"Imported contact",A=Number((u==null?void 0:u.connectedUserId)||0);j.push({key:`c-${w}`,source:"contact",userId:A>0?A:null,name:Q,role:M,email:(u==null?void 0:u.email)!=null?String(u.email):null,linkedinUrl:(u==null?void 0:u.linkedinUrl)!=null?String(u.linkedinUrl):null})}}Qe(j),Ne(!0)}catch(a){ne(a instanceof Error?a.message:"Couldn't load your network")}finally{Ve(!1)}}},[p]);const es=()=>{ze||Ke(!1)},ke=async()=>{if(!p)return;let a;if(we){const c=pe.find(j=>j.key===we);if(!c)return;a={name:c.name,role:c.role||"",email:c.email||"",linkedinUrl:c.linkedinUrl||""},c.userId&&(a.contactUserId=c.userId)}else{const c=z.name.trim();if(!c){ne("Enter a name (or pick someone from your network).");return}a={name:c,role:z.role.trim(),email:z.email.trim(),linkedinUrl:z.linkedinUrl.trim()}}Le(!0),ne(null);try{const c=await mt(p,a),j=await c.json().catch(()=>null);if(!c.ok)throw new Error((j==null?void 0:j.error)||`Couldn't add person (${c.status})`);const x=j==null?void 0:j.person;if(x!=null&&x.id){const d={id:Number(x.id),name:String(x.name||a.name),role:x.role??null,email:x.email??null,linkedinUrl:x.linkedinUrl??null,contactUserId:x.contactUserId??null};le(C=>({...C,whoIKnow:[...C.whoIKnow,d]})),V.current={...V.current,whoIKnow:[...V.current.whoIKnow,d]}}Ke(!1)}catch(c){ne(c instanceof Error?c.message:"Couldn't add person")}finally{Le(!1)}},ss=async()=>{if(p){X(!0),R(null);try{const a=await ht(p,{fullname:n.fullname.trim(),email:V.current.email.trim(),linkedinProfile:n.linkedinProfile.trim(),docusign:"",phoneNumber:V.current.phoneNumber.trim()}),c=await a.json().catch(()=>null);if(!a.ok||(c==null?void 0:c.success)===!1){const C=(c==null?void 0:c.message)||(c==null?void 0:c.error)||`updateUserDetails failed (${a.status})`;throw new Error(String(C))}const j={phoneNumber:V.current.phoneNumber.trim(),companyRole:n.role===2?n.title.trim()||n.companyRole.trim():n.companyRole.trim()||n.title.trim()};n.role!==2&&(j.experience=n.experience,j.school=n.school),n.role===1?Object.assign(j,{companyName:n.companyName,companyOverview:n.companyOverview,revenue:n.revenue,traction:n.traction,superpower:n.superpower,why:n.why,motivation:n.motivation,sectorIndustryFocus:n.selectedSectorIds.slice(0,3),askInitialCheck:n.selectedAskIds}
1):n.role===2?Object.assign(j,{title:n.title,fundName:n.fundName,companyName:n.fundName,companyOverview:n.commonAdvice,sectorIndustryFocus:n.selectedSectorIds.slice(0,3),askInitialCheck:n.selectedAskIds,commonAdvice:n.commonAdvice,whatThey:n.whatThey,favPitchStyle:n.favPitchStyle}):n.role===3&&Object.assign(j,{title:n.companyRole.trim()||n.title.trim(),companyName:n.companyName,companyOverview:n.companyOverview,revenueString:n.revenue,traction:n.traction,superpower:n.superpower,why:n.why,motivation:n.motivation});const x=await pt(p,j),d=await x.json().catch(()=>null);if(!x.ok||(d==null?void 0:d.success)===!1){const C=(d==null?void 0:d.message)||(d==null?void 0:d.error)||`profile save failed (${x.status})`;throw new Error(String(C))}if(n.introBlurb!==V.current.introBlurb){const C=await Ps(p,n.introBlurb),u=await C.json().catch(()=>null);if(!C.ok){const w=(u==null?void 0:u.error)||`Couldn't save blurb (${C.status})`;throw new Error(String(w))}}V.current=n,R({kind:"ok",msg:"Profile saved."})}catch(a){R({kind:"err",msg:a instanceof Error?a.message:"Couldn't save profile."})}finally{X(!1)}}};t.useMemo(()=>{const a=new Map(G.map(c=>[c.id,c.name]));return n.selectedSectorIds.map(c=>a.get(c)).filter(c=>!!c)},[G,n.selectedSectorIds]);const oe=n.fullname||(h==null?void 0:h.fullName)||"You",Ae=Ws(oe),Re=JSON.stringify(n)!==JSON.stringify(V.current),Se=Jt(n.role,ys),g=en[Se],fe=ut(n.role,{companyRole:n.companyRole,title:n.title,companyName:n.companyName,fundName:n.fundName}),ge=je&&e.jsx(an,{loading:Ye,errorMsg:us,submitting:ze,search:He,setSearch:qe,entries:pe,alreadyAdded:n.whoIKnow,selectedKey:we,onPick:a=>{Ie(c=>c===a?null:a),ne(null)},manual:z,setManual:ms,onClose:es,onSubmit:ke}),hs=e.jsx(Xt,{open:_e,onClose:()=>ye(!1),initial:q,onSaved:a=>{he(a),R({kind:"ok",msg:"ICP saved"})}}),Ce=!r&&!l&&e.jsxs("div",{className:"profile-danger-card form-card",children:[e.jsx("div",{className:"form-card-title",children:"Delete account"}),e.jsx("div",{className:"form-card-sub",children:"Permanently delete your Gemphere account. This removes your profile, contacts, and intro history. This cannot be undone."}),be&&e.jsx("div",{className:"info-banner settings-msg settings-msg--err",children:be}),e.jsx("button",{type:"button",className:"profile-danger-btn",onClick:()=>{xe(null),te(!0)},disabled:Z,children:"Delete account"})]}),Be=_&&e.jsx("div",{role:"dialog","aria-modal":"true",onClick:()=>{Z||te(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,padding:16},children:e.jsxs("div",{onClick:a=>a.stopPropagation(),style:{background:"#ffffff",borderRadius:12,padding:24,maxWidth:440,width:"100%",boxShadow:"0 12px 40px rgba(0,0,0,0.25)"},children:[e.jsx("div",{style:{fontSize:18,fontWeight:700,color:"#14202E",marginBottom:8},children:"Delete account?"}),e.jsx("div",{style:{fontSize:14,color:"#4a4a4a",lineHeight:1.5,marginBottom:20},children:"This will permanently delete your Gemphere account and all associated data. You won't be able to recover it. Are you sure you want to continue?"}),be&&e.jsx("div",{style:{background:"#fdecea",border:"1px solid #f3c3bb",color:"#9a3a2a",borderRadius:8,padding:"10px 12px",fontSize:13,marginBottom:16},children:be}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:[e.jsx("button",{type:"button",onClick:()=>te(!1),disabled:Z,style:{background:"transparent",color:"#14202E",border:"1px solid #d1d5db",borderRadius:8,padding:"8px 14px",fontSize:14,fontWeight:500,cursor:Z?"not-allowed":"pointer"},children:"Cancel"}),e.jsx("button",{type:"button",onClick:Ee,disabled:Z,style:{background:"#b32a2a",color:"#ffffff",border:0,borderRadius:8,padding:"8px 14px",fontSize:14,fontWeight:600,cursor:Z?"wait":"pointer",opacity:Z?.7:1},children:Z?"Deleting…":"Delete"})]})]})});if(B){const a=n.fullname.split(/\s+/)[0]||"",c=n.fullname.split(/\s+/).slice(1).join(" "),j=n.linkedinProfile.trim()?n.linkedinProfile.trim().replace(/^https?:\/\//,"").replace(/\/+$/,""):"",x=(Fe=g.overview)==null?void 0:Fe.field;return e.jsxs("div",{className:`mp${l?" profile-embedded":" page active page-profile"}`,children:[!l&&e.jsxs("div",{className:"mp-nav",children:[e.jsxs("div",{className:"mp-nav-t",children:[e.jsx("small",{children:"profile"}),"My profile"]}),e.jsx("div",{className:"mp-nav-sub",children:"What we share with teammates and use for matching."})]}),W&&e.jsxs("div",{className:"mp-banner mp-banner--err",children:[e.jsx("strong",{children:"Couldn't load your profile:"})," ",W]}),O&&e.jsx("div",{className:`mp-banner mp-banner--${O.kind}`,children:O.msg}),r?e.jsx(rs,{variant:l?"section":"page",message:"Loading profile…"}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mp-hero",children:[n.profilePhoto?e.jsx("img",{src:n.profilePhoto,alt:"",className:"mp-hero-av mp-hero-av--photo"}):e.jsx("div",{className:"mp-hero-av",children:Ae}),e.jsxs("div",{className:"mp-hero-info",children:[e.jsx("div",{className:"mp-hero-name",children:oe}),fe?e.jsx("div",{className:"mp-hero-meta",children:fe}):null,j?e.jsx("div",{className:"mp-hero-chips",children:e.jsx("span",{className:"mp-chip",children:j})}):null]})]}),e.jsx("div",{className:"mp-sec",id:"ma-you",children:e.jsx("span",{className:"mp-eyebrow",children:"Basic info"})}),e.jsxs("div",{className:"mp-list",children:[e.jsx(Y,{label:"First name",value:a,open:S.has("firstName"),onToggle:()=>P("firstName"),onChange:d=>{const C=d.trim(),u=n.fullname.split(/\s+/).slice(1).join(" ");
1k("fullname",[C,u].filter(Boolean).join(" "))}}),e.jsx(Y,{label:"Last name",value:c,open:S.has("lastName"),onToggle:()=>P("lastName"),onChange:d=>{const C=n.fullname.split(/\s+/)[0]||"";k("fullname",[C,d.trim()].filter(Boolean).join(" "))}}),e.jsx(Y,{label:"Email",value:n.email,empty:"Not provided",readOnly:!0,readOnlyNote:"Your sign-in identity — can't be changed here.",open:!1,onToggle:()=>{},onChange:()=>{}}),e.jsx(Y,{label:"Phone",value:n.phoneNumber,empty:"Not provided",readOnly:!0,readOnlyNote:"How Gem reaches you on WhatsApp.",open:!1,onToggle:()=>{},onChange:()=>{}}),e.jsx(Y,{label:"LinkedIn",value:n.linkedinProfile,empty:"Not added yet",placeholder:"https://linkedin.com/in/your-handle",open:S.has("linkedinProfile"),onToggle:()=>P("linkedinProfile"),onChange:d=>k("linkedinProfile",d)})]}),e.jsx("div",{className:"mp-sec",id:"ma-company",children:e.jsx("span",{className:"mp-eyebrow",children:g.orgTitle})}),e.jsxs("div",{className:"mp-list",children:[e.jsx(Y,{label:g.orgNameLabel,value:n[g.orgNameField],open:S.has("orgName"),onToggle:()=>P("orgName"),onChange:d=>k(g.orgNameField,d)}),e.jsx(Y,{label:g.titleLabel,placeholder:g.titlePlaceholder,value:Se==="investor"?n.title:n.companyRole,open:S.has("orgTitleField"),onToggle:()=>P("orgTitleField"),onChange:d=>{Se==="investor"&&k("title",d),k("companyRole",d)}}),g.overview&&x&&e.jsx(Y,{label:g.overview.label,placeholder:g.overview.placeholder,value:n[x],multiline:!0,open:S.has("overview"),onToggle:()=>P("overview"),onChange:d=>k(x,d)}),g.showRevenue&&e.jsx(Y,{label:"Revenue / Traction",placeholder:"e.g. $50K MRR",value:n.revenue,open:S.has("revenue"),onToggle:()=>P("revenue"),onChange:d=>k("revenue",d)})]}),g.about&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mp-sec",children:e.jsx("span",{className:"mp-eyebrow",children:"About you"})}),e.jsx("p",{className:"mp-sec-note",children:g.about.hint}),e.jsxs("div",{className:"mp-list",children:[g.about.school&&e.jsx(Y,{label:"School",value:n.school,open:S.has("school"),onToggle:()=>P("school"),onChange:d=>k("school",d)}),g.about.experience&&e.jsx(Y,{label:"Professional experience",placeholder:"Previous companies or roles",value:n.experience,open:S.has("experience"),onToggle:()=>P("experience"),onChange:d=>k("experience",d)}),g.about.traction&&e.jsx(Y,{label:"Traction",value:n.traction,multiline:!0,open:S.has("traction"),onToggle:()=>P("traction"),onChange:d=>k("traction",d)})]})]}),Me?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mp-sec",children:e.jsx("span",{className:"mp-eyebrow",children:"Target accounts"})}),e.jsx("p",{className:"mp-sec-note",children:"Customers, investors, partners — anyone you want to reach."}),e.jsxs("div",{className:"mp-card",children:[e.jsx("div",{className:"mp-card-h",children:"🎯 Your ICP"}),e.jsx("div",{className:"mp-card-sub",children:"Who you're looking for — customers, investors, or both. We'll rank warm paths and surface accounts that match."}),e.jsxs("div",{className:"mp-icp-block",children:[e.jsx("div",{className:"mp-eyebrow",children:"Who fits"}),e.jsx("div",{className:"mp-tags",children:(q.firmo??[]).length?(q.firmo??[]).map((d,C)=>e.jsx("span",{className:"mp-tag",children:d},`firmo-${C}-${d}`)):e.jsx("span",{className:"mp-tag empty",children:"e.g. Series A SaaS or seed B2B funds"})})]}),e.jsxs("div",{className:"mp-icp-block",children:[e.jsx("div",{className:"mp-eyebrow",children:"People to reach"}),e.jsx("div",{className:"mp-tags",children:(q.persona??[]).length?(q.persona??[]).map((d,C)=>e.jsx("span",{className:"mp-tag persona",children:d},`persona-${C}-${d}`)):e.jsx("span",{className:"mp-tag empty",children:"e.g. VPs of RevOps, GPs"})})]}),e.jsxs("div",{className:"mp-icp-block",children:[e.jsx("div",{className:"mp-eyebrow",children:"Signals"}),e.jsx("div",{className:"mp-tags",children:(q.signal??[]).length?(q.signal??[]).map((d,C)=>e.jsx("span",{className:"mp-tag signal",children:d},`signal-${C}-${d}`)):e.jsx("span",{className:"mp-tag empty",children:"e.g. just raised, hiring sales"})})]}),e.jsxs("div",{className:"mp-btnrow",children:[e.jsx("button",{type:"button",className:"mp-btn mp-btn--ghost",onClick:()=>ye(!0),children:"✎ Edit ICP"}),e.jsx("button",{type:"button",className:"mp-btn",onClick:()=>b("/accounts"),children:"+ Add accounts"})]})]})]}):e.jsxs(e.Fragment,{children:[g.edge&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mp-sec",children:e.jsx("span",{className:"mp-eyebrow",children:g.edge.title})}),e.jsx("p",{className:"mp-sec-note",children:g.edge.hint}),e.jsxs("div",{className:"mp-list",children:[g.edge.superpower&&e.jsx(Y,{label:"Your superpower",placeholder:"What are you unusually good at?",value:n.superpower,multiline:!0,open:S.has("superpower"),onToggle:()=>P("superpower"),onChange:d=>k("superpower",d)}),g.edge.why&&e.jsx(Y,{label:"Why you're building this",value:n.why,multiline:!0,open:S.has("why"),onToggle:()=>P("why"),onChange:d=>k("why",d)}),g.edge.motivation&&e.jsx(Y,{label:"Motivation",value:n.motivation,multiline:!0,open:S.has("motivation"),onToggle:()=>P("motivation"),onChange:d=>k("motivation",d)})]})]}),g.showThesis&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mp-sec",children:e.jsx("span",{className:"mp-eyebrow",children:"Thesis details"})}),e.jsx("p",{className:"mp-sec-note",children:"What you look for in founders and the stories you tell."}),e.jsxs("div",{className:"mp-list",children:[e.jsx(Y,{label:"What I look for in a founder",value:n.whatThey,multiline:!0,open:S.has("whatThey"),onToggle:()=>P("whatThey"),onChange:d=>k("whatThey",d)}),e.jsx(Y,{label:"Favourite quote / pitch style",value:n.favPitchStyle,multiline:!0,open:S.has("favPitchStyle"),onToggle:()=>P("favPitchStyle"),onChange:d=>k("favPitchStyle",d)})]})]})]}),e.jsxs("div",{className:"mp-sec",id:"ma-how",children:[e.jsx("span",{className:"mp-eyebrow",children:"How others see you"}),e.jsx("span",{className:"mp-sec-flag",children:ie?"Saving…":"Auto-saves"})]}),e.jsx("p",{className:"mp-sec-note",children:"How others see you when someone gets introduced. Write this in your own words — one paragraph. This is what connectors forward when someone wants an intro to you."}),e.jsx("div",{className:"mp-list",children:e.jsx(Y,{label:"Your intro blurb",value:n.introBlurb,empty:"Nothing written yet — tap Add to write one paragraph.",multiline:!0,maxLength:500,open:S.has("introBlurb"),onToggle:()=>P("introBlurb"),onChange:d=>k("introBlurb",d),onBlur:d=>Je(d),footer:e.jsxs("div",{className:"mp-count",children:[e.jsxs("span",{children:[n.introBlurb.length," / 500 characters"]}),e.jsx("span",{children:ie?"Saving…":"Auto-saves on blur"})]})})}),e.jsxs("div",{className:"mp-card mp-preview",children:[e.jsx("div",{className:"mp-card-h",children:"Live preview"}),e.jsx("div",{className:"mp-card-sub",children:"Exactly what the connector sees in their intro request."}),e.jsxs("div",{className:"mp-preview-box",children:[e.jsx("div",{className:"mp-eyebrow",children:"Forwardable blurb"}),e.jsx("div",{className:"mp-preview-text",children:n.introBlurb.trim()?`"Hey — wanted to introduce you to ${oe}. In their own words: ${n.introBlurb}"`:"Write your intro blurb above to see how it reads when a connector forwards it for you."})]}),e.jsx("div",{className:"mp-note",children:"Connectors can edit this before sending."})]}),e.jsxs("div",{className:`mp-savebar${Re?" mp-savebar--pinned":""}`,children:[Re?e.jsx("span",{className:"mp-savebar-note",children:"Unsaved changes"}):null,e.jsx("button",{type:"button",className:"mp-btn mp-btn--ghost",onClick:Ze,disabled:F,children:"Cancel"}),e.jsx("button",{type:"button",className:"mp-btn",onClick:ss,disabled:F,children:F?"Saving…":"Save changes"})]})]}),ge,hs,Ce,Be]})}return e.jsxs("div",{className:l?"profile-embedded":"page active page-profile",children:[!l&&e.jsxs("div",{className:"top-header",children:[e.jsxs("div",{className:"header-left",children:[e.jsx("div",{className:"page-h",children:"My profile"}),e.jsx("div",{className:"page-sub",children:"What we share with teammates and use for matching."})]}),e.jsxs("div",{className:"header-right",children:[e.jsx("button",{className:"save-btn-ghost",onClick:Ze,disabled:F||r,children:"Cancel"}),e.jsx("button",{className:"save-btn",onClick:ss,disabled:F||r,children:F?"Saving…":"Save changes"})]})]}),W&&e.jsxs("div",{className:"info-banner",style:{background:"#fdecea",borderColor:"#f3c3bb",color:"#9a3a2a"},children:[e.jsx("strong",{children:"Couldn't load your profile:"})," ",W]}),O&&e.jsx("div",{className:"info-banner",style:O.kind==="ok"?{background:"#E1F5EE",borderColor:"#9FE1CB",color:"#0F6E56"}:{background:"#fdecea",borderColor:"#f3c3bb",color:"#9a3a2a"},children:O.msg}),!l&&e.jsx("div",{className:"profile-identity profile-header-card",children:e.jsxs("div",{className:"profile-identity-inner profile-header-content",children:[n.profilePhoto?e.jsx("img",{src:n.profilePhoto,alt:"",className:"profile-av-big",style:{objectFit:"cover"}}):e.jsx("div",{className:"profile-av-big",children:Ae}),e.jsxs("div",{className:"phc-info profile-identity-info",children:[e.jsx("div",{className:"phc-name profile-identity-name",children:oe}),fe?e.jsx("div",{className:"phc-role profile-identity-meta",children:e.jsx("span",{children:fe})}):null]}),e.jsx(Zt,{className:"profile-mycode-btn"})]})}),r?e.jsx(rs,{variant:l?"section":"page",message:"Loading profile…"}):e.jsxs(e.Fragment,{children:[l?e.jsxs("div",{className:"profile-embedded-savebar",children:[O?e.jsx("span",{className:`profile-embedded-savemsg ${O.kind}`,children:O.msg}):e.jsx("span",{}),e.jsxs("div",{className:"profile-embedded-saveactions",children:[e.jsx("button",{className:"save-btn-ghost",onClick:Ze,disabled:F,children:"Cancel"}),e.jsx("button",{className:"save-btn",onClick:ss,disabled:F,children:F?"Saving…":"Save changes"})]})]}):null,e.jsxs("div",{className:`profile-form-columns form-grid-2${l?" profile-form-columns--stacked":""}`,children:[e.jsxs("div",{id:"ma-you",className:"profile-field-section form-card",children:[e.jsx("div",{className:"profile-section-kicker form-card-title",children:"Basic info"}),e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:"First name"}),e.jsx("input",{className:"profile-field-input form-field-input",type:"text",value:n.fullname.split(/\s+/)[0]||"",onChange:a=>{const c=a.target.value.trim(),j=n.fullname.split(/\s+/).slice(1).join(" ");
1k("fullname",[c,j].filter(Boolean).join(" "))}})]}),e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:"Last name"}),e.jsx("input",{className:"profile-field-input form-field-input",type:"text",value:n.fullname.split(/\s+/).slice(1).join(" "),onChange:a=>{const c=n.fullname.split(/\s+/)[0]||"";k("fullname",[c,a.target.value.trim()].filter(Boolean).join(" "))}})]}),e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:"Email"}),e.jsx("input",{className:"profile-field-input form-field-input profile-field-input--readonly",type:"email",value:n.email,readOnly:!0,"aria-readonly":"true"})]}),e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:"Phone"}),e.jsx("input",{className:"profile-field-input form-field-input profile-field-input--readonly",type:"text",value:n.phoneNumber,readOnly:!0,"aria-readonly":"true"})]}),e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:"LinkedIn"}),e.jsx("input",{className:"profile-field-input form-field-input",type:"text",placeholder:"https://linkedin.com/in/your-handle",value:n.linkedinProfile,onChange:a=>k("linkedinProfile",a.target.value)})]})]}),e.jsxs("div",{id:"ma-company",className:"profile-field-section form-card",children:[e.jsx("div",{className:"profile-section-kicker form-card-title",children:g.orgTitle}),e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:g.orgNameLabel}),e.jsx("input",{className:"profile-field-input form-field-input",type:"text",value:n[g.orgNameField],onChange:a=>k(g.orgNameField,a.target.value)})]}),e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:g.titleLabel}),e.jsx("input",{className:"profile-field-input form-field-input",type:"text",placeholder:g.titlePlaceholder,value:Se==="investor"?n.title:n.companyRole,onChange:a=>{Se==="investor"&&k("title",a.target.value),k("companyRole",a.target.value)}})]}),g.overview&&e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:g.overview.label}),e.jsx("textarea",{className:"profile-field-textarea form-field-textarea",placeholder:g.overview.placeholder,value:n[g.overview.field],onChange:a=>k(g.overview.field,a.target.value)})]}),g.showRevenue&&e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:"Revenue / Traction"}),e.jsx("input",{className:"profile-field-input form-field-input",type:"text",placeholder:"e.g. $50K MRR",value:n.revenue,onChange:a=>k("revenue",a.target.value)})]})]})]}),g.about&&e.jsxs("div",{className:"profile-section-wide form-card",children:[e.jsx("div",{className:"form-card-title",children:"About you"}),e.jsx("div",{className:"form-card-sub",children:g.about.hint}),e.jsxs("div",{className:"profile-form-columns form-grid-2",children:[g.about.school&&e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:"School"}),e.jsx("input",{className:"profile-field-input form-field-input",type:"text",value:n.school,onChange:a=>k("school",a.target.value)})]}),g.about.experience&&e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:"Professional experience"}),e.jsx("input",{className:"profile-field-input form-field-input",type:"text",placeholder:"Previous companies or roles",value:n.experience,onChange:a=>k("experience",a.target.value)})]})]}),g.about.traction&&e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:"Traction"}),e.jsx("textarea",{className:"profile-field-textarea form-field-textarea",value:n.traction,onChange:a=>k("traction",a.target.value)})]})]}),Me?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"sec-head",style:{marginTop:24},children:e.jsx("div",{className:"sec-h",children:"Target accounts"})}),e.jsx("div",{className:"form-card-sub",style:{marginBottom:14,color:"#888",fontSize:12.5},children:"Customers, investors, partners — anyone you want to reach."}),e.jsxs("div",{className:"icp-card",children:[e.jsxs("div",{className:"icp-head",children:[e.jsxs("div",{className:"icp-head-left",children:[e.jsx("div",{className:"icp-head-ico",children:"🎯"}),e.jsxs("div",{children:[e.jsx("div",{className:"icp-head-title",children:"Your ICP"}),e.jsx("div",{className:"icp-head-sub",children:"Who you're looking for — customers, investors, or both. We'll rank warm paths and surface accounts that match."})]})]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("button",{className:"icp-edit-btn",onClick:()=>ye(!0),children:"✎ Edit ICP"}),e.jsxs("button",{className:"make-intro-btn",onClick:()=>b("/accounts"),style:{background:"#1a1a1a",color:"#fff",border:"none"},children:[e.jsx("span",{children:"+"})," Add accounts"]})]})]}),e.jsx("div",{className:"icp-body",children:e.jsxs("div",{className:"icp-gri
1d",children:[e.jsxs("div",{className:"icp-block",children:[e.jsx("div",{className:"icp-block-lbl",children:"Who fits"}),e.jsx("div",{className:"icp-tags",children:(q.firmo??[]).length?(q.firmo??[]).map((a,c)=>e.jsx("span",{className:"icp-tag",children:a},`firmo-${c}-${a}`)):e.jsx("span",{className:"icp-empty-tag",children:"e.g. Series A SaaS or seed B2B funds"})})]}),e.jsxs("div",{className:"icp-block",children:[e.jsx("div",{className:"icp-block-lbl",children:"People to reach"}),e.jsx("div",{className:"icp-tags",children:(q.persona??[]).length?(q.persona??[]).map((a,c)=>e.jsx("span",{className:"icp-tag persona",children:a},`persona-${c}-${a}`)):e.jsx("span",{className:"icp-empty-tag",children:"e.g. VPs of RevOps, GPs"})})]}),e.jsxs("div",{className:"icp-block",children:[e.jsx("div",{className:"icp-block-lbl",children:"Signals"}),e.jsx("div",{className:"icp-tags",children:(q.signal??[]).length?(q.signal??[]).map((a,c)=>e.jsx("span",{className:"icp-tag signal",children:a},`signal-${c}-${a}`)):e.jsx("span",{className:"icp-empty-tag",children:"e.g. just raised, hiring sales"})})]})]})})]})]}):e.jsxs(e.Fragment,{children:[g.edge&&e.jsxs("div",{className:"profile-section-wide form-card",children:[e.jsx("div",{className:"form-card-title",children:g.edge.title}),e.jsx("div",{className:"form-card-sub",children:g.edge.hint}),g.edge.superpower&&e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:"Your superpower"}),e.jsx("textarea",{className:"profile-field-textarea form-field-textarea",placeholder:"What are you unusually good at?",value:n.superpower,onChange:a=>k("superpower",a.target.value)})]}),g.edge.why&&e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:"Why you're building this"}),e.jsx("textarea",{className:"profile-field-textarea form-field-textarea",value:n.why,onChange:a=>k("why",a.target.value)})]}),g.edge.motivation&&e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:"Motivation"}),e.jsx("textarea",{className:"profile-field-textarea form-field-textarea",value:n.motivation,onChange:a=>k("motivation",a.target.value)})]})]}),g.showThesis&&e.jsxs("div",{className:"profile-section-wide form-card",children:[e.jsx("div",{className:"form-card-title",children:"Thesis details"}),e.jsx("div",{className:"form-card-sub",children:"What you look for in founders and the stories you tell."}),e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:"What I look for in a founder"}),e.jsx("textarea",{className:"profile-field-textarea form-field-textarea",value:n.whatThey,onChange:a=>k("whatThey",a.target.value)})]}),e.jsxs("div",{className:"profile-field-row",children:[e.jsx("label",{className:"profile-field-lbl form-field-lbl",children:"Favourite quote / pitch style"}),e.jsx("textarea",{className:"profile-field-textarea form-field-textarea",value:n.favPitchStyle,onChange:a=>k("favPitchStyle",a.target.value)})]})]})]}),e.jsx("div",{id:"ma-how",className:"sec-head",children:e.jsx("div",{className:"sec-h",children:"Intro blurb"})}),e.jsx("div",{className:"form-card-sub",children:"How others see you when someone gets introduced."}),e.jsxs("div",{className:"profile-blurb-grid intro-blurb-grid",children:[e.jsxs("div",{className:"profile-blurb-col blurb-card",children:[e.jsx("div",{className:"blurb-card-h",children:"How others see you"}),e.jsx("div",{className:"blurb-card-sub",children:"Write this in your own words — one paragraph. This is what connectors forward when someone wants an intro to you."}),e.jsx("textarea",{className:"blurb-textarea",maxLength:500,value:n.introBlurb,onChange:a=>k("introBlurb",a.target.value),onBlur:a=>Je(a.target.value)}),e.jsxs("div",{className:"blurb-count",children:[e.jsxs("span",{children:[n.introBlurb.length," / 500 characters"]}),e.jsx("span",{children:ie?"Saving…":"Auto-saves on blur"})]})]}),e.jsxs("div",{className:"profile-blurb-preview-col blurb-card",children:[e.jsx("div",{className:"blurb-card-h",children:"Live preview"}),e.jsx("div",{className:"blurb-card-sub",children:"Exactly what the connector sees in their intro request."}),e.jsxs("div",{className:"blurb-preview-box",children:[e.jsx("div",{className:"blurb-preview-label",children:"Forwardable blurb"}),e.jsx("div",{className:"blurb-preview-text",children:n.introBlurb.trim()?`"Hey — wanted to introduce you to ${oe}. In their own words: ${n.introBlurb}"`:"Write your intro blurb on the left to see how it reads when a connector forwards it for you."}),e.jsx("div",{className:"blurb-preview-note",children:"Connectors can edit this before sending."})]})]})]})]}),ge,hs,Ce,Be]})}function an({loading:l,errorMsg:h,submitting:f,search:p,setSearch:b,entries:B,alreadyAdded:S,selectedKey:D,onPick:P,manual:r,setManual:o,onClose:W,onSubmit:I}){const F=t.useMemo(()=>{const y=new Set;for(const _ of S){_.contactUserId&&y.add(`u-${_.contactUserId}`);const te=`n-${(_.name||"").trim().toLowerCase()}|e-${(_.email||"").trim().toLowerCase()}`;y.add(te)}return y},[S]),X=p.trim(),O=X.length>0,R=t.useMemo(()=>{const y=X.toLowerCase();return y?B.filter(_=>{const te=`n-${_.name.trim().toLowerCase()}|e-${(_.email||"").trim().toLowerCase()}`;return F.has(_.key)||F.has(te)?!1:_.name.toLowerCase().includes(y)||_.role.toLowerCase().includes(y)||(_.email||"").toLowerCase().includes(y)}):[]},[B,X,F]),ie=!f&&(D!=null||r.name.trim().length>0);return e.jsx("div",{className:"modal-overlay open",onClick:W,children:e.jsxs("div",{className:"modal req-modal who-know-modal",style:{maxWidth:520},onClick:y=>y.stopPropagation(),children:[e.jsxs("div",{className:"modal-head",children:[e.jsxs("div",{children:[e.jsx("div",{className:"mod-title",children:"Add someone you can intro to"}),e.jsx("div",{className:"mod-sub",children:"Pick a teammate or contact, or enter someone new. Gemp
1here uses this to surface you as a connector when other users search for this person."})]}),e.jsx("button",{className:"mod-close",onClick:W,"aria-label":"Close",children:"×"})]}),e.jsxs("div",{className:"modal-body",children:[e.jsxs("div",{className:"fld-row who-know-network",children:[e.jsx("label",{className:"fld-lbl",children:"From your network"}),e.jsxs("div",{className:"pn-picker",children:[e.jsx(ft,{value:p,onChange:b,placeholder:"Type to search"}),e.jsx(gt,{open:O,children:e.jsxs("div",{className:"pn-list",children:[l&&e.jsx(rs,{variant:"section",message:"Loading your network…"}),!l&&R.length===0&&e.jsx("div",{className:"pn-empty",children:B.length===0?"No teammates or imported contacts yet — add someone manually below.":"No matches — try a different search or add manually below."}),!l&&R.slice(0,50).map(y=>e.jsxs("div",{className:`pn-row${D===y.key?" selected":""}`,onClick:()=>P(y.key),children:[e.jsx("div",{className:`av sm ${sn(y.name)} no-border`,children:Ws(y.name)}),e.jsxs("div",{className:"pn-info",children:[e.jsx("div",{className:"pn-name",children:y.name}),e.jsxs("div",{className:"pn-role",children:[e.jsx("span",{children:y.role}),y.source==="contact"&&e.jsx("span",{className:"pn-tag imported",children:"Imported"})]})]})]},y.key)),!l&&R.length>50&&e.jsx("div",{className:"pn-row pn-show-more",children:"Showing first 50 — refine your search to narrow down →"})]})})]})]}),e.jsx("div",{className:"who-know-divider",children:e.jsx("span",{children:"or add manually"})}),e.jsxs("div",{className:"who-know-manual",children:[e.jsx("input",{className:"who-know-field",type:"text",placeholder:"Full name",value:r.name,onChange:y=>{o({...r,name:y.target.value})},disabled:f}),e.jsx("input",{className:"who-know-field",type:"text",placeholder:"Role / title (optional)",value:r.role,onChange:y=>o({...r,role:y.target.value}),disabled:f}),e.jsx("input",{className:"who-know-field",type:"email",placeholder:"Email (optional)",value:r.email,onChange:y=>o({...r,email:y.target.value}),disabled:f}),e.jsx("input",{className:"who-know-field",type:"url",placeholder:"LinkedIn URL (optional)",value:r.linkedinUrl,onChange:y=>o({...r,linkedinUrl:y.target.value}),disabled:f}),e.jsx("p",{className:"who-know-hint",children:"We won't email or message anyone — this just tells Gemphere you're open to making a warm intro to them."})]}),h&&e.jsx("div",{className:"info-banner",style:{background:"#fdecea",borderColor:"#f3c3bb",color:"#9a3a2a",marginTop:0},children:h})]}),e.jsxs("div",{className:"modal-foot",children:[e.jsx("button",{className:"btn-foot",onClick:W,disabled:f,children:"Cancel"}),e.jsx("button",{className:"btn-foot primary",onClick:I,disabled:!ie,children:f?"Adding…":"Add to my list"})]})]})})}const ls=[{id:"ma-you",label:"You",tab:"st-profile"},{id:"ma-company",label:"Your company",tab:"st-profile"},{id:"ma-how",label:"How people see you",tab:"st-profile"},{id:"ma-integrations",label:"Connected apps",tab:"st-integrations"},{id:"ma-plan",label:"Plan",tab:"st-plans"},{id:"ma-delete",label:"Delete account",tab:"st-plans",danger:!0}],ln=new Set(["[email protected]","[email protected]"]);function xs(l){return l.toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0})}function fn(){var Ss,Cs;const{user:l,logout:h,refreshTier:f,accountType:p}=cs(),b=vt(),{isInvitedTeamMember:B}=bt(),S=B||b.isTeamMember,D=xt(),P=Rs(),r=l==null?void 0:l.userId,o=l==null?void 0:l.accessToken;Bs(!0);const W=Vt(),I=(l==null?void 0:l.fullName)||"You",F=(()=>{const s=I.replace(/\s+/g," ").trim().split(" ").filter(Boolean);return s.length>=2?(s[0][0]+s[s.length-1][0]).toUpperCase():I.slice(0,2).toUpperCase()||"?"})(),X=((l==null?void 0:l.email)||"").trim(),[O,R]=t.useState("ma-you"),[ie,y]=t.useState(!1),[_,te]=t.useState(!1),[Z,ue]=t.useState(null),be=t.useCallback(async()=>{if(!o){ue("Please sign in again to delete your account.");return}te(!0),ue(null);try{await Fs(o),h(),P("/",{replace:!0})}catch(s){ue(s instanceof Error?s.message:"Couldn't delete account."),te(!1)}},[o,h,P]),xe=t.useCallback((s,i)=>{Oe(i),R(s);const m=document.getElementById(s);m&&m.scrollIntoView({behavior:"smooth",block:"start"})},[]),Ee=t.useMemo(()=>{const s=new URLSearchParams(D.search),i=s.get("tab");return i==="plans"||i==="st-plans"?"st-plans":i==="notifications"||i==="st-notifications"?"st-notifications":i==="profile"||i==="st-profile"?"st-profile":s.get("stripe_return")==="1"||s.has("stripe_session_id")?"st-plans":"st-integrations"},[D.search]),[G,Oe]=t.useState(Ee);t.useEffect(()=>{let s=0;const i=()=>{s||(s=window.requestAnimationFrame(()=>{s=0;let m=ls[0];for(const N of ls){const $=document.getElementById(N.id);$&&$.getBoundingClientRect().top-140<=0&&(m=N)}R(N=>N===m.id?N:m.id),Oe(N=>N===m.tab?N:m.tab)}))};return window.addEventListener("scroll",i,{passive:!0}),i(),()=>{window.removeEventListener("scroll",i),s&&window.cancelAnimationFrame(s)}},[]),t.useEffect(()=>{if(!window.matchMedia("(max-width: 900px)").matches)return;const s=document.querySelector(".ma-nav");if(!s)return;const i=ls.findIndex(N=>N.id===O),m=i>=0?s.children[i]:null;if(m instanceof HTMLElement){const N=m.offsetLeft-(s.clientWidth-m.offsetWidth)/2;s.scrollTo({left:Math.max(0,N),behavior:"smooth"})}},[O]),t.useEffect(()=>{if(!new URLSearchParams(D.search).has("tab")||Ee==="st-profile")return;const m={"st-profile":"ma-you","st-integrations":"ma-integrations","st-notifications":"ma-notifications","st-plans":"ma-plan"}[Ee],N=window.setTimeout(()=>{const $=document.getElementById(m);$&&$.scrollIntoView({block:"start"})},300);return()=>window.clearTimeout(N)},[]);const[E,me]=t.useState(null),[n,le]=t.useState(!0),[V,Me]=t.useState(null),De=t.useMemo(()=>{const s=new URLSearchParams(D.search);return s.get("stripe_return")==="1"||s.has("stripe_session_id")},[D.search]),[ys,Ge]=t.useState(!1),[q,he]=t.useState(null),[_e,ye]=t.useState(!1),[je,Ke]=t.useState(null),[Ye,Ve]=t.useState(null),[ds,Ne]=t.useState(null),[us,ne]=t.useState(!1),[ze,Le]=t.useState(!1),[He,qe]=t.useState(null),[pe,Qe]=t.useState(null),[we,Ie]=t.useState(""),[z,ms]=t.useState({}),[Xe,k]=t.useState(!1),[Ze,Je]=t.useState("weekly");t.useState(!1),t.useState("");const[es,ke]=t.useState(!1),[ss,oe]=t.useState(!0),[Ae,Re]=t.useState(!1),[Se,g]=t.useState(null),[fe,ge]=t.useState(!0),[hs,Ce]=t.useState(!0),[Be,Fe]=t.useState(!1),[a,c]=t.useState(null),j=t.useRef(null),[x,d]=t.useState(!1),[C,u]=t.useState(null),[w,Q]=t.useState([]),[J,ee]=t.useState(!1),M=t.useRef(null),A=t.useCallback(()=>{var s;(s=M.current)==null||s.call(M),M.current=null,ee(!1)},[]);t.useEffect(()=>()=>{var s;(s=M.current)==null||s.call(M)},[]);const[ts,ns]=t.useState(!1),[$e,L]=t.useState(null),[as,ve]=t.useState(null),[K,Pe]=t.useState(null),[We,de]=t.useState(""),[v,ae]=t.useState(null),[T,se]=t.useState(null),Us=t.useMemo(()=>{const s=((l==null?void 0:l.email)||"").trim().toLowerCase();return ln.has(s)},[l==null?void 0:l.email]),ps=t.useMemo(()=>typeof window>"u"?"":yt(window.location.origin),[]);async function Os(){if(!o||!r){L({kind:"err",text:"Please sign in again to sync."});return}ns(!0),L(null);try{const[s,i]=await Promise.all([Dt(r,o),Gt(r,o)]),m=await s.json().catch(()=>null),N=await i.json().catch(()=>null);if(!s.ok||!(m!=null&&m.success))throw new Error(m&&m.error||`Signals sync failed (${s.status})`);const $=[];i.ok&&(N!=null&&N.success)&&(typeof N.meetings=="number"&&$.push(`${N.meetings.toLocaleStr
1ing()} meetings`),typeof N.contacts=="number"&&$.push(`${N.contacts.toLocaleString()} attendees`));const H=[];typeof m.contacts=="number"&&H.push(`${m.contacts.toLocaleString()} contacts`),typeof m.messages_scanned=="number"&&H.push(`${m.messages_scanned.toLocaleString()} emails`),$.length?H.push(...$):typeof m.events_scanned=="number"&&H.push(`${m.events_scanned.toLocaleString()} events`),L({kind:"ok",text:H.length?`Refreshed — ${H.join(", ")}.`:"Refreshed your Gmail signals."});const re=await Ts(o,r);re!=null&&re.lastSyncAt&&ve(re.lastSyncAt)}catch(s){L({kind:"err",text:s instanceof Error?s.message:"Sync failed"})}finally{ns(!1)}}async function Ms(s){var i;if(!o){u({kind:"err",text:"Please sign in again to upload."});return}d(!0),u(null),(i=M.current)==null||i.call(M),M.current=null;try{const{csv:m,parsed:N}=await Wt(s),{recovered:$}=await Ut(o,s.name,m,0);Q(N),ee(!0),M.current=Ot(o,N,Q),u({kind:"ok",text:`Imported ${N.length.toLocaleString()} LinkedIn contact${N.length===1?"":"s"}. Map your strongest relationships next.${$?" Your upload finished on the server — syncing contact ids.":""}`})}catch(m){u({kind:"err",text:m instanceof Error?m.message:"Upload failed"})}finally{d(!1)}}t.useEffect(()=>{if(!r||G!=="st-integrations")return;let s=!0;const i=async()=>{try{const N=await Et(r);if(!s)return;const $={};for(const H of N.providers){const re=(H.provider||"").toLowerCase();$[re]={status:H.status||"not",count:H.imported_count||0,error:H.last_error||null}}return ms($),$}catch{}return null};i();const m=window.setInterval(async()=>{const N=await i();if(!s||!N)return;Object.values(N).some(H=>H.status==="importing")||window.clearInterval(m)},5e3);return()=>{s=!1,window.clearInterval(m)}},[r,G]),t.useEffect(()=>{if(!o||!r||G!=="st-integrations")return;let s=!0;return(async()=>{const i=await Ts(o,r);!s||!(i!=null&&i.lastSyncAt)||ve(i.lastSyncAt)})(),()=>{s=!1}},[o,r,G]),t.useEffect(()=>{if(!o||G!=="st-integrations")return;let s=!0;return(async()=>{try{const i=await Es(o);s&&Pe(i)}catch(i){s&&se({kind:"err",text:i instanceof Error?i.message:"Couldn't load Granola status."})}})(),()=>{s=!1}},[o,G]),t.useEffect(()=>{if(!r||G!=="st-notifications")return;let s=!0;return(async()=>{try{const i=await Qt(r);if(!s)return;i!=null&&i.digestCadence&&Je(i.digestCadence)}catch{}})(),()=>{s=!1}},[r,G]),t.useEffect(()=>{if(!o||G!=="st-notifications"){G!=="st-notifications"&&oe(!1);return}let s=!1;return oe(!0),jt(o).then(i=>{s||ke(i.hideOutsideCompany)}).catch(()=>{s||ke(!1)}).finally(()=>{s||oe(!1)}),()=>{s=!0}},[o,G]),t.useCallback(async()=>{if(!o||Ae)return;const s=!es;ke(s),Re(!0),g(null);try{await Nt(o,s),g(s?"Your network is now hidden from people outside your company.":"Your network is visible to all Gemphere members.")}catch(i){ke(!s),g(i instanceof Error?i.message:"Couldn't save network visibility")}finally{Re(!1)}},[o,es,Ae]),t.useEffect(()=>{if(!o||G!=="st-notifications"){G!=="st-notifications"&&Ce(!1);return}let s=!1;return Ce(!0),wt(o).then(i=>{s||ge(i.defaultSharingEnabled)}).catch(()=>{s||ge(!0)}).finally(()=>{s||Ce(!1)}),()=>{s=!0}},[o,G]),t.useCallback(async()=>{if(!o||Be)return;const s=!fe;ge(s),Fe(!0),c(null);try{await kt(o,s),c(s?"New connectors will be able to see targets they can introduce you to.":"New connectors won't see your targets until you turn sharing on for them.")}catch(i){ge(!s),c(i instanceof Error?i.message:"Couldn't save connector sharing default")}finally{Fe(!1)}},[o,fe,Be]);const[js,Ds]=t.useState(!1),Ue=t.useRef(null);t.useEffect(()=>{if(!o||!r){le(!1);return}let s=!1;return Ue.current===null&&le(!0),(async()=>{try{const i=await os(o,Number(r));if(s)return;me(i),Ue.current=((i==null?void 0:i.plan)||"").toLowerCase()}catch{s||me(null)}finally{s||le(!1)}})(),()=>{s=!0}},[o,r]),t.useEffect(()=>{if(!o||!r||G!=="st-plans")return;let s=!1;const i=async()=>{try{const $=await os(o,Number(r));if(s)return;me($);const H=(($==null?void 0:$.plan)||"").toLowerCase(),re=(Ue.current||"").toLowerCase(),Zs=re===""||re==="free",Js=H&&H!=="free";Ue.current!==null&&Zs&&Js&&(Ds(!0),await f()),Ue.current=H}catch{if(s)return;me(null)}finally{s||le(!1)}};i();let m=null;G==="st-plans"&&(m=window.setInterval(()=>{s||i()},5e3));const N=()=>{document.visibilityState!=="visible"||s||(i(),G==="st-plans"&&o&&r&&vs(o,Number(r)).then($=>{s||$.applied&&i()}).catch(()=>{}))};return document.addEventListener("visibilitychange",N),window.addEventListener("focus",N),()=>{s=!0,m!=null&&window.clearInterval(m),document.removeEventListener("visibilitychange",N),window.removeEventListener("focus",N)}},[o,r,G,f]);const Ns=t.useRef(!1);t.useEffect(()=>{if(!De||!o||!r||Ns.current)return;Ns.current=!0;let s=!1;return(async()=>{Ge(!0),he("Confirming your seats with Stripe…");try{let i=await vs(o,Number(r));if(!i.applied){if(await new Promise(N=>setTimeout(N,3500)),s)return;i=await vs(o,Number(r))}const m=await os(o,Number(r));if(s)return;me(m),await f(),i.applied?he(`Synced ${i.seats} seat${i.seats===1?"":"s"} from Stripe.`):he("We're still waiting on Stripe to confirm your payment. If the seat count doesn't update in a minute, hit Refresh from Stripe.")}catch(i){s||he(i instanceof Error?`Couldn't sync with Stripe: ${i.message}`:"Couldn't sync with Stripe right now.")}finally{s||Ge(!1)}})(),()=>{s=!0}},[De,o,r,f]);const Te=t.useMemo(()=>!E||!E.plans||E.plans.length===0?null:E.plans[0],[E]);E&&Math.max(1,E.usage.total);const fs=E==null?void 0:E.proPlan,gs=(fs==null?void 0:fs.price_usd_per_month)??49,is=St(E==null?void 0:E.bookDemoUrl),Gs=Te?Te.seats:1e3,_s=(Te==null?void 0:Te.price_usd_per_month)??0,Ks=E?_s*E.seatLimit:0,Ys=async()=>
1{if(!o){Ne("Please sign in again.");return}ye(!0),Ne(null),ne(!1);const s=await Lt(o);if(ye(!1),!s.success||!s.url){Ne(s.error||"Could not generate trial link.");return}Ke(s.url),Ve(s.expiresAt||null)},Vs=async()=>{if(je)try{await navigator.clipboard.writeText(je),ne(!0),setTimeout(()=>ne(!1),2500)}catch{Ne("Could not copy — select the link and copy manually.")}},zs=async()=>{if(ps){qe(null);try{await navigator.clipboard.writeText(ps),Le(!0),setTimeout(()=>Le(!1),2500)}catch{qe("Could not copy. Select the link and copy manually.")}}},ws=async(s="google")=>{if(!o){Ie("Please log in again.");return}Qe(s),Ie("");try{const i=It(),m=s==="google"?At(p,b.isIndividual?"individual":(i==null?void 0:i.tier)??null):void 0;await Rt(o,s,{googleScopeTier:m})}catch(i){Qe(null),Ie(i instanceof Error?i.message:"Failed to start connect")}},Hs=async()=>{if(!o)return null;const s=await Es(o);return Pe(s),s},qs=async()=>{if(!o){se({kind:"err",text:"Please sign in again to connect Granola."});return}if(!We.trim()){se({kind:"err",text:"Paste a Granola API key that starts with grn_."});return}ae("connect"),se(null);try{const s=await Bt(o,We.trim());Pe(s),de(""),se({kind:"ok",text:"Granola connected. Run a sync to find intro mentions in recent notes."})}catch(s){se({kind:"err",text:s instanceof Error?s.message:"Could not connect Granola."})}finally{ae(null)}},Qs=async()=>{if(o){ae("sync"),se(null);try{const s=await Ft(o);await Hs();const i=Number(s.opportunities||0),m=Number(s.notesProcessed||0);se({kind:"ok",text:`Synced ${m.toLocaleString()} note${m===1?"":"s"} and found ${i.toLocaleString()} intro mention${i===1?"":"s"}.`})}catch(s){se({kind:"err",text:s instanceof Error?s.message:"Granola sync failed."})}finally{ae(null)}}},Xs=async()=>{if(o){ae("disconnect"),se(null);try{await $t(o),Pe({connected:!1,pendingOpportunities:0,totalOpportunities:0}),se({kind:"ok",text:"Granola disconnected. The API key was removed from Gemphere."})}catch(s){se({kind:"err",text:s instanceof Error?s.message:"Could not disconnect Granola."})}finally{ae(null)}}};function ks(s,i){const m=z[s];return!m||m.status==="not"?{label:i,cls:"int-status not"}:m.status==="importing"?{label:`Importing… ${m.count}`,cls:"int-status not"}:m.status==="done"?{label:"✓ Connected",cls:"int-status connected"}:m.status==="error"?{label:"Retry",cls:"int-status not"}:{label:i,cls:"int-status not"}}return e.jsxs("div",{className:"page active page-settings",children:[J?e.jsxs("div",{style:{position:"fixed",inset:0,zIndex:9999,overflow:"auto",background:"#0a1411"},children:[e.jsx("button",{type:"button",onClick:A,"aria-label":"Close",style:{position:"fixed",top:16,right:18,zIndex:1e4,width:36,height:36,borderRadius:"50%",border:"1px solid rgba(255,255,255,0.25)",background:"rgba(0,0,0,0.35)",color:"#fff",fontSize:20,lineHeight:1,cursor:"pointer"},children:"×"}),e.jsx(Ct,{active:J,token:o||"",csvContacts:w,onBack:A,onFinish:A})]}):null,e.jsx("div",{className:"ma-page-head",children:e.jsxs("div",{className:"ma-page-identity",children:[e.jsx("div",{className:"ma-page-av",children:F}),e.jsxs("div",{className:"ma-page-identity-info",children:[e.jsx("div",{className:"ma-page-name",children:I}),X?e.jsx("div",{className:"ma-page-subline",children:X}):null]})]})}
1),e.jsxs("div",{className:"ma-shell",children:[e.jsx("nav",{className:"ma-nav","aria-label":"Account sections",children:ls.map(s=>e.jsx("button",{type:"button",className:`ma-nav-item${O===s.id?" active":""}${s.danger?" danger":""}`,onClick:()=>xe(s.id,s.tab),children:s.label},s.id))}),e.jsxs("div",{className:"ma-content",children:[e.jsx("section",{id:"ma-profile-section","data-ma-section":!0,children:e.jsx(nn,{embedded:!0})}),e.jsxs("section",{id:"ma-integrations","data-ma-section":!0,children:[e.jsx("div",{className:"settings-section-kicker",children:"Connected accounts"}),e.jsx("div",{className:"settings-section-sub",children:"Connect more tools to unlock more warm paths for your team."}),e.jsxs("div",{className:"settings-int-list",children:[we&&e.jsx("div",{className:"settings-error-banner",children:we}),(()=>{var i,m;const s=ks("google","Connect");return e.jsxs("div",{className:"settings-int-row int-row",children:[e.jsx("div",{className:"int-ico gmail",children:"G"}),e.jsxs("div",{className:"int-info",children:[e.jsx("div",{className:"int-name",children:"Google Calendar"}),((i=z.google)==null?void 0:i.status)==="error"&&z.google.error?e.jsxs("div",{className:"settings-msg settings-msg--err",children:["Last error: ",z.google.error]}):null]}),e.jsx("button",{className:s.cls,disabled:pe!==null||((m=z.google)==null?void 0:m.status)==="importing",onClick:()=>ws("google"),children:pe==="google"?"Redirecting…":s.label})]})})(),(()=>{var i,m;const s=ks("microsoft","Connect");return e.jsxs("div",{className:"settings-int-row int-row",children:[e.jsx("div",{className:"int-ico outlook",children:"O"}),e.jsxs("div",{className:"int-info",children:[e.jsx("div",{className:"int-name",children:"Outlook & Microsoft 365 Calendar"}),((i=z.microsoft)==null?void 0:i.status)==="error"&&z.microsoft.error?e.jsxs("div",{className:"settings-msg settings-msg--err",children:["Last error: ",z.microsoft.error]}):null]}),e.jsx("button",{className:s.cls,disabled:pe!==null||((m=z.microsoft)==null?void 0:m.status)==="importing",onClick:()=>ws("microsoft"),children:pe==="microsoft"?"Redirecting…":s.label})]})})(),((Ss=z.google)==null?void 0:Ss.status)==="done"||((Cs=z.microsoft)==null?void 0:Cs.status)==="done"?e.jsx("div",{className:"settings-int-row settings-int-row--note int-row",children:e.jsxs("div",{className:"int-info",children:[e.jsx("button",{type:"button",className:"settings-link-btn",onClick:Os,disabled:ts,children:ts?"Refreshing — this can take 30–60s…":"Refresh emails + meetings now"}),$e?e.jsx("div",{className:`settings-msg settings-msg--${$e.kind==="ok"?"ok":"err"}`,children:$e.text}):null]})}):null,e.jsxs("div",{className:"settings-int-row int-row",children:[e.jsx("div",{className:"int-ico slack",children:"#"}),e.jsx("div",{className:"int-info",children:e.jsx("div",{className:"int-name",children:"Slack"})}),e.jsx("button",{className:"int-status not",onClick:()=>k(!0),children:"Connect"})]}),e.jsxs("div",{className:"settings-int-row int-row",children:[e.jsx("div",{className:"int-ico whatsapp",children:"W"}),e.jsx("div",{className:"int-info",children:e.jsx("div",{className:"int-name",children:"WhatsApp"})}),e.jsx("button",{className:"int-status not",onClick:()=>k(!0),children:"Connect"})]}),e.jsxs("div",{className:"settings-int-row settings-int-row--stack int-row",children:[e.jsx("div",{className:"int-ico granola",children:"G"}),e.jsxs("div",{className:"int-info",children:[e.jsx("div",{className:"int-name",children:"Granola meeting notes"}),K!=null&&K.connected?e.jsxs("div",{className:"settings-msg settings-msg--ok",children:["Connected",K.lastSyncAt?` · last sync ${new Date(K.lastSyncAt).toLocaleString()}`:"",K.pendingOpportunities?` · ${K.pendingOpportunities} pending intro mention${K.pendingOpportunities===1?"":"s"}`:""]}):e.jsxs("div",{className:"settings-granola-row",children:[e.jsx("input",{type:"password",className:"settings-granola-input",value:We,onChange:s=>de(s.target.value),placeholder:"grn_...",autoComplete:"off"}),e.jsx("button",{className:"int-status not",disabled:v!==null,onClick:qs,children:v==="connect"?"Connecting…":"Connect"})]}),K!=null&&K.lastError?e.jsxs("div",{className:"settings-msg settings-msg--err",children:["Last error: ",K.lastError]}):null,T?e.jsx("div",{className:`settings-msg settings-msg--${T.kind==="ok"?"ok":"err"}`,children:T.text}):null]}),K!=null&&K.connected?e.jsxs("div",{className:"settings-granola-actions",children:[e.jsx("button",{className:"int-status done",disabled:v!==null,onClick:Qs,children:v==="sync"?"Syncing…":"Sync notes"}),e.jsx("button",{className:"int-status not",disabled:v!==null,onClick:Xs,children:v==="disconnect"?"Disconnecting…":"Disconnect"})]}):null]}),e.jsxs("div",{className:"settings-int-row int-row",children:[e.jsx("div",{className:"int-ico linkedin",children:"in"}),e.jsxs("div",{className:"int-info",children:[e.jsx("div",{className:"int-name",children:"LinkedIn (CSV import)"}),C?e.jsx("div",{className:`settings-msg settings-msg--${C.kind==="ok"?"ok":"err"}`,children:C.text}):null]}),e.jsx("input",{ref:j,type:"file",accept:".csv,text/csv,application/vnd.ms-excel",style:{display:"none"},onChange:s=>{var m;
1const i=(m=s.target.files)==null?void 0:m[0];i&&Ms(i),s.target&&(s.target.value="")}}),e.jsx("button",{className:"int-status not",disabled:x,onClick:()=>{var s;return(s=j.current)==null?void 0:s.click()},children:x?"Uploading…":"Upload CSV"})]})]})]}),e.jsxs("section",{id:"ma-plan","data-ma-section":!0,className:"settings-plans",children:[e.jsx("h1",{className:"settings-plans-h",children:"Pricing"}),S?e.jsx("p",{className:"settings-plans-sub",children:"Your workspace is covered by your team's plan. Billing changes are managed by your team admin."}):e.jsxs("p",{className:"settings-plans-sub",children:["Go Pro for ",xs(gs),"/mo as a solo user, or book a demo for Enterprise team seats and shared workspaces."]}),Us&&e.jsxs("div",{className:"settings-callout settings-callout--warn",children:[e.jsx("div",{className:"settings-callout-title",children:"Individual onboarding link"}),e.jsx("p",{className:"settings-callout-text",children:"Share this only when someone should join as an individual founder or investor. Public onboarding defaults everyone to enterprise."}),e.jsxs("div",{className:"settings-callout-row",children:[e.jsx("input",{readOnly:!0,className:"settings-callout-input",value:ps}),e.jsx("button",{type:"button",className:"settings-btn-primary",onClick:zs,children:ze?"Copied":"Copy link"})]}),He?e.jsx("div",{className:"settings-msg settings-msg--err",children:He}):null]}),(E==null?void 0:E.canGenerateTrialLinks)&&e.jsxs("div",{className:"settings-callout settings-callout--info",children:[e.jsx("div",{className:"settings-callout-title",children:"Shareable trial links"}),e.jsxs("p",{className:"settings-callout-text",children:["Generate a link valid for ",e.jsx("strong",{children:"12 hours"}),". Anyone who onboards with it gets ",e.jsx("strong",{children:"2 weeks"})," of full access — including teammates they invite."]}),e.jsx("button",{type:"button",className:"settings-btn-accent",onClick:Ys,disabled:_e,children:_e?"Generating…":"Generate trial link"}),ds?e.jsx("div",{className:"settings-msg settings-msg--err",children:ds}):null,je?e.jsxs("div",{style:{marginTop:14},children:[e.jsxs("div",{className:"settings-callout-row",children:[e.jsx("input",{readOnly:!0,className:"settings-callout-input",value:je}),e.jsx("button",{type:"button",className:"settings-btn-secondary",onClick:Vs,children:us?"Copied":"Copy link"})]}),Ye?e.jsxs("div",{className:"settings-msg",children:["Link expires"," ",new Date(Ye).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})]}):null]}):null]}),E!=null&&E.shareTrial&&E.shareTrialEndsAt?e.jsxs("div",{className:"settings-callout settings-callout--ok",children:[e.jsx("strong",{children:"Free trial active"})," — full access through"," ",new Date(E.shareTrialEndsAt).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),". Teammates on your workspace are included."]}):null,!js&&b.isFreeSolo&&!S&&e.jsxs("div",{className:"settings-callout",children:[e.jsx("strong",{children:"Solo today — upgrade to unlock the full product."})," ","Go Pro for unlimited targets and warm-intro workflows. Need teammates?"," ",e.jsx("a",{href:is,target:"_blank",rel:"noreferrer",children:"Book a demo"})," ","for our Enterprise plan."]}),js&&e.jsxs("div",{className:"settings-callout settings-callout--ok",children:[e.jsx("strong",{children:"You're on the paid plan."}
1)," Accounts and Team just unlocked in the sidebar — invite a teammate from the Team tab to start building your shared warm-intro graph."]}),q&&e.jsx("div",{className:"settings-callout",children:q}),n?e.jsx(rs,{variant:"section",message:"Loading your plan…"}):!E||!Te?e.jsx("div",{className:"settings-callout settings-msg--err",children:"We couldn't load your plan right now. Please refresh and try again."}):e.jsxs(e.Fragment,{children:[V&&e.jsx("div",{className:"settings-callout settings-msg--err",children:V}),E.isPro?e.jsxs("div",{className:"settings-plan-card",children:[e.jsxs("div",{className:"settings-plan-head",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-plan-name",children:"Pro"}),e.jsx("div",{className:"settings-plan-tagline",children:"You're on the individual plan — target accounts, connectors, and warm intros."})]}),e.jsxs("div",{className:"settings-plan-price",children:[e.jsx("span",{className:"settings-plan-price-num",children:xs(gs)}),e.jsx("span",{children:" / mo"})]})]}),e.jsxs("div",{className:"settings-callout",style:{marginTop:16},children:[e.jsx("strong",{children:"Want to add your team?"})," Team accounts are available through our enterprise plan — shared targets, team warm paths, and seat pricing."]}),e.jsx("a",{className:"settings-checkout-btn",href:is,target:"_blank",rel:"noreferrer",style:{display:"block",textAlign:"center",textDecoration:"none",marginTop:12},children:"Book a Demo"})]}):null,!E.isPro&&b.isFreeSolo&&!S?e.jsx(Pt,{proPrice:gs,bookDemoUrl:is,onCheckoutError:Me}):null,!E.isPro&&!b.isFreeSolo&&!S?e.jsxs("div",{className:"settings-plan-card",children:[e.jsx("div",{className:"settings-plan-head",children:e.jsxs("div",{children:[e.jsx("div",{className:"settings-plan-name",children:"Enterprise"}),e.jsx("div",{className:"settings-plan-tagline",children:"Team seats, shared targets, and admin controls — talk with us to get started."})]})}),e.jsx("a",{className:"settings-checkout-btn",href:is,target:"_blank",rel:"noreferrer",style:{display:"block",textAlign:"center",textDecoration:"none",marginTop:12},children:"Book a Demo"})]}):null,e.jsxs("p",{className:"settings-plans-foot",children:["Need volume pricing, custom contracts, or SSO?"," ",e.jsx("a",{href:"mailto:[email protected]",children:"[email protected]"})]}),e.jsxs("details",{className:"settings-plans-foot",children:[e.jsx("summary",{children:"Plan details"}),e.jsxs("div",{children:["Current usage: ",E.usage.total," seat",E.usage.total===1?"":"s"," · Current purchased:"," ",E.seatLimit," seat",E.seatLimit===1?"":"s"," · Max ",Gs," · Current plan total ",xs(Ks)," / mo"]})]})]})]}),W?e.jsx("div",{className:"ma-mobile-logout",children:e.jsxs("button",{type:"button",className:"ma-mobile-logout-btn",onClick:()=>{h(),P("/")},children:[e.jsx(Tt,{size:16,strokeWidth:1.75,"aria-hidden":!0}),"Log out"]})}):null,e.jsx("section",{id:"ma-delete","data-ma-section":!0,children:e.jsxs("div",{className:"profile-danger-card form-card",children:[e.jsx("div",{className:"form-card-title",children:"Delete account"}),e.jsx("div",{className:"form-card-sub",children:"Permanently delete your Gemphere account. This removes your profile, contacts, and intro history. This cannot be undone."}),Z&&e.jsx("div",{className:"info-banner settings-msg settings-msg--err",children:Z}),e.jsx("button",{type:"button",className:"profile-danger-btn",onClick:()=>{ue(null),y(!0)},disabled:_,children:"Delete account"})]})})]})]}),ie&&e.jsx("div",{className:"modal-overlay open",onClick:()=>_?null:y(!1),children:e.jsxs("div",{className:"modal",onClick:s=>s.stopPropagation(),style:{maxWidth:460},children:[e.jsxs("div",{className:"modal-head",children:[e.jsx("div",{className:"mod-title",children:"Delete account?"}),e.jsx("button",{className:"mod-close",onClick:()=>y(!1),disabled:_,children:"×"})]}),e.jsxs("div",{className:"modal-body",children:[e.jsx("p",{style:{margin:0,color:"var(--gp-muted)",fontSize:14,lineHeight:1.5},children:"This erases your profile, your contacts, and every intro you've made or received. It cannot be undone."}),Z&&e.jsx("div",{className:"info-banner settings-msg settings-msg--err",style:{marginTop:12},children:Z})]}),e.jsxs("div",{className:"modal-foot",style:{display:"flex",justifyContent:"flex-end",gap:10},children:[e.jsx("button",{className:"save-btn-ghost",onClick:()=>y(!1),disabled:_,children:"Cancel"}),e.jsx("button",{className:"profile-danger-btn",onClick:be,disabled:_,children:_?"Deleting…":"Delete account"})]})]})}),e.jsx(Mt,{open:Xe,onClose:()=>k(!1)})]})}export{fn 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.