import React, { useState, useMemo, useEffect } from 'react'; import { LineChart, Line, BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, ComposedChart, Area, Cell } from 'recharts'; import { TrendingUp, Wallet, PieChart, Calendar, Info, Calculator, DollarSign, ChevronRight, Settings, Users, ShieldCheck, Landmark, Receipt, Briefcase, HelpCircle, Layers, MousePointer2, Printer, ChevronUp, ChevronDown, Sparkles, Cloud, CloudOff, Save, RefreshCw } from 'lucide-react'; // --- AWS CONFIGURATION (FOR ATLAS DEPLOYMENT) --- // Note: In a production AWS build, these are usually injected via environment variables. const AWS_CONFIG = { region: "us-east-1", // Update to your region userPoolId: "us-east-1_XXXXX", userPoolClientId: "XXXXX", dynamoDbTable: "EquityBriefings" }; const App = () => { // --- STATE & CALCULATIONS --- const [valuationMultiple, setValuationMultiple] = useState(12); const [selectedYear, setSelectedYear] = useState('Series B'); const [showSettings, setShowSettings] = useState(false); const [isSummaryExpanded, setIsSummaryExpanded] = useState(false); const [isSyncing, setIsSyncing] = useState(false); const [lastSynced, setLastSynced] = useState(null); // Inputs const [employeeName, setEmployeeName] = useState('Sarah Jenkins'); const [jobTitle, setJobTitle] = useState('Chief Design Officer'); const [initialShares, setInitialShares] = useState(150000); const [newGrantShares, setNewGrantShares] = useState(350000); const [strikePrice, setStrikePrice] = useState(0.01); const [taxRate, setTaxRate] = useState(25); const [totalPool, setTotalPool] = useState(10000000); const totalSharesForEmployee = Number(initialShares) + Number(newGrantShares); const scenarios = [ { stage: 'Current', year: '2025', arr: 0, valuation: 1000000, totalShares: totalPool, sharePrice: 0.10, newVestedPercent: 0 }, { stage: 'Seed', year: '2026', arr: 500000, valuation: 25000000, totalShares: totalPool * 1.25, sharePrice: 2.00, newVestedPercent: 30 }, { stage: 'Series A', year: '2027', arr: 2500000, valuation: 50000000, totalShares: totalPool * 1.56, sharePrice: 3.20, newVestedPercent: 60 }, { stage: 'Series B', year: '2028', arr: 7500000, valuation: 125000000, totalShares: totalPool * 1.95, sharePrice: 6.40, newVestedPercent: 100 } ]; const chartData = useMemo(() => { return scenarios.map(s => { const dynamicValuation = s.arr > 0 ? s.arr * valuationMultiple : s.valuation; const dynamicSharePrice = dynamicValuation / s.totalShares; const ownershipPercent = (totalSharesForEmployee / s.totalShares) * 100; const grossValue = totalSharesForEmployee * dynamicSharePrice; const exerciseCost = totalSharesForEmployee * strikePrice; const netPreTax = Math.max(0, grossValue - exerciseCost); const taxLiability = netPreTax * (taxRate / 100); const netPostTax = netPreTax - taxLiability; return { ...s, ownershipPercent: ownershipPercent.toFixed(3), grossValue, exerciseCost, netPreTax, taxLiability, netPostTax, displayValue: (netPostTax / 1000000).toFixed(2) }; }); }, [valuationMultiple, initialShares, newGrantShares, totalPool, strikePrice, taxRate]); const selectedData = chartData.find(d => d.stage === selectedYear); const initialPercent = ((initialShares / totalPool) * 100).toFixed(2); const newGrantPercent = ((newGrantShares / totalPool) * 100).toFixed(2); const totalCombinedPercent = ((totalSharesForEmployee / totalPool) * 100).toFixed(2); const formatCurrency = (val) => new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', maximumFractionDigits: 0 }).format(val); const formatCompact = (val) => new Intl.NumberFormat('en-US', { notation: "compact", compactDisplay: "short" }).format(val); // Persistence Logic (Stubs for AWS Amplify/AppSync) const handleSaveToCloud = async () => { setIsSyncing(true); // Real logic would be: await DataStore.save(new Briefing({...})) setTimeout(() => { setIsSyncing(false); setLastSynced(new Date().toLocaleTimeString()); }, 1500); }; const LaymanTooltip = ({ title, text }) => (
{text}
{jobTitle}
AWS Storage
{lastSynced ? <>
Allocation Summary
{totalSharesForEmployee.toLocaleString()}
Ownership Stake
{totalCombinedPercent}%
Capital Multiple
{(selectedData.netPostTax / (Math.max(1, initialShares * 0.10))).toFixed(0)}X
Projected Appreciation
Scenario: {selectedYear}
Stage Payout (Net)
{formatCompact(selectedData.netPostTax)}
Post-Tax Outcome for {selectedData.stage}
Pro Forma Calculation
Stage: {selectedYear}
Value Growth vs. Round Dilution
| Funding Round | Valuation | Price | Net Cash |
|---|---|---|---|
| {d.stage} ({d.year}) | {formatCompact(d.arr > 0 ? d.arr * valuationMultiple : d.valuation)} | {formatCurrency(d.sharePrice)} | {formatCompact(d.netPostTax)} |
Our strategic roadmap targets a net post-tax outcome of {formatCompact(chartData[3].netPostTax)} at Series B scale.
Maximum Liquidity
{formatCompact(chartData[3].netPostTax)}