export type EventKind = "Workshop" | "Conference" | "School" | "Event" | "Course" | "Unconference";

export type ScheduleItem = {
  time: string;
  title: string;
  speaker?: string;
  affiliation?: string;
  kind?: "session" | "break" | "keynote" | "social" | "note";
  detail?: string;
  links?: { label: string; href: string }[];
};

export type ScheduleDay = {
  label: string;
  date?: string;
  moderator?: string;
  items: ScheduleItem[];
};

export type InfoTable = {
  headers: string[];
  rows: string[][];
};

export type EventSection = {
  title: string;
  eyebrow?: string;
  body?: string[];
  numbered?: string[];
  bullets?: string[];
  table?: InfoTable;
  tables?: InfoTable[];
};

export type Event = {
  year: string;
  slug?: string;
  title: string;
  shortTitle?: string;
  subtitle?: string;
  date: string;
  location?: string;
  kind: EventKind;
  role: string;
  status?: string;
  summary: string;
  href?: string;
  sourceUrl?: string;
  showRoleInHero?: boolean;
  showOverviewContent?: boolean;
  hideOverviewNav?: boolean;
  showScheduleOnOverview?: boolean;
  scheduleDisplay?: "grid" | "tabs";
  featured?: boolean;
  highlight?: boolean;
  tags?: string[];
  theme?: "sage" | "ink" | "rose" | "amber" | "sky" | "violet" | "barcamp";
  image?: {
    src: string;
    alt: string;
  };
  gallery?: {
    src: string;
    alt: string;
    caption: string;
  }[];
  links?: { label: string; href: string }[];
  facts?: { label: string; value: string }[];
  sections?: EventSection[];
  schedule?: ScheduleDay[];
  people?: string[];
};

export type EventPageKind = "overview" | "section" | "visual" | "schedule" | "people";

export type EventPageEntry = {
  id: string;
  label: string;
  href: string;
  type: EventPageKind;
  sectionIndex?: number;
};

export const events: Event[] = [
  {
    year: "2026",
    slug: "barcamp",
    title: "Barcamp 2026",
    subtitle: "A participant-led day of talks, demos, workshops, questions, and hallway conversations.",
    date: "July 18, 2026",
    location: "IIT Gandhinagar",
    kind: "Unconference",
    role: "Organizer",
    status: "Registration open",
    featured: true,
    highlight: true,
    theme: "barcamp",
    summary:
      "A new unconference-style gathering where participants shape the day through short talks, demos, open discussions, workshops, and useful cross-disciplinary encounters.",
    tags: ["new", "unconference", "community"],
    links: [
      {
        label: "Register",
        href: "https://events.neeldhara.cloud/event/2/barcamp-2026",
      },
    ],
    facts: [
      { label: "Format", value: "Participant-led unconference" },
      { label: "Venue", value: "AB 7/101-104, IITGN" },
      { label: "Registration", value: "Open" },
    ],
    schedule: [],
    people: [],
  },
  {
    year: "2026",
    slug: "history-of-science",
    title: "Workshop on Doing History of Science and Engineering in India",
    shortTitle: "History of Science 2026",
    subtitle: "A social history perspective",
    date: "February 23-24, 2026",
    location: "Academic Block 1/201, IIT Gandhinagar",
    kind: "Workshop",
    role: "Co-organizer",
    theme: "rose",
    href: "/2026/history-of-science/",
    showRoleInHero: false,
    showOverviewContent: true,
    hideOverviewNav: true,
    showScheduleOnOverview: true,
    scheduleDisplay: "tabs",
    summary:
      "A two-day workshop on the social histories of science, mathematics, engineering, medicine, computing, and allied knowledge practices in India.",
    tags: ["history of science", "HSS", "IITGN"],
    sections: [
      {
        title: "Overview",
        body: [
          "This workshop brings together historians, scientists, engineers, and scholars of society to examine how scientific and technical knowledge has been produced, taught, circulated, and contested in India.",
          "The two days move across mathematics, medicine, computing, engineering, public health, colonial institutions, pedagogy, and local practices. The format combines plenary talks, focused research presentations, and conversations across disciplinary boundaries.",
          "A shared emphasis is on social history: the institutions, publics, materials, infrastructures, and political settings that shape what counts as science and engineering, and how those histories are remembered.",
        ],
      },
    ],
    schedule: [
      {
        label: "Day 1",
        date: "February 23, 2026",
        items: [
          { time: "08:15 - 08:55", title: "Registration", kind: "break" },
          { time: "09:00 - 09:10", title: "Welcome Address", speaker: "Prof Madhumita Sengupta", affiliation: "Humanities and Social Sciences, IITGN" },
          { time: "09:10 - 09:15", title: "Welcome Address", speaker: "Prof Vinod Chandra", affiliation: "Physics, HoD of HSS" },
          { time: "09:20 - 09:35", title: "Address", speaker: "Prof Vimal Misra", affiliation: "Civil Engineering, Dean R&D" },
          { time: "09:40 - 09:50", title: "Address", speaker: "Prof Neeldhara Mishra", affiliation: "Computer Science and Engineering, IITGN; HoMI Coordinator and Co-organiser" },
          { time: "09:50 - 10:05", title: "Tea Break", kind: "break" },
          { time: "10:05 - 11:05", title: "Why Study History of Science?", speaker: "Prof Deepak Kumar", affiliation: "Retd Professor of the History of Science and Education, JNU", kind: "keynote" },
          { time: "11:10 - 12:10", title: "A Perspective on Mathematics in the Sulbasutras", speaker: "Prof SG Dani", affiliation: "Retd Professor, TIFR, Mumbai; currently with DAE-CEBS, Mumbai" },
          { time: "12:15 - 13:15", title: "History of Computing, with Interesting (Social) Bits from Far and Near", speaker: "Prof K Gopinath", affiliation: "Retd Professor, IISc Bangalore; currently Professor at Rishihood University and Guest Professor at IITGN" },
          { time: "13:15 - 14:00", title: "Lunch", kind: "break" },
          { time: "14:00 - 14:50", title: "Notes on a Historic Floorplan: A Fragmentary History of British India's First Purpose-Built Chemistry Lab", speaker: "Prof Madhumita Mazumdar" },
          { time: "14:55 - 15:45", title: "The Contested Terrain of Electrification in Colonial Calcutta", speaker: "Prof Suvobrata Sarkar" },
          { time: "15:50 - 16:40", title: "The Extraordinary Career of M Visvesvaraya", speaker: "Prof Aparajith Ramnath" },
          { time: "16:50 - 17:00", title: "Tea Break", kind: "break" },
          { time: "17:00 - 17:15", title: "Coding the Nation: A Genealogy of Computing as a Practice in India", speaker: "Aditya Kumar Pandey" },
          { time: "17:20 - 17:35", title: "Derailing Guard? A Global History of Check-Rails", speaker: "Tilak Bhardwaj" },
          { time: "17:40 - 17:55", title: "Science at the Edge of an Empire", speaker: "Anup Sharma" },
          { time: "18:00 - 18:15", title: "Electrifying a Company Town", speaker: "Harsh Kumar" },
        ],
      },
      {
        label: "Day 2",
        date: "February 24, 2026",
        items: [
          { time: "08:30 - 09:00", title: "Tea Break", kind: "break" },
          { time: "09:00 - 09:50", title: "Relationship Between Diseases and Society: A Bioarchaeological Perspective", speaker: "Prof Veena Mushrif-Tripathy" },
          { time: "09:55 - 10:45", title: "Oral Healthcare and Public Health: Twentieth Century Bengal", speaker: "Prof Sahara Ahmed" },
          { time: "10:50 - 11:40", title: "Girindrasekhar Bose and Sigmund Freud: Psychoanalysis and the Social History of Science", speaker: "Prof Arka Chattopadhyay" },
          { time: "11:45 - 12:25", title: "Colonial Epidemiology: Insights from Assam", speaker: "Prof Madhumita Sengupta" },
          { time: "12:30 - 13:30", title: "Lunch", kind: "break" },
          { time: "13:35 - 14:25", title: "Genesis of Zero in Ancient India", speaker: "Prof Parthasarathi Mukhopadhyay" },
          { time: "14:30 - 15:20", title: "A Historical Overview of Gravitational Physics in India", speaker: "Prof Sudipta Sarkar" },
          { time: "15:20 - 15:30", title: "Tea Break", kind: "break" },
          { time: "15:35 - 15:50", title: "Tracing the Historicity of the Water Management System in Ancient India", speaker: "Dr Shikha Rai" },
          { time: "15:55 - 16:10", title: "River Drought Forcing of the Harappan Metamorphosis", speaker: "Hiren Solanki" },
          { time: "16:15 - 16:30", title: "Spaces of Healing and Control: Colonial Medical Institutions in the Madras Presidency", speaker: "Abin Joshy V" },
          { time: "16:35 - 16:50", title: "Laughing Out Science: A Social History of Satirical Literature and Science in Nineteenth-Century Bengal", speaker: "Anamika Panda" },
          { time: "16:55 - 17:10", title: "Negotiating the Native Mind: A Social History of Psychoanalysis in India (1922-1950)", speaker: "Ruchi Sharma" },
          { time: "17:20 - 17:40", title: "Vote of Thanks", kind: "session" },
        ],
      },
    ],
  },
  {
    year: "2025",
    title: "Research-Oriented Computing Symposium (ROCS)",
    date: "March 22, 2025",
    kind: "Workshop",
    role: "Co-organizer",
    href: "https://events.neeldhara.com/2025/rocs/",
    theme: "sage",
    summary: "A research-oriented computing symposium.",
    tags: ["computing research"],
  },
  {
    year: "2024",
    slug: "fsttcs-local",
    title: "FSTTCS 2024 Local Information",
    shortTitle: "FSTTCS 2024 Local",
    subtitle: "Local arrangements for FSTTCS 2024 at IIT Gandhinagar",
    date: "December 16-18, 2024",
    location: "IIT Gandhinagar",
    kind: "Conference",
    role: "Local organizer",
    href: "/2024/fsttcs-local/",
    sourceUrl: "https://2024-fsttcs-local.netlify.app/",
    theme: "sky",
    image: {
      src: "/assets/events/fsttcs-2024-map.png",
      alt: "Annotated local map for FSTTCS 2024 at IIT Gandhinagar",
    },
    gallery: [
      {
        src: "/assets/events/fsttcs-2024-map.png",
        alt: "Annotated local map for FSTTCS 2024 at IIT Gandhinagar",
        caption: "Venue map used for the FSTTCS 2024 local information page.",
      },
      {
        src: "/assets/events/fsttcs-2024-sponsors.png",
        alt: "Sponsor and supporter logos for FSTTCS 2024",
        caption: "Supporters and sponsors for FSTTCS 2024.",
      },
    ],
    summary:
      "This is the local information page for FSTTCS 2024, which will be hosted at IIT Gandhinagar between December 16-18, 2024.",
    tags: ["conference", "local guide", "theory CS"],
    facts: [
      { label: "Venue", value: "IIT Gandhinagar" },
      { label: "Dates", value: "December 16-18, 2024" },
      { label: "Contact", value: "fsttcs2024@gmail.com" },
    ],
    sections: [
      {
        title: "Welcome",
        body: [
          "If you have questions not addressed by the information on this page, please leave a comment on the helpdesk page (recommended) or reach out to us at fsttcs2024@gmail.com.",
          "This is the local information page for FSTTCS 2024, which will be hosted at IIT Gandhinagar between December 16-18, 2024. On this page, you will find more information about local arrangements and important announcements.",
          "Please check the intel page for details that will help you navigate the venue.",
          "Entry and exit to the campus is through Gate 1. The password to get through is FSTTCS, verbalized with confidence. If this triggers further rituals, please follow them - you might have to at most sign off on a register.",
        ],
        bullets: [
          "The talks are in Academic Block 1, behind the 2 degree cafe.",
          "Track A talks at FSTTCS and AMD talks are in AB 1/101.",
          "Track B talks at FSTTCS, MM/RHPL/WAGS talks are in AB 1/102.",
          "All keynote talks are in AB 1/103 (aka Jibaben auditorium).",
          "All food is at the pedway behind the fountain area near AB1: follow the crowd!",
        ],
      },
      {
        title: "Workshops",
        bullets: [
          "Milestones and Motifs in the Theory of Proofs, Algebraic Computation, and Lower Bounds. Dates: December 14-15, 2024.",
          "Research Highlights in Programming Languages. Dates: December 16-18, 2024 (in parallel with FSTTCS).",
          "Automata and Games for Synthesis. Dates: December 19, 2024.",
          "Workshop on Algorithmic Mechanism Design. Dates: December 19-20, 2024.",
        ],
      },
      {
        title: "Important Dates",
        bullets: [
          "Invitation Requests for Visa Applications: 13th October 2024 (AoE).",
          "Registrations Open: 7th October 2024.",
          "Early Bird Registration Deadline: 24th November 2024 (AoE) (extended).",
          "Final Registration Deadline: 13th December 2024 (AoE).",
        ],
      },
      {
        title: "Registration Logistics",
        body: [
          "There are three forms relevant to registration:",
        ],
        numbered: [
          "The main registration form: please register by filling out the registration form, which also includes a payment gateway. This should work for both Indian and international credit cards. If you are on an international card, the currency conversion happens after your card details have been entered. The registration fees are outlined on the registration page. You can use this form to register for the conference and associated workshops. If you would like to sign up for a workshop separately later, that will be possible to do as well.",
          "The accommodation request form: if you would like to reserve a room at the guest house or our partner hotel, please use the accommodation form. Students can use the same form to indicate a request for a shared hostel room, which will be offered based on availability. Information about rates associated with various accommodation options is available on the intel page.",
          "For international participants: when applying for a conference visa to India, you would need an invitation letter from the conference organizers and letter of clearance from the Ministry of External Affairs. To generate these documents, we will need some details, so we request you fill out the visa form ASAP, and in any case no later than 13th October 2024 (AoE). For more information about applying for a visa, please see the international participants page.",
        ],
      },
      {
        title: "Contact",
        body: [
          "You can reach out to any of the organizers with specific inquiries as indicated below, or post a question on the helpdesk page if you think it is broadly relevant, or email fsttcs2024@gmail.com.",
        ],
        numbered: [
          "Abhishek Bichhawat, abhishek.b -AT- iitgn.ac.in (for queries on international participant support).",
          "Bireswar Das, bireswar -AT- iitgn.ac.in (for queries related to being a volunteer at FSTTCS).",
          "Anirban Dasgupta, anirbandg -AT- iitgn.ac.in (for queries related to the Young Investigators Meet).",
          "Manoj Gupta, gmanoj -AT- iitgn.ac.in (for queries related to workshop and student accommodation logistics).",
          "Balagopal Komarath, bkomarath -AT- iitgn.ac.in (for queries related to registration and guest house/hotel accommodation, classrooms and recording arrangements).",
          "Neeldhara Misra, neeldhara.m -AT- iitgn.ac.in (for any general queries).",
          "Manisha Padala, manisha.padala -AT- iitgn.ac.in (for queries related to food arrangements).",
          "Siddharth Barman, barman -AT- iisc.ac.in (for queries related to supporting FSTTCS).",
          "Aalok Thakkar, aalok.thakkar -AT- ashoka.edu.in (for queries related to FSTTCS on social media).",
          "Shibashis Guha, shibashis -AT- tifr.res.in (for queries related to FSTTCS publicity beyond social media).",
          "S P Suresh, spsuresh -AT- cmi.ac.in (for queries related to the main FSTTCS 2024 website and program pages).",
          "Jyothi Krishnan, jyothi.k -AT- iitgn.ac.in (for queries related to the registration kit).",
        ],
      },
      {
        title: "Internet Access via WiFi",
        body: [
          "If you use a wireless device, please connect to IITGN-SSO and use the credentials shared by email and WhatsApp to connect to the Internet. If you use a LAN connection, please log in to the web portal.",
          "Internet ID: workshop2. Password: shared by email and whatsapp.",
          "This IITGN Internet ID will work only at the IIT Gandhinagar campus.",
        ],
      },
      {
        title: "Accommodation for Students",
        body: [
          "A limited number of rooms are available in the hostels on campus or in a nearby residency. These rooms will be shared. The approximate cost of the room is Rs. 300/day.",
          "The conference registration covers lunch on all days, and three coffee breaks. Depending on your situation, you may interpret the first coffee break as a late and light breakfast.",
          "The student mess serves breakfast, lunch, snacks, and dinner as per the following schedule and walk-in rates:",
        ],
        numbered: [
          "Breakfast: 07:30 AM to 09:30 AM (Mon-Fri) and 08:00 AM to 10:00 AM (Sat/Sun); INR 50.",
          "Lunch: 12:15 PM - 2:15 PM; INR 70.",
          "Snacks: 04.30 PM - 06.00 PM; INR 35.",
          "Dinner: 07.30 PM - 09.30 PM; INR 70.",
        ],
      },
      {
        title: "Guest House and Hotel Accommodation",
        body: [
          "There are two accommodation options offered by the organizers on a first-come, first-serve basis. We detail both options below, noting that participants are encouraged to book sooner than later since availability is limited. International participants would have to be prepared to fill out some additional forms on arrival.",
          "Please note that the exact rates shared below are indicative. That said, they are a reasonable approximation to what you can expect to be charged.",
          "The IIT Gandhinagar Guest House is a facility located on the IIT Gandhinagar campus, and is a five-minute walk from the conference venue. Room rates are Rs. 2000/- per day exclusive of taxes and breakfast.",
          "The default check-in and check-out times are 02.00 P.M and 12.00 Noon, respectively. An early check-in (i.e, 10AM or later) and late check-out (4PM or earlier) can be availed for 30% of the full day rate, subject to availability.",
          "The guest house has a dining hall where meals are available as per the following schedule and rates:",
        ],
        table: {
          headers: ["Breakfast", "Lunch", "Dinner"],
          rows: [
            ["8:00AM-9:30AM", "1PM - 2:30PM", "8:00PM-9:30PM"],
            ["Rs. 125/-", "Rs. 175/-", "Rs. 175/-"],
          ],
        },
      },
      {
        title: "Fortune Inn Haveli",
        body: [
          "Fortune Inn Haveli is a contemporary full service hotel run by ITC and located in the city of Gandhinagar. It is a 20 minute commute by car from the venue of the conference. A shuttle service will be provided between the hotel and the conference venue, once in the morning and once in the evening.",
          "Participants who wish to go to their room at other times or miss the shuttle can typically book an Uber to make their way in either direction.",
          "The hotel is a 20 minute drive from the Ahmedabad airport and is 3km away from the Gandhinagar railway station.",
          "The conference rate at the hotel is Rs. 5000/- per day inclusive of taxes and breakfast. The default check-in and check-out times are 02.00 P.M and 12.00 Noon, respectively. Availability at these rates is limited.",
        ],
      },
      {
        title: "For International Participants",
        body: [
          "To apply for an invitation letter, and a letter of clearance from the Ministry of External Affairs, please fill out the visa form no later than 13th October, midnight, AoE.",
          "All foreign nationals entering India are required to possess a valid international travel document in the form of a national passport with a valid visa from an Indian Mission/Post or eVisa (Limited Categories) from Bureau of Immigration, Ministry of Home Affairs.",
          "We recommend all participants that require a visa to travel to India, to apply for a Conference visa. If an individual who is not attending the conference plans to accompany you, they will likely need an Indian Tourist visa.",
          "For more details about Indian visas, please visit indianvisaonline.gov.in.",
          "The process for obtaining an Indian conference visa would be as follows:",
        ],
        bullets: [
          "International registrants are to fill out the visa form by 13th October, midnight, AoE at the latest. The form collects details essential for the conference organisers to obtain clearance from the Government of India. If you have any issues filling out the form, kindly email fsttcs2024@gmail.com at the earliest.",
          "We strongly suggest you apply for a Conference visa only when you have the conference invitation letter and the MEA clearance letter.",
          "You can find more details about the visa application process, as well as how to submit the application, on the website of Indian consulate in your country.",
        ],
      },
      {
        title: "International Visitor Notes",
        body: [
          "You should not have any trouble in terms of language barriers in the cities of Ahmedabad and Gandhinagar. Most people understand and speak English, and most signage is typically in English as well.",
          "The currency in India is the Indian Rupee (INR). You can exchange your currency at the airport or at any of the local banks. The campus has a bank and an ATM as well. While you will find that QR-code based payment systems, powered by UPI, are increasingly the default at most places, credit and debit cards are still widely accepted, including on campus. Please make sure to enable your cards for international transactions. We recommend carrying some cash for exceptions.",
          "Most places on campus will have WiFi connectivity. We have eduroam, and we will also share the credentials for the local network with you over email and on a Whatsapp group a couple of days ahead of the conference. That said, having some cellular connectivity will be useful for things like booking cabs or using Google maps when outside WiFi range.",
          "The voltage in India is 230V, 50Hz. The standard socket type is the C type, which is the same as the European plug. If you are coming from a country that uses a different type of plug, you would want to keep a travel adapter handy.",
          "Food in the state of Gujarat is predominantly vegetarian and can be spicy. We will ensure that there are milder options available at the conference lunches, but if you have specific dietary restrictions, please do indicate it at the time of registration.",
          "If you have any questions, please let us know!",
        ],
      },
      {
        title: "For Speakers",
        body: [
          "The conference will be held in a hybrid format and talks will be recorded. A consent form will be shared with you over email, which you could use to opt out of the recording if you desire.",
          "All rooms will have a computer that is already connected to the AV system in the room. It would be simplest to prepare your presentation in a standard format (PDF/HTML/PPT) so that we can load it directly from the in-house system.",
          "If you have a good reason to use your own laptop for the presentation (e.g, fonts available only locally or a Keynote presentation that does not convert well to PPT or PDF), then please carry appropriate connectors if your laptop does not have a HDMI port. It is recommended that you test your setup at least one break in advance of the session that your talk is in. Please ping the session chair or any of the volunteers for help with this.",
        ],
      },
      {
        title: "Reaching and Leaving IIT Gandhinagar",
        bullets: [
          "Sardar Vallabhbhai Patel International Airport (AMD) is an international airport serving the cities of Ahmedabad and Gandhinagar in Gujarat, India and is a 30-minute drive from IIT Gandhinagar.",
          "Ahmedabad Junction Railway Station (ADI), locally known as Kalupur station is the main terminus which is very well connected with the other parts of the country.",
          "Geeta Mandir & Paldi are the bus terminals of Ahmedabad city.",
        ],
        body: [
          "Typically, finding an Uber or getting an auto for coming to our campus is an advanced-beginner level activity, while getting out of campus is more of an intermediate level challenge. We recommend booking cabs or autos in advance, especially for catching flights or trains at odd hours.",
          "Contacts of reliable private service providers will be shared on the participant whatsapp group and over email.",
          "The campus security will have intel about all registered participants, so you should face no hassles coming in, although there is a small ritual of signing in at the gate.",
        ],
      },
      {
        title: "About the IIT Gandhinagar Campus",
        body: [
          "The campus is divided into a few key areas:",
        ],
        bullets: [
          "Residential (staff and faculty housing).",
          "Student Hostels (ft. Mess + Coffee/Juice Shops + Amul Shop + Groceries).",
          "Academic Area (ft. Classrooms + Offices + Labs + Library).",
          "Sports Complex (ft. Swimming Pools + Climbing Wall + Squash/Badminton/TT Courts + Football/Cricket fields + Running Track + Gym + a Juice Shop).",
          "Central Arcade (ft. Canara Bank + ATM + Post Office + Medical Center + Dry Cleaning + Vegetable Shop).",
          "Research Park and Entrepreneurship Cell (ft. industry offices + the startup ecosystem at IITGN).",
        ],
      },
      {
        title: "Campus Notes",
        body: [
          "If you can find the time, feel free to explore the campus during your visit! There are also two EECO shuttles that go around the main areas of the campus every 15 minutes. You can find the schedule online and you can typically ask the security folks at the gate for any help you need in identifying these vehicles.",
          "It is generally a very walkable campus, especially in December, when heat and rain don't get in the way of a good walk. Although we don't have cycle rentals on campus, you can let us know if you would like to borrow one, and we might be able to source something for you informally.",
          "The campus is also generally wheelchair friendly.",
          "The medical facilities are in the central arcade. The regular number is 079-2395-1116 and the emergency contact is +91-7069795000 (Emergency number).",
          "Eduroam is functional across the campus. WiFi credentials for the local network will also be shared with participants over a Whatsapp group and over email a couple of days ahead of the conference.",
          "In general, you can find out more about our campus from our website and by following the social media accounts. Speaking of, please tag #FSTTCS2024 and #IITGN if you are posting about your conference experience on socials!",
        ],
      },
      {
        title: "Venue of the Talks, Posters, and Socials",
        body: [
          "All Track A contributed conference talks and the MM/AMD workshops will be held in AB 1/101.",
          "All Track B contributed conference talks and WAGS will be held in AB 1/102.",
          "All keynote talks will be held in AB 1/103 (aka the Jibaben Auditorium).",
          "The posters for RHPL will be displayed in a foyer area right outside the learning theaters.",
          "Academic Block 1 is strategically located in proximity to the main cafeteria, known as the 2 degree cafe. Use that as a guiding landmark to find the venue.",
          "The venue for the conference banquet is (tentatively) the fountain area near Academic Block 1. To find it, follow the crowd!",
          "The venue for the puzzles social is the Center for Creative Learning. Finding the place is the first puzzle to solve.",
          "The venue for other social events will be announced on the event pages and by direct contact to those who signed up.",
        ],
      },
      {
        title: "Bring Your Own",
        bullets: [
          "Please bring a water bottle along, which you can refill at conveniently located water coolers across the campus.",
          "The weather in Gandhinagar in December is typically pleasantly cool and dry. It can be somewhat cold inside the lecture halls if the AC is on. You might want to bring along a light jacket.",
          "Please do bring your own bag(s) and stationery. The registration kits are fun but spartan, so you won't be expanding your conference bag collection this time :)",
          "If you plan on using the gym, the running track, or other indoors sports facilities, you would need to have non-marking shoes. If you plan to use the swimming pool, please bring your own gear.",
        ],
      },
      {
        title: "Watch Out For",
        body: [
          "Animals on campus: IITGN is home to a variety of animals, including dogs, cats, peacocks, snakes, antelopes, hedgehogs, and monkeys. Expect encounters with most of them to be brief and harmless, but exercise caution as needed.",
          "Please note that current campus policies prohibit feeding strays outside designated feeding areas.",
          "Alcoholic drinks are strictly prohibited on campus, both as a matter of campus policy and state law. Smoking is also forbidden in public places.",
        ],
      },
      {
        title: "For Parents",
        body: [
          "IIT Gandhinagar has a day care facility on campus which can be availed on request. Kids are welcome to be at any of the talks or socials as well. If you need a volunteer to help out in real-time, please reach out to us!",
        ],
      },
      {
        title: "Local Attractions",
        body: [
          "Gujarat Tourism is a great resource for planning non-trivial outings in Gujarat.",
          "Here are some options that can fit in an evening or half a day of sneaking out:",
        ],
        bullets: [
          "Adalaj Stepwell.",
          "Akshardham Temple.",
          "Sabarmati Ashram.",
          "Indroda Nature Park.",
          "Ahmedabad Science City.",
          "Calico Mueseum.",
          "Udipi Jaya.",
          "Swati Snacks.",
          "Terracotta.",
          "RISE, GIFT City Club.",
          "Mocha at Infocity.",
          "1944 The Hocco Kitchen at Sargasan.",
        ],
      },
      {
        title: "Registration",
        body: [
          "Join FSTTCS Virtually!",
          "If you missed registering for FSTTCS at early bird rates or traveling to attend is not feasible, note that we have an exciting remote experience planned for our online attendees. Further, attending online is free of cost!",
          "If you are still looking to participate in person, registration will remain open until the 10th of December.",
          "Registration is now closed.",
          "Please note that registrations are not refundable or transferable.",
          "There are no publishing costs to be borne by authors.",
          "Registration costs, in Indian Rupees (INR), exclusive of taxes and markup fees are given in the table below.",
          "The conference registration covers lunch, and two tea breaks on each day for all the three days of the conference, and a banquet dinner. The fees do not cover accommodation.",
        ],
        table: {
          headers: ["Category", "Early Bird (up to Nov 26th AoE)", "Regular (Dec 13th midnight IST)"],
          rows: [
            ["Students", "₹ 5,000", "₹ 6,000"],
            ["Non-Student (Developing Countries)", "₹ 12,500", "₹ 14,000"],
            ["Non-Student (Developed Countries)", "₹ 25,000", "₹ 27,000"],
          ],
        },
      },
      {
        title: "Workshop Registration",
        body: [
          "Registration costs for the workshops, in Indian Rupees (INR), exclusive of taxes and markup fees are given in the table below. The workshop registration covers lunch, and two tea breaks on each day of the workshop.",
        ],
        table: {
          headers: ["Workshop", "Early Bird (up to Nov 26th AoE)", "Regular (Dec 13th midnight IST)"],
          rows: [
            ["Milestones and Motifs in the Theory of Proofs, Algebraic Computation, and Lower Bounds", "₹ 3,500", "₹ 5,000"],
            ["Workshop on Algorithmic Mechanism Design", "₹ 3,500", "₹ 5,000"],
            ["Workshop on Automata and Games for Synthesis", "₹ 2,500", "₹ 4,000"],
            ["While we have a combined registration form for all events, if you decide to register for a workshop later, it will be possible to do so.", "", ""],
          ],
        },
      },
      {
        title: "Registration Notes",
        numbered: [
          "By non-student we mean faculty, post-docs and researchers working at academic/corporate institutions.",
          "A developed country is a high income country as defined in the World Bank Classification 2022.",
          "Any country that is not classified as a high Income country as defined in the World Bank Classification 2022 is treated as a developing country in our context.",
        ],
      },
      {
        title: "Socials at FSTTCS 2024",
        body: [
          "FSTTCS 2024 will feature the following social events, open to all (this includes invited and registered participants, and volunteers, and the IITGN community).",
          "Please be sure to register for the individual events to help the organizers plan appropriately, though. The page for each event has more information on signing up and the point of contact, should you need more information.",
          "Leave a comment on the helpdesk page if you have any questions!",
        ],
        table: {
          headers: ["Day", "Date", "Time", "Event", "Venue", "Cost"],
          rows: [
            ["Sun", "15th Dec", "5AM", "GIFT City Run", "GIFT City", "499 INR onwards"],
            ["Mon", "16th Dec", "5PM", "Young Investigators Meeting", "AB 1/101", "Free"],
            ["Mon", "16th Dec", "6.30PM", "Board Games", "CCL, Faculty Lounge, FSTTCS Lounge", "Free"],
            ["Mon", "16th Dec", "Evening", "Squash with Jaison", "Squash Court, Sports Complex", "Free"],
            ["Mon", "16th Dec", "1PM", "Chess", "Over Lunch", "Free"],
            ["Mon", "16th Dec", "7AM", "Birdwatching", "Central Arcade", "Free"],
            ["Tue", "17th Dec", "1PM", "Chess", "Over Lunch", "Free"],
            ["Wed", "18th Dec", "7AM", "Sketchy Campus Tour", "Start from Guest House", "Free"],
            ["Wed", "18th Dec", "5PM", "Puzzles and Exhibits", "CCL", "Free"],
            ["Wed", "18th Dec", "1PM", "Magic", "Over Lunch", "Free"],
            ["Wed", "18th Dec", "5PM", "Juggling", "CCL", "Free"],
            ["Wed", "18th Dec", "5PM", "Art @IITGN Exhibition", "Central Arcade", "Free"],
            ["Thu", "19th Dec", "6.30PM", "Board Games Redux", "CCL, Faculty Lounge, FSTTCS Lounge", "Free"],
            ["Thu", "19th Dec", "9PM", "Movie Screening (Secrets of the Surface)", "Jibaben Auditorium", "Free"],
          ],
        },
      },
    ],
    links: [
      { label: "Main FSTTCS 2024 site", href: "https://www.fsttcs.org.in/2024/" },
      { label: "FSTTCS local site", href: "https://2024-fsttcs-local.netlify.app/" },
    ],
  },
  {
    year: "2024",
    slug: "csed",
    title: "CRiCKET 2024",
    subtitle: "Computing Research in Curricula: Knowledge, Education & Training",
    date: "February 3-5, 2024",
    location: "AB 1/101, IIT Gandhinagar",
    kind: "Workshop",
    role: "Organizer",
    href: "/2024/csed/",
    sourceUrl: "https://events.neeldhara.com/2024/csed/",
    theme: "amber",
    image: {
      src: "/assets/events/cricket-2024-poster.png",
      alt: "CRiCKET 2024 workshop announcement poster",
    },
    summary:
      "A hands-on workshop for CSEd researchers and practitioners on how to do computing education research, led by Shriram Krishnamurthi.",
    tags: ["CSEd", "workshop", "computing education"],
    facts: [
      { label: "Lead", value: "Shriram Krishnamurthi" },
      { label: "Chairs", value: "Neeldhara Misra and Venkatesh Choppella" },
      { label: "Registration", value: "Closed" },
    ],
    sections: [
      {
        title: "Overview",
        body: [
          "The workshop asked what it means to study computing education: what kinds of questions the field asks, what methods are used, and how research about humans can be done carefully.",
          "The format was deliberately not slide-and-lecture heavy. The page emphasizes hands-on activities, conversations, bottom-up learning, and constructive responses to participant work.",
        ],
      },
      {
        title: "Topics",
        bullets: [
          "What kinds of areas does computing education research cover?",
          "What kinds of questions does CER ask?",
          "What kinds of study designs do we see?",
          "What kinds of analysis methods are used?",
          "How and where are findings presented?",
        ],
      },
      {
        title: "Logistics and expectations",
        bullets: [
          "Participants were expected to attend the whole event, be mentally present, and participate in discussions.",
          "A laptop or tablet was recommended because the workshop involved editing, collaboration, and drawing.",
          "The event was in English, while other languages were welcome in groups when everyone was comfortable.",
          "There were no registration fees. Limited shared hostel rooms were available for student participants at no cost.",
        ],
      },
      {
        title: "FAQ",
        bullets: [
          "Target audience: graduate students, postdocs, faculty, industry practitioners, and others interested in methods for learning about humans.",
          "Prerequisites: no explicit prerequisites, though experience with instructional aspects of computing classes was useful.",
          "Publication expectation: the goal was training and collaboration, not a shortcut to a paper.",
          "Remote participation: no; the goal was a high-quality intensive in-person event.",
          "Accessibility needs could be shared with the organizers by email.",
        ],
      },
    ],
    schedule: [
      {
        label: "Day 1",
        date: "February 3, 2024",
        items: [
          { time: "09:30", title: "Registration", kind: "break" },
          { time: "10:00", title: "Session I" },
          { time: "11:30", title: "Coffee Break", kind: "break" },
          { time: "12:00", title: "Session II" },
          { time: "13:30", title: "Lunch Break", kind: "break" },
          { time: "15:00", title: "Session III" },
          { time: "17:00", title: "Coffee Break", kind: "break" },
        ],
      },
      {
        label: "Day 2",
        date: "February 4, 2024",
        items: [
          { time: "10:00", title: "Session IV" },
          { time: "11:30", title: "Coffee Break", kind: "break" },
          { time: "12:00", title: "Session V" },
          { time: "13:30", title: "Lunch Break", kind: "break" },
          { time: "15:00", title: "Session VI" },
          { time: "17:00", title: "Coffee Break", kind: "break" },
          { time: "19:30", title: "Banquet", kind: "social" },
        ],
      },
      {
        label: "Day 3",
        date: "February 5, 2024",
        items: [
          { time: "10:00", title: "Session VII" },
          { time: "11:30", title: "Coffee Break", kind: "break" },
          { time: "12:00", title: "Session VIII" },
          { time: "13:30", title: "Lunch", kind: "break" },
        ],
      },
    ],
    people: [
      "Adithi Iyer (IIT Gandhinagar)",
      "Amey Karkare (IIT Kanpur)",
      "Anirban Dasgupta (IIT Gandhinagar)",
      "Anupama Pradeepan (IITGN)",
      "Arup Kumar Chattopadhyay (IIT Madras)",
      "Arvind W Kiwelekar (DBATU Lonere)",
      "Atul Pratap Singh (IIT Madras)",
      "Bhavesh Neekhra (Ashoka University)",
      "Bhavini Korthi (IIT Gandhinagar)",
      "Bhumika Shah (Gujarat University)",
      "Binita Maity (IIT Gandhinagar)",
      "Divya Joseph (Raspberry Pi Foundation)",
      "Gnaneswar Kulindala (IIIT Hyderabad)",
      "Jatin Ambasana (Unitedworld School of Computational Intelligence)",
      "Jyothi Krishnan (IIT Gandhinagar)",
      "Kareena Beniwal (IIT Gandhinagar)",
      "Lavanya S.C (Dr.Mahalingam College of Engineering and Technology)",
      "Mamta Manaktala (Raspberry Pi Educational Services)",
      "Neeldhara Misra (IIT Gandhinagar)",
      "Neha Garg (IIT Gandhinagar)",
      "Parthasarathy PD (BITS Pilani, K.K. Birla Goa Campus)",
      "Prajish Prasad (FLAME University)",
      "Pranav Vats (IIIT Hyderabad)",
      "Rashmita Panigrahi (Raspberry Pi Foundation)",
      "S P Suresh (Chennai Mathematical Institute)",
      "Sakshi Sharma (IIT Ropar)",
      "Saurabh N. Mehta (Vidyalankar Institute of Technology)",
      "Srikumar Subramanian (Krea University)",
      "Sudarshan Iyengar (IIT Gandhinagar)",
      "Vaishnavi Sundararajan (IIT Delhi)",
      "Venkatesh Choppella (IIIT Hyderabad)",
      "Viraj Kumar (IISc)",
      "Yashpal Yadav (IIIT Hyderabad)",
    ],
  },
  {
    year: "2024",
    title: "COMPUTE 2024",
    date: "December 5-7, 2024",
    location: "IIT Gandhinagar",
    kind: "Conference",
    role: "Local organizer",
    href: "https://compute2024.netlify.app/",
    theme: "ink",
    summary:
      "Seventh Annual Conference on Computing Education.",
    tags: ["external", "computing education"],
  },
  {
    year: "2022",
    slug: "csed",
    title: "ACM-India CS Education Workshop",
    date: "December 23, 2022",
    location: "AB 1/101, IIT Gandhinagar",
    kind: "Workshop",
    role: "Local organizer",
    href: "/2022/csed/",
    sourceUrl: "https://events.neeldhara.com/2022/csed/",
    theme: "violet",
    image: {
      src: "/assets/events/csed-2022-poster.png",
      alt: "ACM-India CS Education Workshop poster",
    },
    summary:
      "A one-day hybrid workshop on CS education, teaching programming, computational thinking, Refute questions, Mapcode, and teaching data structures.",
    tags: ["CSEd", "ACM India", "NPTEL"],
    facts: [
      { label: "Partners", value: "ACM India and NPTEL India" },
      { label: "Format", value: "Hybrid" },
      { label: "Registration", value: "Closed" },
    ],
    sections: [
      {
        title: "Overview",
        body: [
          "The discipline of Computer Science and Engineering at IIT Gandhinagar, in partnership with ACM India and NPTEL India, organized a one-day workshop on CS Education on December 23, 2022.",
          "The workshop focused on teaching programming and computational thinking at the school and undergraduate levels.",
        ],
      },
      {
        title: "Logistics",
        bullets: [
          "Hybrid event with onsite and online participation.",
          "Registration cost was Rs. 1500 for in-person attendees, Rs. 350 plus GST for online student attendees, and Rs. 650 plus GST for online non-student attendees.",
          "Registered participants were eligible for certificates subject to participation.",
          "Sessions were recorded and planned for release in early January 2023.",
        ],
      },
      {
        title: "FAQ",
        bullets: [
          "Target audience: anyone interested in CS Education at school or college level.",
          "Prerequisites: no explicit prerequisites; experience teaching introductory programming or DSA was relevant.",
          "Accommodation was explored on request, though most in-person attendance was expected to be local.",
          "Registration fees were generally not refundable, with exceptional cases handled by email.",
        ],
      },
    ],
    schedule: [
      {
        label: "Workshop day",
        date: "December 23, 2022",
        items: [
          { time: "09:30 - 10:00", title: "Registration", kind: "break" },
          {
            time: "10:00 - 11:00",
            title: "The CSPathshala Initiative: Computational Thinking in Schools",
            speaker: "Sonia Garcha",
            links: [
              { label: "Recording", href: "https://youtu.be/emcFf69J5nQ" },
              { label: "CSPathshala", href: "https://cspathshala.org" },
            ],
          },
          { time: "11:00 - 11:30", title: "Coffee Break", kind: "break" },
          {
            time: "11:30 - 13:00",
            title: "A hands-on introduction to Refute Questions",
            speaker: "Viraj Kumar",
            detail:
              "Participants explored Refute questions, where students inspect code written for a stated purpose and provide evidence for why it fails to serve that purpose.",
            links: [
              { label: "Recording", href: "https://youtu.be/wp3roNKAtVU" },
              { label: "Slides", href: "https://tinyurl.com/refute-slides" },
            ],
          },
          { time: "13:00 - 14:00", title: "Lunch", kind: "break" },
          {
            time: "14:00 - 15:30",
            title: "Algorithmic program development using Mapcode",
            speaker: "Venkatesh Choppella",
            detail:
              "Mapcode is a methodology for iterative algorithmic problem solving in which requirements and design are expressed as a collection of maps.",
            links: [
              { label: "Worksheet", href: "https://colab.research.google.com/drive/1GiMFFpfgS0A5dXqFwRpUzyRtAPMF8Ldz?usp=sharing" },
              { label: "Slides", href: "https://faculty.iiit.ac.in/~venkatesh.choppella/talks/2022-12-23-iitgn-cs-ed-ws/main.pdf" },
            ],
          },
          { time: "15:30 - 16:00", title: "Coffee Break", kind: "break" },
          {
            time: "16:00 - 17:00",
            title: "Teaching Data Structures",
            speaker: "N S Kumar",
            links: [
              { label: "Recording", href: "https://youtu.be/fcUHFrWhoY0" },
              { label: "GitHub repository", href: "https://github.com/neeldhara/csed-ws-DSA-talk" },
            ],
          },
          { time: "17:00 - 17:30", title: "High Tea", kind: "break" },
        ],
      },
    ],
    links: [
      { label: "ACM India", href: "https://india.acm.org/" },
      { label: "NPTEL", href: "https://nptel.ac.in/" },
    ],
  },
  {
    year: "2022",
    title: "GIAN Course on Randomized Methods in Parameterized Algorithms",
    date: "December 5-9, 2022",
    kind: "Course",
    role: "Organizer",
    href: "https://randomizedalgos.netlify.app",
    summary: "A GIAN course by Prof. Daniel Lokshtanov.",
    tags: ["algorithms"],
  },
  {
    year: "2020",
    title: "Workshop on Parameterized Complexity 301 (Virtual)",
    date: "December 21-31, 2020",
    kind: "Workshop",
    role: "Scientific co-coordinator",
    href: "https://sites.google.com/view/parameterized-algorithms-301/home",
    summary: "A virtual workshop on parameterized complexity.",
  },
  {
    year: "2020",
    title: "Workshop on Parameterized Complexity 201 (IISER Pune)",
    date: "March 6-8, 2020",
    kind: "Workshop",
    role: "Scientific co-coordinator",
    href: "https://sites.google.com/students.iiserpune.ac.in/iiserpc201/home",
    summary: "A workshop on parameterized complexity at IISER Pune.",
  },
  {
    year: "2020",
    title: "ACM-India Inter-Research Institute Student Seminar in CS",
    date: "February 13-14, 2020",
    kind: "Event",
    role: "PC chair for IRISS and organizing committee",
    href: "http://events.iitgn.ac.in/2020/IRISS/",
    summary: "A student seminar in CS.",
  },
  {
    year: "2020",
    title: "ACM-India Annual Event",
    date: "February 15, 2020",
    kind: "Event",
    role: "Co-organizer",
    href: "http://events.iitgn.ac.in/2020/ACMAnnualEvent/",
    summary: "ACM-India annual event.",
  },
  {
    year: "2020",
    title: "ACM-W India Workshop for Women in CS Research",
    date: "February 13, 2020",
    kind: "Event",
    role: "Co-organizer",
    href: "http://events.iitgn.ac.in/2020/ACMW",
    summary: "ACM-W India workshop for women in CS research.",
  },
  {
    year: "2019",
    title: "ACM-W Summer School on Algorithmic Game Theory",
    date: "July 2-14, 2019",
    kind: "School",
    role: "Coordinator",
    href: "http://events.iitgn.ac.in/2019/ACMSummerSchool/",
    summary: "A summer school on algorithmic game theory.",
  },
  {
    year: "2017",
    title: "GIAN Course on Computational Social Choice",
    date: "December 4-8, 2017",
    kind: "Course",
    role: "Organizer",
    href: "http://events.iitgn.ac.in/2017/comsoc/",
    summary: "A GIAN course by Prof. Edith Elkind.",
  },
  {
    year: "2017",
    title: "GIAN Course on Pattern Matching Algorithms",
    date: "August 28 - September 7, 2017",
    kind: "Course",
    role: "Organizer",
    href: "http://events.iitgn.ac.in/2017/patternmatching/",
    summary: "A GIAN course by Prof. Amihood Amir.",
  },
  {
    year: "2017",
    title: "ACM Summer School on Graph Theory and Graph Algorithms",
    date: "June 26 - July 15, 2017",
    kind: "School",
    role: "Co-coordinator",
    href: "http://events.iitgn.ac.in/2017/ACMSummerSchool/",
    summary: "A summer school on graph theory and graph algorithms.",
  },
  {
    year: "2016",
    title: "NMI Workshop on Complexity Theory",
    date: "November 2016",
    kind: "Workshop",
    role: "Co-organizer",
    href: "http://sites.iitgn.ac.in/events/2016/nmi/",
    summary: "A workshop on complexity theory.",
  },
  {
    year: "2016",
    title: "TEQIP Summer School on Design and Analysis of Algorithms",
    date: "May 2016",
    kind: "School",
    role: "Co-organizer",
    summary: "A summer school on design and analysis of algorithms.",
  },
];

export const internalEvents = events.filter((event) => event.slug);
export const organizedEvents = events;

export function getEventPath(event: Event) {
  if (event.slug) return `/${event.year}/${event.slug}/`;
  return event.href ?? "#";
}

export function getEventBasePath(event: Event) {
  return getEventPath(event);
}

export function isExternalEvent(event: Event) {
  const path = getEventPath(event);
  return path.startsWith("http");
}

export function getEventByParams(year: string, slug: string) {
  return internalEvents.find((event) => event.year === year && event.slug === slug);
}

function slugifyEventPage(label: string) {
  return label
    .toLowerCase()
    .replace(/&/g, " and ")
    .replace(/[^a-z0-9]+/g, "-")
    .replace(/^-|-$/g, "");
}

export function getEventOverviewSectionIndex(event: Event) {
  const firstTitle = event.sections?.[0]?.title;
  if (!firstTitle) return undefined;

  const normalized = slugifyEventPage(firstTitle);
  return ["overview", "welcome", "what-this-is"].includes(normalized) ? 0 : undefined;
}

export function getEventPageEntries(event: Event): EventPageEntry[] {
  const basePath = getEventBasePath(event);
  const overviewSectionIndex = getEventOverviewSectionIndex(event);
  const entries: EventPageEntry[] = [
    {
      id: "overview",
      label: "Overview",
      href: basePath,
      type: "overview",
    },
  ];
  const usedIds = new Set(entries.map((entry) => entry.id));

  event.sections?.forEach((section, sectionIndex) => {
    if (sectionIndex === overviewSectionIndex) return;

    const baseId = slugifyEventPage(section.title) || `section-${sectionIndex + 1}`;
    let id = baseId;
    let suffix = 2;

    while (usedIds.has(id)) {
      id = `${baseId}-${suffix}`;
      suffix += 1;
    }

    usedIds.add(id);
    entries.push({
      id,
      label: section.title,
      href: `${basePath}${id}/`,
      type: "section",
      sectionIndex,
    });
  });

  if (event.gallery || event.image) {
    entries.push({
      id: "visual-material",
      label: "Visual Material",
      href: `${basePath}visual-material/`,
      type: "visual",
    });
  }

  if (event.schedule) {
    entries.push({
      id: "schedule",
      label: "Schedule",
      href: `${basePath}schedule/`,
      type: "schedule",
    });
  }

  if (event.people) {
    entries.push({
      id: "participants",
      label: "Participants",
      href: `${basePath}participants/`,
      type: "people",
    });
  }

  return entries;
}

export function getEventPageEntry(event: Event, page = "overview") {
  return getEventPageEntries(event).find((entry) => entry.id === page);
}
