// data.jsx — product catalog, calculators, mock dashboard, schedule slots

const PRODUCTS = [
  {
    id: "wealth-tracker-ai",
    name_id: "Wealth Tracker AI",
    name_en: "Wealth Tracker AI",
    price: 139000,
    priceOld: 149000,
    tag_id: "Baru · AI",
    tag_en: "New · AI",
    icon: "Sparkle",
    image: "assets/products/wealth-tracker-ai.png",
    blurb_id: "Catat keuangan cukup lewat chat Telegram. Kirim \"beli bensin 80 ribu\", AI otomatis membacanya dan mencatat ke Google Sheets-mu.",
    blurb_en: "Track your finances just by chatting on Telegram. Send \"beli bensin 80 ribu\" and the AI reads it and logs it to your Google Sheets.",
    features_id: [
      "AI Telegram Bot untuk pencatatan otomatis",
      "Dashboard cashflow & budgeting otomatis",
      "Tracker aset, tabungan, income & expense",
      "Setup guide lengkap",
    ],
    features_en: [
      "AI Telegram Bot for automatic logging",
      "Automatic cashflow & budgeting dashboard",
      "Asset, savings, income & expense tracker",
      "Complete setup guide",
    ],
    note_id: "Khusus 100 orang pertama, diskon jadi 99K! Akses template lifetime.",
    note_en: "First 100 buyers only — discounted to 99K! Lifetime template access.",
  },
  {
    id: "cashflow",
    name_id: "Cashflow & Budget Tracker",
    name_en: "Cashflow & Budget Tracker",
    price: 39000,
    tag_id: "Paling laris",
    tag_en: "Best seller",
    icon: "Wallet",
    image: "assets/products/cashflow.png",
    blurb_id: "Smart budget planner & tracker — simpel, efisien, dan terarah.",
    blurb_en: "Smart budget planner & tracker — simple, efficient, and on-track.",
    features_id: [
      "Budgeting bulanan sesuai kebutuhan",
      "Transaction tracker yang fleksibel (adjustable)",
      "BONUS: Free konsultasi template",
    ],
    features_en: [
      "Monthly budgeting tailored to your needs",
      "Flexible, adjustable transaction tracker",
      "BONUS: Free template consultation",
    ],
  },
  {
    id: "kpr",
    name_id: "Mortgage Planner",
    name_en: "Mortgage Planner",
    price: 55000,
    tag_id: "Premium",
    tag_en: "Premium",
    icon: "Home",
    image: "assets/products/kpr.png",
    blurb_id: "Hitung KPR dengan lengkap sebelum akad — syariah, fix, maupun floating.",
    blurb_en: "Plan your mortgage completely before signing — sharia, fixed, or floating.",
    features_id: [
      "Skema hitung KPR terlengkap: Syariah, Floating & Fix Rate, Fix Rate Berjenjang",
      "BONUS: Skema proteksi KPR",
      "BONUS: Free konsultasi template",
    ],
    features_en: [
      "Most complete mortgage scheme: Sharia, Floating & Fixed, Tiered Fixed Rate",
      "BONUS: Mortgage protection scheme",
      "BONUS: Free template consultation",
    ],
  },
  {
    id: "edu",
    name_id: "Education Planner",
    name_en: "Education Planner",
    price: 39000,
    tag_id: "Untuk orang tua",
    tag_en: "For parents",
    icon: "GraduationCap",
    image: "assets/products/edu.png",
    blurb_id: "Kalkulator dana pendidikan + simulasi investasi + simulasi proteksi.",
    blurb_en: "Education fund calculator + investment simulation + protection simulation.",
    features_id: [
      "Template lengkap & estetik — hitung dana pendidikan dari TK sampai kuliah",
      "Perencanaan investasi pendidikan",
      "BONUS: Skema proteksi dana pendidikan",
      "BONUS: Free konsultasi template",
    ],
    features_en: [
      "Complete & aesthetic template — education fund from kindergarten to university",
      "Education investment planning",
      "BONUS: Education fund protection scheme",
      "BONUS: Free template consultation",
    ],
  },
  {
    id: "pension",
    name_id: "Financial Freedom Planner",
    name_en: "Financial Freedom Planner",
    price: 49000,
    tag_id: "Untuk masa depan",
    tag_en: "Long-term",
    icon: "Coins",
    image: "assets/products/pension.png",
    blurb_id: "Kalkulator perencanaan pensiun/F.I.R.E + perencanaan investasi & proteksi dana pensiun.",
    blurb_en: "Retirement/F.I.R.E planning calculator + retirement investment & protection planning.",
    features_id: [
      "Hitung perencanaan pensiun & FIRE",
      "Perencanaan investasi pensiun",
      "BONUS: Skema proteksi dana pensiun",
      "BONUS: Free konsultasi template",
    ],
    features_en: [
      "Calculate retirement & FIRE planning",
      "Retirement investment planning",
      "BONUS: Retirement fund protection scheme",
      "BONUS: Free template consultation",
    ],
  },
  {
    id: "invest",
    name_id: "Investment Tracker",
    name_en: "Investment Tracker",
    price: 49000,
    tag_id: "Lengkap",
    tag_en: "Most complete",
    icon: "ChartBar",
    image: "assets/products/invest.png",
    blurb_id: "Simulasi perencanaan investasi + investment tracker super lengkap (saham, obligasi, bisnis, dll).",
    blurb_en: "Investment planning simulation + super complete investment tracker (stocks, bonds, business, etc).",
    features_id: [
      "Simulasi perencanaan tujuan investasi",
      "Investment tracker & decision support",
      "BONUS: Skema proteksi dana investasi",
      "BONUS: Free konsultasi template",
    ],
    features_en: [
      "Investment goal planning simulation",
      "Investment tracker & decision support",
      "BONUS: Investment fund protection scheme",
      "BONUS: Free template consultation",
    ],
  },
  {
    id: "insurance",
    name_id: "Insurance Planning",
    name_en: "Insurance Planning",
    price: 39000,
    tag_id: "Wajib punya",
    tag_en: "Essential",
    icon: "ShieldCheck",
    image: "assets/products/insurance.png",
    blurb_id: "Kalkulator kebutuhan asuransi + policy tracker + ilustrasi polis asuransi ideal.",
    blurb_en: "Insurance needs calculator + policy tracker + ideal insurance policy illustration.",
    features_id: [
      "Kalkulator kebutuhan asuransi",
      "Policy tracker untuk kelola polis dengan rapi",
      "BONUS: Free konsultasi template",
    ],
    features_en: [
      "Insurance needs calculator",
      "Policy tracker to manage your policies neatly",
      "BONUS: Free template consultation",
    ],
  },
  {
    id: "bundle",
    name_id: "Paket Lengkap (Semua 6 Produk)",
    name_en: "Complete Bundle (All 6 Products)",
    price: 149000,
    tag_id: "Hemat 35%",
    tag_en: "Save 35%",
    icon: "Sparkle",
    blurb_id: "Semua 6 spreadsheet planner dalam satu paket — cashflow, KPR, pendidikan, financial freedom, investasi, & asuransi.",
    blurb_en: "All 6 spreadsheet planners in one package — cashflow, mortgage, education, financial freedom, investment, & insurance.",
    features_id: [
      "Cashflow & Budget Tracker",
      "Mortgage Planner",
      "Education Planner",
      "Financial Freedom Planner",
      "Investment Tracker",
      "Insurance Planning",
    ],
    features_en: [
      "Cashflow & Budget Tracker",
      "Mortgage Planner",
      "Education Planner",
      "Financial Freedom Planner",
      "Investment Tracker",
      "Insurance Planning",
    ],
  },
];

const CALCULATORS = [
  { id: "checkup", icon: "Sparkle", color: "#FFB800" },
  { id: "rumah", icon: "Home", color: "#FF9A6B" },
  { id: "edu", icon: "GraduationCap", color: "#C6F24E" },
  { id: "pension", icon: "Coins", color: "#E5A4FF" },
  { id: "warisan", icon: "Gift", color: "#FFD66B" },
  { id: "haji", icon: "Mosque", color: "#5EE5B0" },
  { id: "zakat", icon: "Heart", color: "#7C9CFF" },
  { id: "invest", icon: "ChartBar", color: "#C6F24E" },
  { id: "insurance", icon: "ShieldCheck", color: "#7C9CFF" },
];

const PAYMENT_METHODS = [
  { id: "qris", name: "QRIS", sub: "Scan & bayar dengan e-wallet apapun" },
  { id: "bank", name: "Transfer Bank", sub: "BCA · Mandiri · BNI", banks: ["BCA", "Mandiri", "BNI"] },
  { id: "ewallet", name: "E-Wallet", sub: "GoPay · OVO · Dana", wallets: ["GoPay", "OVO", "Dana"] },
];

const PROGRAMS = [
  {
    id: "warisan",
    icon: "Gift",
    color: "#FFB800",
    title_id: "Perencanaan Warisan",
    title_en: "Estate Planning",
    tagline_id: "Warisan cinta, bukan warisan hutang",
    tagline_en: "An inheritance of love, not of debt",
    desc_id: "Aset yang kamu kumpulin susah payah harus jadi milik keluarga — bukan jadi beban administrasi atau sumber konflik.",
    desc_en: "Assets you've built up should belong to your family — not become an admin burden or source of conflict.",
    benefits_id: [
      "Asuransi jiwa yang bikin keluarga tetap aman finansial",
      "Premium yang ditempatkan juga tumbuh nilainya",
      "Inheritance plan sesuai prinsip syariah (faraidh + wasiat)",
    ],
    benefits_en: [
      "Life insurance keeping your family financially secure",
      "Premiums that grow in value over time",
      "Sharia-compliant inheritance plan (faraidh + will)",
    ],
    ideal_id: "Cocok buat yang sudah established & punya keluarga",
    ideal_en: "For those established with a family",
  },
  {
    id: "utang",
    icon: "Coins",
    color: "#FF9A6B",
    title_id: "Pelunasan Utang",
    title_en: "Debt Protection",
    tagline_id: "Utang jangan jadi beban keluarga",
    tagline_en: "Don't let debt burden your family",
    desc_id: "KPR, mobil, atau pinjaman bisnis — semua bagus untuk pertumbuhan. Tapi siapa yang lunasi kalau kamu tiba-tiba ada apa-apa?",
    desc_en: "Mortgage, car, or business loans are all great for growth. But who covers them if something happens to you?",
    benefits_id: [
      "Cicilan otomatis lunas 100% kalau terjadi risiko",
      "Proses klaim cepat & transparan",
      "Bisa di-apply ke KPR, vehicle loan, business loan",
    ],
    benefits_en: [
      "Loans paid off 100% if something happens",
      "Fast & transparent claim process",
      "Works for mortgage, vehicle, and business loans",
    ],
    ideal_id: "Cocok buat yang baru ambil KPR atau cicilan besar",
    ideal_en: "For those with recent mortgage or major loans",
  },
  {
    id: "pendidikan",
    icon: "GraduationCap",
    color: "#C6F24E",
    title_id: "Pendidikan Anak",
    title_en: "Children's Education",
    tagline_id: "Anak kamu tetap sekolah, apapun yang terjadi",
    tagline_en: "Your kids stay in school — no matter what",
    desc_id: "Biaya pendidikan naik 10% per tahun. Plan-nya bukan sekadar nabung — tapi nabung yang dilindungi & tumbuh.",
    desc_en: "Education costs rise ~10% per year. The plan isn't just saving — it's protected, growing savings.",
    benefits_id: [
      "Tabungan khusus yang invest & tumbuh",
      "Pertanggungan agar pendidikan anak gak terhenti",
      "Pencairan flexible per fase (SD/SMP/SMA/Kuliah)",
    ],
    benefits_en: [
      "Dedicated savings that invest & grow",
      "Coverage ensures education never stops",
      "Flexible withdrawals per stage (primary / secondary / university)",
    ],
    ideal_id: "Cocok buat orang tua muda dengan planning matang",
    ideal_en: "For young parents with a solid plan",
  },
  {
    id: "investasi",
    icon: "ChartBar",
    color: "#5EE5B0",
    title_id: "Program Investasi",
    title_en: "Investment Program",
    tagline_id: "Duit kamu tumbuh dengan safety net lengkap",
    tagline_en: "Your money grows — with a full safety net",
    desc_id: "Nabung doang sudah gak cukup. Tapi investasi tanpa proteksi juga risiko. Solusi: investasi dengan asuransi terintegrasi.",
    desc_en: "Saving alone isn't enough. But investing without protection is risky. Solution: investment with integrated insurance.",
    benefits_id: [
      "Akses ke instrumen yang dikelola fund manager profesional",
      "Portofolio terdiversifikasi (saham, bond, money market)",
      "Asuransi terintegrasi dengan laporan transparan bulanan",
    ],
    benefits_en: [
      "Access to professional fund manager portfolios",
      "Diversified across stocks, bonds, money market",
      "Integrated insurance with transparent monthly reports",
    ],
    ideal_id: "Cocok buat long-term wealth building",
    ideal_en: "For long-term wealth building",
  },
  {
    id: "haji",
    icon: "Mosque",
    color: "#7C9CFF",
    featured: true,
    title_id: "Pelunasan Haji",
    title_en: "Hajj Savings",
    tagline_id: "Ibadah haji adalah impian — rencananya finansial",
    tagline_en: "Hajj is a spiritual dream — the plan is financial",
    desc_id: "Pergi haji dengan pikiran tenang, bukan parno biaya. Tabungan khusus dengan growth, dilindungi asuransi.",
    desc_en: "Go on Hajj with peace of mind, not financial anxiety. A dedicated growing fund, fully insured.",
    benefits_id: [
      "Tabungan khusus dengan return investasi syariah",
      "Asuransi proteksi — dana tetap aman buat keluarga",
      "Fleksibilitas: kapan ready berangkat, tinggal jalan",
    ],
    benefits_en: [
      "Dedicated savings with sharia-compliant returns",
      "Insurance protection — funds stay safe for family",
      "Flexible departure timing — go when you're ready",
    ],
    ideal_id: "Cocok buat yang serius merencanakan ibadah haji",
    ideal_en: "For those seriously planning their Hajj",
  },
  {
    id: "employee",
    icon: "Users",
    color: "#E5A4FF",
    title_id: "Employee Benefit",
    title_en: "Employee Benefit",
    tagline_id: "Tim yang sehat = bisnis yang jalan",
    tagline_en: "Healthy team = thriving business",
    desc_id: "Program untuk perusahaan — bikin tim merasa valued, terlindungi, fokus kerja tanpa parno biaya kesehatan.",
    desc_en: "For companies — making your team feel valued, protected, and focused without worrying about medical costs.",
    benefits_id: [
      "Paket asuransi kesehatan, jiwa, dan pensiun",
      "Retention rate naik — hemat biaya rekrutmen",
      "Compliance penuh + tax advantages + employer branding",
    ],
    benefits_en: [
      "Health, life, and pension insurance packages",
      "Higher retention — saves on recruitment costs",
      "Full compliance + tax advantages + employer branding",
    ],
    ideal_id: "Cocok buat bisnis yang lagi scale",
    ideal_en: "For businesses that are scaling",
  },
];

const WEBINARS = [
  {
    id: "cuan",
    date_id: "10 Mei 2026",
    date_en: "10 May 2026",
    time: "10:00 WIB",
    title_id: "Ekonomi Lagi Gak Pasti, Tapi Cuan Harus Pasti",
    title_en: "Ekonomi Lagi Gak Pasti, Tapi Cuan Harus Pasti",
    subtitle_id: "Kupas tuntas jalur cuan: Nabung, Investasi & Bisnis",
    subtitle_en: "Breaking down the paths: Saving, Investing & Business",
    speaker: "Jannatul Jasmine & Zahira Mustika",
    format: "Online via Zoom",
    price: 30000,
    image: "assets/webinars/cuan-pasti.jpeg",
    past: true,
  },
  {
    id: "pendidikan",
    date_id: "14 April 2026",
    date_en: "14 April 2026",
    time: "19:30 WIB",
    title_id: "Biaya Sekolah Naik Terus, Kita Harus Gimana?",
    title_en: "Biaya Sekolah Naik Terus, Kita Harus Gimana?",
    subtitle_id: "Strategi nyiapin dana pendidikan anak",
    subtitle_en: "Strategy to prepare your child's education fund",
    speaker: "Jannatul Jasmine & Zahira Mustika",
    format: "Online via Zoom",
    price: 30000,
    image: "assets/webinars/dana-pendidikan.jpeg",
    past: true,
  },
];

const formatIDR = (n, lang) => {
  const locale = (lang || window.__currentLang__ || "id") === "en" ? "en-US" : "id-ID";
  return "Rp " + new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(Math.round(n));
};

// Format a plain integer with thousand separators (no "Rp" prefix). Used by NumberInput.
const formatThousands = (n, lang) => {
  if (n === "" || n === null || n === undefined || isNaN(n)) return "";
  const locale = (lang || window.__currentLang__ || "id") === "en" ? "en-US" : "id-ID";
  return new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(n);
};

Object.assign(window, { PRODUCTS, CALCULATORS, PAYMENT_METHODS, PROGRAMS, WEBINARS, formatIDR, formatThousands });
