/* MIRAI — Datos mock del CRM (consultas desde formulario web / sitio) */

// Extiende DASH_INBOX (definido en dashboard-inbox-data.jsx) con el canal CRM.
DASH_INBOX.crm = [
  {
    id: "crm1",
    name: "Laura Méndez",
    handle: "lauramendez@gmail.com",
    source: "Formulario web",
    avatar: null,
    mode: "agent",
    unread: 0,
    online: true,
    lastTime: "18:52",
    messages: [
      { from: "lead", time: "18:41", text: "Hola, vi una propiedad en Nordelta en la web. ¿Sigue disponible?" },
      { from: "emma", time: "18:42", text: "¡Hola Laura! Sí, sigue disponible. ¿La buscás para comprar o alquilar?" },
      { from: "lead", time: "18:43", text: "Para comprar. Me interesan 3 ambientes." },
      { from: "emma", time: "18:44", text: "Perfecto. ¿Tenés un presupuesto aproximado en mente?" },
      { from: "lead", time: "18:45", text: "Hasta USD 220.000." },
      { from: "lead", time: "18:46", text: "¿También tienen algo similar en Tigre?" },
      { from: "agent", time: "18:52", text: "¡Hola Laura! Soy Martina del equipo comercial. Sí, tenemos opciones en Nordelta y Tigre. ¿Querés que te comparta las más relevantes?" },
    ],
    lead: {
      intent: "Comprar", operation: "Compra", zone: "Nordelta", budget: "USD 220.000",
      propertyType: "Departamento · 3 amb.", propertyOfInterest: "Depto Nordelta · ND-204",
      status: "talking", broker: "Martina López", origin: "Formulario web",
      createdAt: "Hoy, 18:41", lastContact: "Hoy, 18:52", tags: ["Web", "Comprador"],
      notes: "Busca opciones en Nordelta y Tigre. Quiere recibir alternativas similares.",
    },
  },
  {
    id: "crm2",
    name: "Tomás Suárez",
    handle: "tsuarez@outlook.com",
    source: "Formulario web",
    avatar: null,
    mode: "bot",
    unread: 0,
    online: true,
    lastTime: "18:21",
    messages: [
      { from: "lead", time: "18:15", text: "Buenas, ¿tienen cocheras disponibles en el edificio que vi en la web?" },
      { from: "emma", time: "18:15", text: "¡Hola Tomás! Sí, el edificio tiene cocheras disponibles. ¿Buscás una fija o rotativa?" },
      { from: "lead", time: "18:18", text: "Fija, para dos autos." },
      { from: "emma", time: "18:21", text: "Perfecto. Hay disponibles dos cocheras fijas contiguas. ¿Querés que un asesor te contacte para coordinar la visita?" },
    ],
    lead: {
      intent: "Comprar", operation: "Compra", zone: "Palermo", budget: "USD 280.000",
      propertyType: "Departamento · 3 amb.", propertyOfInterest: "Edificio Palermo · PA-310",
      status: "emma", broker: "Sin asignar", origin: "Formulario web",
      createdAt: "Hoy, 18:15", lastContact: "Hoy, 18:21", tags: ["Web", "Cochera"],
      notes: "Requiere dos cocheras fijas. Emma avanzando con la consulta.",
    },
  },
  {
    id: "crm3",
    name: "Paula Ríos",
    handle: "paula.rios@gmail.com",
    source: "Formulario web",
    avatar: null,
    mode: "waiting",
    unread: 1,
    online: true,
    lastTime: "17:48",
    messages: [
      { from: "lead", time: "17:40", text: "Me interesa el depto de Palermo. ¿Podría conseguir más información?" },
      { from: "emma", time: "17:40", text: "¡Hola Paula! Con gusto. ¿Lo buscás para vivir o como inversión?" },
      { from: "lead", time: "17:43", text: "Para vivir con mi pareja. 2 o 3 ambientes." },
      { from: "emma", time: "17:44", text: "Perfecto. ¿Tienen preferencia por el piso o alguna orientación en particular?" },
      { from: "lead", time: "17:48", text: "Alto y con buena luz, si puede ser. ¿Cuándo podrían mostrarme el depto?" },
    ],
    lead: {
      intent: "Comprar", operation: "Compra", zone: "Palermo", budget: "USD 180.000",
      propertyType: "Departamento · 2/3 amb.", propertyOfInterest: "Depto Palermo · PA-122",
      status: "waiting", broker: "Sin asignar", origin: "Formulario web",
      createdAt: "Hoy, 17:40", lastContact: "Hoy, 17:48", tags: ["Web", "Pareja"],
      notes: "Busca piso alto con buena luz. Espera coordinar visita.",
    },
  },
  {
    id: "crm4",
    name: "Nicolás Vega",
    handle: "nvega@empresa.com",
    source: "Formulario web",
    avatar: null,
    mode: "waiting",
    unread: 0,
    online: true,
    lastTime: "17:15",
    messages: [
      { from: "lead", time: "17:08", text: "Hola! Vi la propiedad en Nordelta. ¿Cuáles son los gastos aproximados?" },
      { from: "emma", time: "17:08", text: "¡Hola Nicolás! Las expensas del edificio son de $180.000 mensuales, incluyen seguridad y mantenimiento de amenities." },
      { from: "lead", time: "17:12", text: "Y los impuestos municipales, ¿están incluidos?" },
      { from: "emma", time: "17:13", text: "Los impuestos municipales no están incluidos. Están estimados en $45.000 mensuales para esa zona." },
      { from: "lead", time: "17:15", text: "¿Y el precio de venta es negociable?" },
    ],
    lead: {
      intent: "Comprar", operation: "Compra", zone: "Nordelta", budget: "USD 310.000",
      propertyType: "Casa · 4 amb.", propertyOfInterest: "Casa Nordelta · ND-089",
      status: "waiting", broker: "Sin asignar", origin: "Formulario web",
      createdAt: "Hoy, 17:08", lastContact: "Hoy, 17:15", tags: ["Web", "Comprador"],
      notes: "Consulta detallada sobre expensas e impuestos. Espera respuesta sobre precio.",
    },
  },
  {
    id: "crm5",
    name: "Sofía Benítez",
    handle: "sbenitez@gmail.com",
    source: "Formulario web",
    avatar: null,
    mode: "bot",
    unread: 0,
    online: false,
    lastTime: "16:40",
    messages: [
      { from: "lead", time: "16:30", text: "Hola, vi el depto en la web. ¿Pueden enviarme más fotos y el plano?" },
      { from: "emma", time: "16:30", text: "¡Hola Sofía! Claro, con gusto. El departamento cuenta con plano disponible. ¿A qué email te lo envío?" },
      { from: "lead", time: "16:35", text: "A sbenitez@gmail.com, muchas gracias." },
      { from: "emma", time: "16:40", text: "¡Perfecto! En los próximos minutos recibirás el plano y un álbum completo de fotos. Si tenés alguna otra consulta, estoy acá 😊" },
    ],
    lead: {
      intent: "Alquilar", operation: "Alquiler", zone: "Tigre", budget: "USD 900 / mes",
      propertyType: "Departamento · 2 amb.", propertyOfInterest: "Depto Tigre · TG-044",
      status: "emma", broker: "Sin asignar", origin: "Formulario web",
      createdAt: "Hoy, 16:30", lastContact: "Hoy, 16:40", tags: ["Web", "Alquiler"],
      notes: "Emma envió plano y fotos. Lead en etapa de evaluación.",
    },
  },
];

Object.assign(window, { DASH_INBOX });
