/* Registration wizard: Account → Allotment → Verify → Addresses */ (function () { const { useState } = React; const Icon = window.Icon; const D = window.YEIDA; const AuthShell = window.AuthShell, VerifyPanel = window.VerifyPanel; const STEPS = [ { k: 'account', label: 'Account', icon: 'user' }, { k: 'allotment', label: 'Allotment', icon: 'building' }, { k: 'verify', label: 'Verify', icon: 'shield' }, { k: 'address', label: 'Address', icon: 'mapPin' }, ]; function Stepper({ step }) { return (
{STEPS.map((s, i) => (
{i < step ? : i + 1} {s.label}
{i < STEPS.length - 1 && }
))}
); } function Register({ go }) { const [step, setStep] = useState(0); const [form, setForm] = useState({ firstName: 'Rajeev', lastName: 'Malhotra', email: 'r.malhotra@email.com', cc: '+91', mobile: '9876500012', password: '', confirm: '', relationship: 'Self', terms: true, cookies: true, allotteeFirst: 'Rajeev', allotteeLast: 'Malhotra', hasAllotment: true, allotment: 'YEA-654321', sector: 'Sector 18', pocket: 'Pocket B', plot: 'B-47', }); const set = (k, v) => setForm(f => ({ ...f, [k]: v })); const next = () => setStep(s => Math.min(STEPS.length - 1, s + 1)); const isAllottee = form.relationship === 'Self'; return (
New Allottee Registration

{['Create your account', 'Identify your plot', 'Verify email & phone', 'Your addresses'][step]}

{step === 0 && } {step === 1 && } {step === 2 && } {step === 3 && }
{step !== 2 && ( )} {step === 0 && (
Already registered?{' '}
)}
); } /* Step 0 — Account creation */ function AccountStep({ form, set, isAllottee }) { const pwMismatch = form.confirm.length > 0 && form.password !== form.confirm; return (
set('firstName', e.target.value)} />
set('lastName', e.target.value)} />
set('email', e.target.value)} placeholder="you@email.com" />
set('mobile', e.target.value)} />
set('password', e.target.value)} placeholder="Min 8 characters" />
set('confirm', e.target.value)} placeholder="Re-enter password" style={pwMismatch ? { borderColor: 'var(--red-500)' } : undefined} />
{pwMismatch &&
Passwords do not match
} {/* Relationship with Allottee */}
{isAllottee ? 'Self registration — you are the original allottee (Allottee = User).' : `Invitation registration — you are registering on behalf of the allottee as ${form.relationship} (Allottee ≠ User).`}
{/* Allottee name — required when registrant is NOT the allottee */} {!isAllottee && (
Original Allottee Details
set('allotteeFirst', e.target.value)} placeholder="As per records" />
set('allotteeLast', e.target.value)} placeholder="As per records" />
)}
); } /* Step 1 — Allotment identification */ function AllotmentStep({ form, set }) { return (

What is your Allotment Number?

Enter your allotment number to link your plot, or identify it by sector & plot if you don't have it handy.

{/* toggle */}
{[['have', 'I have my allotment number'], ['forgot', "I don't remember it"]].map(([k, l]) => ( ))}
{form.hasAllotment ? (
set('allotment', e.target.value.toUpperCase())} placeholder="e.g. YEA-654321" />
Format: YEA- followed by your 6-digit number
) : (
Identify your plot below — we'll match it to your allotment record.
set('plot', e.target.value)} placeholder="3–4 digits" maxLength={5} />
Plot number is typically 3 or 4 digits (e.g. 047 or 1024).
)}
); } /* Step 2 — Verification */ function VerifyStep({ form, go }) { const [both, setBoth] = useState(false); return (

Verify both your email and mobile number on this screen. Each requires an OTP.

); } /* Step 3 — Addresses (registered + mailing, editable independently) */ function AddressStep({ form, set }) { const [sameAsReg, setSameAsReg] = useState(false); return (
{!sameAsReg && }
); } function AddressBlock({ title, sub, icon, prefix, form, set }) { const def = prefix === 'reg' ? D.user.registeredAddress : D.user.mailingAddress; return (
{title}
{sub}
); } /* Standalone allotment lookup (login path — "I don't remember my allotment number") */ function AllotmentLookup({ go }) { const [form, setForm] = useState({ sector: 'Sector 18', pocket: 'Pocket B', plot: 'B-47' }); const [found, setFound] = useState(false); const set = (k, v) => setForm(f => ({ ...f, [k]: v })); return (
Find your allotment

Identify your plot

No allotment number? Locate your plot by sector, pocket and plot number.

set('plot', e.target.value)} placeholder="e.g. 047" />
{found ? (
Allotment found · YEA-654321
{form.sector} · {form.pocket} · Plot {form.plot}
) : ( )}
); } window.Register = Register; window.AllotmentLookup = AllotmentLookup; })();