import { e as createComponent, k as renderComponent, r as renderTemplate, h as createAstro, ak as defineScriptVars, g as addAttribute, m as maybeRenderHead, u as unescapeHTML } from '../../chunks/astro/server_DePCulMI.mjs';
import 'piccolore';
import { $ as $$Layout } from '../../chunks/Layout_DxAv3UTa.mjs';
import { $ as $$ProductCard, W as WatchlistButton } from '../../chunks/ProductCard_7e_PI4fu.mjs';
import { jsxs, jsx } from 'react/jsx-runtime';
import { useState, useEffect } from 'react';
import { ResponsiveContainer, AreaChart, XAxis, YAxis, Tooltip, ReferenceLine, Area } from 'recharts';
import { e as getProductBySlug, g as getProductsFromDB, b as getBrandBySlugFromDB } from '../../chunks/products_DQrRaeeW.mjs';
/* empty css                                     */
export { renderers } from '../../renderers.mjs';

function SizeChips({ sizes }) {
  const [open, setOpen] = useState(false);
  const sorted = [...sizes].sort((a, b) => parseFloat(a) - parseFloat(b));
  const maxShow = 10;
  const hasMore = sorted.length > maxShow;
  const visible = open ? sorted : sorted.slice(0, maxShow);
  return /* @__PURE__ */ jsxs("div", { children: [
    /* @__PURE__ */ jsxs(
      "button",
      {
        onClick: (e) => {
          e.preventDefault();
          setOpen(!open);
        },
        className: "text-xs text-text-muted hover:text-accent transition-colors",
        children: [
          "· ",
          sizes.length,
          " maten ",
          open ? "▾" : "▸"
        ]
      }
    ),
    open && /* @__PURE__ */ jsxs("div", { className: "mt-1 flex flex-wrap gap-1", children: [
      visible.map((size) => /* @__PURE__ */ jsx("span", { className: "rounded bg-bg-elevated px-1.5 py-0.5 text-[10px] text-text-muted", children: size }, size)),
      hasMore && !open && /* @__PURE__ */ jsxs("span", { className: "text-[10px] text-text-muted", children: [
        "en ",
        sorted.length - maxShow,
        " meer"
      ] })
    ] })
  ] });
}
function PriceComparisonTable({ offers, lowestPrice, selectedSize, sneakerData }) {
  const filtered = selectedSize ? offers.filter((o) => o.sizes.includes(selectedSize)) : offers;
  const sorted = [...filtered].sort((a, b) => a.price - b.price);
  const handleOutboundClick = (offer) => {
    if (!sneakerData) return;
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({ ecommerce: null });
    window.dataLayer.push({
      event: "select_promotion",
      ecommerce: {
        promotion_id: offer.shop,
        promotion_name: offer.shop,
        items: [sneakerData]
      }
    });
    window.dataLayer.push({
      event: "outbound_click",
      destination_url: offer.url,
      shop_name: offer.shop
    });
  };
  return /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-2xl border border-border/50", children: [
    /* @__PURE__ */ jsx("div", { className: "bg-bg-elevated px-4 py-3", children: /* @__PURE__ */ jsxs("h3", { className: "text-sm font-bold uppercase tracking-widest text-text-muted", children: [
      "Prijsvergelijking",
      selectedSize && /* @__PURE__ */ jsxs("span", { className: "ml-2 text-accent", children: [
        "· Maat ",
        selectedSize
      ] })
    ] }) }),
    sorted.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "px-4 py-8 text-center text-sm text-text-muted", children: [
      "Geen shops gevonden met maat ",
      selectedSize
    ] }) : /* @__PURE__ */ jsx("div", { className: "divide-y divide-border/30", children: sorted.map((offer, i) => {
      const isLowest = offer.price === Math.min(...sorted.map((o) => o.price));
      return /* @__PURE__ */ jsxs(
        "div",
        {
          className: `flex items-center gap-4 px-4 py-4 transition-colors hover:bg-bg-hover ${i === 0 ? "bg-accent/5" : ""}`,
          children: [
            /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
              /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
                /* @__PURE__ */ jsx("span", { className: "font-semibold text-text", children: offer.shop }),
                isLowest && /* @__PURE__ */ jsx("span", { className: "rounded-full bg-accent/20 px-2 py-0.5 text-[10px] font-bold text-accent", children: "LAAGSTE" })
              ] }),
              /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center gap-2", children: [
                offer.inStock ? /* @__PURE__ */ jsx("span", { className: "text-xs text-accent", children: "✓ Op voorraad" }) : /* @__PURE__ */ jsx("span", { className: "text-xs text-danger", children: "✗ Uitverkocht" }),
                offer.sizes.length > 0 && /* @__PURE__ */ jsx(SizeChips, { sizes: offer.sizes })
              ] })
            ] }),
            /* @__PURE__ */ jsx("div", { className: "text-right", children: /* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-2", children: [
              offer.originalPrice && offer.originalPrice > offer.price && /* @__PURE__ */ jsxs("span", { className: "text-sm text-text-muted line-through", children: [
                "€",
                offer.originalPrice.toFixed(2).replace(".", ",")
              ] }),
              /* @__PURE__ */ jsxs("span", { className: `text-lg font-black ${isLowest ? "text-accent" : "text-text"}`, children: [
                "€",
                offer.price.toFixed(2).replace(".", ",")
              ] })
            ] }) }),
            /* @__PURE__ */ jsx(
              "a",
              {
                href: offer.url,
                target: "_blank",
                rel: "noopener noreferrer",
                onClick: () => handleOutboundClick(offer),
                className: `rounded-xl px-4 py-2 text-sm font-bold transition-all ${offer.inStock ? "bg-accent text-bg hover:bg-accent-dim hover:shadow-lg hover:shadow-accent/20" : "cursor-not-allowed bg-surface text-text-muted"}`,
                children: "Bekijk"
              }
            )
          ]
        },
        offer.shop
      );
    }) })
  ] });
}

function ProductPriceSection({ offers, lowestPrice, sizes, sneakerData }) {
  const [selectedSize, setSelectedSize] = useState(null);
  const sortedSizes = [...sizes].sort((a, b) => parseFloat(a) - parseFloat(b));
  return /* @__PURE__ */ jsxs("div", { children: [
    sortedSizes.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
      /* @__PURE__ */ jsx("h4", { className: "mb-2 text-xs font-bold uppercase tracking-widest text-text-muted", children: "Filter op maat" }),
      /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-1.5", children: [
        /* @__PURE__ */ jsx(
          "button",
          {
            onClick: () => setSelectedSize(null),
            className: `rounded-lg px-3 py-1.5 text-xs font-bold transition-colors ${selectedSize === null ? "bg-accent text-bg" : "bg-bg-elevated text-text-muted hover:text-text"}`,
            children: "Alle maten"
          }
        ),
        sortedSizes.map((size) => {
          const available = offers.some((o) => o.inStock && o.sizes.includes(size));
          return /* @__PURE__ */ jsx(
            "button",
            {
              onClick: () => setSelectedSize(selectedSize === size ? null : size),
              className: `rounded-lg px-3 py-1.5 text-xs font-bold transition-colors ${selectedSize === size ? "bg-accent text-bg" : available ? "bg-bg-elevated text-text-muted hover:text-text" : "bg-bg-elevated text-text-muted/40"}`,
              children: size
            },
            size
          );
        })
      ] })
    ] }),
    /* @__PURE__ */ jsx(
      PriceComparisonTable,
      {
        offers,
        lowestPrice,
        sneakerData,
        selectedSize
      }
    )
  ] });
}

function PriceHistoryChart({ data, rrp }) {
  const [range, setRange] = useState(30);
  const filtered = data.slice(-range);
  const prices = filtered.map((d) => d.price);
  if (rrp && rrp > 0) prices.push(rrp);
  const min = Math.floor(Math.min(...prices) - 5);
  const max = Math.ceil(Math.max(...prices) + 5);
  const ranges = [
    { value: 30, label: "30D" },
    { value: 90, label: "90D" },
    { value: 365, label: "1J" }
  ];
  return /* @__PURE__ */ jsxs("div", { children: [
    /* @__PURE__ */ jsxs("div", { className: "mb-4 flex items-center justify-between", children: [
      /* @__PURE__ */ jsx("h3", { className: "text-sm font-bold uppercase tracking-widest text-text-muted", children: "Prijsverloop" }),
      /* @__PURE__ */ jsx("div", { className: "flex gap-1 rounded-xl bg-bg-elevated p-1", children: ranges.map((r) => /* @__PURE__ */ jsx(
        "button",
        {
          onClick: () => setRange(r.value),
          className: `rounded-lg px-3 py-1.5 text-xs font-bold transition-all ${range === r.value ? "bg-accent text-bg shadow-sm" : "text-text-muted hover:text-text"}`,
          children: r.label
        },
        r.value
      )) })
    ] }),
    /* @__PURE__ */ jsx("div", { className: "h-[250px] w-full", children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(AreaChart, { data: filtered, margin: { top: 5, right: 5, bottom: 5, left: 5 }, children: [
      /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: "priceGrad", x1: "0", y1: "0", x2: "0", y2: "1", children: [
        /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#D69F7E", stopOpacity: 0.2 }),
        /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "#D69F7E", stopOpacity: 0 })
      ] }) }),
      /* @__PURE__ */ jsx(
        XAxis,
        {
          dataKey: "date",
          tick: { fill: "#774936", fontSize: 11 },
          tickFormatter: (v) => {
            const d = new Date(v);
            return `${d.getDate()}/${d.getMonth() + 1}`;
          },
          axisLine: false,
          tickLine: false,
          interval: "preserveStartEnd"
        }
      ),
      /* @__PURE__ */ jsx(
        YAxis,
        {
          domain: [min, max],
          tick: { fill: "#774936", fontSize: 11 },
          tickFormatter: (v) => `€${v}`,
          axisLine: false,
          tickLine: false,
          width: 50
        }
      ),
      /* @__PURE__ */ jsx(
        Tooltip,
        {
          contentStyle: {
            background: "#0D0D12",
            border: "1px solid #774936",
            borderRadius: "12px",
            padding: "8px 12px",
            fontSize: "13px"
          },
          labelFormatter: (v) => {
            const d = new Date(v);
            return d.toLocaleDateString("nl-NL", { day: "numeric", month: "long", year: "numeric" });
          },
          formatter: (value) => [`€${value.toFixed(2).replace(".", ",")}`, "Prijs"]
        }
      ),
      rrp && rrp > 0 && /* @__PURE__ */ jsx(
        ReferenceLine,
        {
          y: rrp,
          stroke: "#774936",
          strokeDasharray: "5 5",
          label: { value: "Adviesprijs", position: "right", fill: "#774936", fontSize: 11 }
        }
      ),
      /* @__PURE__ */ jsx(
        Area,
        {
          type: "monotone",
          dataKey: "price",
          stroke: "#D69F7E",
          strokeWidth: 2,
          fill: "url(#priceGrad)",
          dot: false,
          activeDot: { r: 4, fill: "#D69F7E", stroke: "#050609", strokeWidth: 2 }
        }
      )
    ] }) }) })
  ] });
}

function PriceAlertForm({ productId, currentLowestPrice, productName }) {
  const [user, setUser] = useState(null);
  const [email, setEmail] = useState("");
  const [targetPrice, setTargetPrice] = useState(
    (Math.floor(currentLowestPrice * 0.9 * 100) / 100).toFixed(2).replace(".", ",")
  );
  const [loading, setLoading] = useState(false);
  const [success, setSuccess] = useState(false);
  const [message, setMessage] = useState("");
  const [isOnWatchlist, setIsOnWatchlist] = useState(false);
  const [expanded, setExpanded] = useState(false);
  useEffect(() => {
    fetch("/api/auth/session").then((r) => r.json()).then((data) => {
      if (data.user) {
        setUser(data.user);
        setEmail(data.user.email);
        fetch("/api/watchlist").then((r) => r.json()).then((wl) => {
          const item = wl.items?.find((i) => i.product_id === productId);
          if (item) {
            setIsOnWatchlist(true);
            if (item.target_price) {
              setTargetPrice(item.target_price.toFixed(2).replace(".", ","));
            }
          }
        }).catch(() => {
        });
      }
    }).catch(() => {
    });
  }, [productId]);
  const parsePrice = (val) => parseFloat(val.replace(",", "."));
  const handleSubmit = async (e) => {
    e.preventDefault();
    setLoading(true);
    setMessage("");
    const price = parsePrice(targetPrice);
    if (isNaN(price) || price <= 0) {
      setMessage("Voer een geldig bedrag in");
      setLoading(false);
      return;
    }
    try {
      if (!user) {
        const regRes = await fetch("/api/auth/register", {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({ email })
        });
        const regData = await regRes.json();
        if (regData.error && !regData.error.includes("al geregistreerd")) {
          setMessage(regData.error);
          setLoading(false);
          return;
        }
        if (regData.error?.includes("al geregistreerd")) {
          await fetch("/api/auth/login", {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({ email })
          });
        }
        setSuccess(true);
        setMessage("Check je email om je account te bevestigen. Daarna is je prijsalert actief!");
        setLoading(false);
        return;
      }
      const res = await fetch("/api/watchlist", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({
          product_id: productId,
          target_price: price
        })
      });
      if (res.ok) {
        setSuccess(true);
        setIsOnWatchlist(true);
        setMessage(`Je ontvangt een mail als de prijs onder €${targetPrice} komt`);
      } else {
        const data = await res.json();
        setMessage(data.error || "Er ging iets mis");
      }
    } catch {
      setMessage("Er ging iets mis, probeer het opnieuw");
    }
    setLoading(false);
  };
  if (success && isOnWatchlist) {
    return /* @__PURE__ */ jsxs("div", { className: "rounded-2xl border-2 border-accent/30 bg-accent/5 p-6", children: [
      /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
        /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", className: "w-6 h-6 text-accent", children: [
          /* @__PURE__ */ jsx("path", { d: "M5.85 3.5a.75.75 0 0 0-1.117-1 9.719 9.719 0 0 0-2.348 4.876.75.75 0 0 0 1.479.248A8.219 8.219 0 0 1 5.85 3.5ZM19.267 2.5a.75.75 0 1 0-1.118 1 8.22 8.22 0 0 1 1.987 4.124.75.75 0 0 0 1.48-.248A9.72 9.72 0 0 0 19.266 2.5Z" }),
          /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M12 2.25A6.75 6.75 0 0 0 5.25 9v.75a8.217 8.217 0 0 1-2.119 5.52.75.75 0 0 0 .298 1.206c1.544.57 3.16.99 4.831 1.243a3.75 3.75 0 1 0 7.48 0 24.583 24.583 0 0 0 4.83-1.244.75.75 0 0 0 .298-1.205 8.217 8.217 0 0 1-2.118-5.52V9A6.75 6.75 0 0 0 12 2.25ZM9.75 18c0-.034 0-.067.002-.1a25.05 25.05 0 0 0 4.496 0l.002.1a2.25 2.25 0 1 1-4.5 0Z", clipRule: "evenodd" })
        ] }),
        /* @__PURE__ */ jsx("h3", { className: "text-lg font-bold", children: "Prijsalert actief" })
      ] }),
      /* @__PURE__ */ jsxs("p", { className: "text-text-secondary text-sm", children: [
        "We mailen je zodra de ",
        /* @__PURE__ */ jsx("span", { className: "font-medium", children: productName }),
        " onder",
        " ",
        /* @__PURE__ */ jsxs("span", { className: "text-accent font-bold", children: [
          "€",
          targetPrice
        ] }),
        " zakt."
      ] })
    ] });
  }
  return /* @__PURE__ */ jsxs("div", { className: "rounded-2xl border-2 border-border bg-bg-card overflow-hidden", children: [
    /* @__PURE__ */ jsxs(
      "button",
      {
        type: "button",
        onClick: () => setExpanded(!expanded),
        className: "w-full flex items-center justify-between p-5 hover:bg-bg-elevated/50 transition-colors",
        children: [
          /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
            /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", className: "w-5 h-5 text-accent", children: [
              /* @__PURE__ */ jsx("path", { d: "M5.85 3.5a.75.75 0 0 0-1.117-1 9.719 9.719 0 0 0-2.348 4.876.75.75 0 0 0 1.479.248A8.219 8.219 0 0 1 5.85 3.5ZM19.267 2.5a.75.75 0 1 0-1.118 1 8.22 8.22 0 0 1 1.987 4.124.75.75 0 0 0 1.48-.248A9.72 9.72 0 0 0 19.266 2.5Z" }),
              /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M12 2.25A6.75 6.75 0 0 0 5.25 9v.75a8.217 8.217 0 0 1-2.119 5.52.75.75 0 0 0 .298 1.206c1.544.57 3.16.99 4.831 1.243a3.75 3.75 0 1 0 7.48 0 24.583 24.583 0 0 0 4.83-1.244.75.75 0 0 0 .298-1.205 8.217 8.217 0 0 1-2.118-5.52V9A6.75 6.75 0 0 0 12 2.25ZM9.75 18c0-.034 0-.067.002-.1a25.05 25.05 0 0 0 4.496 0l.002.1a2.25 2.25 0 1 1-4.5 0Z", clipRule: "evenodd" })
            ] }),
            /* @__PURE__ */ jsx("span", { className: "font-bold text-sm", children: "Prijsalert instellen" }),
            /* @__PURE__ */ jsx("span", { className: "text-xs text-text-muted", children: "— mail me als de prijs daalt" })
          ] }),
          /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", className: `w-5 h-5 text-text-muted transition-transform duration-200 ${expanded ? "rotate-180" : ""}`, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z", clipRule: "evenodd" }) })
        ]
      }
    ),
    expanded && /* @__PURE__ */ jsxs("div", { className: "px-5 pb-5 border-t border-border", children: [
      /* @__PURE__ */ jsxs("div", { className: "mt-4 mb-4 flex items-baseline gap-2", children: [
        /* @__PURE__ */ jsx("span", { className: "text-sm text-text-secondary", children: "Huidige laagste prijs:" }),
        /* @__PURE__ */ jsxs("span", { className: "text-lg font-bold text-accent", children: [
          "€",
          currentLowestPrice.toFixed(2).replace(".", ",")
        ] })
      ] }),
      /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: "space-y-3", children: [
        /* @__PURE__ */ jsxs("div", { children: [
          /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-text-secondary mb-1.5", children: "Alert mij onder" }),
          /* @__PURE__ */ jsxs("div", { className: "relative", children: [
            /* @__PURE__ */ jsx("span", { className: "absolute left-3.5 top-1/2 -translate-y-1/2 text-text-muted font-medium", children: "€" }),
            /* @__PURE__ */ jsx(
              "input",
              {
                type: "text",
                value: targetPrice,
                onChange: (e) => setTargetPrice(e.target.value),
                className: "w-full rounded-xl border border-border bg-bg-elevated pl-8 pr-4 py-3 text-lg font-bold placeholder-text-muted focus:border-accent/50 focus:outline-none",
                placeholder: "0,00",
                required: true
              }
            )
          ] })
        ] }),
        !user && /* @__PURE__ */ jsxs("div", { children: [
          /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-text-secondary mb-1.5", children: "Je e-mailadres" }),
          /* @__PURE__ */ jsx(
            "input",
            {
              type: "email",
              value: email,
              onChange: (e) => setEmail(e.target.value),
              placeholder: "je@email.nl",
              required: true,
              className: "w-full rounded-xl border border-border bg-bg-elevated px-4 py-3 placeholder-text-muted focus:border-accent/50 focus:outline-none"
            }
          )
        ] }),
        message && /* @__PURE__ */ jsx("p", { className: `text-sm ${message.includes("Check") || message.includes("ontvangt") ? "text-accent" : "text-red-400"}`, children: message }),
        /* @__PURE__ */ jsx(
          "button",
          {
            type: "submit",
            disabled: loading,
            className: "w-full rounded-xl bg-accent px-4 py-3.5 text-base font-bold text-black transition-colors hover:bg-accent/90 disabled:opacity-50",
            children: loading ? "Even geduld..." : "Alert me als de prijs daalt"
          }
        )
      ] })
    ] })
  ] });
}

var __freeze = Object.freeze;
var __defProp = Object.defineProperty;
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(cooked.slice()) }));
var _a;
const $$Astro = createAstro();
const $$slug = createComponent(async ($$result, $$props, $$slots) => {
  const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
  Astro2.self = $$slug;
  function getDiscountPercent(sneaker2) {
    return Math.round((sneaker2.originalPrice - sneaker2.lowestPrice) / sneaker2.originalPrice * 100);
  }
  const { slug } = Astro2.params;
  const sneaker = await getProductBySlug(slug);
  if (!sneaker) return Astro2.redirect("/sneakers");
  const discount = getDiscountPercent(sneaker);
  const related = await getProductsFromDB({ limit: 4, brand: sneaker.brandSlug });
  const brandInfo = await getBrandBySlugFromDB(sneaker.brandSlug);
  const viewItemData = {
    item_id: sneaker.id,
    item_name: `${sneaker.brand} ${sneaker.name}`,
    item_brand: sneaker.brand,
    price: sneaker.lowestPrice,
    item_category: sneaker.name
  };
  const schema = {
    "@context": "https://schema.org",
    "@type": "Product",
    name: `${sneaker.brand} ${sneaker.name}`,
    description: `${sneaker.brand} ${sneaker.name} - ${sneaker.colorway}. Vergelijk prijzen bij ${sneaker.offers.length} shops.`,
    image: sneaker.image,
    brand: { "@type": "Brand", name: sneaker.brand },
    ...sneaker.sizes.length > 0 ? { sku: sneaker.sizes[0] } : {},
    offers: {
      "@type": "AggregateOffer",
      lowPrice: sneaker.lowestPrice,
      highPrice: Math.max(...sneaker.offers.map((o) => o.price)),
      priceCurrency: "EUR",
      offerCount: sneaker.offers.length,
      availability: "https://schema.org/InStock",
      url: `https://sneakerpicks.nl/sneakers/${sneaker.slug}`
    }
  };
  const breadcrumbSchema = {
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    itemListElement: [
      { "@type": "ListItem", position: 1, name: "Home", item: "https://sneakerpicks.nl/" },
      { "@type": "ListItem", position: 2, name: "Sneakers", item: "https://sneakerpicks.nl/sneakers" },
      { "@type": "ListItem", position: 3, name: sneaker.brand, item: `https://sneakerpicks.nl/merken/${sneaker.brandSlug}` },
      { "@type": "ListItem", position: 4, name: sneaker.name }
    ]
  };
  return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": `${sneaker.brand} ${sneaker.name} \u2014 SneakerPicks`, "ogImage": sneaker.image, "description": `Vergelijk prijzen voor de ${sneaker.brand} ${sneaker.name} (${sneaker.colorway}). Vanaf \u20AC${sneaker.lowestPrice.toFixed(2)}.`, "data-astro-cid-j4kzr3uu": true }, { "default": async ($$result2) => renderTemplate(_a || (_a = __template([' <script type="application/ld+json">', '<\/script> <script type="application/ld+json">', "<\/script> ", '<section class="mx-auto max-w-7xl px-4 py-12 sm:px-6" data-astro-cid-j4kzr3uu> <!-- Breadcrumb --> <nav class="mb-8 text-sm text-text-muted" aria-label="Breadcrumb" data-astro-cid-j4kzr3uu> <a href="/" class="hover:text-accent" data-astro-cid-j4kzr3uu>Home</a> <span class="mx-2" data-astro-cid-j4kzr3uu>/</span> <a href="/sneakers" class="hover:text-accent" data-astro-cid-j4kzr3uu>Sneakers</a> <span class="mx-2" data-astro-cid-j4kzr3uu>/</span> <a', ' class="hover:text-accent" data-astro-cid-j4kzr3uu>', '</a> <span class="mx-2" data-astro-cid-j4kzr3uu>/</span> <span class="text-text" data-astro-cid-j4kzr3uu>', '</span> </nav> <div class="grid gap-12 lg:grid-cols-2" data-astro-cid-j4kzr3uu> <!-- Image --> <div class="relative overflow-hidden rounded-3xl border border-border/50 bg-bg-card" data-astro-cid-j4kzr3uu> ', ' <div class="aspect-square p-8 sm:p-12" data-astro-cid-j4kzr3uu> <img', "", ` width="600" height="600" class="h-full w-full object-contain" onerror="this.style.display='none'" data-astro-cid-j4kzr3uu> </div> </div> <!-- Info --> <div data-astro-cid-j4kzr3uu> <div class="flex items-center gap-2" data-astro-cid-j4kzr3uu> `, ' <p class="text-xs font-bold uppercase tracking-[0.2em] text-accent" data-astro-cid-j4kzr3uu>', '</p> </div> <div class="mt-2 flex items-start justify-between gap-3" data-astro-cid-j4kzr3uu> <h1 class="text-3xl font-black tracking-tight sm:text-4xl" data-astro-cid-j4kzr3uu>', "</h1> ", ' </div> <p class="mt-2 text-text-secondary" data-astro-cid-j4kzr3uu>', '</p> <div class="mt-6 flex items-baseline gap-3" data-astro-cid-j4kzr3uu> <span class="text-3xl font-black text-accent" data-astro-cid-j4kzr3uu>\u20AC', "</span> ", ' </div> <div class="mt-2 text-sm text-text-muted" data-astro-cid-j4kzr3uu>\nLaagste prijs bij ', ' </div> <!-- Meta --> <div class="mt-6 flex flex-wrap gap-3" data-astro-cid-j4kzr3uu> <span class="rounded-xl bg-bg-elevated px-3 py-1.5 text-xs font-bold text-text-secondary" data-astro-cid-j4kzr3uu> ', " </span> ", ' <span class="rounded-xl bg-bg-elevated px-3 py-1.5 text-xs font-bold text-text-secondary" data-astro-cid-j4kzr3uu> ', ' shops op voorraad\n</span> </div> <!-- Price alert form --> <div class="mt-8" data-astro-cid-j4kzr3uu> ', ' </div> </div> </div> <!-- Price comparison --> <div class="mt-12" data-astro-cid-j4kzr3uu> ', ' </div> <!-- Price history --> <div class="mt-12 rounded-2xl border border-border/50 bg-bg-card p-6" data-astro-cid-j4kzr3uu> ', ' </div> <!-- Available sizes --> <div class="mt-12" data-astro-cid-j4kzr3uu> <h3 class="mb-4 text-sm font-bold uppercase tracking-widest text-text-muted" data-astro-cid-j4kzr3uu>Beschikbare maten</h3> <div class="flex flex-wrap gap-2" data-astro-cid-j4kzr3uu> ', " </div> </div> <!-- Related --> ", " </section> <script>(function(){", "\n    window.dataLayer = window.dataLayer || [];\n    window.dataLayer.push({ ecommerce: null });\n    window.dataLayer.push({\n      event: 'view_item',\n      ecommerce: { items: [viewItemData] }\n    });\n  })();<\/script> "])), unescapeHTML(JSON.stringify(schema)), unescapeHTML(JSON.stringify(breadcrumbSchema)), maybeRenderHead(), addAttribute(`/merken/${sneaker.brandSlug}`, "href"), sneaker.brand, sneaker.name, discount > 0 && renderTemplate`<div class="absolute left-4 top-4 z-10 rounded-full bg-deal px-3 py-1.5 text-sm font-bold text-white" data-astro-cid-j4kzr3uu>
-${discount}%
</div>`, addAttribute(`/api/img/${sneaker.id}`, "src"), addAttribute(`${sneaker.brand} ${sneaker.name}`, "alt"), brandInfo?.logo_url && renderTemplate`<img${addAttribute(brandInfo.logo_url, "src")}${addAttribute(sneaker.brand, "alt")} class="brand-logo h-5 w-auto object-contain" data-astro-cid-j4kzr3uu>`, sneaker.brand, sneaker.name, renderComponent($$result2, "WatchlistButton", WatchlistButton, { "client:visible": true, "productId": sneaker.id, "size": "md", "client:component-hydration": "visible", "client:component-path": "C:/Users/Roel/clawd/sneakerpicks/src/components/WatchlistButton.tsx", "client:component-export": "default", "data-astro-cid-j4kzr3uu": true }), sneaker.colorway, sneaker.lowestPrice.toFixed(2).replace(".", ","), sneaker.originalPrice > sneaker.lowestPrice && renderTemplate`<span class="text-lg text-text-muted line-through" data-astro-cid-j4kzr3uu>€${sneaker.originalPrice.toFixed(2).replace(".", ",")}</span>`, sneaker.offers.sort((a, b) => a.price - b.price)[0].shop, sneaker.gender === "heren" ? "Heren" : sneaker.gender === "dames" ? "Dames" : "Unisex", sneaker.releaseDate && !isNaN(new Date(sneaker.releaseDate).getTime()) && renderTemplate`<span class="rounded-xl bg-bg-elevated px-3 py-1.5 text-xs font-bold text-text-secondary" data-astro-cid-j4kzr3uu> ${new Date(sneaker.releaseDate).toLocaleDateString("nl-NL", { day: "numeric", month: "long", year: "numeric" })} </span>`, sneaker.offers.filter((o) => o.inStock).length, renderComponent($$result2, "PriceAlertForm", PriceAlertForm, { "client:visible": true, "productId": sneaker.id, "currentLowestPrice": sneaker.lowestPrice, "productName": `${sneaker.brand} ${sneaker.name}`, "client:component-hydration": "visible", "client:component-path": "C:/Users/Roel/clawd/sneakerpicks/src/components/PriceAlertForm.tsx", "client:component-export": "default", "data-astro-cid-j4kzr3uu": true }), renderComponent($$result2, "ProductPriceSection", ProductPriceSection, { "client:load": true, "offers": sneaker.offers, "lowestPrice": sneaker.lowestPrice, "sizes": sneaker.sizes, "sneakerData": viewItemData, "client:component-hydration": "load", "client:component-path": "C:/Users/Roel/clawd/sneakerpicks/src/components/ProductPriceSection.tsx", "client:component-export": "default", "data-astro-cid-j4kzr3uu": true }), renderComponent($$result2, "PriceHistoryChart", PriceHistoryChart, { "client:load": true, "data": sneaker.priceHistory, "rrp": sneaker.originalPrice > sneaker.lowestPrice ? sneaker.originalPrice : void 0, "client:component-hydration": "load", "client:component-path": "C:/Users/Roel/clawd/sneakerpicks/src/components/PriceHistoryChart.tsx", "client:component-export": "default", "data-astro-cid-j4kzr3uu": true }), sneaker.sizes.map((size) => {
    const available = sneaker.offers.some((o) => o.inStock && o.sizes.includes(size));
    return renderTemplate`<span${addAttribute([
      "rounded-xl border px-3.5 py-2 text-sm font-bold transition-colors",
      available ? "border-border/50 bg-bg-card text-text hover:border-accent/50" : "border-border/20 text-text-muted/40"
    ], "class:list")} data-astro-cid-j4kzr3uu>
EU ${size} </span>`;
  }), related.length > 0 && renderTemplate`<div class="mt-16" data-astro-cid-j4kzr3uu> <h2 class="mb-6 text-2xl font-black tracking-tight" data-astro-cid-j4kzr3uu>Meer van ${sneaker.brand}</h2> <div class="grid grid-cols-2 gap-4 sm:gap-6 md:grid-cols-4" data-astro-cid-j4kzr3uu> ${related.map((s, i) => renderTemplate`${renderComponent($$result2, "ProductCard", $$ProductCard, { "sneaker": s, "index": i, "data-astro-cid-j4kzr3uu": true })}`)} </div> </div>`, defineScriptVars({ viewItemData })) })} `;
}, "C:/Users/Roel/clawd/sneakerpicks/src/pages/sneakers/[slug].astro", void 0);

const $$file = "C:/Users/Roel/clawd/sneakerpicks/src/pages/sneakers/[slug].astro";
const $$url = "/sneakers/[slug]";

const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
  __proto__: null,
  default: $$slug,
  file: $$file,
  url: $$url
}, Symbol.toStringTag, { value: 'Module' }));

const page = () => _page;

export { page };
