PageSourceSearch

https://nyanza.ai/assets/Plan-CVfpvOOA.js

js nyanza.ai collected 2026-10-02 01:12:04 UTC 54,778 bytes, 8 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PersonaAvatar-C_QuAGLe.js","assets/react-TITiJaTY.js","assets/three-tOwceFWS.js","assets/avatars-DJw3usWC.js","assets/memory-BnxUEnat.js","assets/llm-CdWZ4qgd.js","assets/shared-lite-BOZiOCY1.js","assets/shared-lite-NJdqmnyq.css"])))=>i.map(i=>d[i]);
2import{f as ge,r as h,j as e,L as ee,_ as ns,m as is}from"./react-TITiJaTY.js";import{A as me}from"./AppHeader-Bv7bfOUu.js";import{S as pe}from"./SectionTabs-DD1NeLsB.js";import{a as ye,j as fe,k as je,au as os,av as ls,aw as Ie,ax as cs,Z as ds,ar as Ke,c as ms,S as ps,l as us,F as hs,al as xs}from"./App-Dli7sJFM.js";import{G as Le,H as gs,I as ys,J as fs,K as js,L as bs}from"./llm-CdWZ4qgd.js";import{ag as Ae,T as vs}from"./memory-BnxUEnat.js";import{buildGrounding as Ve}from"./skills-D6BqwXZN.js";import{u as ws,a as ks,b as Ns,s as Ss,r as Oe,c as Cs,d as De,e as $s,t as Is}from"./roadmaps-wk75zCxK.js";import{u as As,P as Rs,g as ve,a as we,b as Es,d as Ts,e as Je}from"./prepareLineage-DS9LiRiC.js";import{I}from"./shared-lite-BOZiOCY1.js";import{S as le}from"./Skeleton-BCU2RlMF.js";import{m as _,A as Ze}from"./motion-DheP8iPc.js";import{g as ne,o as Qe}from"./index-D0VpW5-F.js";import{m as Ps}from"./motionPreference-URsTOoht.js";import{A as Ms}from"./AgentActivity-ClnQdxzU.js";import{u as zs,E as Be}from"./prepareEvidence-s0xKtrhE.js";import{c as qs,l as Fe}from"./level-BOAP7PXo.js";import"./podcastDeviceState-B0NlAIS7.js";import"./jobs-ChirZhp9.js";import"./roleReadinessAssessment-CQFunQR_.js";import"./conversationalCapabilities-Bb0rm-l7.js";async function Ls(t,o=1){const c=new URLSearchParams({part:"snippet",q:t,maxResults:String(o),type:"video",videoEmbeddable:"true",relevanceLanguage:"en",safeSearch:"strict"}),n=await fetch(`/youtube/search?${c.toString()}`);if(!n.ok){const m=new Error(`YouTube search failed (${n.status}).`);throw m.status=n.status,m}const a=await n.json();if(a.error){const m=new Error(a.error.message||"YouTube error");throw m.status=403,m}return(a.items||[]).filter(m=>{var i;return(i=m.id)==null?void 0:i.videoId}).map(m=>{var i,E;return{videoId:m.id.videoId,title:((i=m.snippet)==null?void 0:i.title)||"Video",channel:((E=m.snippet)==null?void 0:E.channelTitle)||"",url:`https://www.youtube.com/watch?v=${m.id.videoId}`}})}const Os=t=>Ae(t,{langs:!0,repos:!0,pubs:!0,cap:4e3}),Ds=(t,o)=>Ve(t,o?`skills, projects and experience relevant to ${o}`:"").then(c=>[Os(t),c].filter(Boolean).join(`
3
4`)),Bs={course:"cap",project:"tool",reading:"book",practice:"target"};function Fs({embedded:t=!1}={}){var ie,r,g,q,F,te,K;ge();const{profile:o}=ye(),c=fe(),n=je(c),a=ws(),m=As(),i=ks(a),E=(m.items||[]).filter(s=>s.targetId===(n==null?void 0:n.id)&&s.entityType===Rs.REPLAN&&s.originatingFeature==="prepare-reassessment").sort((s,l)=>String(l.updatedAt||"").localeCompare(String(s.updatedAt||""))),N=!!(n&&i&&(i.targetId?i.targetId!==n.id:i.kind!=="job"||((ie=i.target)==null?void 0:ie.trim().toLowerCase())!==n.role.toLowerCase())),[y,v]=h.useState(!1),[f,M]=h.useState("job"),[B,L]=h.useState((n==null?void 0:n.role)||o.targetRole||""),[P,W]=h.useState(!1),[A,H]=h.useState(""),[j,d]=h.useState({}),[u,S]=h.useState(""),w=s=>{var D,J;if(!["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(s.key))return;s.preventDefault();const l=["job","learning"],x=Math.max(0,l.indexOf(s.currentTarget.dataset.kind)),p=s.key==="Home"?0:s.key==="End"?l.length-1:(x+(s.key==="ArrowRight"||s.key==="ArrowDown"?1:-1)+l.length)%l.length,k=l[p];M(k),(J=(D=s.currentTarget.parentElement)==null?void 0:D.querySelector(`[data-kind="${k}"]`))==null||J.focus()};h.useEffect(()=>{a.items.length||v(!0)},[a.items.length]),h.useEffect(()=>{var s;if(n){f==="job"&&L(n.role);for(const l of a.items)!l.targetId&&l.kind==="job"&&((s=l.target)==null?void 0:s.trim().toLowerCase())===n.role.toLowerCase()&&Ns(l.id,n.id)}},[n==null?void 0:n.id,n==null?void 0:n.role,a.items,f]);const O=async(s,l,{allowFallback:x=!0}={})=>{let p;try{if(p=await gs({role:s,kind:l,profileSummary:await Ds(o,s)}),!p.milestones.length)throw new Error("empty");return{data:p,isFallback:!1}}catch(k){return x?(p={...Le(_s(s)),_genericFallback:!0},{data:p,isFallback:!0}):{data:null,isFallback:!1,error:k}}},z=(s,l,x,p)=>{var k;(k=s.gaps)!=null&&k.length&&x&&Ie(s.gaps,l==="learning"?"learning":"roadmap",{targetId:x,sourceId:p,status:"proposed",provenance:{originatingFeature:"roadmap",generatedBy:"model",estimateOnly:!0}})},U=(s,l,x)=>{if(!s||!x)return l;const p=cs().items.filter(D=>D.targetId===x),k=(l.milestones||[]).map((D,J)=>{const re=Array.isArray(D.skills)?D.skills:[],oe=p.filter(be=>re.some(rs=>ds(rs,be.topic))).map(be=>be.id),he=`roadmap_task_${s}_${J}`,ze=D.expectedProof||(re.length?`Attach a work sample or demonstrated application of ${re.join(", ")}.`:"Record what you produced or demonstrated; checking this task alone is activity completion."),qe={id:he,targetId:x,originatingFeature:"roadmap",sourceRefs:[{ref:s,t
4ype:"roadmap"}],payload:{roadmapId:s,milestoneIndex:J,title:D.title||`Milestone ${J+1}`,gapIds:oe,expectedProof:ze,activityStatus:"not-complete",proofStatus:"not-provided"},confirmationStatus:"proposed"};return ve(he)?we(he,qe,{reasonCode:"roadmap-regenerated"}):Es(qe),{...D,gapIds:oe,expectedProof:ze,actionTaskId:he}});return{...l,milestones:k}},Y=async s=>{s==null||s.preventDefault();const l=B.trim();if(!l||P||!n||f==="job"&&(!n||l.toLowerCase()!==n.role.toLowerCase()))return;W(!0),H("");const{data:x,isFallback:p}=await O(l,f),k=Cs({title:l,kind:f,target:l,targetId:(n==null?void 0:n.id)||"",data:x});if(!k){W(!1);return}p||(z(x,f,n==null?void 0:n.id,k),De(k,U(k,x,n==null?void 0:n.id)),os()),L(""),v(!1),W(!1)},T=async()=>{var l,x;if(!i||P)return;W(!0),H("");const{data:s}=await O(i.target||i.title,i.kind,{allowFallback:!1});if(!s){H("Refresh failed. Your existing plan and its gap links are unchanged. Check your AI engine settings or try again."),W(!1);return}if(De(i.id,U(i.id,s,i.targetId)),!((l=i.data)!=null&&l._genericFallback)){const p=i.kind==="learning"?"learning":"roadmap";(((x=i.data)==null?void 0:x.gaps)||[]).forEach(k=>{try{ls(k,p,{targetId:i.targetId,sourceId:i.id})}catch{}})}z(s,i.kind,i.targetId,i.id),W(!1)},C=s=>{window.confirm("Delete this roadmap? Your progress on it will be lost.")&&$s(s)},$=(s,l)=>{var D,J,re,oe;const x=(J=(D=s==null?void 0:s.data)==null?void 0:D.milestones)==null?void 0:J[l],p=!((re=s==null?void 0:s.done)!=null&&re[l]);if(Is(s.id,l),!(x!=null&&x.actionTaskId))return;const k=ve(x.actionTaskId);k&&we(x.actionTaskId,{payload:{...k.payload||{},activityStatus:p?"complete":"not-complete",proofStatus:((oe=k.payload)==null?void 0:oe.proofStatus)||"not-provided"},confirmationStatus:p?"confirmed":"proposed",personConfirmed:p,confirmedBy:p?"person":""},{reasonCode:p?"activity-completed":"activity-reopened"})},b=async(s,l)=>{const x=`${i.id}-${s}`;d(p=>({...p,[x]:{title:"Finding...",url:"#",busy:!0}}));try{const[p]=await Ls(`${l.title} ${i.target||""} tutorial`.trim(),1);d(k=>({...k,[x]:p||{title:"No video found",url:"#"}}))}catch(p){const k=(p==null?void 0:p.status)===503?"Add a YouTube API key to enable video lessons":(p==null?void 0:p.status)===429||(p==null?void 0:p.status)===403?"Video lessons are busy right now - try again later":"Couldn't find a video lesson - try again";d(D=>({...D,[x]:{title:k,url:"#"}}))}},R=i!=null&&i.data?Le(i.data):null,Me=!!((r=i==null?void 0:i.data)!=null&&r._genericFallback),X=(i==null?void 0:i.done)||[],Z=X.filter(Boolean).length,V=((g=R==null?void 0:R.milestones)==null?void 0:g.length)||0,ae=V?Math.round(Z/V*100):0,ue=((q=R==null?void 0:R.milestones)==null?void 0:q.reduce((s,l)=>s+((l==null?void 0:l.weeks)||0),0))||0;return e.jsxs("div",{className:"rm",children:[!t&&e.jsx(me,{}),e.jsxs("main",{className:"rm-main",children:[!t&&e.jsx(pe,{}),e.jsxs(_.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5},children:[e.jsx("span",{className:"eyebrow",children:"Career Roadmap agent"}),e.jsxs("h1",{className:"rm-title",children:["Your ",e.jsx("span",{className:"gradient-text",children:"roadmaps"}),"."]}),e.jsx("p",{className:"rm-sub",children:"Sequence role requirements or target-relevant learning into activity tasks with explicit expected proof. Checking work off records progress; it does not prove a skill."})]}),a.items.length>0&&e.jsxs("div",{className:"rm-library","aria-label":"Saved roadmaps",children:[a.items.map(s=>e.jsxs("div",{className:`rm-tab ${s.id===a.activeId?"on":""}`,children:[e.jsxs("button",{type:"button",className:"rm-tab-pick",onClick:()=>Ss(s.id),"aria-pressed":s.id===a.activeId,title:s.kind==="learning"?"Learning plan":"Career path",children:[e.jsx(I,{name:s.kind==="learning"?"learn":"map",size:13})," ",s.title]}),e.jsx("button",{type:"button",className:"rm-tab-x",onClick:()=>C(s.id),"aria-label":`Delete ${s.title} roadmap`,children:"✕"})]},s.id)),e.jsx("button",{type:"button",className:"rm-tab rm-tab-new",onClick:()=>{v(!0),L((n==null?void 0:n.role)||""),M("job")},children:"+ New roadmap"})]}
4),(y||!a.items.length)&&e.jsxs("form",{className:"rm-form card",onSubmit:Y,children:[e.jsxs("div",{className:"rm-kind",role:"radiogroup","aria-label":"Roadmap type",children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":f==="job",tabIndex:f==="job"?0:-1,"data-kind":"job",className:`rm-kind-opt ${f==="job"?"on":""}`,onClick:()=>M("job"),onKeyDown:w,children:[e.jsx(I,{name:"map",size:14})," Target a role"]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":f==="learning",tabIndex:f==="learning"?0:-1,"data-kind":"learning",className:`rm-kind-opt ${f==="learning"?"on":""}`,onClick:()=>M("learning"),onKeyDown:w,children:[e.jsx(I,{name:"learn",size:14})," Learn a skill"]})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:f==="learning"?"What do you want to learn?":"Target role"}),e.jsx("input",{type:"text",value:B,onChange:s=>L(s.target.value),readOnly:f==="job"&&!!n,placeholder:f==="learning"?"e.g. System design, Rust, LLM fine-tuning":"Confirm a target in Prepare overview",required:!0})]}),!n&&e.jsxs("p",{className:"rm-target-note",role:"status",children:["Confirm an active career target in ",e.jsx(ee,{to:"/app/prepare",children:"Prepare overview"})," before building a plan."]}),e.jsxs("div",{className:"rm-form-actions",children:[e.jsx("button",{type:"submit",className:"btn btn-primary",disabled:P||!B.trim()||!n,children:P?"Mapping your path...":"Build roadmap"}),a.items.length>0&&e.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>v(!1),disabled:P,children:"Cancel"})]})]}),P&&!i&&e.jsxs("div",{className:"rm-loading",role:"status",children:[e.jsx("p",{children:"Analyzing your profile and mapping a path..."}),e.jsx(le,{variant:"row",count:4})]}),N&&e.jsxs("div",{className:"rm-target-warning",role:"alert",children:[e.jsx(I,{name:"warn",size:17}),e.jsxs("p",{children:["This roadmap is not linked to ",e.jsx("strong",{children:n.role}),". Select a roadmap for the active target, or ",e.jsx(ee,{to:"/app/prepare",children:"change the active target"}),". Nyanza will not mix its gaps or progress into this target."]})]}),i&&R&&!N&&e.jsxs(_.div,{className:"rm-result",initial:{opacity:0,y:14},animate:{opacity:1,y:0},transition:{duration:.45},children:[e.jsxs("div",{className:"rm-active-head",children:[u===i.id?e.jsx("input",{className:"rm-rename",defaultValue:i.title,autoFocus:!0,onBlur:s=>{Oe(i.id,s.target.value),S("")},onKeyDown:s=>{s.key==="Enter"&&(Oe(i.id,s.target.value),S("")),s.key==="Escape"&&S("")}}):e.jsxs("h2",{className:"rm-active-title",children:[e.jsx("span",{className:`rm-badge ${i.kind}`,children:i.kind==="learning"?"Learning":"Career"}),i.title,e.jsx("button",{type:"button",className:"rm-edit",onClick:()=>S(i.id),"aria-label":`Rename ${i.title} roadmap`,children:"✎"})]}),e.jsx("button",{className:"btn btn-ghost btn-sm",onClick:T,disabled:P,children:P?"Regenerating...":"Regenerate"})]}),A&&e.jsxs("p",{className:"rm-offline",role:"alert",children:[A," ",e.jsx(ee,{to:"/app/profile",children:"Open AI engine settings"}),"."]}),Me&&e.jsx("p",{className:"rm-offline",role:"status",children:"Showing a general plan. It has not changed your gaps, activity, or Career Persona. Add or fix your AI key in Profile → AI engine for a tailored roadmap."}),e.jsxs("div",{className:"card rm-overview",children:[e.jsxs("div",{className:"rm-progress",children:[e.jsxs("div",{className:"rm-progress-top",children:[e.jsxs("span",{children:[Z," of ",V," milestones · ~",ue," weeks"]}),e.jsxs("strong",{children:[ae,"%"]})]}),e.jsx("div",{className:"rm-progress-track",role:"progressbar","aria-label":`${i.title} roadmap progress`,"aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":ae,"aria-valuetext":`${Z} of ${V} milestones complete`,children:e.jsx(_.div,{className:"rm-progress-fill",initial:{scaleX:0},animate:{scaleX:ae/100},transition:{duration:.7,ease:[.22,1,.36,1]}})})]}),R.summary&&e.jsx("p",{className:"rm-summary",children:R.summary})]}),e.jsxs("div",{className:"rm-cols",children:[((F=R.currentStrengths)==null?void 0:F.length)>0&&e.jsxs("div",{className:"card rm-panel",children:[e.jsxs("h3",{children:[e.jsx("span",{className:"rm-icon good",children:e.jsx(I,{name:"check",size:13})})," Possible strengths to verify"]}),e.jsx("ul",{className:"rm-chips",children:R.currentStrengths.map((s,l)=>e.jsx("li",{className:"rm-chip good",children:s},l))})]}),((te=R.gaps)==null?void 0:te.length)>0&&e.jsxs("div",{className:"card rm-panel",children:[e.jsxs("h3",{children:[e.jsx("span",{className:"rm-icon gap",children:e.jsx(I,{name:"up",size:13})})," Proposed skills to build"]}),e.jsx("ul",{className:"rm-chips",children:R.gaps.map((s,l)=>e.jsx("li",{className:"rm-chip gap",children:s},l))})]})]}),e.jsxs("div",{className:"rm-timeline",children:[e.jsxs("p",{className:"rm-proof-note",children:[e.jsx(I,{name:"shield",size:15})," Checking a milestone records activity completion only. Add or confirm evidence separately before Nyanza treats the skill as demonstrated."]}),P?e.jsx(le,{variant:"row",count:((K=R.milestones)==null?void 0:K.length)||4}):(R.milestones||[]).map((s,l)=>{var x,p;return e.jsxs(_.div,{className:`rm-milestone card ${X[l]?"is-done":""}`,initial:{opacity:0,x:-10}
4,animate:{opacity:1,x:0},transition:{duration:.4,delay:l*.06},children:[e.jsx("button",{type:"button",className:"rm-check",onClick:()=>$(i,l),"aria-pressed":!!X[l],"aria-label":`${X[l]?"Mark incomplete":"Mark complete"}: ${s.title}`,children:X[l]?"✓":l+1}),e.jsxs("div",{className:"rm-milestone-body",children:[e.jsxs("div",{className:"rm-milestone-head",children:[e.jsx("h4",{children:s.title}),e.jsxs("span",{className:"rm-weeks",children:[s.weeks,"w"]})]}),s.focus&&e.jsx("p",{className:"rm-focus",children:s.focus}),s.expectedProof&&e.jsxs("p",{className:"rm-expected-proof",children:[e.jsx("strong",{children:"Expected proof:"})," ",s.expectedProof]}),((x=s.skills)==null?void 0:x.length)>0&&e.jsx("div",{className:"rm-skills",children:s.skills.map((k,D)=>e.jsx("span",{className:"rm-skill",children:k},D))}),((p=s.resources)==null?void 0:p.length)>0&&e.jsx("ul",{className:"rm-resources",children:s.resources.map((k,D)=>e.jsxs("li",{children:[e.jsx("span",{className:"rm-res-kind",children:e.jsx(I,{name:Bs[k.kind]||"target",size:14})}),k.label]},D))}),j[`${i.id}-${l}`]?e.jsxs("a",{className:"rm-video",href:j[`${i.id}-${l}`].url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(I,{name:"play",size:14})," ",j[`${i.id}-${l}`].title]}):e.jsxs("button",{type:"button",className:"rm-video-btn",onClick:()=>b(l,s),children:[e.jsx(I,{name:"play",size:13})," Find a video lesson"]})]})]},l)})]}),e.jsxs("details",{className:"rm-reassessment-history",children:[e.jsxs("summary",{children:["Reassessment history ",e.jsx("span",{children:E.length})]}),e.jsxs("div",{children:[E.length?e.jsx("ol",{children:E.slice(0,8).map(s=>{var l;return e.jsxs("li",{children:[e.jsxs("div",{children:[e.jsx("strong",{children:s.trigger==="evidence-revoked"?"Evidence revoked":"Evidence confirmed"}),e.jsxs("small",{children:[new Date(s.updatedAt||s.createdAt).toLocaleDateString()," · ",((l=s.payload)==null?void 0:l.lifecycle)||s.status]})]}),e.jsx("p",{children:s.summary})]},s.id)})}):e.jsx("p",{children:"No evidence-driven reassessment has been recorded for this target yet."}),e.jsx("small",{children:"Reassessment may reprioritize linked work, but it never creates a profile or resume claim and never resolves a gap automatically."})]})]})]},i.id)]})]})}function _s(t){return{summary:`A general path toward ${t}
4. Add or fix your AI key in Profile → AI engine for a version tailored to your background.`,currentStrengths:[],gaps:[],milestones:[{title:"Master the fundamentals",focus:`Build a solid base in the core concepts ${t} relies on.`,weeks:3,skills:["Core concepts"],resources:[{label:"A well-reviewed online course",kind:"course"}]},{title:"Build a portfolio project",focus:"Ship something real that demonstrates the key skills.",weeks:4,skills:["Applied practice"],resources:[{label:"An end-to-end project you can demo",kind:"project"}]},{title:"Deepen with a specialization",focus:"Pick one in-demand area and go deeper than the basics.",weeks:3,skills:["Specialization"],resources:[{label:"Advanced reading or docs",kind:"reading"}]},{title:"Prepare to prove it",focus:"Practice explaining what you learned out loud.",weeks:2,skills:["Communication"],resources:[{label:"Mock interviews (use the Interview agent!)",kind:"practice"}]}]}}const Re="nemo_blueprint",_e={targetId:"",role:"",result:null,generatedAt:""};function Ee(t){try{const o=t===void 0?localStorage.getItem(Re):t,c={..._e,...JSON.parse(o)||{}};return{...c,result:c.result?ys(c.result):null}}catch{return{..._e}}}let ce=Ee(),ke=ne();const Ne=new Set;function Se(){const t=ne();t!==ke&&(ke=t,ce=Ee())}function es(){Ne.forEach(t=>t())}function Ws(t){Se();try{localStorage.setItem(Re,JSON.stringify(t))}catch{return!1}return ce=t,es(),!0}Qe(({base:t,value:o})=>{t===Re&&(ke=ne(),ce=Ee(o),es())});function Gs(t,o,c){const n=String(c||"").trim();return n?Ws({targetId:n,role:t,result:o,generatedAt:new Date().toISOString()}):!1}function Hs(){return h.useSyncExternalStore(t=>(Ne.add(t),()=>Ne.delete(t)),()=>(Se(),ce),()=>(Se(),ce))}const We={have:{label:"Evidence found",icon:"✓"},partial:{label:"Some evidence",icon:"◐"},gap:{label:"Insufficient evidence",icon:"!"}},Ge=[{key:"required",label:"Core",sub:"AI-proposed common role requirements",accent:"var(--accent)"},{key:"niceToHave",label:"Differentiators",sub:"AI-proposed ways candidates may stand out",accent:"var(--persona)"},{key:"trending",label:"Additional signals",sub:"Responsibilities or model-inferred topics to validate",accent:"var(--cyan)"}];function Q(t){let o=2166136261;for(const c of String(t||""))o=Math.imul(o^c.charCodeAt(0),16777619);return(o>>>0).toString(36)}function Us(t,o,c){return`blueprint_requirement_${Q(t)}_${Q(`${o}|${c}`)}`}function Xs({embedded:t=!1}={}){const o=ge(),{profile:c}=ye(),n=fe(),a=je(n),m=Hs(),i=!!(a&&m.targetId===a.id),E=i?m.role:"",N=i?m.result:null,y=i?m.generatedAt:"",v=(a==null?void 0:a.role)||"",[f,M]=h.useState(!1),[B,L]=h.useState(""),[P,W]=h.useState(""),A=N?[...N.required,...N.niceToHave,...N.trending].reduce((j,d)=>(j[d.status]++,j),{have:0,partial:0,gap:0}):null,H=async()=>{var d;const j=(d=a==null?void 0:a.role)==null?void 0:d.trim();if(!(!a||!j||f)){M(!0),L("");try{const u=await fs({role:j,profileSummary:await Ve(c,`skills, projects and experience relevant to ${j}`),resume:c.resumeText,jobDescription:P});if(!Gs(j,u,a.id))throw new Error("Could not save this target-bound analysis.");const S=new Date().toISOString(),w=P.trim()?Q(P.trim()):"",O=w?{ref:`job-description:${w}`,type:"job-description",hash:w}:{ref:"model:role-blueprint",type:"model-inference"},z=Q(JSON.stringify({resumeText:c.resumeText||"",experiences:c.experiences||[],skills:c.skillList||[]})),U=Ge.flatMap(T=>(u[T.key]||[]).map(C=>({section:T,item:C}))),Y=U.map(({section:T,item:C})=>{const $=Us(a.id,T.key,C.skill),b={id:$,targetId:a.id,title:C.skill,summary:C.why||"",kind:"role-skill",importance:T.key,status:"proposed",originatingFeature:"blueprint",sourceRefs:[{ref:`career-target:${a.id}`,type:"career-target"},{ref:"profile:current",type:"profile"},O],promptVersion:"role-blueprint-v1",inputHash:Q(`${a.id}|${z}|${w||"model-pattern"}`),profileRevision:z,sourceRevision:S,generatedAt:S,confirmationStatus:"proposed",payload:{section:T.key,modelCoverage:C.status,candidateEvidence:C.evidence||"",sourceText:C.sourceText||"",suggestedAction:C.action||"",estimateOnly:!0}};if(ve($)){const R={...b};delete R.confirmationStatus,delete R.status,we($,R,{reasonCode:"blueprint-rerun"})}else Ts(b);return $});Je({targetId:a.id,title:`Profile evidence comparison for ${j}`,summary:u.summary||"",status:"complete",originatingFeature:"blueprint",sourceRefs:[{ref:`career-target:${a.id}`,type:"career-target"},{ref:"profile:current",type:"profile"},O],requirementIds:Y,requirementResults:U.map(({item:T},C)=>({requirementId:Y[C],status:T.status==="have"?"evidence-found":T.status==="partial"?"some-evidence":"insufficient-evidence",explanation:T.why||""})),rubricId:"ai-role-pattern-estimate",rubricRevision:"v1",score:null,scoreMax:null,insufficientEvidence:!0,confirmationStatus:"proposed",promptVersion:"role-blueprint-v1",inputHash:Q(`${a.id}|${z}|${w||"model-pattern"}`),profileRevision:z,generatedAt:S,payload:{role:j,estimateOnly:!0,notHiringBar:!0,requirementSource:w?"job-description":"model-pattern"}}),U.map((T,C)=>({...T,requirementId:Y[C]})).filter(({item:T})=>T.status!=="have").slice(0,12).forEach(({section:T,item:C,requirementId:$})=>{Ie([C.skill],"blueprint",{targetId:a.id,requirementId:$,sourceId:$,status:"proposed",promptVersion:"role-blueprint-v1",sourceRevision:S,inputHash:Q(`${a.id}|${z}|${w||"model-pattern"}`),profileRevision:z,provenance:{originatingFeature:"blueprint",section:T.key,generatedBy:"model",requirementSource:w?"job-description":"model-pattern",estimateOnly:!0}})})}catch(u){const S=(u==null?void 0:u.message)||"";L(/ollama|model|cloud|503|reach/i.test(S)?"Couldn't reach the AI - open Profile → AI engine and check your API key, then try again.":S||"Couldn't analyze that role - try a more specific title.")}finally{M(!1)}}};return e.jsxs("div",{className:"rb",children:[!t&&e.jsx(me,{}),e.jsxs("main",{className:"rb-main",children:[!t&&e.jsx(pe,{}),e.jsxs(_.div,{initial:{opacity:0,y:16}
4,animate:{opacity:1,y:0},transition:{duration:.5,ease:[.22,1,.36,1]},children:[e.jsx("span",{className:"eyebrow",children:"Role Blueprint"}),e.jsxs("h1",{className:"rb-title",children:["Explore the evidence for ",e.jsx("span",{className:"gradient-text",children:v||"your target role"}),"."]}),e.jsx("p",{className:"rb-sub",children:"Nyanza proposes a role pattern and compares it with your profile evidence. Treat it as a planning estimate, then verify requirements against real job descriptions."})]}),a?e.jsxs("div",{className:"rb-form card",children:[e.jsxs("label",{className:"rb-role-field",htmlFor:"rb-target-role",children:[e.jsx("span",{children:"Active career target"}),e.jsx("input",{id:"rb-target-role",className:"rb-input",value:v,readOnly:!0,"aria-describedby":"rb-target-help"})]}),e.jsxs("details",{className:"rb-source-input",children:[e.jsx("summary",{children:P.trim()?"Job description added":"Use a job description for sourced requirements"}),e.jsxs("label",{htmlFor:"rb-job-description",children:[e.jsx("span",{children:"Job description"}),e.jsx("textarea",{id:"rb-job-description",value:P,onChange:j=>W(j.target.value),rows:5,placeholder:"Paste the posting. Requirements will be traced to this source instead of a generalized role pattern."})]})]}),e.jsx("button",{type:"button",className:"btn btn-primary",onClick:H,disabled:f,children:f?"Comparing evidence...":N?"Refresh estimate":"Compare evidence"}),e.jsx("p",{id:"rb-target-help",className:"rb-form-help",children:"Change or confirm the target from Prepare Overview."})]}):e.jsxs("div",{className:"rb-target-required card",role:"status",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Confirm a career target first"}),e.jsx("p",{children:"Blueprints and gaps stay attached to one confirmed target so evidence cannot leak between plans."})]}),e.jsx(ee,{className:"btn btn-primary",to:"/app/prepare",children:"Choose a target"})]}),B&&e.jsx("p",{className:"rb-error",role:"alert",children:B}),f&&e.jsxs("div",{className:"rb-busy",role:"status",children:[e.jsxs("p",{className:"rb-busy-line",children:["Mapping ",v," against your persona..."]}),e.jsxs("div",{className:"rb-busy-ready card",children:[e.jsx(le,{variant:"ring"}),e.jsx(le,{lines:3,className:"rb-busy-sum"})]}),e.jsx(le,{variant:"row",count:6})]}),N&&!f&&e.jsxs(_.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.45},children:[e.jsxs("div",{className:"rb-readiness card",children:[e.jsxs("div",{className:"rb-estimate-mark","aria-label":"AI-proposed evidence comparison; no readiness score calculated",children:[e.jsx(I,{name:"spark",size:20}),e.jsxs("strong",{children:[A?A.have+A.partial:0,e.jsxs("span",{children:["/",A?A.have+A.partial+A.gap:0]})]}),e.jsx("small",{children:"items with some evidence"})]}),e.jsxs("div",{className:"rb-readiness-body",children:[e.jsxs("h2",{children:["Profile evidence compared with ",E]}),e.jsxs("p",{children:[e.jsx("strong",{children:"AI summary:"})," ",N.summary]}),e.jsx("p",{className:"rb-caveat",children:"This is not a verified market rubric or an employer hiring bar."}),A&&e.jsxs("div",{className:"rb-tally",children:[e.jsxs("span",{className:"have",children:[A.have," evidence found"]}),e.jsxs("span",{className:"partial",children:[A.partial," some evidence"]}),e.jsxs("span",{className:"gap",children:[A.gap," insufficient evidence"]})]}),e.jsxs("div",{className:"rb-readiness-actions",children:[e.jsx("button",{type:"button",className:"btn btn-primary btn-sm",onClick:()=>o(`/app/roadmap?targetId=${encodeURIComponent(a.id)}`),children:"Review the plan →"}),e.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>o(`/app/growth?targetId=${encodeURIComponent(a.id)}`),children:"Review proposed gaps →"})]})]})]}),Ge.map(j=>{var d;return((d=N[j.key])==null?void 0:d.length)>0?e.jsxs("section",{className:"rb-sec",style:{"--ac":j.accent},children:[e.jsxs("div",{className:"rb-sec-head",children:[e.jsx("span",{className:"rb-sec-dot","aria-hidden":"true"}),e.jsx("h3",{children:j.label}),e.jsx("span",{className:"rb-sec-sub",children:j.sub})]}),e.jsx("div",{className:"rb-items",children:N[j.key].map((u,S)=>{const w=We[u.status]||We.gap;return e.jsxs("div",{className:`rb-item ${u.status}`,children:[e.jsx("span",{className:`rb-status ${u.status}`,"aria-hidden":"true",children:w.icon}),e.jsxs("div",{className:"rb-item-body",children:[e.jsxs("div",{className:"rb-item-top",children:[e.jsx("strong",{children:u.skill}),e.jsx("span",{className:`rb-tag ${u.status}`,children:w.label})]}),u.why&&e.jsx("p",{className:"rb-why",children:u.why}),e.jsxs("p",{className:"rb-source-line",children:[e.jsx("strong",{children:"Requirement source:"})," ",u.source==="job-description"||u.sourceText?"Provided job description":"Generalized AI role pattern",u.sourceText?` · ${u.sourceText}`:""]}),e.jsxs("p",{className:"rb-evidence-line",children:[e.jsx("strong",{children:"Candidate evidence:"})," ",u.evidence||(u.status==="gap"?"Insufficient confirmed profile evidence.":"Model comparison did not return a specific evidence reference; review before relying on it.")]}),u.action&&u.status!=="have"&&e.jsxs("p",{className:"rb-action",children:[e.jsx(I,{name:"spark",size:12})," ",u.action]})]})]},S)})})]},j.key):null}),y&&e.jsxs("p",{className:"rb-foot",children:["Compared ",new Date(y).toLocaleDateString()," from your current profile and ",[...N.required,...N.niceToHave,...N.trending].some(j=>j.source==="job-description"||j.sourceText)?"the provided job description":"a generalized AI role pattern",". Review every proposed requirement before relying on it."]})]}),a&&!N&&!f&&e.jsx("div",{className:"rb-empty card",children:v.trim()?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Nyanza can generate a proposed skill pattern for ",e.jsx("strong",{children:v.trim()})," and compare it with your current profile evidence."]}),e.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>H(),children:"Compare evidence"}),e.jsx("p",{className:"hint",children:"AI-generated planning aid; not verified labor-market data."})]}):e.jsx("p",{children:"Confirm a career target in Prepare Overview to create a target-bound blueprint."})})]})]})}const Te="nemo_dream",He={boards:[]};function Pe(t){try{const o=t===void 0?localStorage.getItem(Te):t,c={...He,...JSON.parse(o)||{}};return{boards:Array.isArray(c.boards)?c.boards:[]}}catch{return{...He}}}let se=Pe(),Ce=ne();const $e=new Set;function de(){const t=ne();t!==Ce&&(Ce=t,se=Pe())}function ss(){$e.forEach(t=>t())}function as(t){de();try{localStorage.setItem(Te,JSON.stringify(t))}catch{return!1}return se=t,ss(),!0}Qe(({base:t,value:o})=>{t===Te&&(Ce=ne(),se=Pe(o),ss())});const Ys=()=>Math.random().toString(36).slice(2,9)+Date.now().toString(36).slice(-4);function Ks({targetId:t,company:o,role:c,result:n}){de();const a=String(t||"").trim();if(!a)return null;const m={id:Ys(),targetId:a,company:o,role:c,overall:n.overall,timeWeeks:n.timeWeeks,result:n,date:new Date().toISOString()},i=String(o).toLowerCase(),E=String(c).toLowerCase(),N=se.boards.filter(y=>y.targetId!==a||String(y.company).toLowerCase()!==i||String(y.role).toLowerCase()!==E);return as({boards:[m,...N].slice(0,12)}),m}function Vs(t){de(),as({boards:se.boards.filter(o=>o.id!==t)})}function Js(){return h.useSyncExternalStore(t=>($e.add(t),()=>$e.delete(t)),()=>(de(),se),()=>(de(),se))}const Zs=["OpenAI","Google","Anthropic","Meta","Amazon","Netflix","Databricks","Stripe","Nvidia","Microsoft"],Qs=t=>Ae(t,{repos:!0,skills:!0,skillsLabel:"Skills learned: ",cap:2e3});function ea(t){let o=2166136261;
4for(const c of String(t||""))o=Math.imul(o^c.charCodeAt(0),16777619);return(o>>>0).toString(36)}function sa({embedded:t=!1}={}){var H,j;const o=ge(),{profile:c}=ye(),n=fe(),a=je(n),m=Js(),i=a?m.boards.filter(d=>d.targetId===a.id):[],[E,N]=h.useState((a==null?void 0:a.company)||""),[y,v]=h.useState(!1),[f,M]=h.useState(""),[B,L]=h.useState(null);h.useEffect(()=>{N((a==null?void 0:a.company)||""),L(null),M("")},[a==null?void 0:a.id]);const P=async(d,u)=>{var T;d==null||d.preventDefault();const S=(u||E).trim(),w=a,O=(w==null?void 0:w.role)||"";if(!w||!S||!O||y)return;N(S),v(!0),M("");let z;try{if(z=await js({company:S,role:O,profileSummary:[Qs(c),Ke(c)].filter(Boolean).join(`
5
6`)}),!((T=z==null?void 0:z.dimensions)!=null&&T.length))throw new Error("empty")}catch{v(!1),M("Couldn't complete this estimate. Your previous assessment has not changed. Check Profile → AI engine, then try again.");return}Ks({targetId:w.id,company:S,role:O,result:z});const U=new Date().toISOString(),Y=Je({targetId:w.id,title:`Company preparation estimate for ${O}`,summary:z.summary||"",status:"complete",originatingFeature:"dream",sourceRefs:[{ref:`career-target:${w.id}`,type:"career-target"},{ref:"profile:current",type:"profile"},{ref:"model:company-preparation-estimate",type:"model-inference"}],rubricId:"ai-company-preparation-estimate",rubricRevision:"v1",score:null,scoreMax:null,insufficientEvidence:!0,confirmationStatus:"proposed",promptVersion:"dream-readiness-v1",generatedAt:U,payload:{company:S,role:O,estimateOnly:!0,notCompanyHiringBar:!0,dimensions:z.dimensions.map(C=>({name:C.name,score:C.score}))}});z.dimensions.forEach(C=>{(C.gaps||[]).forEach($=>Ie([$],"dream",{targetId:w.id,sourceId:`dream_${ea(`${w.id}|${S}|${O}|${C.name}|${$}`)}`,sourceRevision:Y||U,status:"proposed",promptVersion:"dream-readiness-v1",provenance:{originatingFeature:"dream",dimension:C.name,generatedBy:"model",estimateOnly:!0}}))}),L({targetId:w.id,company:S,role:O,result:z}),v(!1)},W=d=>{L({targetId:d.targetId,company:d.company,role:d.role,result:d.result}),window.scrollTo({top:0,behavior:Ps()})},A=B&&B.targetId===(a==null?void 0:a.id)?B.result:null;return e.jsxs("div",{className:"dr",children:[!t&&e.jsx(me,{}),e.jsxs("main",{className:"dr-main",children:[!t&&e.jsx(pe,{}),e.jsxs(_.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5},children:[e.jsx("span",{className:"eyebrow",children:"Company preparation estimate"}),e.jsxs("h1",{className:"dr-title",children:["Compare your evidence with a ",e.jsx("span",{className:"gradient-text",children:"company goal"}),"."]}),e.jsx("p",{className:"dr-sub",children:"This AI-generated estimate uses your saved profile and general model knowledge. It does not use the company's current hiring rubric and cannot predict a hiring decision."})]}),a?e.jsxs("form",{className:"dr-form card",onSubmit:P,children:[e.jsxs("div",{className:"dr-form-row",children:[e.jsxs("label",{className:"field dr-company",children:[e.jsx("span",{children:"Target company"}),e.jsx("input",{type:"text",value:E,onChange:d=>N(d.target.value),placeholder:"e.g. OpenAI"})]}),e.jsxs("label",{className:"field dr-role",children:[e.jsx("span",{children:"Role"}),e.jsx("input",{type:"text",value:a.role,readOnly:!0,"aria-describedby":"dr-role-help"})]}),e.jsx("button",{type:"submit",className:"btn btn-primary dr-go",disabled:y||!E.trim(),children:y?"Estimating...":"Estimate preparation"})]}),e.jsx("p",{id:"dr-role-help",className:"dr-form-help",children:"Role comes from your active CareerTarget. Change it in Prepare Overview."}),e.jsx("div",{className:"dr-chips",children:[...new Set([a.company,...String(c.targetCompanies||"").split(",").map(d=>d.trim()).filter(Boolean).slice(0,4),...Zs].filter(Boolean))].slice(0,12).map(d=>e.jsx("button",{type:"button",className:"dr-chip",onClick:()=>P(null,d),disabled:y,children:d},d))})]}):e.jsxs("div",{className:"dr-target-required card",role:"status",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Confirm a career target first"}),e.jsx("p",{children:"Company estimates and proposed gaps stay bound to one target so separate plans never mix."})]}),e.jsx(ee,{className:"btn btn-primary",to:"/app/prepare",children:"Choose a target"})]}),y&&e.jsx(Ms,{title:`Comparing evidence for ${E||"this company"}`,skeletonLines:5}),f&&!y&&e.jsxs("div",{className:"dr-offline card",role:"alert",children:[e.jsx("p",{children:f}),e.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>P(null,E),children:"Try again"})]}),e.jsx(Ze,{mode:"wait",children:A&&!y&&e.jsxs(_.div,{className:"dr-result",initial:{opacity:0,y:14}
6,animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:.45},children:[e.jsxs("div",{className:"dr-result-hero card",children:[e.jsxs("div",{className:"dr-no-score",role:"status","aria-label":"No readiness score calculated because no sourced company rubric is available",children:[e.jsx(I,{name:"shield",size:22}),e.jsx("strong",{children:"No score"}),e.jsx("span",{children:"insufficient sourced rubric"})]}),e.jsxs("div",{className:"dr-hero-body",children:[e.jsxs("span",{className:"dr-hero-target",children:[B.role||"Role"," at ",e.jsx("strong",{children:B.company})]}),e.jsx("span",{className:"dr-band",children:"AI planning estimate"}),A.summary&&e.jsx("p",{className:"dr-hero-summary",children:A.summary}),A.timeWeeks>0&&e.jsxs("p",{className:"dr-time",children:[e.jsx(I,{name:"prep",size:14})," Suggested focus horizon: about ",A.timeWeeks," weeks"]}),e.jsx("p",{className:"dr-estimate-note",children:"Model estimate, not a probability of interview or offer."})]})]}),((H=A.dimensions)==null?void 0:H.length)>0&&e.jsxs("div",{className:"card dr-dims",children:[e.jsx("h3",{className:"dr-h3",children:"Estimated evidence alignment by dimension"}),A.dimensions.map((d,u)=>{var S;return e.jsxs("div",{className:"dr-dim",children:[e.jsxs("div",{className:"dr-dim-head",children:[e.jsx("span",{className:"dr-dim-name",children:d.name}),e.jsx("span",{className:"dr-dim-score",children:"Model comparison"})]}),d.why&&e.jsx("p",{className:"dr-dim-why",children:d.why}),((S=d.gaps)==null?void 0:S.length)>0&&e.jsx("div",{className:"dr-dim-gaps",children:d.gaps.map((w,O)=>e.jsx("span",{className:"dr-gap",children:w},O))})]},u)})]}),((j=A.plan)==null?void 0:j.length)>0&&e.jsxs("div",{className:"card dr-plan",children:[e.jsxs("h3",{className:"dr-h3",children:[e.jsx(I,{name:"map",size:15})," Suggested preparation path"]}),e.jsx("ol",{className:"dr-plan-list",children:A.plan.map((d,u)=>e.jsxs("li",{children:[e.jsx("span",{className:"dr-plan-n",children:u+1}),e.jsxs("div",{children:[e.jsx("strong",{children:d.title}),d.focus&&e.jsx("span",{className:"dr-plan-focus",children:d.focus})]}),e.jsxs("span",{className:"dr-plan-weeks",children:[d.weeks,"w"]})]},u))}),e.jsxs("div",{className:"dr-cta-row",children:[e.jsxs("button",{type:"button",className:"btn btn-primary",onClick:()=>o(`/app/growth?targetId=${encodeURIComponent(a.id)}`),children:[e.jsx(I,{name:"bulb",size:15})," Review evidence gaps"]}),e.jsxs("button",{type:"button",className:"btn btn-ghost",onClick:()=>o(`/app/panel?targetId=${encodeURIComponent(a.id)}`),children:[e.jsx(I,{name:"critique",size:15})," Mock a ",B.company," panel"]}),e.jsxs("button",{type:"button",className:"btn btn-ghost",onClick:()=>o(`/app/roadmap?targetId=${encodeURIComponent(a.id)}`),children:[e.jsx(I,{name:"map",size:15})," Build the roadmap"]})]})]})]},B.company)}),a&&i.length===0&&!y&&!B&&e.jsxs("div",{className:"dr-board dr-board-empty",children:[e.jsx("h2",{className:"dr-board-title",children:"Saved company estimates"}),e.jsx("p",{className:"dr-board-sub",children:"Estimates for this career target stay together here. Choose a company above to create the first comparison."}),e.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>{var d;return(d=document.querySelector(".dr-company input"))==null?void 0:d.focus()},children:"Pick a target ↑"})]}),a&&i.length>0&&e.jsxs("div",{className:"dr-board",children:[e.jsx("h2",{className:"dr-board-title",children:"Saved company estimates"}),e.jsxs("p",{className:"dr-board-sub",children:["Compare AI estimates for ",a.role,". Select one to inspect it."]}),e.jsx("div",{className:"dr-board-grid",children:i.map(d=>e.jsxs("article",{className:"dr-board-card card",children:[e.jsxs("button",{type:"button",className:"dr-board-open",onClick:()=>W(d),"aria-label":`View ${d.company} preparation estimate for ${d.role||"your target role"}`,children:[e.jsx("strong",{className:"dr-board-co",children:d.company}),e.jsx("span",{className:"dr-board-role",children:d.role||"Role"}),e.jsx("span",{className:"dr-board-score",children:e.jsx("span",{className:"dr-board-band",children:"AI planning estimate · no readiness score"})}),d.timeWeeks>0&&e.jsxs("span",{className:"dr-board-time",children:["~",d.timeWeeks,"w suggested focus"]}
6)]}),e.jsxs("button",{type:"button",className:"dr-board-x",onClick:()=>Vs(d.id),"aria-label":`Remove ${d.company} preparation estimate`,children:[e.jsx(I,{name:"x",size:13})," ",e.jsx("span",{children:"Remove"})]})]},d.id))})]})]})]})}const aa=[{key:"coast",name:"Coast",accent:"#7c7080",blurb:"A light touch - keep momentum without the grind.",week:{lessons:1,masteries:.2,interviews:.5,jobsSaved:1,jobsApplied:.3,critiques:.2,arena:0}},{key:"steady",name:"Steady",accent:"#ffb347",recommended:!0,blurb:"The sustainable path most students can actually hold.",week:{lessons:2,masteries:.5,interviews:1,jobsSaved:3,jobsApplied:1,critiques:.3,arena:.3}},{key:"sprint",name:"Sprint",accent:"#ff4d6d",blurb:"All-in for a deadline - a season of deliberate intensity.",week:{lessons:3,masteries:1,interviews:2,jobsSaved:5,jobsApplied:2,critiques:.5,arena:.6}}],Ue=[8,12,16];function ta(t){return t.lessons*12+t.masteries*25+t.interviews*35+t.jobsSaved*10+t.jobsApplied*25+t.critiques*8+t.arena*50}function ra({parts:t={},openGaps:o=0,weeks:c=12}={}){const n=qs(t),a=Fe(n),m=aa.map(i=>{const E=ta(i.week),N=n+E*c,y=Fe(N),v={lessons:Math.round(i.week.lessons*c),masteries:Math.round(i.week.masteries*c),interviews:Math.round(i.week.interviews*c),applied:Math.round(i.week.jobsApplied*c),saved:Math.round(i.week.jobsSaved*c),gapsClosed:Math.min(o,Math.round(i.week.lessons*c))};return{...i,perWeek:Math.round(E),futureXp:Math.round(N),future:y,gain:y.xp-a.xp,levelsGained:y.level-a.level,totals:v}});return{now:a,weeks:c,baseXp:n,openGaps:o,paths:m}}function na(t,o,c){const n=o||"your target role",a=t.totals,m=t.key==="sprint"?`In ${c} focused weeks you go all-in`:t.key==="steady"?`Over ${c} steady weeks you build real momentum`:`Across ${c} lighter weeks you keep the door open`;return{headline:`${t.name}: Level ${t.future.level} · ${t.future.rank}`,story:`${m} toward ${n} - about ${a.lessons} lessons, ${a.interviews} mock interview${a.interviews===1?"":"s"}, and ${a.applied} application${a.applied===1?"":"s"} sent. Under these fixed assumptions, that adds roughly +${t.gain} XP and gives you time to revisit ${a.gapsClosed} gap topic${a.gapsClosed===1?"":"s"}.`,milestones:[`Week ${Math.max(1,Math.round(c*.25))}: ${a.gapsClosed>0?"first gap work started":"fundamentals revisited"}`,`Week ${Math.round(c*.6)}: review whether a work sample is ready to demonstrate`,`Week ${c}: compare new evidence with the requirements for ${n}`],unlocks:t.future.rank?[`Reach the ${t.future.rank} rank`]:[]}}const ia=h.lazy(()=>ns(()=>import("./PersonaAvatar-C_QuAGLe.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),oa="nemo_twin_seen",G={x:84,y:160},Xe=636,la={sprint:74,steady:160,coast:246},ts=t=>{const o=la[t];return{c1:{x:G.x+210,y:G.y},c2:{x:Xe-200,y:o},end:{x:Xe,y:o}}},Ye=t=>{const o=ts(t);return`M ${G.x} ${G.y} C ${o.c1.x} ${o.c1.y}, ${o.c2.x} ${o.c2.y}, ${o.end.x} ${o.end.y}`},ca=(t,o,c,n,a)=>{const m=1-a,i=m*m*m*t.x+3*m*m*a*o.x+3*m*a*a*c.x+a*a*a*n.x,E=m*m*m*t.y+3*m*m*a*o.y+3*m*a*a*c.y+a*a*a*n.y;return{x:i,y:E}},da=t=>Ae(t,{repos:!0,skills:!0,skillsLabel:"Skills learned: ",cap:1800});function ma({embedded:t=!1}={}){var ue,ie;const o=ge(),{user:c}=ms(),{profile:n,completeness:a}=ye(),{interviews:m}=ps(),i=us(),E=zs(),N=fe(),y=je(N),v=(y==null?void 0:y.id)||"",f=(y==null?void 0:y.role)||"",[M,B]=h.useState(12),[L,P]=h.useState("steady"),[W,A]=h.useState({}),[H,j]=h.useState(!1),[d,u]=h.useState(0),S=h.useMemo(()=>hs(),[]),w=h.useMemo(()=>(m||[]).filter(r=>(r==null?void 0:r.targetId)===v),[m,v]),O=h.useMemo(()=>(E.items||[]).filter(r=>(r==null?void 0:r.targetId)===v&&r.status==="active"&&r.stale!==!0),[E.items,v]),z=O.filter(r=>Be.indexOf(r.level)>=Be.indexOf("demonstrated")),U=h.useMemo(()=>({completeness:0,savedJobs:[],interviews:w,resumesGenerated:0,critiquesRun:0,learnedCount:O.length,masteredCount:z.length,arenaWins:0}),[w,O.length,z.length]),Y=h.useMemo(()=>(i.items||[]).filter(r=>(r==null?void 0:r.targetId)===v),[i.items,v]),T=Y.length,C=[...Y].sort((r,g)=>g.weight-r.weight).slice(0,6).map(r=>r.topic),$=h.useMemo(()=>ra({parts:U,openGaps:T,weeks:M}),[U,T,M]),b=$.paths.find(r=>r.key===L)||$.paths[1],R=`${v}:${M}:${$.baseXp}:${C.join("|")}`;h.useEffect(()=>{if(u(0),!!v)try{const r=`${oa}:${v}`,g=Number(localStorage.getItem(r));g&&$.now.xp>g&&u($.now.xp-g),localStorage.setItem(r,String($.now.xp))}catch{}},[v,$.now.xp]),h.useEffect(()=>{if(!y||W[R])return;let r=!1;j(!0);const g={...n,targetRole:f};
6return bs({role:f,profileSummary:[da(g),Ke(g)].filter(Boolean).join(`
7
8`),gaps:C,horizonWeeks:M,paths:$.paths}).then(q=>{!r&&q&&Object.keys(q).length&&A(F=>({...F,[R]:q}))}).catch(()=>{}).finally(()=>{r||j(!1)}),()=>{r=!0}},[R,v]);const X=(r=>{var g;return((g=W[R])==null?void 0:g[r.key])||na(r,f,M)})(b),Z=vs(f),V=r=>v?`${r}?targetId=${encodeURIComponent(v)}`:r,ae=(r,g,q,F)=>{var s,l,x;if(!["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(r.key))return;r.preventDefault();const te=Math.max(0,g.indexOf(q)),K=r.key==="Home"?0:r.key==="End"?g.length-1:(te+(r.key==="ArrowRight"||r.key==="ArrowDown"?1:-1)+g.length)%g.length;F(g[K]),(x=(l=(s=r.currentTarget.closest('[role="radiogroup"]'))==null?void 0:s.querySelectorAll('[role="radio"]'))==null?void 0:l[K])==null||x.focus()};return e.jsxs("div",{className:"tw",children:[!t&&e.jsx(me,{}),e.jsxs("main",{className:"tw-main",children:[!t&&e.jsx(pe,{}),y?e.jsxs(e.Fragment,{children:[e.jsxs(_.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5},children:[e.jsx("span",{className:"eyebrow",children:"Career Twin · Experimental"}),e.jsxs("h1",{className:"tw-title",children:["Explore ",e.jsx("span",{className:"gradient-text",children:"effort scenarios"}),"."]}),e.jsx("p",{className:"tw-sub",children:"Compare fixed practice cadences for your confirmed target. Use the result to plan your week, not to predict a hiring outcome."})]}),e.jsxs("aside",{className:"tw-experiment",role:"note","aria-label":"About this experimental projection",children:[e.jsx(I,{name:"shield",size:16,"aria-hidden":"true"}),e.jsxs("p",{children:[e.jsx("strong",{children:"Scenario, not forecast."})," Career Twin applies fixed activity assumptions to your Nyanza history. It does not predict readiness, interviews, offers, or employment."]})]}),e.jsx(Ze,{children:d>0&&e.jsxs(_.div,{className:"tw-delta",initial:{opacity:0,y:-8},animate:{opacity:1,y:0},exit:{opacity:0},children:[e.jsx(I,{name:"zap",size:15})," ",e.jsxs("strong",{children:["+",d," XP"]})," since your last visit. The scenario baseline was updated."]})}),e.jsxs("div",{className:"tw-controls card",children:[e.jsxs("div",{className:"tw-target-context","aria-labelledby":"tw-active-target-label",children:[e.jsx("span",{id:"tw-active-target-label",children:"Active Career Target"}),e.jsx("strong",{children:f}),e.jsxs("small",{children:[y.company||"No company specified"," · person confirmed"]}),e.jsx(ee,{to:"/app/prepare",children:"Change target"})]}),e.jsxs("div",{className:"field",children:[e.jsx("span",{children:"Horizon"}),e.jsx("div",{className:"tw-seg",role:"radiogroup","aria-label":"Projection horizon",children:Ue.map(r=>e.jsxs("button",{type:"button",role:"radio","aria-checked":M===r,tabIndex:M===r?0:-1,className:`tw-seg-opt ${M===r?"active":""}`,onClick:()=>B(r),onKeyDown:g=>ae(g,Ue,M,B),children:[r," wks"]},r))})]})]}),e.jsxs("div",{className:"tw-stage card","aria-busy":H,children:[e.jsxs("svg",{className:"tw-tree",viewBox:"0 0 720 320",preserveAspectRatio:"xMidYMid meet","aria-hidden":"true",focusable:"false",children:[e.jsx("defs",{children:$.paths.map(r=>e.jsxs("linearGradient",{id:`tw-${r.key}`,x1:"0",y1:"0",x2:"1",y2:"0",children:[e.jsx("stop",{offset:"0%",stopColor:Z,stopOpacity:"0.5"}),e.jsx("stop",{offset:"100%",stopColor:r.accent,stopOpacity:"1"})]},r.key))}),$.paths.map((r,g)=>{const q=r.key===L,F=ts(r.key),te=[.34,.62].map(K=>ca(G,F.c1,F.c2,F.end,K));return e.jsxs("g",{className:`tw-branch ${q?"on":"off"}`,onClick:()=>P(r.key),style:{cursor:"pointer"},children:[e.jsx("path",{d:Ye(r.key),fill:"none",stroke:"transparent",strokeWidth:"28",style:{pointerEvents:"stroke"}}),e.jsx(_.path,{d:Ye(r.key),fill:"none",stroke:`url(#tw-${r.key})`,strokeWidth:q?6:3,strokeLinecap:"round",initial:{pathLength:0,opacity:0},animate:{pathLength:1,opacity:q?1:.4},transition:{duration:1,ease:[.22,1,.36,1],delay:.15+g*.12}}),te.map((K,s)=>e.jsx(_.circle,{cx:K.x,cy:K.y,r:q?4:3,fill:r.accent,initial:{scale:0,opacity:0},animate:{scale:1,opacity:q?1:.35},transition:{delay:.6+g*.12+s*.1}},s)),e.jsx(_.circle,{cx:F.end.x,cy:F.end.y,r:q?26:20,fill:"var(--panel)",stroke:r.accent,strokeWidth:q?3:2,initial:{scale:0,opacity:0}
8,animate:{scale:1,opacity:q?1:.5},transition:{type:"spring",stiffness:200,damping:15,delay:.9+g*.12}}),e.jsxs("text",{x:F.end.x,y:F.end.y+1,textAnchor:"middle",dominantBaseline:"middle",className:"tw-node-lvl",fill:r.accent,style:{opacity:q?1:.6},children:["L",r.future.level]}),e.jsx("text",{x:F.end.x,y:F.end.y+42,textAnchor:"middle",className:"tw-node-rank",style:{opacity:q?1:.5},children:r.name}),e.jsxs("text",{x:F.end.x,y:F.end.y-36,textAnchor:"middle",className:"tw-node-gain",fill:r.accent,style:{opacity:q?1:0},children:["+",r.gain," XP"]})]},r.key)}),e.jsx("circle",{cx:G.x,cy:G.y,r:"30",fill:"var(--panel)",stroke:Z,strokeWidth:"3"}),e.jsxs("text",{x:G.x,y:G.y-2,textAnchor:"middle",dominantBaseline:"middle",className:"tw-now-lvl",fill:Z,children:["L",$.now.level]}),e.jsx("text",{x:G.x,y:G.y+12,textAnchor:"middle",className:"tw-now-sub",children:"now"}),e.jsx("text",{x:G.x,y:G.y+52,textAnchor:"middle",className:"tw-node-rank strong",children:$.now.rank})]}),e.jsx("div",{className:"tw-legend",role:"radiogroup","aria-label":"Choose a path",children:$.paths.map(r=>e.jsxs("button",{type:"button",role:"radio","aria-checked":L===r.key,tabIndex:L===r.key?0:-1,className:`tw-legend-pill ${L===r.key?"on":""}`,style:{"--seat":r.accent},onClick:()=>P(r.key),onKeyDown:g=>ae(g,$.paths.map(q=>q.key),L,P),children:[e.jsx("span",{className:"tw-legend-dot",style:{background:r.accent},"aria-hidden":"true"}),r.name," · L",r.future.level,r.recommended?" ·★":""]},r.key))}),e.jsxs("p",{className:"tw-stage-hint",role:"status","aria-live":"polite",children:["Choose a path to inspect its assumptions · ",H?"writing a grounded scenario...":W[R]?"model-written from your saved profile and target gaps":"fixed scenario copy - model narration unavailable"]})]}),e.jsxs(_.div,{className:"tw-detail",initial:{opacity:0,y:14},animate:{opacity:1,y:0},transition:{duration:.4},children:[e.jsxs("div",{className:"tw-detail-grid",children:[e.jsxs("div",{className:"card tw-future",children:[e.jsx("div",{className:"tw-future-orb",children:S?e.jsx(xs,{children:e.jsx(h.Suspense,{fallback:e.jsx("div",{className:"orbit-fallback",role:"img","aria-label":"Loading your projected Career Twin"}),children:e.jsx(ia,{style:n.avatarStyle||"figure",gender:n.avatarGender||"neutral",accent:Z,level:a,motes:Math.min(24,(n.learnedSkills||[]).length+b.totals.lessons),skin:n.skinTone||void 0,hair:n.hairColor||void 0,name:n.fullName||(c==null?void 0:c.name)||"",flatStyle:n.flatStyle||"notionists",avatarUrl:n.avatarUrl||"",power:b.future.power,tier:b.future.level,compact:!0})})}):e.jsx("div",{className:"orbit-fallback",role:"img","aria-label":`Projected Career Twin at level ${b.future.level}`})}),e.jsxs("span",{className:"tw-future-tag",style:{color:b.accent},children:[b.name," scenario · ",M," weeks"]}),e.jsxs("strong",{className:"tw-future-lvl",children:["Level ",b.future.level," · ",b.future.rank]}),e.jsx("div",{className:"tw-xpbar",role:"progressbar","aria-label":`Progress through level ${b.future.level}`,"aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":Math.round(b.future.pct*100),children:e.jsx(_.div,{className:"tw-xpbar-fill",style:{background:b.accent},initial:{scaleX:0},animate:{scaleX:Math.round(b.future.pct*100)/100},transition:{duration:.8,ease:[.22,1,.36,1]}})}),e.jsxs("span",{className:"tw-future-delta",children:[b.levelsGained>0?`+${b.levelsGained} level${b.levelsGained===1?"":"s"} · `:"","+",b.gain," XP from where you are now"]})]}),e.jsxs("div",{className:"card tw-story",children:[e.jsx("h3",{className:"tw-story-head",style:{color:b.accent},children:X.headline}),e.jsx("p",{className:"tw-story-body",children:X.story}),e.jsx("p",{className:"tw-cadence-label",children:"The weekly habit"}),e.jsxs("div",{className:"tw-cadence",children:[e.jsxs("span",{children:[e.jsx("strong",{children:b.week.lessons})," lessons/wk"]}),e.jsxs("span",{children:[e.jsx("strong",{children:b.week.interviews})," interviews/wk"]}),e.jsxs("span",{children:[e.jsx("strong",{children:b.week.jobsApplied})," apps/wk"]})]}),e.jsxs("div",{className:"tw-stats",children:[e.jsxs("div",{className:"tw-stat",children:[e.jsx("strong",{children:b.totals.lessons}
8),e.jsx("span",{children:"lessons"})]}),e.jsxs("div",{className:"tw-stat",children:[e.jsx("strong",{children:b.totals.interviews}),e.jsx("span",{children:"interviews"})]}),e.jsxs("div",{className:"tw-stat",children:[e.jsx("strong",{children:b.totals.applied}),e.jsx("span",{children:"apps sent"})]}),e.jsxs("div",{className:"tw-stat",children:[e.jsx("strong",{children:b.totals.gapsClosed}),e.jsx("span",{children:"gap topics practiced"})]})]}),((ue=X.milestones)==null?void 0:ue.length)>0&&e.jsx("ul",{className:"tw-miles",children:X.milestones.map((r,g)=>e.jsxs("li",{children:[e.jsx("span",{className:"tw-mile-dot",style:{background:b.accent}}),r]},g))}),((ie=X.unlocks)==null?void 0:ie.length)>0&&e.jsx("div",{className:"tw-unlocks",children:X.unlocks.map((r,g)=>e.jsxs("span",{className:"tw-unlock",children:[e.jsx(I,{name:"zap",size:12})," ",r]},g))})]})]}),e.jsxs("div",{className:"tw-cta card",children:[e.jsx("p",{children:"Treat this as a planning aid. Practice, collect evidence, and review what actually changed before updating your target plan."}),e.jsxs("div",{className:"tw-cta-row",children:[e.jsxs("button",{className:"btn btn-primary",onClick:()=>o(V("/app/growth")),children:[e.jsx(I,{name:"bulb",size:15})," Work a gap"]}),e.jsxs("button",{className:"btn btn-ghost",onClick:()=>o(V("/app/panel")),children:[e.jsx(I,{name:"critique",size:15})," Face the panel"]}),e.jsxs("button",{className:"btn btn-ghost",onClick:()=>o(V("/app/jobs")),children:[e.jsx(I,{name:"target",size:15})," Find jobs"]}),e.jsxs("button",{className:"btn btn-ghost",onClick:()=>o(V("/app/roadmap")),children:[e.jsx(I,{name:"map",size:15})," See the roadmap"]})]})]})]},L)]}):e.jsxs("section",{className:"card tw-target-required","aria-labelledby":"tw-target-required-title",children:[e.jsx(I,{name:"target",size:22,"aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx("h1",{id:"tw-target-required-title",children:"Choose a Career Target first."}),e.jsx("p",{children:"Career Twin needs one person-confirmed role before it can build a scenario. A profile role is never selected on your behalf."})]}),e.jsx(ee,{className:"btn btn-primary",to:"/app/prepare",children:"Choose in Prepare"})]})]})]})}const xe=[{id:"roadmap",label:"Roadmap",blurb:"Sequence the work",component:Fs},{id:"requirements",label:"Requirements",blurb:"Target vs evidence",component:Xs},{id:"estimate",label:"Estimate",blurb:"Time to target",component:sa},{id:"scenarios",label:"Scenarios",blurb:"Simulate the path",component:ma}];function Pa(){const[t,o]=is(),c=String(t.get("tool")||""),n=xe.find(m=>m.id===c)||xe[0],a=n.component;return e.jsxs("div",{className:"plan",children:[e.jsx(me,{}),e.jsxs("main",{className:"plan-main",children:[e.jsx(pe,{}),e.jsx("nav",{className:"plan-tools","aria-label":"Planning tools",children:xe.map(m=>e.jsxs("button",{type:"button",className:`plan-tool ${m.id===n.id?"on":""}`,"aria-current":m.id===n.id?"page":void 0,"aria-pressed":m.id===n.id,onClick:()=>o(m.id===xe[0].id?{}:{tool:m.id},{replace:!0}),children:[e.jsx("strong",{children:m.label}),e.jsx("span",{children:m.blurb})]},m.id))}),e.jsx(a,{embedded:!0})]})]})}export{Pa 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.