1import{r as d,j as e,a as f}from"./index-DVkwpmat.js";import{u as F}from"./useQuery-CAN3jwvw.js";import{u as N}from"./grid-3x3-B7jJ0oVs.js";import{S as v}from"./search-op0hHpcD.js";import{L as y}from"./loader-circle-dlCz7Hl8.js";import{U as M}from"./users-yP41BLY5.js";import{S as L}from"./star-5AOCdhk7.js";import{C as $}from"./circle-check-big-DEVcv8Dr.js";import{P as g}from"./phone-wcneXLPx.js";import{C as A}from"./chevron-right-DQEZ8d97.js";import{B as w}from"./brain-CQSs3qEQ.js";import{S as C}from"./sparkles-Bsph41kn.js";import{T as b}from"./target-MuVGPDtG.js";import{T as k}from"./trending-up-Bj43wjbS.js";import{C as B}from"./clock-D7OWamQT.js";import{C as E}from"./check-CZMoiS4Z.js";import{C as I}from"./copy-Cku-r2Xi.js";import{E as W}from"./eye-D5M_aQhq.js";async function T(t){try{const s=await fetch(t,{credentials:"include"});return s.ok?await s.json():null}catch{return null}}function S({text:t}){const[s,a]=d.useState(!1);return e.jsxs("button",{onClick:l=>{l.stopPropagation(),navigator.clipboard.writeText(t),a(!0),setTimeout(()=>a(!1),2e3)},className:"flex items-center gap-1 px-2 py-1 text-xs rounded-md border border-gray-200 text-gray-500 hover:bg-gray-50 transition-all",children:[s?e.jsx(E,{className:"w-3 h-3 text-emerald-500"}):e.jsx(I,{className:"w-3 h-3"}),s?"Copied":"Copy"]})}function P(t){return t.split(` 2`).map((s,a)=>
2{if(s.startsWith("### "))return e.jsx("h3",{className:"text-base font-bold mt-3 mb-1.5 text-gray-900",children:s.slice(4)},a);if(s.startsWith("## "))return e.jsx("h2",{className:"text-lg font-bold mt-4 mb-2 text-gray-900",children:s.slice(3)},a);if(s.startsWith("# "))return e.jsx("h1",{className:"text-xl font-bold mt-5 mb-2 text-gray-900",children:s.slice(2)},a);if(s.startsWith("- ")||s.startsWith("* "))return e.jsxs("div",{className:"flex gap-2 ml-4 my-0.5",children:[e.jsx("span",{className:"text-indigo-400 mt-1 text-xs",children:"â¢"}),e.jsx("span",{className:"text-gray-700 text-sm",children:s.slice(2)})]},a);if(s.match(/^\d+\.\s/)){const i=s.match(/^(\d+)\.\s(.*)$/);if(i)return e.jsxs("div",{className:"flex gap-2 ml-4 my-0.5",children:[e.jsxs("span",{className:"text-indigo-500 font-medium text-sm",children:[i[1],"."]}),e.jsx("span",{className:"text-gray-700 text-sm",children:i[2]})]},a)}if(s.startsWith("> "))return e.jsx("blockquote",{className:"border-l-4 border-indigo-300 pl-3 italic text-gray-600 my-2 text-sm",children:s.slice(2)},a);if(s.trim()==="")return e.jsx("div",{className:"h-1.5"},a);const l=s.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>");return e.jsx("p",{className:"text-gray-700 my-0.5 text-sm leading-relaxed",dangerouslySetInnerHTML:{__html:l}},a)})}function q({members:t}){const s=d.useMemo(()=>{const a={},l={};return t.forEach(i=>{a[i.tier||"unknown"]=(a[i.tier||"unknown"]||0)+1,l[i.status||"active"]=(l[i.status||"active"]||0)+1}),{tiers:a,statuses:l,total:t.length}},[t]);return e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4 flex items-center gap-3",children:[e.jsx("div",{className:"p-2.5 rounded-lg bg-indigo-50 text-indigo-600",children:e.jsx(M,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-gray-900",children:s.total}),e.jsx("div",{className:"text-xs text-gray-500",children:"Total Members"})]})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4 flex items-center gap-3",children:[e.jsx("div",{className:"p-2.5 rounded-lg bg-amber-50 text-amber-600",children:e.jsx(L,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-gray-900",children:s.tiers.premium||0}),e.jsx("div",{className:"text-xs text-gray-500",children:"Premium"})]})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4 flex items-center gap-3",children:[e.jsx("div",{className:"p-2.5 rounded-lg bg-emerald-50 text-emerald-600",children:e.jsx($,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-gray-900",children:s.statuses.active||s.total}),e.jsx("div",{className:"text-xs text-gray-500",children:"Active"})]})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4 flex items-center gap-3",children:[e.jsx("div",{className:"p-2.5 rounded-lg bg-purple-50 text-purple-600",children:e.jsx(g,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-gray-900",children:"â"}),e.jsx("div",{className:"text-xs text-gray-500",children:"Calls This Week"})]})]})]})})}function R({member:t,onSelect:s}){var l;const a={premium:"bg-amber-100 text-amber-700 border-amber-200",standard:"bg-blue-100 text-blue-700 border-blue-200"};return e.jsxs("button",{onClick:s,className:"w-full bg-white rounded-xl border border-gray-200 p-4 text-left hover:shadow-md hover:border-indigo-200 transition-all group",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-indigo-500 to-purple-500 flex items-center justify-center text-white font-bold text-sm",children:(l=t.name)==null?void 0:l.split(" ").map(i=>i[0]).join("").substring(0,2).toUpperCase()}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-gray-900 text-sm group-hover:text-indigo-600 transition-colors",children:t.name}),e.jsx("p",{className:"text-xs text-gray-500",children:t.niche||"Niche not set"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[t.tier&&e.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-semibold uppercase border ${a[t.tier]||a.standard}`,children:t.tier}),e.jsx(A,{className:"w-4 h-4 text-gray-400 group-hover:text-indigo-500"})]})]}),t.email&&e.jsx("p",{className:"text-[11px] text-gray-400 mt-2 ml-[52px]",children:t.email})]})}function G({member:t,onBack:s}){var h;
2const[a,l]=d.useState("overview"),[i,j]=d.useState(null),[o,p]=d.useState(null),{data:n}=F({queryKey:["/api/evolution/foundation-blueprint",t.id],queryFn:()=>T(`/api/evolution/foundation-blueprint?memberId=${t.id}`)}),c=N({mutationFn:async()=>(await(await f("POST","/api/synth/ask",{question:`Generate a comprehensive member intelligence profile for ${t.name}. 3 4Member Info: 5- Name: ${t.name} 6- Niche: ${t.niche||"Unknown"} 7- Tier: ${t.tier||"Standard"} 8- Email: ${t.email||"N/A"} 9${n?`- Foundation Blueprint: ${JSON.stringify(n).substring(0,500)}`:"- No Foundation Blueprint on file"} 10 11Create a detailed profile including: 121. **Member Snapshot** â Quick overview of who they are and where they are in their journey 132. **Strengths & Assets** â What they bring to the table based on available data 143. **Key Opportunities** â Specific areas where they can grow, tied to Evolution modules 154. **Recommended Next Steps** â 3-5 concrete actions ranked by priority 165. **Coaching Notes** â Topics to explore in next call, potential blockers, motivational triggers 176. **Content Suggestions** â What kind of content they should be creating based on their stage`,conversationHistory:[]})).json()).answer,onSuccess:r=>p(r)}),x=N({mutationFn:async()=>(await(await f("POST","/api/synth/ask",{question:`Generate a coaching call prep sheet for an upcoming call with ${t.name}. 18 19Member Info: 20- Name: ${t.name} 21- Niche: ${t.niche||"Unknown"} 22- Tier: ${t.tier||"Standard"} 23${n?"- Foundation Blueprint completed: Yes":"- Foundation Blueprint: Not yet completed"} 24 25Create a detailed call prep including: 261. **Quick Context** â Who they are, their stage, what they're working on 272. **Conversation Starters** â 3 natural openers based on their situation 283. **Key Questions to Ask** â 5 strategic questions to uncover progress and blockers 294. **Topics to Cover** â Prioritized list of coaching topics 305. **Relevant Frameworks** â Which Evolution frameworks to reference (and specific talking points) 316. **Action Items to Propose** â 3 specific homework items for after the call 327. **Watch For** â Red flags, potential objections, or opportunities to notice`,conversationHistory:[]})).json()).answer,onSuccess:r=>j(r)}),u=[{id:"overview",label:"Overview",icon:W},{id:"prep",label:"Call Prep",icon:g},{id:"blueprint",label:"Blueprint",icon:b},{id:"progress",label:"Progress",icon:k}];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("button",{onClick:s,className:"p-2 rounded-lg border border-gray-200 text-gray-500 hover:bg-gray-50 transition-all",children:e.jsx(A,{className:"w-4 h-4 rotate-180"})}),e.jsx("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-indigo-500 to-purple-500 flex items-center justify-center text-white font-bold text-lg shadow-lg",children:(h=t.name)==null?void 0:h.split(" ").map(r=>r[0]).join("").substring(0,2).toUpperCase()}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h2",{className:"text-xl font-bold text-gray-900",children:t.name}),e.jsxs("div",{className:"flex items-center gap-3 text-sm text-gray-500",children:[t.niche&&e.jsx("span",{children:t.niche}),t.tier&&e.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-semibold uppercase bg-amber-100 text-amber-700 border border-amber-200",children:t.tier})]})]})]}),e.jsx("div",{className:"flex gap-2 bg-gray-100 rounded-xl p-1.5",children:u.map(r=>e.jsxs("button",{onClick:()=>l(r.id),className:`flex-1 flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all ${a===r.id?"bg-white shadow-md text-gray-900":"text-gray-500 hover:text-gray-700"}`,children:[e.jsx(r.icon,{className:"w-4 h-4"}),r.label]},r.id))}),a==="overview"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h3",{className:"font-semibold text-gray-900 flex items-center gap-2",children:[e.jsx(w,{className:"w-5 h-5 text-indigo-500"})," AI Member Profile"]}),e.jsx("button",{onClick:()=>c.mutate(),disabled:c.isPending,className:"flex items-center gap-2 px-3 py-1.5 bg-indigo-600 text-white rounded-lg text-xs font-medium hover:bg-indigo-700 disabled:opacity-50 transition-all",children:c.isPending?e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-3.5 h-3.5 animate-spin"})," Generating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(C,{className:"w-3.5 h-3.5"})," Generate Profile"]})})]}),o?e.jsxs("div",{children:[e.jsx("div",{className:"flex justify-end mb-2",children:e.jsx(S,{text:o})}),e.jsx("div",{className:"text-sm leading-relaxed",children:P(o)})]}):e.jsxs("div",{className:"text-center py-8 text-gray-400",children:[e.jsx(w,{className:"w-10 h-10 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:'Click "Generate Profile" to create an AI-powered member intelligence report'})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:[e.jsx("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Contact"}),e.jsx("p",{className:"text-sm text-gray-700",children:t.email||"No email on file"})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:[e.jsx("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Niche"}),e.jsx("p",{className:"text-sm text-gray-700",children:t.niche||"Not specified"})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:[e.jsx("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Tier"}),e.jsx("p",{className:"text-sm text-gray-700 capitalize",children:t.tier||"Standard"})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:[e.jsx("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Status"}),e.jsx("p",{className:"text-sm text-gray-700 capitalize",children:t.status||"Active"})]})]})]}),a==="prep"&&e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h3",{className:"font-semibold text-gray-900 flex items-center gap-2",children:[e.jsx(g,{className:"w-5 h-5 text-emerald-500"})," Call Prep Sheet"]}),e.jsx("button",{onClick:()=>x.mutate(),disabled:x.isPending,className:"flex items-center gap-2 px-3 py-1.5 bg-emerald-600 text-white rounded-lg text-xs font-medium hover:bg-emerald-700 disabled:opacity-50 transition-all",children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-3.5 h-3.5 animate-spin"})," Preparing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(C,{className:"w-3.5 h-3.5"})," Generate Call Prep"]})})]}),i?e.jsxs("div",{children:[e.jsx("div",{className:"flex justify-end mb-2",children:e.jsx(S,{text:i})}),e.jsx("div",{className:"text-sm leading-relaxed",children:P(i)})]}):e.jsxs("div",{className:"text-center py-8 text-gray-400",children:[e.jsx(g,{className:"w-10 h-10 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"Generate a coaching c
32all prep sheet with questions, frameworks, and action items"})]})]}),a==="blueprint"&&e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-5 space-y-4",children:[e.jsxs("h3",{className:"font-semibold text-gray-900 flex items-center gap-2",children:[e.jsx(b,{className:"w-5 h-5 text-violet-500"})," Foundation Blueprint"]}),n?e.jsx("div",{className:"space-y-3",children:Object.entries(n).filter(([r])=>!["id","userId","createdAt","updatedAt"].includes(r)).map(([r,m])=>e.jsxs("div",{className:"bg-gray-50 rounded-lg p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1",children:r.replace(/([A-Z])/g," $1").trim()}),e.jsx("p",{className:"text-sm text-gray-700",children:String(m)||"â"})]},r))}):e.jsxs("div",{className:"text-center py-8 text-gray-400",children:[e.jsx(b,{className:"w-10 h-10 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"Foundation Blueprint not yet completed by this member"}),e.jsx("p",{className:"text-xs text-gray-300 mt-1",children:"They'll complete this in their Evolution portal Command Center"})]})]}),a==="progress"&&e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[e.jsxs("h3",{className:"font-semibold text-gray-900 flex items-center gap-2 mb-4",children:[e.jsx(k,{className:"w-5 h-5 text-purple-500"})," Evolution Progress"]}),e.jsx("div",{className:"space-y-3",children:[{module:"Foundation Blueprint",phase:"Foundation",status:n?"completed":"not started"},{module:"Launch Preparation",phase:"Foundation",status:"not started"},{module:"Launch Attract",phase:"Launch Protocol",status:"not started"},{module:"Launch Convert",phase:"Launch Protocol",status:"not started"},{module:"Launch Deliver",phase:"Launch Protocol",status:"not started"},{module:"Community Networking",phase:"Community Growth",status:"not started"},{module:"Community Discovery",phase:"Community Growth",status:"not started"},{module:"Content Foundation",phase:"Content Authority",status:"not started"},{module:"First Content Piece",phase:"Content Authority",status:"not started"},{module:"Content System",phase:"Content Authority",status:"not started"},{module:"Community Culture",phase:"Scale",status:"not started"},{module:"Program Mastery",phase:"Scale",status:"not started"}].map((r,m)=>e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg hover:bg-gray-50",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center text-xs font-bold text-white shadow-sm ${r.status==="completed"?"bg-emerald-500":r.status==="in progress"?"bg-amber-500":"bg-gray-300"}`,children:m+1}),e.jsxs("div",{className:"flex-1",children:[e.jsx("span",{className:"text-sm font-medium text-gray-900",children:r.module}),e.jsx("span",{className:"text-xs text-gray-400 ml-2",children:r.phase})]}),e.jsx("div",{className:"flex items-center gap-1.5",children:r.status==="completed"?e.jsxs(e.Fragment,{children:[e.jsx($,{className:"w-4 h-4 text-emerald-500"}),e.jsx("span",{className:"text-xs text-emerald-600 font-medium",children:"Done"})]}):r.status==="in progress"?e.jsxs(e.Fragment,{children:[e.jsx(B,{className:"w-4 h-4 text-amber-500"}),e.jsx("span",{className:"text-xs text-amber-600 font-medium",children:"In Progress"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-300"}),e.jsx("span",{className:"text-xs text-gray-400",children:"Not Started"})]})})]},m))})]})})]})}function ie(){const[t,s]=d.useState(""),[a,l]=d.useState(null),{data:i,isLoading:j}=F({queryKey:["/api/evolution/members"],queryFn:()=>T("/api/evolution/members")}),o=(i==null?void 0:i.members)||[],p=d.useMemo(()=>{if(!t)return o;const n=t.toLowerCase();return o.filter(c=>{var x,u,h;return((x=c.name)==null?void 0:x.toLowerCase().includes(n))||((u=c.niche)==null?void 0:u.toLowerCase().includes(n))||((h=c.email)==null?void 0:h.toLowerCase().includes(n))})},[o,t]);return a?e.jsx(G,{member:a,onBack:()=>l(null)}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-center mb-4",children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Member Intelligence"}),e.jsx("p",{className:"text-gray-500",children:"AI-powered profiles, call prep, progress tracking, and coaching insights for every Evolution member."})]}),e.jsx(q,{members:o}),e.jsxs("div",{className:"relative",children:[e.jsx(v,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",placeholder:"Search members by name, niche, or email...",value:t,onChange:n=>s(n.target.value),className:"w-full pl-10 pr-4 py-2.5 border border-gray-200 rounded-xl text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-500"})]}),j?e.jsxs("div",{className:"flex items-center justify-center py-16",children:[e.jsx(y,{className:"w-6 h-6 animate-spin text-indigo-500"}),e.jsx("span",{className:"ml-2 text-sm text-gray-500",children:"Loading members..."})]}):p.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:p.map(n=>e.jsx(R,{member:n,onSelect:()=>l(n)},n.id))}):o.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx(M,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500 font-medium",children:"No Evolution members found"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"Members will appear here once they're added to the system."})]}):e.jsxs("div",{className:"text-center py-16",children:[e.jsx(v,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),e.jsxs("p",{className:"text-gray-500 font-medium",children:['No members matching "',t,'"']})]})]})}export{ie 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.