// Contact page — CRO-optimized lead form
// ← Paste your Apps Script Web App URL here after deploying (see README / setup instructions)
const WEBHOOK_URL = 'https://script.google.com/macros/s/AKfycbwvjYBBewj_rHSLQk0R3Sw9F559_EbvaqobuZbOa-w03_UjoLm_Ld4Z0yv9UXdH_8Jm/exec';
const { useState: useStateC } = React;
const DIAL_CODES = [
{ code: '+91', label: 'IN +91', country: 'India', min: 10, max: 10 },
{ code: '+1', label: 'US +1', country: 'USA/Canada', min: 10, max: 10 },
{ code: '+44', label: 'UK +44', country: 'UK', min: 10, max: 10 },
{ code: '+971', label: 'AE +971', country: 'UAE', min: 9, max: 9 },
{ code: '+61', label: 'AU +61', country: 'Australia', min: 9, max: 9 },
{ code: '+65', label: 'SG +65', country: 'Singapore', min: 8, max: 8 },
{ code: '+974', label: 'QA +974', country: 'Qatar', min: 8, max: 8 },
{ code: '+965', label: 'KW +965', country: 'Kuwait', min: 8, max: 8 },
{ code: '+968', label: 'OM +968', country: 'Oman', min: 8, max: 8 },
{ code: '+973', label: 'BH +973', country: 'Bahrain', min: 8, max: 8 },
];
const TYPO_TLDS = ['ocm','cmo','con','cpm','nte','ogr','coim','comn','cob','gmai','gamil','yahooo','gnail'];
function validatePhone(digits, dialInfo) {
if (!digits) return 'Phone number is required';
if (digits.length !== dialInfo.min) return `Enter a valid ${dialInfo.min}-digit mobile number`;
if (dialInfo.code === '+91' && !/^[6-9]/.test(digits)) return 'Indian mobile numbers must start with 6, 7, 8 or 9';
// Reject all same digit: 9999999999
if (/^(.)\1+$/.test(digits)) return 'Enter a real mobile number';
// Reject sequential ascending / descending: 1234567890, 9876543210
const d = digits.split('').map(Number);
const asc = d.every((n, i) => i === 0 || n === (d[i-1] + 1) % 10);
const desc = d.every((n, i) => i === 0 || n === (d[i-1] - 1 + 10) % 10);
if (asc || desc) return 'Enter a real mobile number';
return null;
}
function validateEmail(v) {
const s = v.trim().toLowerCase();
if (!s) return 'Email is required';
const atIdx = s.lastIndexOf('@');
if (atIdx < 1) return 'Enter a valid email address';
const local = s.slice(0, atIdx);
const domain = s.slice(atIdx + 1);
if (!domain.includes('.')) return 'Enter a valid email address';
const parts = domain.split('.');
const tld = parts[parts.length - 1];
const host = parts[parts.length - 2] || '';
if (!/^[a-z]{2,10}$/.test(tld)) return 'Enter a valid email address';
if (host.length < 2) return 'Enter a valid email address';
if (local.length < 2 || /^(.)\1+$/.test(local)) return 'Enter a valid email address';
if (TYPO_TLDS.includes(tld)) {
const fix = ['ocm','cmo','cob','comn','coim'].includes(tld) ? 'com' : tld === 'nte' ? 'net' : ['ogr','org'].includes(tld) ? 'org' : 'com';
return `Did you mean .${fix}? Please check your email`;
}
return null;
}
const ContactHero = () => (
Tell us what you're imagining — a home, an investment, a brand collaboration — and we'll bring the rest.
Start with a
single question.
A member of our team will be in touch within one working day.