Terms.Law Co-Founder Equity Hub
๐Ÿค Startup Equity & Co-Founder Documents

Bringing On a Co-Founder the Right Way

Adding a CTO, technical co-founder, or equity partner? Get the complete document bundleโ€”Founders Agreement, Stock Purchase with 83(b), IP Assignment, vesting schedulesโ€”everything to protect both parties.

500+ Founder Agreements
30 Days 83(b) Deadline
4 Years Standard Vesting
$799 Full Bundle
โš ๏ธ
California Founders: Special Requirements Apply

If you or your co-founder live in California, you need additional filings: 83(b) state copy, spousal consent, securities exemption. See CA requirements โ†’

What Documents Do You Need?

Answer 3 questions to get your personalized checklist

1 What's your situation?
Equal Partners Two people starting together from day 1. Needs strong deadlock provisions and voting tie-breakers since neither has control.
โš–๏ธ Equal Partners Starting together 50/50 50% each
Technical Co-Founder Technical person joining early to build the product. Often negotiating for larger equity than a later-stage CTO hire.
โš™๏ธ Tech Co-Founder Joining early to build 25-45%
Business Co-Founder Biz/sales/ops person joining a technical founder. Less IP assignment focus, more on roles, sales duties, and go-to-market.
๐Ÿ“Š Biz Co-Founder Sales, ops, or strategy 20-40%
Adding a CTO Existing founder bringing on a technical leader as co-founder. Heavy on IP assignmentโ€”CTO needs PIIA and prior work assignment.
๐Ÿ‘จโ€๐Ÿ’ป Adding a CTO Post-idea, need tech lead 15-35%
Advisor โ†’ Founder Converting an existing advisor to full co-founder. May need to terminate advisor agreement. Smaller equity, accelerated vesting common.
๐ŸŽ“ Advisor โ†’ Founder Converting advisor role 5-15%
Investor Co-Founder Someone investing capital AND becoming a co-founder. Hybrid docs neededโ€”investment terms plus founder terms, board seat issues.
๐Ÿ’ฐ Investor Founder Capital + active role 10-25%
โœ… Your Document Checklist
Get This Bundle โ†’

Critical Deadlines

Miss the 83(b) deadline and you could owe taxes on stock worth millions

๐Ÿ“
Day 0
Stock Grant Date
Sign all documents. Issue shares with vesting.
โš ๏ธ
Day 30 - CRITICAL
83(b) Election Deadline
File with IRS. NO extensions. CA founders file with FTB too.
๐Ÿ“…
Month 12
1-Year Cliff
First 25% vests. Leave before = 0%.
๐Ÿ“ˆ
Months 13-48
Monthly Vesting
Remaining 75% vests monthly (1/48th each).
๐ŸŽ‰
Month 48
Fully Vested
All shares owned outright. No repurchase risk.

Your Progress

0 of 18
0
Completed
18
Remaining
Download Document Bundle
Select documents to download as a zip file with Word templates

Co-Founder Document Library

Every document you need when bringing on a co-founder

Essential Must-Have Documents
๐Ÿ“‹
Founders Agreement
Master document: roles, equity splits, decision-making, deadlock resolution, departure scenarios.
Generate โ†’
๐Ÿ“ˆ
Stock Purchase + 83(b)
Issues founder shares with vesting. Includes critical 83(b) election (file within 30 days!).
Generate โ†’
๐Ÿ”’
PIIA (IP Assignment)
Ensures all code, designs, and IP belong to the companyโ€”not individual founders.
Generate โ†’
๐Ÿ›๏ธ
Board Resolution
Formal board approval authorizing equity grant. Required corporate formality.
Generate โ†’
๐Ÿ’ผ
IP Assignment
Assigns pre-existing IP the co-founder brings. Critical if CTO has prior code.
Generate โ†’
Recommended Highly Recommended
๐Ÿ‘”
Executive Employment
If co-founder is W-2 employee. Covers salary, benefits, termination, severance.
Generate โ†’
๐Ÿค
NDA / Confidentiality
Standalone confidentiality if not covered in PIIA. Protects trade secrets.
Generate โ†’
๐Ÿ“œ
Corporate Bylaws
May need amendment to add officers or adjust board for new co-founder.
Generate โ†’
๐Ÿ“Š
Equity Incentive Plan
If reserving option pool for future employees. Framework for equity comp.
Generate โ†’
Situational May Be Needed
๐Ÿ“„
Shareholder Agreement
Drag-along, tag-along, ROFR, voting agreements, share transfer restrictions.
Generate โ†’
๐ŸŽซ
Stock Certificate
Physical or electronic certificate evidencing stock ownership.
Generate โ†’
๐Ÿ›ก๏ธ
Indemnification Agreement
Protects co-founder as officer/director from personal liability.
Generate โ†’
โœ๏ธ
Written Consent
Board/shareholder action without formal meeting when all parties agree.
Generate โ†’
California California-Specific Requirements
๐Ÿ’
Spousal Consent
CA is community property. Married founders need spouse consent to prevent disputes.
Generate โ†’
๐Ÿ“‘
CA 83(b) FTB Filing
CA Franchise Tax Board requires copy of 83(b). Different from IRS filing!
Generate โ†’
โš–๏ธ
25102(f) Exemption
CA securities compliance. Stock must qualify for exemption.
Generate โ†’
๐Ÿ‘ฅ
Community Property Ack.
Both spouses acknowledge equity grant, waiving community claims.
Generate โ†’

Equity Tools & Calculators

Interactive tools to plan and visualize your equity structure

Tools Planning & Analysis
๐Ÿ“Š
Vesting Calculator
Visualize vesting schedules with cliff, monthly vesting, and acceleration scenarios.
Open Tool โ†’
๐Ÿ“ˆ
Cap Table
Build your capitalization table with founders, investors, and option pool.
Open Tool โ†’
๐ŸŽฏ
Option Grant Agreement
ISO and NSO stock option grants for employees and advisors.
Generate โ†’
๐Ÿ—ณ๏ธ
Voting Agreement
Board composition, drag-along rights, and protective provisions.
Generate โ†’
๐Ÿ”’
Right of First Refusal
ROFR and co-sale rights to control share transfers.
Generate โ†’
๐Ÿค
Advisor Agreement
FAST-standard advisor equity with vesting and services.
Generate โ†’

Equity Scenario Comparison

Compare different equity splits and vesting scenarios side by side

Your Shares Value
$1,250,000
250,000 shares
Your Shares Value
$1,750,000
350,000 shares
Your Shares Value
$1,000,000
200,000 shares
๐Ÿ“Š Comparison Summary
Metric Scenario 1 Scenario 2 Scenario 3

State-Specific Requirements

Key considerations based on where you incorporate or where founders reside

Delaware Delaware Corporations
Franchise Tax

Annual franchise tax due March 1st. Use Authorized Shares method (often cheaper) or Assumed Par Value method. Minimum $175/year for startups.

Annual Report

File annual report with DE Secretary of State. $50 filing fee. Due same date as franchise tax.

Registered Agent

Must maintain registered agent in Delaware. Typically $50-300/year through services like CT Corp or CSC.

Texas Texas Requirements
Franchise Tax

Texas has NO state income tax but has margin tax (franchise tax). Report due May 15th. No tax if revenue under $1.23M.

Securities Exemption

Texas Securities Act exemptions available. Rule 139.16 for small offerings. Federal Reg D often sufficient.

Non-Competes

Non-competes ARE enforceable in Texas (unlike California) if reasonable in scope, geography, and duration.

New York New York Requirements
Publication Requirement

LLCs must publish formation notice in 2 newspapers for 6 weeks. Can cost $500-2,000 depending on county.

Biennial Statement

File biennial statement with NY DOS every 2 years. $9 filing fee. Failure results in dissolution.

NYC Taxes

NYC has additional corporate tax (8.85%) and unincorporated business tax. Consider if operating in NYC.

Frequently Asked Questions

Quick answers to common co-founder equity questions

What is an 83(b) election and why is it critical? +
An 83(b) election is an IRS filing that lets you pay taxes on stock at the time of grant rather than when it vests. For founders getting stock at near-$0 value, this means paying minimal taxes now instead of potentially huge taxes later when the stock is worth more. You MUST file within 30 days of receiving stockโ€”there are no extensions, no exceptions.
What's the difference between ISO and NSO options? +
ISOs (Incentive Stock Options) are for employees only and have favorable tax treatmentโ€”no tax on exercise if you hold 2+ years. NSOs (Non-Qualified Stock Options) can go to anyone (employees, advisors, contractors) but are taxed as ordinary income on exercise. ISOs have a $100K annual limit; NSOs don't.
What's standard vesting for a co-founder? +
Standard is 4-year vesting with a 1-year cliff. This means: nothing vests for the first year, then 25% vests at the 1-year mark (the "cliff"), then the remaining 75% vests monthly over the next 3 years. This protects the company if a co-founder leaves early.
Should founders have a cliff? +
Yes, even existing founders should have vesting when bringing on a co-founder. It ensures everyone is committed for the long term. Some founders negotiate for "credit" for time already spent (e.g., 6-month cliff if already working 6 months), but fresh vesting for new co-founders is standard.
What's single-trigger vs double-trigger acceleration? +
Single-trigger: All unvested shares vest immediately when the company is acquired. Double-trigger: Vesting accelerates only if (1) the company is acquired AND (2) you're terminated within 12 months. Double-trigger is more common and investor-friendly; single-trigger can discourage acquirers.
Do I need a PIIA for every co-founder? +
Yes, absolutely. A PIIA (Proprietary Information and Inventions Assignment) ensures all intellectual property created by the co-founder belongs to the company. Without it, a departing co-founder could claim ownership of code, designs, or inventions. This is especially critical for technical co-founders.

Equity Glossary

Key terms you'll encounter in co-founder agreements

Vesting

The process by which equity is "earned" over time. Unvested shares can be repurchased by the company if you leave.

Cliff

A period before any equity vests. Typically 1 year. If you leave before the cliff, you get nothing.

Fully Diluted

Total shares including all outstanding shares, options, warrants, and reserved option poolโ€”the "true" ownership picture.

Option Pool

Shares reserved for future employees. Typically 10-20% of fully diluted shares. Dilutes existing shareholders.

ROFR (Right of First Refusal)

Company's right to buy shares before you can sell them to someone else. Prevents unwanted third-party shareholders.

Drag-Along

Majority shareholders can force minority to sell in an acquisition. Prevents holdouts from blocking deals.

Tag-Along (Co-Sale)

If founders sell, investors can sell too on the same terms. Protects minority investors from being left behind.

409A Valuation

Independent appraisal of company value for tax purposes. Required to set option exercise prices. Valid for 12 months.

FMV (Fair Market Value)

Current value of company stock. Options must be priced at FMV or higher to avoid tax penalties.

Liquidation Preference

Investors get paid first (usually their investment back) before common shareholders get anything in a sale.

Anti-Dilution

Protects investors from price decreases in future rounds. They get more shares if company raises at lower valuation.

Change of Control

Acquisition, merger, or sale of substantially all assets. Often triggers acceleration or liquidation preferences.

Common Mistakes to Avoid

Learn from others' errorsโ€”these mistakes can be catastrophic

Missing the 83(b) deadline

You have exactly 30 days from receiving stock to file. Miss it and you could owe taxes on millions of dollars of gains. Set a calendar reminder, send certified mail, keep proof of mailing.

No vesting for co-founders

If a co-founder leaves after 3 months with 40% of the company, you're in trouble. Always have vesting. Even for yourself if you're the original founderโ€”investors will require it anyway.

No IP assignment

If your CTO leaves and claims they own the code because there was no PIIA, your company could be worthless. Get IP assignment signed BEFORE work begins.

Handshake equity deals

"We agreed I'd get 30%" means nothing without paperwork. Get signed documents: stock purchase agreement, founders agreement, board resolutions. Verbal agreements lead to lawsuits.

50/50 splits without deadlock provisions

Equal ownership sounds fair, but what happens when you disagree? Without a tie-breaker mechanism, the company can become paralyzed. Include mediation, shotgun clauses, or advisory votes.

Ignoring California community property

If your co-founder is married and lives in California, their spouse may have a claim to half their equity. Get spousal consent to avoid nasty surprises in a divorce or acquisition.

Common Co-Founder Scenarios

What's typical? Here's what we see most often.

๐Ÿ‘จโ€๐Ÿ’ป CTO Joining Post-Idea
Solo founder has idea + early traction, brings on technical co-founder to build product.
Typical: 20-35%
โš–๏ธ Equal Partners Day 1
Two founders starting together, both contributing equally. Needs deadlock provisions.
Typical: 50/50
๐ŸŽ“ Advisor โ†’ Founder
Advisor going full-time as co-founder. Transition from advisory to founder equity.
Typical: 5-15%
๐Ÿ’ฐ Investor Co-Founder
Angel/early backer joins full-time. May have investment + founder equity.
Typical: 10-25%
๐Ÿข Wyoming Corp + CA Founders
Company in WY/DE, founders in CA. Must comply with both states.
Extra CA filings
๐Ÿš€ Employee โ†’ Co-Founder
Early employee proving invaluable, promoting to co-founder status.
Typical: 5-20%

Ready to Bring On Your Co-Founder?

Email me your situationโ€”company state, founder locations, equity split. I'll send a custom checklist and quote within 24 hours.

Get My Document Bundle โ†’ Browse Documents
'; } function generateFoundersTemplate() { return wrapDoc('Founders Agreement', '

Founders Agreement

' + '

This Founders Agreement is entered into as of [DATE]

' + '

1. The Company

' + '

Company Name: [COMPANY NAME]

' + '

State of Incorporation: [STATE]

' + '

2. Founders

' + '

Founder 1: [NAME] โ€” [TITLE] โ€” [EQUITY %]

' + '

Founder 2: [NAME] โ€” [TITLE] โ€” [EQUITY %]

' + '

3. Equity Allocation

' + '

The equity shall be allocated as set forth above, subject to vesting as described in the Stock Purchase Agreement.

' + '

4. Vesting

' + '

All founder shares shall vest over [4] years with a [1]-year cliff.

' + '

5. Roles and Responsibilities

' + '

Each founder agrees to devote their full business time and attention to the Company.

' + '

6. Intellectual Property

' + '

All founders shall execute the PIIA and assign all intellectual property to the Company.

' + '

7. Decision Making

' + '

Major decisions require unanimous consent of the founders.

' + '
' + '

Founder 1:

' + '
Signature
' + '

Name: [NAME]

' + '

Founder 2:

' + '
Signature
' + '

Name: [NAME]

' + '
' ); } function generateStockPurchaseTemplate() { return wrapDoc('Stock Purchase Agreement with 83(b) Election', '

Restricted Stock Purchase Agreement

' + '

Effective Date: [DATE]

' + '

1. Purchase of Shares

' + '

The Company agrees to sell and the Purchaser agrees to purchase [NUMBER] shares of Common Stock at a price of $[PRICE] per share.

' + '

2. Vesting Schedule

' + '

Shares vest over [48] months with a [12]-month cliff.

' + '

3. 83(b) Election

' + '

IMPORTANT: The Purchaser must file an 83(b) election with the IRS within 30 days of the grant date.

' + '

4. Repurchase Option

' + '

Unvested shares are subject to repurchase at the original purchase price upon termination.

' + '
' + '

Company:

' + '
Authorized Signature
' + '

Purchaser:

' + '
Signature
' + '
' ); } function generatePIIATemplate() { return wrapDoc('Proprietary Information and Inventions Assignment Agreement', '

PIIA Agreement

' + '

1. Confidential Information

' + '

Employee agrees to hold in confidence all proprietary information of the Company.

' + '

2. Inventions Assignment

' + '

All inventions, improvements, and discoveries made during employment are assigned to the Company.

' + '

3. Prior Inventions

' + '

List any prior inventions to be excluded: [NONE / LIST]

' + '
' + '
Employee Signature
' + '

Date: [DATE]

' + '
' ); } function generateBoardResolutionTemplate() { return wrapDoc('Board Resolution - Equity Grant', '

Written Consent of the Board of Directors

' + '

The undersigned, being all of the directors of [COMPANY NAME], hereby consent to the following resolutions:

' + '

Stock Issuance

' + '

RESOLVED, that the Company is authorized to issue [NUMBER] shares to [NAME] pursuant to the Restricted Stock Purchase Agreement.

' + '
' + '
Director Signature
' + '

Date: [DATE]

' + '
' ); } function generateIPAssignmentTemplate() { return wrapDoc('IP Assignment Agreement', '

Intellectual Property Assignment Agreement

' + '

1. Assignment

' + '

Assignor hereby assigns to the Company all right, title, and interest in the following intellectual property:

' + '

[DESCRIPTION OF IP]

' + '
' + '
Assignor Signature
' + '
' ); } function generateExecutiveEmploymentTemplate() { return wrapDoc('Executive Employment Agreement', '

Executive Employment Agreement

' + '

1. Position

' + '

Title: [TITLE]

' + '

2. Compensation

' + '

Base Salary: $[AMOUNT] per year

' + '

3. Term

' + '

Employment is at-will.

' + '
' + '
Executive Signature
' + '
Company Signature
' + '
' ); } function generateConsultingTemplate() { return wrapDoc('Consulting Agreement', '

Consulting Agreement

' + '

This Agreement is between [COMPANY] and [CONSULTANT].

' + '

1. Services

' + '

[DESCRIPTION OF SERVICES]

' + '

2. Compensation

' + '

$[RATE] per [hour/month]

' + '
' + '
Consultant Signature
' + '
Company Signature
' + '
' ); } function generateShareholderTemplate() { return wrapDoc('Shareholder Agreement', '

Shareholder Agreement

' + '

1. Transfer Restrictions

' + '

Shares may not be transferred without company consent and are subject to ROFR.

' + '

2. Drag-Along Rights

' + '

Majority shareholders may require minority participation in a sale.

' + '
' + '
Shareholder Signature
' + '
' ); } function generateIndemnificationTemplate() { return wrapDoc('Indemnification Agreement', '

Indemnification Agreement

' + '

The Company agrees to indemnify [NAME] to the fullest extent permitted by law.

' + '
' + '
Company Signature
' + '
Indemnitee Signature
' + '
' ); } function generateStockCertificateTemplate() { return wrapDoc('Stock Certificate', '

Stock Certificate

' + '

[COMPANY NAME]

' + '

Certificate No. [NUMBER]

' + '

[SHAREHOLDER NAME]

' + '

is the owner of [NUMBER] shares of Common Stock

' ); } function generateSpousalConsentTemplate() { return wrapDoc('Spousal Consent', '

Spousal Consent

' + '

I, the spouse of [FOUNDER NAME], consent to the terms of the Stock Purchase Agreement and waive any community property interest.

' + '
' + '
Spouse Signature
' + '

Date: [DATE]

' + '
' ); } function generate83bFTBTemplate() { return wrapDoc('California FTB 83(b) Election Cover Letter', '

California Franchise Tax Board Filing

' + '

Franchise Tax Board
P.O. Box 942840
Sacramento, CA 94240-0040

' + '

Re: IRC Section 83(b) Election

' + '

Dear Sir or Madam:

' + '

Enclosed please find a copy of an election under IRC Section 83(b) for California income tax purposes.

' + '

Taxpayer: [NAME]

' + '

SSN: [XXX-XX-XXXX]

' ); } function generate25102fTemplate() { return wrapDoc('California 25102(f) Exemption Notice', '

Notice of Transaction Under Section 25102(f)

' + '

Department of Financial Protection and Innovation

' + '

This notice is filed pursuant to California Corporations Code Section 25102(f).

' + '

Issuer: [COMPANY NAME]

' + '

Securities Issued: [NUMBER] shares of Common Stock

' ); } function generateCommunityPropertyTemplate() { return wrapDoc('Community Property Acknowledgment', '

Community Property Acknowledgment

' + '

We acknowledge that shares acquired are community property but agree to voting and disposition terms.

' + '
' + '
Founder Signature
' + '
Spouse Signature
' + '
' ); } function generateAdvisorTemplate() { return wrapDoc('Advisor Agreement', '

Advisor Agreement

' + '

Advisor: [NAME]

' + '

Equity: [PERCENTAGE]% vesting over [24] months

' + '

Services

' + '

[DESCRIPTION]

' + '
' + '
Advisor Signature
' + '
Company Signature
' + '
' ); } function generateOptionGrantTemplate() { return wrapDoc('Stock Option Grant Agreement', '

Stock Option Grant Agreement

' + '

Optionee: [NAME]

' + '

Option Type: [ISO/NSO]

' + '

Number of Shares: [NUMBER]

' + '

Exercise Price: $[PRICE] per share

' + '

Vesting: [4] years with [1]-year cliff

' + '
' + '
Optionee Signature
' + '
Company Signature
' + '
' ); } function generateVotingTemplate() { return wrapDoc('Voting Agreement', '

Voting Agreement

' + '

The stockholders agree to vote their shares as follows:

' + '

Board Composition

' + '

[DESCRIPTION]

' + '

Drag-Along

' + '

Stockholders agree to participate in approved sales.

' + '
' + '
Stockholder Signature
' + '
' ); } function generateROFRTemplate() { return wrapDoc('Right of First Refusal Agreement', '

Right of First Refusal and Co-Sale Agreement

' + '

1. Right of First Refusal

' + '

Before any transfer, the Company has first right to purchase.

' + '

2. Co-Sale Rights

' + '

Investors may participate pro-rata in founder sales.

' + '
' + '
Stockholder Signature
' + '
Company Signature
' + '
' ); } function generateReadme() { return 'CO-FOUNDER EQUITY DOCUMENT BUNDLE\n' + '================================\n\n' + 'Generated by Terms.Law Co-Founder Equity Hub\n' + 'https://terms.law/Founders/\n\n' + 'IMPORTANT INSTRUCTIONS:\n' + '----------------------\n\n' + '1. These are TEMPLATE documents with placeholder fields marked in [BRACKETS] or highlighted yellow.\n\n' + '2. Fill in all placeholder fields before using.\n\n' + '3. For full customization, use the online generators at https://terms.law/Founders/\n\n' + '4. CRITICAL DEADLINES:\n' + ' - 83(b) Election: File with IRS within 30 DAYS of stock grant\n' + ' - California 25102(f): File within 15 days of issuance\n\n' + '5. These documents are provided for informational purposes. Consult an attorney for your specific situation.\n\n' + '================================\n' + 'Terms.Law - Legal Made Simple\n'; } // Initialize initBundleChecklist(); })(); // ============================================ // SAVED DRAFTS MANAGER // ============================================ (function() { var STORAGE_PREFIX = 'termslaw_generator_'; // Known generator mappings var generatorMappings = { 'founders-agreement-generator': { name: 'Founders Agreement', url: '/Templates/founders-agreement-generator.html', icon: '๐Ÿ“‹' }, 'founder-stock-purchase-generator': { name: 'Stock Purchase + 83(b)', url: '/Templates/founder-stock-purchase-generator.html', icon: '๐Ÿ“ˆ' }, 'piia-generator': { name: 'PIIA (IP Assignment)', url: '/Templates/piia-generator.html', icon: '๐Ÿ”’' }, 'board-resolution-generator': { name: 'Board Resolution', url: '/Templates/board-resolution-generator.html', icon: '๐Ÿ›๏ธ' }, 'ip-assignment-agreement-generator': { name: 'IP Assignment', url: '/Templates/ip-assignment-agreement-generator.html', icon: '๐Ÿ’ผ' }, 'executive-employment-agreement-generator': { name: 'Executive Employment', url: '/Templates/executive-employment-agreement-generator.html', icon: '๐Ÿ‘”' }, 'consulting-agreement-generator': { name: 'Consulting Agreement', url: '/Templates/consulting-agreement-generator.html', icon: '๐Ÿ“„' }, 'shareholder-agreement-generator': { name: 'Shareholder Agreement', url: '/Templates/shareholder-agreement-generator.html', icon: '๐Ÿค' }, 'indemnification-agreement-generator': { name: 'Indemnification Agreement', url: '/Templates/indemnification-agreement-generator.html', icon: '๐Ÿ›ก๏ธ' }, 'stock-certificate-generator': { name: 'Stock Certificate', url: '/Templates/stock-certificate-generator.html', icon: '๐Ÿ“œ' }, 'spousal-consent-generator': { name: 'Spousal Consent', url: '/Templates/spousal-consent-generator.html', icon: '๐Ÿ’' }, 'california-83b-ftb-generator': { name: 'CA 83(b) FTB Filing', url: '/Templates/california-83b-ftb-generator.html', icon: '๐Ÿ“‹' }, 'california-25102f-exemption-generator': { name: '25102(f) Exemption', url: '/Templates/california-25102f-exemption-generator.html', icon: '๐Ÿ“‘' }, 'community-property-acknowledgment-generator': { name: 'Community Property', url: '/Templates/community-property-acknowledgment-generator.html', icon: '๐Ÿ ' }, 'advisor-agreement-generator': { name: 'Advisor Agreement', url: '/Templates/advisor-agreement-generator.html', icon: '๐Ÿค' }, 'option-grant-agreement-generator': { name: 'Option Grant', url: '/Templates/option-grant-agreement-generator.html', icon: '๐ŸŽฏ' }, 'voting-agreement-generator': { name: 'Voting Agreement', url: '/Templates/voting-agreement-generator.html', icon: '๐Ÿ—ณ๏ธ' }, 'rofr-agreement-generator': { name: 'ROFR Agreement', url: '/Templates/rofr-agreement-generator.html', icon: '๐Ÿ”’' }, 'vesting-schedule-calculator': { name: 'Vesting Calculator', url: '/Templates/vesting-schedule-calculator.html', icon: '๐Ÿ“Š' }, 'cap-table-generator': { name: 'Cap Table', url: '/Templates/cap-table-generator.html', icon: '๐Ÿ“ˆ' } }; function formatTimeAgo(timestamp) { var ms = Date.now() - timestamp; var seconds = Math.floor(ms / 1000); var minutes = Math.floor(seconds / 60); var hours = Math.floor(minutes / 60); var days = Math.floor(hours / 24); if (days > 0) return days + ' day' + (days > 1 ? 's' : '') + ' ago'; if (hours > 0) return hours + ' hour' + (hours > 1 ? 's' : '') + ' ago'; if (minutes > 0) return minutes + ' min' + (minutes > 1 ? 's' : '') + ' ago'; return 'just now'; } function getSavedDrafts() { var drafts = []; try { for (var i = 0; i < localStorage.length; i++) { var key = localStorage.key(i); if (key && key.startsWith(STORAGE_PREFIX)) { var generatorId = key.replace(STORAGE_PREFIX, ''); var mapping = generatorMappings[generatorId]; if (mapping) { var data = JSON.parse(localStorage.getItem(key)); drafts.push({ id: generatorId, key: key, name: mapping.name, url: mapping.url, icon: mapping.icon, timestamp: data._timestamp || Date.now() }); } } } } catch (e) { console.warn('Error reading drafts:', e); } // Sort by most recent drafts.sort(function(a, b) { return b.timestamp - a.timestamp; }); return drafts; } function renderSavedDrafts() { var drafts = getSavedDrafts(); var section = document.getElementById('savedDraftsSection'); var list = document.getElementById('savedDraftsList'); if (drafts.length === 0) { section.style.display = 'none'; return; } section.style.display = 'block'; var html = ''; drafts.forEach(function(draft) { html += '
'; html += '
'; html += '' + draft.icon + ''; html += '
'; html += '' + draft.name + ''; html += 'Saved ' + formatTimeAgo(draft.timestamp) + ''; html += '
'; html += '
'; html += 'Resume โ†’'; html += ''; html += '
'; }); list.innerHTML = html; } window.deleteDraft = function(key) { try { localStorage.removeItem(key); renderSavedDrafts(); } catch (e) { console.warn('Could not delete draft:', e); } }; window.clearAllDrafts = function() { if (!confirm('Delete all saved drafts? This cannot be undone.')) return; try { var keysToDelete = []; for (var i = 0; i < localStorage.length; i++) { var key = localStorage.key(i); if (key && key.startsWith(STORAGE_PREFIX)) { keysToDelete.push(key); } } keysToDelete.forEach(function(key) { localStorage.removeItem(key); }); renderSavedDrafts(); } catch (e) { console.warn('Could not clear drafts:', e); } }; // Initialize renderSavedDrafts(); })(); // ============================================ // SCENARIO COMPARISON // ============================================ (function() { function getScenarioData(num) { return { name: document.getElementById('scenario' + num + 'Name').value, shares: parseInt(document.getElementById('scenario' + num + 'Shares').value) || 0, equity: parseFloat(document.getElementById('scenario' + num + 'Equity').value) || 0, vesting: parseInt(document.getElementById('scenario' + num + 'Vesting').value) || 0, cliff: parseInt(document.getElementById('scenario' + num + 'Cliff').value) || 0, valuation: parseFloat(document.getElementById('scenario' + num + 'Valuation').value) || 0 }; } function calculateScenario(data) { var yourShares = Math.floor(data.shares * (data.equity / 100)); var yourValue = data.valuation * (data.equity / 100); var cliffShares = Math.floor(yourShares * (data.cliff / data.vesting)); var monthlyVest = data.vesting > data.cliff ? (yourShares - cliffShares) / (data.vesting - data.cliff) : 0; return { yourShares: yourShares, yourValue: yourValue, cliffShares: cliffShares, monthlyVest: Math.floor(monthlyVest), pricePerShare: data.shares > 0 ? data.valuation / data.shares : 0 }; } function formatCurrency(amount) { if (amount >= 1000000) { return '$' + (amount / 1000000).toFixed(2) + 'M'; } else if (amount >= 1000) { return '$' + (amount / 1000).toFixed(0) + 'K'; } return '$' + amount.toLocaleString(); } function formatNumber(num) { return num.toLocaleString(); } window.updateComparison = function() { var scenarios = [ getScenarioData(1), getScenarioData(2), getScenarioData(3) ]; var results = scenarios.map(calculateScenario); // Update individual scenario results for (var i = 0; i < 3; i++) { document.getElementById('scenario' + (i + 1) + 'Value').textContent = formatCurrency(results[i].yourValue); document.getElementById('scenario' + (i + 1) + 'ShareCount').textContent = formatNumber(results[i].yourShares) + ' shares'; } // Update summary table headers document.getElementById('summaryHead1').textContent = scenarios[0].name; document.getElementById('summaryHead2').textContent = scenarios[1].name; document.getElementById('summaryHead3').textContent = scenarios[2].name; // Find winners for each metric var maxValue = Math.max(results[0].yourValue, results[1].yourValue, results[2].yourValue); var maxShares = Math.max(results[0].yourShares, results[1].yourShares, results[2].yourShares); var minCliff = Math.min( scenarios[0].cliff || 999, scenarios[1].cliff || 999, scenarios[2].cliff || 999 ); var minVesting = Math.min( scenarios[0].vesting || 999, scenarios[1].vesting || 999, scenarios[2].vesting || 999 ); // Build summary table var tbody = document.getElementById('summaryTableBody'); tbody.innerHTML = ''; var metrics = [ { label: 'Total Value', values: results.map(function(r) { return formatCurrency(r.yourValue); }), winners: results.map(function(r) { return r.yourValue === maxValue; }) }, { label: 'Share Count', values: results.map(function(r) { return formatNumber(r.yourShares); }), winners: results.map(function(r) { return r.yourShares === maxShares; }) }, { label: 'Cliff Period', values: scenarios.map(function(s) { return s.cliff + ' months'; }), winners: scenarios.map(function(s) { return s.cliff === minCliff; }) }, { label: 'Full Vest', values: scenarios.map(function(s) { return s.vesting + ' months'; }), winners: scenarios.map(function(s) { return s.vesting === minVesting; }) }, { label: 'Monthly Vest', values: results.map(function(r) { return formatNumber(r.monthlyVest) + ' shares'; }), winners: [false, false, false] }, { label: 'Price/Share', values: results.map(function(r) { return '$' + r.pricePerShare.toFixed(4); }), winners: [false, false, false] } ]; metrics.forEach(function(metric) { var row = document.createElement('tr'); row.innerHTML = '' + metric.label + '' + '' + metric.values[0] + '' + '' + metric.values[1] + '' + '' + metric.values[2] + ''; tbody.appendChild(row); }); // Update chart var chart = document.getElementById('comparisonChart'); var maxChartValue = maxValue || 1; var barColors = ['', 'scenario-2', 'scenario-3']; var chartHtml = ''; for (var j = 0; j < 3; j++) { var height = Math.max(20, (results[j].yourValue / maxChartValue) * 150); chartHtml += '
'; chartHtml += '
'; chartHtml += '
' + scenarios[j].name + '
'; chartHtml += '
' + formatCurrency(results[j].yourValue) + '
'; chartHtml += '
'; } chart.innerHTML = chartHtml; }; // Initialize updateComparison(); })();