1import{r as l,j as e,u as U}from"./vendor-react-Cqt7e0tj.js";import{C as z,B as G}from"./chunk-admin-ml-BbuKWyhE.js";import{L as K}from"./LandingNavbar-Bcgcy5X-.js";import{S as x,B as u}from"./chunk-ui-core-6yN0OJdE.js";import{B as X}from"./chunk-os-runtime-CFw-FVLc.js";import{l as D,u as q}from"./chunk-runtime-data-Br6ill-z.js";import{_ as J,G as Q,aq as V,A as Z,b2 as ee,U as P,i as te,O as ae,a as se,h as re,a8 as ie,ah as B,q as ne,X as oe,ai as A,aF as le}from"./vendor-icons-DvMD_vAj.js";import{u as ce}from"./usePageMeta-IngpRSAp.js";import{p as j,c as de}from"./chunk-admin-program-admin-BU1kW5w5.js";import{m as v}from"./vendor-motion-C5n7-syP.js";import"./chunk-trust-diligence-Dj29JT06.js";import"./chunk-monetization-DPalynwV.js";import"./landingAudiences-CDM8lLXT.js";import"./roleOnboardingRoutes-CQlI-_E9.js";function me(a){if(!a||typeof a!="object")return null;const s=a.total;return typeof s=="number"&&Number.isFinite(s)&&s>=0?s:null}function xe({isAuthed:a}){const[s,i]=l.useState(()=>a?{status:"loading"}:{status:"idle"});l.useEffect(()=>{if(!a)return;let n=!1;return X.outcomes.list().then(o=>{if(n)return;const m=me(o);i(m===null?{status:"idle"}:{status:"loaded",total:m})}).catch(o=>{n||(D.debug("[OutcomeDepthTile] outcomes inventory unavailable; abstaining",{error:o instanceof Error?o.message:o}),i({status:"idle"}))}),()=>{n=!0}},[a]);const c=a&&s.status==="loaded"&&s.total>0,d=a&&s.status==="loaded"?String(s.total):a&&s.status==="loading"?"â¦":"â";return e.jsx(x,{variant:"inset",padding:"md",tone:c?"mint":"neutral",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"rounded-xl bg-[color-mix(in_srgb,var(--color-signal-secondary)_10%,transparent)] p-2.5 text-signal-secondary shrink-0",children:e.jsx(J,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[10px] font-black uppercase tracking-[0.22em] text-text-tertiary",children:"Corpus depth"}),e.jsxs("div",{className:"mt-1 flex items-baseline gap-2",children:[e.jsx("span",{className:"text-3xl font-black text-text-primary tracking-tight",children:d}),e.jsx("span",{className:"text-xs text-text-tertiary",children:"outcomes logged"})]}),e.jsx("p",{className:"mt-2 text-xs leading-relaxed text-text-tertiary",children:c?"Each labeled outcome is real ground truth that earns the model out of abstention.":"0 until your first labeled cohort. The review abstains â evidence bands, no fabricated scores â until your members complete scans and you log outcomes (step 06)."})]})]})})}const N=[{id:"capstone",icon:Q,kicker:"Template 01",title:"Capstone & classroom team formation",description:"Build student teams for project courses. Use real behavior evidence, not guesswork about who gets along.",decision:"Who pairs with whom across the class.",tone:"teal"},{id:"cohort",icon:V,kicker:"Template 02",title:"Cohort selection",description:"Help pick your accelerator or fellowship intake. See who to admit, who to pair, and where your coaching time pays off.",decision:"Admit, hold, or decline each applicant.",tone:"blue"},{id:"founder",icon:Z,kicker:"Template 03",title:"Founder / cofounder matching",description:"Pair founders in your program on evidence and a clear working agreement. Not pitch-night chemistry.",decision:"Which founders to pair into teams.",tone:"amber"}];function he(a){return N.find(s=>s.id===a)}const pe=[{step:"01",icon:ee,title:"Pick a template",body:"Choose the call you already make: capstone teams, cohort intake, or founder pairing."},{step:"02",icon:P,title:"Bring your roster",body:"Name the cohort and add the people you have. One link invites them to scan."},{step:"03",icon:te,title:"Members scan",body:"Each member does a short behavior scan. No scan means no evidence, so the review holds back."},{step:"04",icon:ae,title:"Review evidence",body:"See a ranked view. Where the signal is thin, the range widens and scores hold back."},{step:"05",icon:se,title:"You decide",body:"Admit, hold, decline, or pair. PairBright never decides for you. Your call is the record."},{step:"06",icon:re,title:"Label the outcome",body:"Tell us what actually happened. A real outcome label is the only thing that earns the model out of holding back."}],F=200,k="pairbright_run_cohort_draft";
1function ue(a){return typeof a=="string"&&N.some(s=>s.id===a)}function M(a){return a.templateId===null&&a.cohortName.trim()===""&&a.roster.length===0}function ge(a){if(M(a)){f();return}const s={templateId:a.templateId,cohortName:a.cohortName,roster:a.roster.slice(0,F)};try{localStorage.setItem(k,JSON.stringify(s))}catch{}}function fe(){let a=null;try{a=localStorage.getItem(k)}catch{return null}if(!a)return null;let s;try{s=JSON.parse(a)}catch{return f(),null}if(!s||typeof s!="object")return f(),null;const i=s,c=ue(i.templateId)?i.templateId:null,d=typeof i.cohortName=="string"?i.cohortName:"",n=Array.isArray(i.roster)?i.roster.filter(m=>typeof m=="string").slice(0,F):[],o={templateId:c,cohortName:d,roster:n};return M(o)?(f(),null):o}function f(){try{localStorage.removeItem(k)}catch{}}const ve=200,ye=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function L(a){return Array.from(new Set(a.split(/[\s,;]+/).map(s=>s.trim().toLowerCase()).filter(s=>ye.test(s))))}function Ae(){ce("Run one cohort","Bring a group you already have. Get a ranked view to help you admit, pair, or form teams. It stays honest and holds back scores until your members finish their scans.",{path:"/run-cohort"});const a=U(),{user:s}=q(),i=!!s,[c,d]=l.useState("template"),[n,o]=l.useState(null),[m,w]=l.useState(""),[y,C]=l.useState(""),[h,b]=l.useState([]),[S,_]=l.useState(!1),[R,E]=l.useState(null),g=l.useMemo(()=>he(n),[n]);l.useEffect(()=>{const t=fe();t&&(t.templateId&&o(t.templateId),t.cohortName&&w(t.cohortName),t.roster.length>0&&b([...t.roster]),t.templateId&&t.cohortName.trim().length>=2?d("launch"):t.templateId&&d("roster"))},[]);const I=()=>{const t=L(y);t.length!==0&&(b(r=>Array.from(new Set([...r,...t])).slice(0,ve)),C(""))},W=t=>{b(r=>r.filter(p=>p!==t))},$=!!n,T=m.trim().length>=2,H=async()=>{if(!(!g||!T)){if(!s){ge({templateId:n,cohortName:m,roster:h}),a("/login?role=program&signup=1",{state:{from:"/run-cohort"}});return}_(!0),E(null);try{const r=(await de.provisionCohort({name:m.trim(),status:"active",...h.length>0?{emails:h}:{}})).cohort?.id;if(!r)throw new Error("Could not set up your cohort. Please try again.");f(),a(`/admin/programs?cohort=${encodeURIComponent(r)}`)}catch(t){D.error("[RunCohort] cohort launch failed",t),E(t instanceof Error?t.message:"Could not set up your cohort. Please try again.")}finally{_(!1)}}};return e.jsxs(z,{mode:"hero",children:[e.jsx(K,{}),e.jsx("div",{className:"relative z-10 pt-28 pb-32",children:e.jsxs("section",{className:"px-6 max-w-5xl mx-auto",children:[e.jsxs(v.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.6},className:"flex flex-col gap-4 mb-10",children:[e.jsx(G,{variant:"hypothesis",label:"Run one cohort",icon:"Sparkles"}),e.jsxs("h1",{className:"text-4xl md:text-6xl font-primary font-black text-text-primary tracking-tighter leading-[0.98] max-w-3xl",children:["Bring your cohort.",e.jsx("br",{}),e.jsx("span",{className:"text-signal-secondary",children:"Get the decision view."})]}),e.jsx("p",{className:"text-base md:text-lg text-[color-mix(in_srgb,var(--color-text-secondary)_85%,transparent)] leading-relaxed max-w-2xl",children:"You already make a real call: who gets in, who pairs, how teams form. Bring the people you have. PairBright turns their scans into a clear, ranked review. When the evidence is thin, it says so and holds the score back."})]}),e.jsx("ol",{className:"flex flex-wrap items-center gap-2 mb-8 text-[11px] font-black uppercase tracking-[0.18em]",children:["template","roster","launch"].map((t,r)=>{const p={template:"01 · Template",roster:"02 · Roster",launch:"03 · Launch"},Y=c===t,O=["template","roster","launch"].indexOf(c)>r;return e.jsxs("li",{className:`inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 transition-colors ${Y?"border-[color-mix(in_srgb,var(--color-signal-secondary)_40%,transparent)] bg-[color-mix(in_srgb,var(--color-signal-secondary)_12%,transparent)] text-signal-secondary":O?"border-[color-mix(in_srgb,var(--color-signal-momentum)_30%,transparent)] text-signal-momentum":"border-[var(--color-border-default)] text-text-tertiary"}`,children:[O?e.jsx(ie,{className:"h-3 w-3"}):null,p[t]]},t)})}),c==="template"?e.jsxs(v.div,{variants:j.sectionReveal,initial:"hidden",animate:"visible",className:"space-y-6",children:[e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-5",children:N.map(t=>{const r=t.icon,p=n===t.id;return e.jsx("button",{type:"button",onClick:()=>o(t.id),"aria-pressed":p,className:"text-left outline-none focus-visible:ring-2 focus-visible:ring-signal-secondary/70 rounded-2xl",children:e.jsxs(x,{variant:"glass",tone:p?t.tone:"neutral",padding:"lg",interactive:!0,className:"h-full",children:[e.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[e.jsx("div",{className:"rounded-xl bg-[color-mix(in_srgb,var(--color-signal-secondary)_10%,transparent)] p-2.5 text-signal-secondary shrink-0",children:e.jsx(r,{className:"h-6 w-6"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[9px] font-black uppercase tracking-[0.26em] text-text-tertiary mb-1",children:t.kicker}),e.jsx("h3",{className:"text-base font-black text-text-primary leading-snug",children:t.title})]})]}),e.jsx("p",{className:"text-sm text-[color-mix(in_srgb,var(--color-text-secondary)_85%,transparent)] leading-relaxed mb-4",children:t.description}),e.jsxs("div",{className:"pt-3 border-t border-[var(--color-border-subtle)]",children:[e.jsx("div",{className:"text-[9px] font-black uppercase tracking-[0.22em] text-text-tertiary mb-1",children:"The decision you make"}),e.jsx("p",{className:"text-xs text-text-secondary",children:t.decision})]})]})},t.id)})}),e.jsx("div",{className:"flex justify-end pt-2",children:e.jsxs(u,{size:"lg",disabled:!$,onClick:()=>d("roster"),children:["Continue",e.jsx(B,{className:"ml-2 h-4 w-4"})]})})]}):null,c==="roster"?e.jsxs(v.div,{variants:j.sectionReveal,initial:"hidden",animate:"visible",className:"space-y-6",children:[e.jsxs(x,{variant:"glass",padding:"lg",className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"cohort-name",className:"block text-[11px] font-black uppercase tracking-[0.18em] text-text-tertiary mb-2",children:"Cohort name"}),e.jsx("input",{id:"cohort-name",type:"text",value:m,onChange:t=>w(t.target.value),placeholder:g?`${g.title}: Spring`:"Spring cohort",className:"w-full rounded-xl border border-[var(--color-border-default)] bg-[var(--color-glass-fill-raised)] px-4 py-3 text-text-primary outline-none focus-visible:ring-2 focus-visible:ring-signal-secondary/70"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"roster-emails",className:"block text-[11px] font-black uppercase tracking-[0.18em] text-text-tertiary mb-2",children:"Roster: paste emails"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx("input",{id:"roster-emails",type:"text",value:y,onChange:t=>C(t.target.value),onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),I())},placeholder:"[email protected], [email protected]",className:"flex-1 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-glass-fill-raised)] px-4 py-3 text-text-primary outline-none focus-visible:ring-2 focus-visible:ring-signal-secondary/70"}),e.jsxs(u,{variant:"secondary",onClick:I,disabled:L(y).length===0,children:[e.jsx(ne,{className:"mr-1.5 h-4 w-4"}),"Add"]})]}),e.jsx("p",{className:"mt-2 text-xs text-text-tertiary",children:"Separate emails with a comma, space, or new line. You can also invite people later from the review."})]}),h.length>0?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-black uppercase tracking-[0.18em] text-text-tertiary",children:[e.jsx(P,{className:"h-3.5 w-3.5"}),h.length," on the roster"]}),e.jsx("ul",{className:"flex flex-wrap gap-2",children:h.map(t=>e.jsxs("li",{className:"inline-flex items-center gap-2 rounded-full border border-[var(--color-border-default)] bg-[var(--color-glass-fill-base)] px-3 py-1 text-xs text-text-secondary",children:[e.jsx("span",{className:"max-w-[12rem] truncate",children:t}),e.jsx("button",{type:"button",onClick:()=>W(t),"aria-label":`Remove ${t}`,className:"text-text-tertiary hover:text-semantic-danger transition-colors",children:e.jsx(oe,{className:"h-3 w-3"})})]},t))})]}):e.jsx(x,{variant:"outline",padding:"md",children:e.jsx("p",{className:"text-xs text-text-tertiary text-center",children:"No roster yet. Add the people you already have. Or continue now and invite them from the review."})})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2",children:[e.jsxs(u,{variant:"ghost",onClick:()=>d("template"),children:[e.jsx(A,{className:"mr-2 h-4 w-4"}),"Back"]}),e.jsxs(u,{size:"lg",disabled:!T,onClick:()=>d("launch"),children:["Continue",e.jsx(B,{className:"ml-2 h-4 w-4"})]})]})]}):null,c==="launch"?e.jsxs(v.div,{variants:j.sectionReveal,initial:"hidden",animate:"visible",className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_320px] gap-5",children:[e.jsxs(x,{variant:"glass",padding:"lg",className:"space-y-4",children:[e.jsx("div",{className:"text-[10px] font-black uppercase tracking-[0.26em] text-text-tertiary",children:"Ready to launch"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs(x,{variant:"inset",padding:"md",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-text-tertiary mb-1",children:"Template"}),e.jsx("div",{className:"text-sm font-bold text-text-primary",children:g?.title??"â"})]}),e.jsxs(x,{variant:"inset",padding:"md",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-text-tertiary mb-1",children:"Cohort"}),e.jsx("div",{className:"text-sm font-bold text-text-primary",children:m.trim()||"â"})]}),e.jsxs(x,{variant:"inset",padding:"md",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-text-tertiary mb-1",children:"Roster"}),e.jsx("div",{className:"text-sm font-bold text-text-primary",children:h.length>0?`${h.length} invited`:"Invite later"})]}),e.jsxs(x,{variant:"inset",padding:"md",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-text-tertiary mb-1",children:"Decision"}),e.jsx("div",{className:"text-sm font-bold text-text-primary",children:g?.decision??"â"})]})]}),R?e.jsx("div",{role:"alert",className:"rounded-xl border border-[color-mix(in_srgb,var(--color-semantic-danger)_24%,transparent)] bg-[
1color-mix(in_srgb,var(--color-semantic-danger)_8%,transparent)] px-4 py-3 text-sm text-semantic-danger",children:R}):null,e.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-3 pt-1",children:[e.jsxs(u,{variant:"ghost",onClick:()=>d("roster"),children:[e.jsx(A,{className:"mr-2 h-4 w-4"}),"Back"]}),e.jsxs(u,{size:"lg",disabled:S,onClick:()=>{H()},children:[S?"Setting upâ¦":s?"Launch cohort & open review":"Sign in to launch your cohort",e.jsx(le,{className:"ml-2 h-4 w-4"})]})]}),s?null:e.jsx("p",{className:"text-xs text-text-tertiary",children:"Your template and roster stay on this device until you sign in to save them. Nothing is sent yet."})]}),e.jsx(xe,{isAuthed:i})]}),e.jsxs(x,{variant:"glass",padding:"lg",children:[e.jsx("div",{className:"text-[10px] font-black uppercase tracking-[0.26em] text-text-tertiary mb-4",children:"What happens next"}),e.jsx("ol",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:pe.map(t=>{const r=t.icon;return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("div",{className:"rounded-lg bg-[color-mix(in_srgb,var(--color-signal-primary)_10%,transparent)] p-2 text-signal-primary shrink-0 h-fit",children:e.jsx(r,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm font-black text-text-primary",children:[t.step," · ",t.title]}),e.jsx("p",{className:"mt-1 text-xs text-text-tertiary leading-relaxed",children:t.body})]})]},t.step)})})]})]}):null]})})]})}export{Ae as RunCohort,Ae 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.