export function trademarkRegistrationCalculator(form: FormTs) {
// Government filing fees by jurisdiction (per class)
const filingFees: Record<string, number> = {
'uspto-teas-plus': 250,
'uspto-teas-standard': 350,
'euipo': 850,
'euipo-additional': 50,
'uk-ipo': 170,
'wipo-madrid': 653,
'canada': 330,
'australia': 250
};
// Attorney fees by service
const attorneyFees: Record<string, number> = {
'basic-search': 300,
'comprehensive-search': 750,
'clearance-opinion': 500,
'application-prep': 600,
'application-complex': 1000,
'response-oa': 500,
'opposition-defense': 2500,
'monitoring': 300
};
// Trademark type multipliers
const typeMultipliers: Record<string, number> = {
'word': 1.0,
'logo': 1.2,
'combined': 1.3,
'sound': 1.5,
'motion': 1.5,
'3d': 1.4
};
form.addRow(row => {
row.addTextPanel('header', {
computedValue: () => 'Trademark Registration Cost Calculator',
customStyles: { 'font-size': '1.5rem', 'font-weight': '600', 'color': '#1e293b' }
});
});
form.addSpacer({ height: 20 });
// Trademark Details Section
const trademarkSection = form.addSubform('trademark', { title: '™️ Trademark Details' });
trademarkSection.addRow(row => {
row.addDropdown('trademarkType', {
label: 'Trademark Type',
options: [
{ id: 'word', name: 'Word Mark (Text only)' },
{ id: 'logo', name: 'Logo / Design Mark' },
{ id: 'combined', name: 'Combined (Word + Logo)' },
{ id: 'sound', name: 'Sound Mark' },
{ id: 'motion', name: 'Motion Mark' },
{ id: '3d', name: '3D Mark' }
],
defaultValue: 'word',
isRequired: true
}, '1fr');
row.addInteger('numClasses', {
label: 'Number of Classes',
min: 1,
max: 45,
defaultValue: 1,
isRequired: true
}, '1fr');
});
trademarkSection.addRow(row => {
row.addDropdown('applicantType', {
label: 'Applicant Type',
options: [
{ id: 'individual', name: 'Individual / Sole Proprietor' },
{ id: 'small-business', name: 'Small Business' },
{ id: 'corporation', name: 'Corporation / LLC' },
{ id: 'non-profit', name: 'Non-Profit Organization' }
],
defaultValue: 'small-business',
isRequired: true
}, '1fr');
row.addDropdown('filingBasis', {
label: 'Filing Basis',
options: [
{ id: 'use', name: 'Currently in Use' },
{ id: 'intent', name: 'Intent to Use' },
{ id: 'foreign', name: 'Based on Foreign Registration' }
],
defaultValue: 'use',
isRequired: true
}, '1fr');
});
// Jurisdiction Section
const jurisdictionSection = form.addSubform('jurisdiction', { title: '🌍 Filing Jurisdiction' });
jurisdictionSection.addRow(row => {
row.addCheckbox('uspto', {
label: 'United States (USPTO)',
defaultValue: true
}, '1fr');
row.addDropdown('usptoType', {
label: 'USPTO Filing Type',
options: [
{ id: 'teas-plus', name: 'TEAS Plus ($250/class)' },
{ id: 'teas-standard', name: 'TEAS Standard ($350/class)' }
],
defaultValue: 'teas-plus',
isVisible: () => jurisdictionSection.checkbox('uspto')?.value() === true
}, '1fr');
});
jurisdictionSection.addRow(row => {
row.addCheckbox('euipo', {
label: 'European Union (EUIPO)',
defaultValue: false
}, '1fr');
row.addCheckbox('ukipo', {
label: 'United Kingdom (UK IPO)',
defaultValue: false
}, '1fr');
});
jurisdictionSection.addRow(row => {
row.addCheckbox('wipo', {
label: 'International (WIPO Madrid)',
defaultValue: false
}, '1fr');
row.addInteger('wipoCountries', {
label: 'Number of Countries',
min: 1,
max: 130,
defaultValue: 3,
isVisible: () => jurisdictionSection.checkbox('wipo')?.value() === true
}, '1fr');
});
jurisdictionSection.addRow(row => {
row.addCheckbox('canada', {
label: 'Canada (CIPO)',
defaultValue: false
}, '1fr');
row.addCheckbox('australia', {
label: 'Australia (IP Australia)',
defaultValue: false
}, '1fr');
});
// Services Section
const servicesSection = form.addSubform('services', { title: '⚖️ Legal Services' });
servicesSection.addRow(row => {
row.addDropdown('searchType', {
label: 'Trademark Search',
options: [
{ id: 'none', name: 'No Search (Not Recommended)' },
{ id: 'basic', name: 'Basic Search ($300)' },
{ id: 'comprehensive', name: 'Comprehensive Search ($750)' }
],
defaultValue: 'comprehensive',
isRequired: true
}, '1fr');
row.addCheckbox('clearanceOpinion', {
label: 'Legal Clearance Opinion (+$500)',
defaultValue: false
}, '1fr');
});
servicesSection.addRow(row => {
row.addDropdown('applicationComplexity', {
label: 'Application Preparation',
options: [
{ id: 'standard', name: 'Standard Application ($600)' },
{ id: 'complex', name: 'Complex Application ($1,000)' }
],
defaultValue: 'standard',
isRequired: true
}, '1fr');
row.addCheckbox('expedited', {
label: 'Expedited Processing (+30%)',
defaultValue: false
}, '1fr');
});
// Additional Services Section
const addonsSection = form.addSubform('addons', { title: '✨ Additional Services' });
addonsSection.addRow(row => {
row.addCheckbox('officeActionResponse', {
label: 'Office Action Response (if needed, +$500)',
defaultValue: true
}, '1fr');
row.addCheckbox('oppositionDefense', {
label: 'Opposition Defense Budget (+$2,500)',
defaultValue: false
}, '1fr');
});
addonsSection.addRow(row => {
row.addCheckbox('monitoring', {
label: 'Trademark Monitoring (1 year, +$300)',
defaultValue: false
}, '1fr');
row.addCheckbox('renewalReminder', {
label: 'Renewal Reminder Service (Free)',
defaultValue: true
}, '1fr');
});
addonsSection.addRow(row => {
row.addCheckbox('specimenPrep', {
label: 'Specimen Preparation Assistance (+$150)',
defaultValue: false
}, '1fr');
row.addCheckbox('assignmentRecording', {
label: 'Assignment Recording (+$200)',
defaultValue: false
}, '1fr');
});
form.addSpacer({ height: 20, showLine: true, lineStyle: 'dashed' });
// Summary Section
const summarySection = form.addSubform('summary', { title: '💰 Cost Estimate', isCollapsible: false });
summarySection.addRow(row => {
row.addPriceDisplay('governmentFees', {
label: 'Government Filing Fees',
computedValue: () => {
const numClasses = trademarkSection.integer('numClasses')?.value() || 1;
let total = 0;
// USPTO
if (jurisdictionSection.checkbox('uspto')?.value()) {
const usptoType = jurisdictionSection.dropdown('usptoType')?.value() || 'teas-plus';
const fee = (usptoType === 'teas-plus' ? filingFees['uspto-teas-plus'] : filingFees['uspto-teas-standard']) ?? 0;
total += fee * numClasses;
}
// EUIPO
if (jurisdictionSection.checkbox('euipo')?.value()) {
total += filingFees['euipo'] ?? 0; // First class
if (numClasses > 1) {
total += filingFees['euipo-additional'] ?? 0 * (numClasses - 1);
}
}
// UK IPO
if (jurisdictionSection.checkbox('ukipo')?.value()) {
total += filingFees['uk-ipo'] ?? 0 * numClasses;
}
// WIPO Madrid
if (jurisdictionSection.checkbox('wipo')?.value()) {
const countries = jurisdictionSection.integer('wipoCountries')?.value() || 3;
total += filingFees['wipo-madrid'] ?? 0 + (countries * 100 * numClasses);
}
// Canada
if (jurisdictionSection.checkbox('canada')?.value()) {
total += filingFees['canada'] ?? 0 * numClasses;
}
// Australia
if (jurisdictionSection.checkbox('australia')?.value()) {
total += filingFees['australia'] ?? 0 * numClasses;
}
return total;
},
variant: 'default'
}, '1fr');
row.addPriceDisplay('searchFees', {
label: 'Search & Clearance',
computedValue: () => {
let total = 0;
const searchType = servicesSection.dropdown('searchType')?.value() || 'comprehensive';
if (searchType === 'basic') total += attorneyFees['basic-search'] ?? 0;
else if (searchType === 'comprehensive') total += attorneyFees['comprehensive-search'] ?? 0;
if (servicesSection.checkbox('clearanceOpinion')?.value()) {
total += attorneyFees['clearance-opinion'] ?? 0;
}
return total;
},
variant: 'default'
}, '1fr');
});
summarySection.addRow(row => {
row.addPriceDisplay('attorneyFees', {
label: 'Attorney Fees',
computedValue: () => {
const trademarkType = trademarkSection.dropdown('trademarkType')?.value() || 'word';
const numClasses = trademarkSection.integer('numClasses')?.value() || 1;
const typeMult = typeMultipliers?.[trademarkType] ?? 1.0;
// Application prep
const appComplexity = servicesSection.dropdown('applicationComplexity')?.value() || 'standard';
let baseFee = (appComplexity === 'complex' ? attorneyFees['application-complex'] : attorneyFees['application-prep']) ?? 0;
// Additional classes
let total = baseFee * typeMult;
if (numClasses > 1) {
total += (numClasses - 1) * 200; // $200 per additional class
}
// Multiple jurisdictions
let jurisdictionCount = 0;
if (jurisdictionSection.checkbox('uspto')?.value()) jurisdictionCount++;
if (jurisdictionSection.checkbox('euipo')?.value()) jurisdictionCount++;
if (jurisdictionSection.checkbox('ukipo')?.value()) jurisdictionCount++;
if (jurisdictionSection.checkbox('wipo')?.value()) jurisdictionCount++;
if (jurisdictionSection.checkbox('canada')?.value()) jurisdictionCount++;
if (jurisdictionSection.checkbox('australia')?.value()) jurisdictionCount++;
if (jurisdictionCount > 1) {
total += (jurisdictionCount - 1) * 300; // $300 per additional jurisdiction
}
// Expedited
if (servicesSection.checkbox('expedited')?.value()) {
total *= 1.3;
}
return Math.round(total);
},
variant: 'default'
}, '1fr');
row.addPriceDisplay('addonsFees', {
label: 'Additional Services',
computedValue: () => {
let total = 0;
if (addonsSection.checkbox('officeActionResponse')?.value()) total += attorneyFees['response-oa'] ?? 0;
if (addonsSection.checkbox('oppositionDefense')?.value()) total += attorneyFees['opposition-defense'] ?? 0;
if (addonsSection.checkbox('monitoring')?.value()) total += attorneyFees['monitoring'] ?? 0;
if (addonsSection.checkbox('specimenPrep')?.value()) total += 150;
if (addonsSection.checkbox('assignmentRecording')?.value()) total += 200;
return total;
},
variant: 'default',
prefix: '+'
}, '1fr');
});
const finalSection = form.addSubform('final', {
title: '🧾 Total Investment',
isCollapsible: false,
sticky: 'bottom'
});
finalSection.addRow(row => {
row.addPriceDisplay('totalCost', {
label: 'Total Estimated Cost',
computedValue: () => {
const numClasses = trademarkSection.integer('numClasses')?.value() || 1;
const trademarkType = trademarkSection.dropdown('trademarkType')?.value() || 'word';
const typeMult = typeMultipliers?.[trademarkType] ?? 1.0;
// Government fees
let govFees = 0;
if (jurisdictionSection.checkbox('uspto')?.value()) {
const usptoType = jurisdictionSection.dropdown('usptoType')?.value() || 'teas-plus';
const fee = (usptoType === 'teas-plus' ? filingFees['uspto-teas-plus'] : filingFees['uspto-teas-standard']) ?? 0;
govFees += fee * numClasses;
}
if (jurisdictionSection.checkbox('euipo')?.value()) {
govFees += filingFees['euipo'] ?? 0;
if (numClasses > 1) govFees += filingFees['euipo-additional'] ?? 0 * (numClasses - 1);
}
if (jurisdictionSection.checkbox('ukipo')?.value()) {
govFees += filingFees['uk-ipo'] ?? 0 * numClasses;
}
if (jurisdictionSection.checkbox('wipo')?.value()) {
const countries = jurisdictionSection.integer('wipoCountries')?.value() || 3;
govFees += filingFees['wipo-madrid'] ?? 0 + (countries * 100 * numClasses);
}
if (jurisdictionSection.checkbox('canada')?.value()) {
govFees += filingFees['canada'] ?? 0 * numClasses;
}
if (jurisdictionSection.checkbox('australia')?.value()) {
govFees += filingFees['australia'] ?? 0 * numClasses;
}
// Search fees
let searchFees = 0;
const searchType = servicesSection.dropdown('searchType')?.value() || 'comprehensive';
if (searchType === 'basic') searchFees += attorneyFees['basic-search'] ?? 0;
else if (searchType === 'comprehensive') searchFees += attorneyFees['comprehensive-search'] ?? 0;
if (servicesSection.checkbox('clearanceOpinion')?.value()) {
searchFees += attorneyFees['clearance-opinion'] ?? 0;
}
// Attorney fees
const appComplexity = servicesSection.dropdown('applicationComplexity')?.value() || 'standard';
let attFees = (appComplexity === 'complex' ? attorneyFees['application-complex'] : attorneyFees['application-prep']) ?? 0;
attFees *= typeMult;
if (numClasses > 1) attFees += (numClasses - 1) * 200;
let jurisdictionCount = 0;
if (jurisdictionSection.checkbox('uspto')?.value()) jurisdictionCount++;
if (jurisdictionSection.checkbox('euipo')?.value()) jurisdictionCount++;
if (jurisdictionSection.checkbox('ukipo')?.value()) jurisdictionCount++;
if (jurisdictionSection.checkbox('wipo')?.value()) jurisdictionCount++;
if (jurisdictionSection.checkbox('canada')?.value()) jurisdictionCount++;
if (jurisdictionSection.checkbox('australia')?.value()) jurisdictionCount++;
if (jurisdictionCount > 1) attFees += (jurisdictionCount - 1) * 300;
if (servicesSection.checkbox('expedited')?.value()) attFees *= 1.3;
// Addons
let addons = 0;
if (addonsSection.checkbox('officeActionResponse')?.value()) addons += attorneyFees['response-oa'] ?? 0;
if (addonsSection.checkbox('oppositionDefense')?.value()) addons += attorneyFees['opposition-defense'] ?? 0;
if (addonsSection.checkbox('monitoring')?.value()) addons += attorneyFees['monitoring'] ?? 0;
if (addonsSection.checkbox('specimenPrep')?.value()) addons += 150;
if (addonsSection.checkbox('assignmentRecording')?.value()) addons += 200;
return Math.round(govFees + searchFees + attFees + addons);
},
variant: 'large'
});
});
finalSection.addRow(row => {
row.addTextPanel('timeline', {
computedValue: () => {
let timeline = 'Estimated Timeline: ';
if (jurisdictionSection.checkbox('uspto')?.value()) {
timeline += 'USPTO 8-12 months';
}
if (jurisdictionSection.checkbox('euipo')?.value()) {
timeline += timeline.includes('months') ? ', EUIPO 4-6 months' : 'EUIPO 4-6 months';
}
return timeline || 'Timeline varies by jurisdiction';
},
customStyles: { 'font-size': '0.9rem', 'color': '#64748b', 'text-align': 'center' }
});
});
finalSection.addRow(row => {
row.addTextPanel('disclaimer', {
computedValue: () => 'This estimate is for planning purposes only. Government fees are subject to change. Actual costs may vary based on prosecution history, office actions, and oppositions.',
customStyles: { 'font-size': '0.8rem', 'color': '#64748b', 'font-style': 'italic' }
});
});
form.configureSubmitButton({
label: 'Start Registration Process'
});
}