/* Construction Journey — goal selection + 8-step survey + Project Team + Progress Center */ (function () { const { useState } = React; const Icon = window.Icon, PageHead = window.PageHead, Donut = window.Donut, Avatar = window.Avatar; const D = window.YEIDA, fmt = D.fmtINR; function MyJourney({ go, toast }) { const [tab, setTab] = useState('journey'); return (
{/* sub-tabs */}
{[['journey', 'Journey Steps'], ['team', 'Project Team'], ['progress', 'Progress Center']].map(([k, l]) => ( ))}
{tab === 'journey' && } {tab === 'team' && } {tab === 'progress' && }
); } /* ---------------- GOAL SELECTION + 8-STEP ACCORDION SURVEY ---------------- */ function JourneySteps({ go, toast }) { const [goal, setGoal] = useState('start'); const [steps, setSteps] = useState(D.journeySteps); const [open, setOpen] = useState(() => { const a = D.journeySteps.findIndex(s => s.active); return a >= 0 ? a : 0; }); const doneCount = steps.filter(s => s.done).length; const save = (i) => { setSteps(arr => arr.map((s, j) => j === i ? { ...s, done: true, active: false } : s)); toast && toast('Information saved · ' + steps[i].title); const next = steps.findIndex((s, j) => j > i && !s.done); setOpen(next >= 0 ? next : -1); }; return (
{/* progress header */}

You're {Math.round(doneCount / steps.length * 100)}% through your journey

Complete each step below — saved steps turn green and stay editable. We'll guide you to the next action.

{doneCount} completed {steps.length - doneCount} remaining
{/* goal selection */}

What would you like to do with your plot?

Pick a goal — we'll personalise your journey around it.

{D.journeyGoals.map(gOpt => { const on = goal === gOpt.id; return ( ); })}
{/* accordion survey */}
{steps.map((s, i) => { const isOpen = open === i; const state = s.done ? 'done' : s.active || isOpen ? 'active' : 'todo'; return (
{/* header row */} {/* body */} {isOpen && (
{s.done && Editable anytime}
)}
); })}
); } function StepBody({ step, go }) { // tailored, lightweight content per step switch (step.key) { case 'goal': return Your selected goal drives the recommended steps, designs and budget. You can change it from the selector above.; case 'plot': return (
{[['Allotment No.', D.user.allotment], ['Plot', D.user.plot], ['Sector', D.user.sector], ['Pocket', D.user.pocket]].map(([l, v]) => )}
); case 'design': return (
Selected design from the Design Explorer. Browse alternatives anytime.
); case 'planning': return (
{[['Configuration', 'G+1'], ['Built-up area', '4,200 sq.ft'], ['Est. duration', '11 months'], ['Plan status', 'Sanctioned']].map(([l, v]) => )}
); case 'budget': return (
{[['Total budget', fmt(D.construction.estimatedCost)], ['Milestones', '5'], ['Funded', fmt(D.construction.spent)]].map(([l, v]) => )}
); case 'contractor': return (
Assign your project team — manager, site engineer, architect & crew. View the Project Team tab to manage contacts.
); case 'progress': return Once construction starts, track every stage with photos, notes and dates in the Progress Center.; case 'certificate': return After final inspection, apply for and download your Completion Certificate here.; default: return null; } } function Field({ label, value }) { return (
{label}
{value}
); } function Note({ children }) { return

{children}

; } /* ---------------- PROJECT TEAM ---------------- */ function ProjectTeam({ toast }) { return (

Your Project Team

{D.projectTeam.map(m => (
{m.online && }
{m.role}
{m.name}
{m.org}
))}
{/* team updates / milestone */}

Team Updates

{D.teamUpdates.map((u, i, arr) => (
{i !== arr.length - 1 && }
{u.who} — {u.text}
{u.time}
))}
); } /* ---------------- PROGRESS CENTER (stages + live view) ---------------- */ function ProgressCenter() { const overall = Math.round(D.progressStages.reduce((s, x) => s + x.pct, 0) / D.progressStages.length); return (
{/* live view + summary */}
LIVE
Live Site Camera
Plot B-47 · Cam 1 · 1080p — drop in your RTSP/webcam feed
{['Cam 1', 'Cam 2', 'Drone'].map((c, i) => {c})}
Updated just now
{[['Daily Site Photos', 'image', '42 this month'], ['Weekly Progress Report', 'documents', 'Latest: 06 Jun'], ['Current Stage', 'construction', 'Slab Casting']].map(([l, ic, v]) => (
{l} {v}
))}
{/* stage timeline */}

Construction Stages

{D.progressStages.map((st, i, arr) => { const state = st.pct === 100 ? 'done' : st.pct > 0 ? 'active' : 'todo'; const cc = state === 'done' ? 'var(--emerald-500)' : state === 'active' ? 'var(--blue-500)' : '#c2cedd'; return (
{i !== arr.length - 1 && } {state === 'done' ? : state === 'active' ? : {i + 1}}
{st.name}
{st.photos > 0 && {st.photos}} {state === 'done' ? 'Completed' : state === 'active' ? st.pct + '%' : 'Upcoming'}
{st.note &&
{st.note}
}
{st.date}
{state === 'active' &&
}
); })}
); } window.MyJourney = MyJourney; })();