/* Sentosa Marketplace - Buyer Portal sample data */

const PRODUCTS = [
  { id: "p1", origin: "gate", name: "Cable Car Sky Pass", cat: "Attraction", type: "Ticket", partner: "Sentosa Cable Car", trade: 32.0, rack: 40.0, unit: "adult", tag: "Featured", img: "#2E6B7A", photo: "../../assets/photos/p1.jpg", rating: 4.8, sold: "12k+ sold", lead: "Instant", stock: 4820 },
  { id: "p2", origin: "gate", name: "Skyline Luge & Skyride - 2 rides", cat: "Attraction", type: "Package", partner: "Skyline Luge", trade: 28.5, rack: 35.0, unit: "person", tag: "Bestseller", img: "#3E7D5A", photo: "../../assets/photos/p2.jpg", rating: 4.7, sold: "8.4k sold", lead: "Instant", stock: 2610 },
  { id: "p3", origin: "seller", name: "Resort Beach Day Bundle", cat: "Experience", type: "Bundle", partner: "Sentosa Islander", trade: 54.0, rack: 68.0, unit: "pax", tag: null, img: "#C9772E", photo: "../../assets/photos/p3.jpg", rating: 4.6, sold: "3.1k sold", lead: "1 day", stock: 880 },
  { id: "p4", origin: "gate", name: "Oceanarium Admission", cat: "Attraction", type: "Ticket", partner: "Marine Life Park", trade: 38.0, rack: 45.0, unit: "adult", tag: null, img: "#2F5E8A", photo: "../../assets/photos/p4.jpg", rating: 4.9, sold: "21k+ sold", lead: "Instant", stock: 6400 },
  { id: "p5", origin: "seller", name: "Sunset Sail - Group Charter", cat: "Experience", type: "Charter", partner: "Sentosa Marina", trade: 420.0, rack: 520.0, unit: "boat", tag: "New", img: "#8A6A2F", photo: "../../assets/photos/p5.jpg", rating: 4.5, sold: "320 sold", lead: "7 days", stock: 24 },
  { id: "p6", origin: "sdc", name: "Heritage Walking Tour", cat: "Experience", type: "Tour", partner: "Fort Siloso", trade: 18.0, rack: 24.0, unit: "person", tag: null, img: "#5A6E3E", photo: "../../assets/photos/p6.jpg", rating: 4.4, sold: "1.7k sold", lead: "1 day", stock: 1200 },
  { id: "p7", origin: "gate", name: "Indoor Skydiving - Trade Slot", cat: "Attraction", type: "Ticket", partner: "iFly", trade: 78.0, rack: 99.0, unit: "person", tag: null, img: "#6A4E8A", photo: "../../assets/photos/p7.jpg", rating: 4.7, sold: "5.2k sold", lead: "Instant", stock: 640 },
  { id: "p8", origin: "sdc", name: "MICE Welcome Reception Pass", cat: "MICE", type: "Event", partner: "Sentosa MICE", trade: 145.0, rack: 180.0, unit: "delegate", tag: "MICE", img: "#7A2E3E", photo: "../../assets/photos/p8.jpg", rating: 4.6, sold: "640 sold", lead: "14 days", stock: 400 },
  { id: "p9", origin: "sdc", name: "Island Admission - Day Pass", cat: "Island admission", type: "Ticket", partner: "Sentosa Development Corporation", trade: 4.0, rack: 6.0, unit: "adult", tag: null, img: "#2E5A4A", photo: "../../assets/photos/p9.jpg", rating: 4.9, sold: "48k+ sold", lead: "Instant", stock: 25000 },
  { id: "p10", origin: "seller", name: "Beachside Banquet - 10 pax", cat: "Dining", type: "Package", partner: "Tanjong Beach Club", trade: 680.0, rack: 820.0, unit: "table", tag: null, img: "#9A5A2E", photo: "../../assets/photos/p10.jpg", rating: 4.7, sold: "410 sold", lead: "7 days", stock: 36 },
  { id: "p11", origin: "gate", name: "Sky Dining - Cable Car Cabin", cat: "Dining", type: "Experience", partner: "Sentosa Cable Car", trade: 288.0, rack: 348.0, unit: "cabin", tag: "Bestseller", img: "#3E5A7A", photo: "../../assets/photos/p11.jpg", rating: 4.8, sold: "2.2k sold", lead: "3 days", stock: 64 },
  { id: "p12", origin: "sdc", name: "Multi-Attraction Pass (3-in-1)", cat: "Attraction", type: "Bundle", partner: "Sentosa Islander", trade: 58.0, rack: 78.0, unit: "person", tag: "Featured", img: "#4A6E8A", photo: "../../assets/photos/p12.jpg", rating: 4.8, sold: "9.6k sold", lead: "Instant", stock: 3100 },
];

const CATS = ["All categories", "Island admission", "Attraction", "Experience", "Dining", "MICE"];
const PARTNERS = ["Sentosa Cable Car", "Skyline Luge", "Marine Life Park", "iFly", "Fort Siloso", "Sentosa Marina", "Tanjong Beach Club"];
const SELLERS = [...new Set(PRODUCTS.map(p => p.partner))].sort();

/* Product origin - Reply No. 1, Q2/Q10/Q11/Q12.
   Determines which system is authoritative for price, inventory and redemption. */
const ORIGINS = {
  sdc:    { label: "SDC product", tone: "info",
            detail: "Owned by Sentosa Development Corporation. The SnApp Ticketing System masters pricing, inventory and redemption; the marketplace consumes and distributes." },
  gate:   { label: "Straight-to-gate", tone: "brand",
            detail: "Supplied by the island partner over API. The partner's own ticketing system remains authoritative for live availability and redemption." },
  seller: { label: "Seller-listed", tone: "success",
            detail: "Submitted by the island partner through the marketplace, which is the point of entry. The seller sets pricing, inventory, date and time and content; SDC approves; the product is then created in SnApp, which becomes authoritative." },
};

/* ---- MICE venues (S/No. 144a - native in-platform enquiry management) ---- */
const VENUES = [
  { id: "v1", name: "Palawan Amphitheatre", partner: "Sentosa MICE", cap: 1200, layout: "Outdoor amphitheatre", rate: 8800, unit: "day", img: "#2E6B7A", photo: "../../assets/photos/v1.jpg",
    tags: ["Outdoor", "Ceremony", "Product launch"], av: "Full stage, LED wall, PA", lead: "21 days" },
  { id: "v2", name: "Siloso Beach Event Lawn", partner: "Sentosa Beach Events", cap: 2500, layout: "Open lawn", rate: 12400, unit: "day", img: "#C9772E", photo: "../../assets/photos/v2.jpg",
    tags: ["Outdoor", "Gala", "Team building"], av: "Rigging points, generator", lead: "30 days" },
  { id: "v3", name: "Fort Siloso Heritage Hall", partner: "Fort Siloso", cap: 220, layout: "Banquet / theatre", rate: 4200, unit: "day", img: "#5A6E3E", photo: "../../assets/photos/v3.jpg",
    tags: ["Indoor", "Heritage", "Dinner"], av: "Projector, hybrid streaming", lead: "14 days" },
  { id: "v4", name: "Sentosa Cove Waterfront Deck", partner: "Sentosa Marina", cap: 400, layout: "Waterfront cocktail", rate: 9600, unit: "day", img: "#2F5E8A", photo: "../../assets/photos/v4.jpg",
    tags: ["Waterfront", "Cocktail", "Networking"], av: "Ambient PA, mooring access", lead: "21 days" },
  { id: "v5", name: "Imbiah Conference Suites", partner: "Sentosa MICE", cap: 600, layout: "Divisible ballroom", rate: 7400, unit: "day", img: "#6A4E8A", photo: "../../assets/photos/v5.jpg",
    tags: ["Indoor", "Conference", "Breakout"], av: "6 breakouts, simultaneous interpretation", lead: "14 days" },
  { id: "v6", name: "Tanjong Beach Club - Full Buyout", partner: "Tanjong Beach Club", cap: 800, layout: "Beach club buyout", rate: 15800, unit: "day", img: "#9A5A2E", photo: "../../assets/photos/v6.jpg",
    tags: ["Beachfront", "Buyout", "Gala"], av: "In-house F&B, DJ booth", lead: "30 days" },
];

/* ---- Enquiries raised by this buyer (native enquiry management) ---- */
const ENQUIRIES = [
  { ref: "ENQ-10428", venue: "Imbiah Conference Suites", event: "APAC Partner Summit 2026", pax: 480, date: "18-19 Nov 2026", status: "Quote received", updated: "2 days ago", owner: "Sentosa MICE" },
  { ref: "ENQ-10391", venue: "Siloso Beach Event Lawn", event: "Year-end Gala Dinner", pax: 900, date: "12 Dec 2026", status: "In discussion", updated: "5 days ago", owner: "Sentosa Beach Events" },
  { ref: "ENQ-10355", venue: "Fort Siloso Heritage Hall", event: "Incentive Group - Heritage Night", pax: 180, date: "4 Sep 2026", status: "Confirmed", updated: "2 weeks ago", owner: "Fort Siloso" },
];

/* ---- Past and upcoming orders (My bookings) ---- */
const BOOKINGS = [
  { ref: "SDC-00478", placed: "22 Jul 2026", travel: "14 Aug 2026", total: 10080.0, status: "Confirmed", pax: 240, method: "PayNow",
    lines: [{ name: "Island Admission - Day Pass", qty: 240, unit: 42.0, partner: "Sentosa Development Corporation" }],
    tickets: { issued: 240, redeemed: 0, subusers: ["ops@wanderlust.com", "groups@wanderlust.com"] } },
  { ref: "SDC-00461", placed: "9 Jul 2026", travel: "26 Jul 2026", total: 6960.0, status: "Partially redeemed", pax: 120, method: "Bank transfer",
    lines: [{ name: "Multi-Attraction Pass (3-in-1)", qty: 120, unit: 58.0, partner: "Sentosa Islander" }],
    tickets: { issued: 120, redeemed: 74, subusers: ["ops@wanderlust.com"] } },
  { ref: "SDC-00447", placed: "28 Jun 2026", travel: "3 Jul 2026", total: 3420.0, status: "Completed", pax: 60, method: "Credit card",
    lines: [{ name: "Cable Car Sky Pass", qty: 60, unit: 32.0, partner: "Sentosa Cable Car" },
            { name: "Skyline Luge & Skyride - 2 rides", qty: 54, unit: 28.5, partner: "Skyline Luge" }],
    tickets: { issued: 114, redeemed: 114, subusers: ["ops@wanderlust.com"] } },
  { ref: "SDC-00432", placed: "14 Jun 2026", travel: "20 Jun 2026", total: 1710.0, status: "Revalidated", pax: 30, method: "eWallet",
    lines: [{ name: "Oceanarium Admission", qty: 45, unit: 38.0, partner: "Marine Life Park" }],
    tickets: { issued: 45, redeemed: 45, subusers: [] } },
];

/* ---- AI itinerary presets (Amazon Bedrock, grounded on SDC-approved catalogue) ---- */
const AI_PROMPTS = [
  "3-day incentive group of 40 pax, mix of attractions and beachfront dining",
  "Family FIT package under S$120 per pax, half-day",
  "Corporate offsite for 150 delegates with a gala dinner",
];

const AI_ITINERARY = {
  title: "3-day incentive programme · 40 pax",
  rationale: "Built from your contracted FY26 rates. Balances two headline attractions with a beachfront dinner, keeping per-pax cost under your S$180 target. Cross-partner bundle spans 4 island partners - non-hotel bundling is available in Phase 1.",
  perPax: 172.5,
  days: [
    { day: "Day 1", note: "Arrival & island orientation", picks: [{ id: "p9", qty: 40 }, { id: "p1", qty: 40 }] },
    { day: "Day 2", note: "Adventure block, high engagement", picks: [{ id: "p2", qty: 40 }, { id: "p7", qty: 40 }] },
    { day: "Day 3", note: "Beachfront close", picks: [{ id: "p10", qty: 4 }] },
  ],
};

const AI_RECOS = [
  { id: "p12", why: "Agents booking Cable Car Sky Pass add this 68% of the time" },
  { id: "p11", why: "Lifts average order value - strong fit for incentive groups" },
  { id: "p6", why: "Fills the afternoon gap in 3-day itineraries" },
];

Object.assign(window, { PRODUCTS, CATS, PARTNERS, SELLERS, ORIGINS, VENUES, ENQUIRIES, BOOKINGS, AI_PROMPTS, AI_ITINERARY, AI_RECOS });
