1import{d as w,r as o,j as e,L as h}from"./main-exKlCx7X.js";import{V as k,t as S}from"./values-analytics-B0-k6H2h.js";import{V as C,a as N}from"./ValuesStepHeader-Cl_m5CAr.js";import{l as g,s as y}from"./values-state-Csx0-Oa8.js";function z(){const f=w(),[i,x]=o.useState([]),[n,p]=o.useState([]),[v,b]=o.useState(!1),l=o.useRef(null);o.useEffect(()=>{const r=g(),a=(r.clusters??[]).filter(s=>s.words.length>0);x(a);const t=r.names??[];p(a.map((s,c)=>t[c]??"")),b(!0)},[]),o.useEffect(()=>{if(v)return l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{y({names:n,lastScreen:"/values/name"})},300),()=>{l.current&&clearTimeout(l.current)}},[n,v]);const u=i.length>0&&n.every(r=>r.trim().length>0);function q(r,a){p(t=>{const s=[...t];return s[r]=a,s})}function j(){const a=g().values??[],t=i.map((s,c)=>{const d=n[c].trim(),m=a[c];return m&&m.name===d?{...m,words:s.words,name:d}:{name:d,words:s.words}});y({values:t,names:n,statements:t.map(s=>s.statement??""),substrives:t.map(s=>s.strives??["","",""]),lastScreen:"/values/statement"}),S("values_step_completed",{step_number:3,step_name:"name"}),f({to:"/values/statement"})}return e.jsxs(k,{children:[e.jsx(C,{step:3}),e.jsx(N,{number:3,eyebrow:"One word per cluster",title:"Name each cluster.",children:e.jsx("p",{style:{fontFamily:"var(--vq-sans)",fontSize:16,lineHeight:1.55,maxWidth:640,color:"var(--vq-fg)",margin:"0 0 24px"},children:"Each cluster gets one word. Integrity. Empathy. Clarity. Fearlessness. Curiosity. Generosity. Discipline. Joy. Truth. Whatever the words inside the cluster point at. Resist the urge to pick the word that sounds most impressive. Pick the word that makes you flinch a little. That one is yours."})}),i.length===0?e.jsxs("div",{style:{padding:24,border:"1px solid var(--vq-border)",background:"var(--vq-card)",color:"var(--vq-muted-fg)",marginBottom:24},children:["You have not built any clusters yet."," ",e.jsx(h,{to:"/values/cluster",style:{color:"var(--vq-teal)"},children:"Go back to clustering."})]}):null,i.map((r,a)=>e.jsxs("div",{style:{background:"var(--vq-card)",border:"1px solid var(--vq-border)",padding:24,marginBottom:24},children:[e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8,marginBottom:16},children:r.words.map(t=>e.jsx("span",{style:{display:"inline-flex",alignItems:"center",background:"var(--vq-secondary)",border:"1px solid var(--vq-border)",color:"var(--vq-fg)",fontFamily:"var(--vq-sans)",fontSize:13,padding:"4px 12px",lineHeight:1.4},children:t},t))}),e.jsx("div",{style:{height:1,background:"var(--vq-border)",margin:"0 0 16px"}}),e.jsx("label",{style:{display:"block",fontFamily:"var(--vq-sans)",fontWeight:600,fontSize:12,letterSpacing:"0.3em",textTransform:"uppercase",color:"var(--vq-muted-fg)",marginBottom:8},children:"One word"}),e.jsx("input",{type:"text",value:n[a]??"",onChange:t=>q(a,t.target.value),placeholder:"Integrity, Empathy, Clarity, Fearlessness, Curiosity...",className:"vq-input vq-name-input"}),e.jsx("p",{style:{fontFamily:"var(--vq-sans)",fontSize:13,color:"var(--vq-muted-fg)",margin:"8px 0 0"},children:"Pick the word that makes you flinch a little. That one is yours."})]},r.id)),e.jsx("style",{children:` 2 .values-quiz .vq-name-input::placeholder { 3 font-style: italic; 4 color: var(--vq-muted-fg); 5 } 6 `}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:16,marginTop:32,flexWrap:"wrap"},children:[e.jsx(h,{to:"/values/cluster",className:"vq-btn vq-btn--ghost",children:"Back"}),e.jsx("button",{type:"button",className:"vq-btn",onClick:j,disabled:!u,style:{opacity:u?1:.45,cursor:u?"pointer":"not-allowed"},children:"Continue to statements"})]}),e.jsx("div",{style:{height:80}})]})}export{z as component};
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.