/**
 * Demo Contacts - Static sample contacts for unauthenticated users
 *
 * Shows a realistic contact list with various contact types to demonstrate
 * the app's capabilities without requiring login.
 */

import type { Contact } from '$lib/api/contacts';

/**
 * Generate demo contacts
 */
export function generateDemoContacts(): Contact[] {
	const now = new Date().toISOString();

	const demoContacts: Contact[] = [
		{
			id: 'demo_1',
			userId: 'demo',
			firstName: 'Anna',
			lastName: 'Müller',
			displayName: 'Anna Müller',
			email: 'anna.mueller@example.com',
			phone: '+49 30 12345678',
			mobile: '+49 170 1234567',
			company: 'Tech Solutions GmbH',
			jobTitle: 'Product Manager',
			city: 'Berlin',
			country: 'Deutschland',
			isFavorite: true,
			isArchived: false,
			visibility: 'private',
			tags: [{ id: 'tag_1', name: 'Arbeit', color: '#3b82f6' }],
			createdAt: now,
			updatedAt: now,
		},
		{
			id: 'demo_2',
			userId: 'demo',
			firstName: 'Max',
			lastName: 'Schmidt',
			displayName: 'Max Schmidt',
			email: 'max.schmidt@example.com',
			mobile: '+49 171 9876543',
			company: 'Design Studio',
			jobTitle: 'UX Designer',
			city: 'München',
			country: 'Deutschland',
			isFavorite: true,
			isArchived: false,
			visibility: 'private',
			tags: [{ id: 'tag_1', name: 'Arbeit', color: '#3b82f6' }],
			createdAt: now,
			updatedAt: now,
		},
		{
			id: 'demo_3',
			userId: 'demo',
			firstName: 'Lisa',
			lastName: 'Weber',
			displayName: 'Lisa Weber',
			email: 'lisa.w@example.com',
			phone: '+49 40 87654321',
			city: 'Hamburg',
			country: 'Deutschland',
			isFavorite: false,
			isArchived: false,
			visibility: 'private',
			tags: [{ id: 'tag_2', name: 'Freunde', color: '#22c55e' }],
			birthday: '1992-03-15',
			createdAt: now,
			updatedAt: now,
		},
		{
			id: 'demo_4',
			userId: 'demo',
			firstName: 'Thomas',
			lastName: 'Becker',
			displayName: 'Thomas Becker',
			email: 'thomas.becker@example.com',
			mobile: '+49 172 5555555',
			company: 'Consulting Partners',
			jobTitle: 'Senior Consultant',
			city: 'Frankfurt',
			country: 'Deutschland',
			website: 'https://example.com',
			isFavorite: false,
			isArchived: false,
			visibility: 'private',
			tags: [{ id: 'tag_1', name: 'Arbeit', color: '#3b82f6' }],
			createdAt: now,
			updatedAt: now,
		},
		{
			id: 'demo_5',
			userId: 'demo',
			firstName: 'Sarah',
			lastName: 'Klein',
			displayName: 'Sarah Klein',
			email: 'sarah.klein@example.com',
			phone: '+49 221 1111111',
			mobile: '+49 173 2222222',
			city: 'Köln',
			country: 'Deutschland',
			isFavorite: false,
			isArchived: false,
			visibility: 'private',
			tags: [{ id: 'tag_3', name: 'Familie', color: '#f59e0b' }],
			birthday: '1988-07-22',
			createdAt: now,
			updatedAt: now,
		},
		{
			id: 'demo_6',
			userId: 'demo',
			firstName: 'Michael',
			lastName: 'Hoffmann',
			displayName: 'Michael Hoffmann',
			email: 'm.hoffmann@example.com',
			company: 'Startup Ventures',
			jobTitle: 'CEO',
			city: 'Berlin',
			country: 'Deutschland',
			linkedin: 'michael-hoffmann',
			isFavorite: false,
			isArchived: false,
			visibility: 'private',
			tags: [{ id: 'tag_1', name: 'Arbeit', color: '#3b82f6' }],
			createdAt: now,
			updatedAt: now,
		},
		{
			id: 'demo_7',
			userId: 'demo',
			firstName: 'Julia',
			lastName: 'Fischer',
			displayName: 'Julia Fischer',
			mobile: '+49 174 3333333',
			city: 'Stuttgart',
			country: 'Deutschland',
			isFavorite: false,
			isArchived: false,
			visibility: 'private',
			tags: [{ id: 'tag_2', name: 'Freunde', color: '#22c55e' }],
			createdAt: now,
			updatedAt: now,
		},
		{
			id: 'demo_8',
			userId: 'demo',
			firstName: 'Dr. Stefan',
			lastName: 'Wagner',
			displayName: 'Dr. Stefan Wagner',
			email: 'dr.wagner@praxis.de',
			phone: '+49 89 4444444',
			company: 'Praxis Dr. Wagner',
			jobTitle: 'Arzt',
			street: 'Hauptstraße 42',
			city: 'München',
			postalCode: '80331',
			country: 'Deutschland',
			isFavorite: false,
			isArchived: false,
			visibility: 'private',
			notes: 'Hausarzt, Termine immer vormittags',
			createdAt: now,
			updatedAt: now,
		},
		{
			id: 'demo_9',
			userId: 'demo',
			firstName: 'Emma',
			lastName: 'Braun',
			displayName: 'Emma Braun',
			email: 'emma.b@example.com',
			mobile: '+49 175 6666666',
			company: 'Marketing Pro',
			jobTitle: 'Marketing Director',
			city: 'Düsseldorf',
			country: 'Deutschland',
			isFavorite: true,
			isArchived: false,
			visibility: 'private',
			tags: [{ id: 'tag_1', name: 'Arbeit', color: '#3b82f6' }],
			createdAt: now,
			updatedAt: now,
		},
		{
			id: 'demo_10',
			userId: 'demo',
			firstName: 'Peter',
			lastName: 'Schneider',
			displayName: 'Peter Schneider',
			email: 'peter.schneider@example.com',
			phone: '+49 511 7777777',
			city: 'Hannover',
			country: 'Deutschland',
			isFavorite: false,
			isArchived: true,
			visibility: 'private',
			tags: [],
			createdAt: now,
			updatedAt: now,
		},
	];

	return demoContacts;
}

/**
 * Check if a contact ID is a demo contact
 */
export function isDemoContact(id: string): boolean {
	return id.startsWith('demo_');
}
