/* data.jsx — demo content for the Vela e-bikes tenant */

const BIZ = { name: "Vela", full: "Vela E-Bikes", domain: "velabikes.com", initials: "V" };

const MODELS = [
  { id: "fast", tier: "Fast & Affordable", tech: "mos-lite-3", params: "8B",
    blurb: "Snappy answers for high-volume support. Lowest cost per message.",
    cost: "$0.12", latency: "0.4s", quality: 3 },
  { id: "balanced", tier: "Balanced", tech: "mos-core-3", params: "32B",
    blurb: "The recommended starting point. Great accuracy at a sensible price.",
    cost: "$0.34", latency: "0.9s", quality: 4, recommended: true },
  { id: "quality", tier: "High Quality", tech: "mos-pro-3", params: "120B",
    blurb: "Deepest reasoning and the most reliable brand voice. Premium tier.",
    cost: "$0.96", latency: "1.7s", quality: 5 },
];

const SOURCES = [
  { id: 1, name: "Vela Product Catalog 2026.pdf", kind: "pdf", size: "4.2 MB", chunks: 184, status: "indexed" },
  { id: 2, name: "Battery & Range FAQ.pdf", kind: "pdf", size: "820 KB", chunks: 47, status: "indexed" },
  { id: 3, name: "Returns, Refunds & Warranty.pdf", kind: "pdf", size: "1.1 MB", chunks: 63, status: "indexed" },
  { id: 4, name: "Pricing & Financing Sheet.xlsx", kind: "sheet", size: "210 KB", chunks: 22, status: "indexed" },
  { id: 5, name: "Assembly & First Ride SOP.pdf", kind: "pdf", size: "2.6 MB", chunks: 91, status: "indexed" },
  { id: 6, name: "velabikes.com/support", kind: "link", size: "—", chunks: 38, status: "indexed" },
  { id: 7, name: "Maintenance & Service Manual.pdf", kind: "pdf", size: "5.8 MB", chunks: 142, status: "indexing" },
];

// Playground conversation
const PLAY_THREAD = [
  { role: "user", text: "What's the range on the Vela One and does cold weather affect it?" },
  { role: "bot", text: "The Vela One is rated for up to 60 miles on a single charge in Eco mode (around 38 miles in Sport mode). In cold weather below 40°F you can expect roughly 10–20% less range, since lithium cells discharge slower in the cold. Storing the battery indoors and letting it warm up before riding helps recover most of that.",
    sources: [
      { doc: "Battery & Range FAQ.pdf", page: "p.3", score: 0.94 },
      { doc: "Vela Product Catalog 2026.pdf", page: "p.18", score: 0.88 },
    ],
    quality: 92, halluc: 4, voice: 96 },
];

const SUGGESTED_Q = [
  "How long is the warranty?",
  "Can I return a bike after 30 days?",
  "Do you offer financing?",
  "Is the Vela One waterproof?",
];

const LABELS = [
  { id: "sales", name: "Sales", color: "var(--info)" },
  { id: "support", name: "Support", color: "var(--good)" },
  { id: "pricing", name: "Pricing", color: "var(--accent)" },
  { id: "refund", name: "Refund", color: "var(--bad)" },
  { id: "onboarding", name: "Onboarding", color: "var(--warn)" },
  { id: "product", name: "Product question", color: "var(--ink-2)" },
  { id: "complaint", name: "Complaint", color: "var(--bad)" },
];

// Dataset composition for fine-tuning
const DATASETS = [
  { id: "sft", name: "Approved Training Examples", desc: "High-quality question → answer pairs", count: 73, icon: "checkCircle", on: true, live: "approvedTrain" },
  { id: "pref", name: "Preference pairs", desc: "Chosen vs. rejected answer comparisons", count: 41, icon: "scale", on: true },
  { id: "rej", name: "Rejected outputs", desc: "Bad answers to train the model away from", count: 28, icon: "thumbDown", on: false },
  { id: "eval", name: "Eval cases", desc: "Held-out questions to measure quality", count: 35, icon: "target", on: false, live: "evalHoldout" },
  { id: "voice", name: "Brand voice examples", desc: "Tone, formatting, and phrasing references", count: 19, icon: "spark", on: true },
];

const THRESHOLD = { have: 73, need: 200 };

// Evaluation comparison
const EVAL_METRICS = [
  { key: "Answer accuracy", base: 81, tuned: 94, unit: "%", better: "high" },
  { key: "Brand voice consistency", base: 68, tuned: 95, unit: "%", better: "high" },
  { key: "Task success rate", base: 74, tuned: 90, unit: "%", better: "high" },
  { key: "Hallucination rate", base: 9.2, tuned: 2.4, unit: "%", better: "low" },
  { key: "Escalation accuracy", base: 70, tuned: 92, unit: "%", better: "high" },
  { key: "Cost per request", base: 0.34, tuned: 0.21, unit: "$", better: "low" },
  { key: "Latency (p50)", base: 0.9, tuned: 0.7, unit: "s", better: "low" },
  { key: "Human preference win rate", base: 22, tuned: 78, unit: "%", better: "high" },
];

const EVAL_PAIRS = [
  { q: "A customer says the bike arrived with a scratch on the frame. How do you respond?",
    base: "Scratches are considered cosmetic and are not covered under the standard warranty. You can purchase touch-up paint from our store.",
    tuned: "I'm sorry your Vela showed up with a scratch — that's not how we want it to arrive. Shipping damage is fully covered: send a quick photo and we'll get a replacement frame or a partial refund sorted out right away. Want me to start that for you?",
    baseScore: 61, tunedScore: 96, label: "complaint" },
  { q: "What financing options do you offer?",
    base: "We offer financing. Please check the website for details.",
    tuned: "We offer 0% APR financing over 12 months through Affirm, plus 24- and 36-month plans with low interest. On the Vela One that's about $158/month for a year, with no impact to apply. Want the link to pre-qualify?",
    baseScore: 70, tunedScore: 93, label: "pricing" },
  { q: "Is the Vela One waterproof?",
    base: "The Vela One is waterproof and can be used in all conditions including underwater.",
    tuned: "The Vela One is water-resistant (IP65), so rain and wet roads are no problem. I'd avoid submerging it or power-washing the drivetrain, though — that can force water past the seals.",
    baseScore: 48, tunedScore: 97, label: "product" },
];

const TRAIN_PHASES = ["Queued", "Training", "Validating", "Ready"];

window.DEMO = { BIZ, MODELS, SOURCES, PLAY_THREAD, SUGGESTED_Q, LABELS, DATASETS, THRESHOLD, EVAL_METRICS, EVAL_PAIRS, TRAIN_PHASES };
