{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "modal-lightbox-zoom",
  "type": "registry:component",
  "title": "Zoom Lightbox",
  "description": "A photo lightbox opened from a mosaic grid, with directional slides, a filmstrip and click to zoom that pans with the pointer. Arrow keys, swipe, Z for zoom and I for details all work.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "modals",
    "lightbox",
    "gallery",
    "zoom",
    "photo",
    "filmstrip",
    "modal"
  ],
  "docs": "https://hyperblur.dev/effects/modal-lightbox-zoom",
  "files": [
    {
      "path": "registry/hyperblur/modal-lightbox-zoom.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/modal-lightbox-zoom.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface LightboxImage {\n  title: string;\n  location: string;\n  meta?: string;\n  background: string;\n  alt?: string;\n}\n\nexport interface ModalLightboxZoomProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n  open?: boolean;\n  defaultOpen?: boolean;\n  onOpenChange?: (open: boolean) => void;\n  embedded?: boolean;\n  images?: LightboxImage[];\n  index?: number;\n  defaultIndex?: number;\n  onIndexChange?: (index: number) => void;\n  gallery?: boolean;\n  zoom?: number;\n  accent?: string;\n}\n\nconst defaultImages: LightboxImage[] = [\n  {\n    title: \"Dune sea at first light\",\n    location: \"Erg Chebbi, Morocco\",\n    meta: \"X-T5 · 23mm · f/8 · 1/320s\",\n    background:\n      \"radial-gradient(120% 60% at 30% 100%, #8a4a22 0 38%, transparent 39%), radial-gradient(140% 55% at 85% 105%, #b5652c 0 40%, transparent 41%), radial-gradient(90% 40% at 60% 92%, #d98a45 0 45%, transparent 46%), radial-gradient(30% 22% at 72% 38%, #ffe2b0, transparent 70%), linear-gradient(180deg, #5a7bb0 0%, #e9b48a 58%, #f7cf9f 70%)\",\n  },\n  {\n    title: \"Aurora over the falls\",\n    location: \"Skógafoss, Iceland\",\n    meta: \"A7 IV · 14mm · f/1.8 · 6s\",\n    background:\n      \"linear-gradient(180deg, transparent 72%, #05070a 72%), radial-gradient(60% 18% at 40% 40%, rgba(80, 255, 170, 0.75), transparent 70%), radial-gradient(50% 14% at 66% 30%, rgba(120, 120, 255, 0.55), transparent 70%), radial-gradient(1px 1px at 20% 20%, #fff, transparent), radial-gradient(1px 1px at 80% 12%, #fff, transparent), radial-gradient(1px 1px at 55% 8%, #fff, transparent), linear-gradient(180deg, #050816 0%, #0c1d33 60%, #12324a 72%)\",\n  },\n  {\n    title: \"Low tide, golden hour\",\n    location: \"Big Sur, California\",\n    meta: \"R6 II · 50mm · f/4 · 1/800s\",\n    background:\n      \"linear-gradient(170deg, transparent 0 64%, #1d1410 64% 70%, transparent 70%), radial-gradient(28% 18% at 50% 58%, #fff3c4, transparent 70%), linear-gradient(180deg, #2b2a52 0%, #c25e5e 38%, #f2a65a 56%, #3a5f7a 58%, #1c3348 100%)\",\n  },\n  {\n    title: \"Fog in the rainforest\",\n    location: \"Hoh, Washington\",\n    meta: \"X100V · 23mm · f/2 · 1/125s\",\n    background:\n      \"radial-gradient(80% 50% at 50% 50%, rgba(220, 235, 230, 0.55), transparent 70%), repeating-linear-gradient(90deg, rgba(10, 30, 26, 0.75) 0 3%, transparent 3% 11%, rgba(10, 30, 26, 0.45) 11% 13%, transparent 13% 21%), linear-gradient(180deg, #8fa8a0 0%, #3e5c54 60%, #142a24 100%)\",\n  },\n  {\n    title: \"Crossing after rain\",\n    location: \"Shibuya, Tokyo\",\n    meta: \"Z6 III · 35mm · f/1.4 · 1/60s\",\n    background:\n      \"repeating-linear-gradient(90deg, transparent 0 6%, rgba(255, 255, 255, 0.5) 6% 8%, transparent 8% 12%) 0 82% / 100% 6% no-repeat, radial-gradient(18% 30% at 18% 30%, rgba(255, 64, 160, 0.8), transparent 70%), radial-gradient(16% 28% at 82% 26%, rgba(0, 220, 255, 0.7), transparent 70%), radial-gradient(40% 20% at 50% 92%, rgba(255, 120, 200, 0.35), transparent 70%), linear-gradient(180deg, #0c0a1a 0%, #1d1430 55%, #120e1e 100%)\",\n  },\n  {\n    title: \"Blue ice, calving face\",\n    location: \"Perito Moreno, Patagonia\",\n    meta: \"GFX 100S · 63mm · f/11 · 1/250s\",\n    background:\n      \"linear-gradient(180deg, transparent 70%, #1b3242 70%), linear-gradient(100deg, transparent 0 20%, #cfe9f5 20% 30%, #9fd4ea 30% 44%, #e9f6fb 44% 58%, #7cc4e0 58% 72%, #d5eef8 72% 86%, transparent 86%) 0 46% / 100% 26% no-repeat, linear-gradient(180deg, #7fa6c4 0%, #c9dbe6 60%, #a9c2d1 70%)\",\n  },\n];\n\nconst css = `\n.hb-xe8 { --hb-xe8-accent: #ededed; display: inline-block; box-sizing: border-box; color: #ededed; font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif); }\n.hb-xe8 *, .hb-xe8 *::before, .hb-xe8 *::after { box-sizing: border-box; }\n.hb-xe8[data-embedded] { position: relative; display: grid; place-items: center; width: 100%; height: 100%; min-height: 190px; border-radius: 16px; overflow: hidden; isolation: isolate; background: #0b0b0b; padding: 12px; }\n.hb-xe8 button:focus-visible { outline: 2px solid var(--hb-xe8-accent); outline-offset: 2px; }\n.hb-xe8-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: 70px 70px; gap: 4px; width: min(340px, 100%); }\n.hb-xe8-tile { position: relative; overflow: hidden; padding: 0; border: 0; border-radius: 6px; background-size: cover; background-position: center; cursor: zoom-in; transition: filter 0.3s ease, transform 0.4s cubic-bezier(0.2, 0.9, 0.2, 1); }\n.hb-xe8-tile:first-child { grid-row: span 2; border-radius: 10px 6px 6px 10px; }\n.hb-xe8-tile:hover { filter: brightness(1.12); }\n.hb-xe8-tile:active { transform: scale(0.98); }\n.hb-xe8-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); font-size: 15px; font-weight: 600; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }\n.hb-xe8-layer { container-type: size; position: fixed; inset: 0; z-index: 1000; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; background: rgba(6, 6, 6, 0.96); outline: none; animation: hb-xe8-fade 0.3s ease both; }\n.hb-xe8[data-embedded] .hb-xe8-layer { position: absolute; height: auto; z-index: 2; }\n.hb-xe8-layer[data-state=\"closed\"] { animation: hb-xe8-fade-out 0.24s ease both; }\n.hb-xe8-bar { display: flex; align-items: center; gap: 10px; padding: clamp(8px, 2.4cqh, 16px) clamp(10px, 2.6cqw, 20px); }\n.hb-xe8-count { font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; color: #9a9a9a; font-variant-numeric: tabular-nums; }\n.hb-xe8-count b { color: #ededed; font-weight: 500; }\n.hb-xe8-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.hb-xe8-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.06); color: #d4d4d4; cursor: pointer; transition: background-color 0.18s ease, color 0.18s ease; }\n.hb-xe8-icon:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }\n.hb-xe8-icon[aria-pressed=\"true\"] { background: #ededed; color: #0a0a0a; }\n.hb-xe8-icon svg { width: 15px; height: 15px; }\n.hb-xe8-stage { position: relative; min-height: 0; display: grid; place-items: center; padding: 0 clamp(40px, 8cqw, 76px); overflow: hidden; touch-action: pan-y; }\n.hb-xe8-frame { position: relative; width: min(100%, calc((100cqh - 150px) * 1.5)); aspect-ratio: 3 / 2; max-height: 100%; overflow: hidden; border-radius: 6px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9); cursor: zoom-in; }\n.hb-xe8-frame[data-zoomed=\"true\"] { cursor: zoom-out; }\n.hb-xe8-img { position: absolute; inset: 0; background-size: cover; background-position: center; transform-origin: var(--hb-xe8-ox, 50%) var(--hb-xe8-oy, 50%); transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.2, 1); animation: hb-xe8-in-next 0.55s cubic-bezier(0.2, 0.9, 0.2, 1) both; }\n.hb-xe8-img[data-dir=\"prev\"] { animation-name: hb-xe8-in-prev; }\n.hb-xe8-frame[data-zoomed=\"true\"] .hb-xe8-img { transform: scale(var(--hb-xe8-zoom, 2.2)); transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.2, 1), transform-origin 0.12s linear; }\n.hb-xe8-nav { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: clamp(30px, 7cqh, 44px); height: clamp(30px, 7cqh, 44px); margin-top: calc(clamp(30px, 7cqh, 44px) / -2); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 50%; background: rgba(20, 20, 20, 0.7); color: #ededed; cursor: pointer; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background-color 0.2s ease, transform 0.2s cubic-bezier(0.3, 0.7, 0.4, 1); }\n.hb-xe8-nav:hover { background: rgba(40, 40, 40, 0.9); }\n.hb-xe8-nav:active { transform: scale(0.92); }\n.hb-xe8-nav[data-side=\"prev\"] { left: clamp(6px, 1.6cqw, 18px); }\n.hb-xe8-nav[data-side=\"next\"] { right: clamp(6px, 1.6cqw, 18px); }\n.hb-xe8-nav svg { width: 45%; height: 45%; }\n.hb-xe8-info { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 8px 10px; border-radius: 9px; background: rgba(10, 10, 10, 0.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); font-size: 11.5px; line-height: 1.4; pointer-events: none; animation: hb-xe8-up 0.3s cubic-bezier(0.2, 0.9, 0.2, 1) both; }\n.hb-xe8-info b { display: block; font-size: 12.5px; font-weight: 600; }\n.hb-xe8-info span { display: block; color: #a8a8a8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.hb-xe8-info span:last-child { font-family: var(--font-mono, ui-monospace, monospace); font-size: 10.5px; color: #8a8a8a; }\n.hb-xe8-strip { display: flex; justify-content: center; gap: 6px; padding: clamp(8px, 2.4cqh, 16px) 12px; overflow-x: auto; scrollbar-width: none; }\n.hb-xe8-thumb { flex: none; width: clamp(34px, 9cqh, 64px); aspect-ratio: 3 / 2; padding: 0; border: 0; border-radius: 4px; background-size: cover; background-position: center; opacity: 0.45; cursor: pointer; box-shadow: 0 0 0 0 transparent; transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.2, 0.9, 0.2, 1), box-shadow 0.25s ease; }\n.hb-xe8-thumb:hover { opacity: 0.8; }\n.hb-xe8-thumb[aria-current=\"true\"] { opacity: 1; transform: translateY(-2px); box-shadow: 0 0 0 2px #0a0a0a, 0 0 0 3.5px var(--hb-xe8-accent); }\n.hb-xe8-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n@container (max-height: 260px) {\n  .hb-xe8-strip { display: none; }\n  .hb-xe8-frame { width: min(100%, calc((100cqh - 64px) * 1.5)); }\n  .hb-xe8-layer { grid-template-rows: auto 1fr 8px; }\n}\n@keyframes hb-xe8-fade { from { opacity: 0; } to { opacity: 1; } }\n@keyframes hb-xe8-fade-out { from { opacity: 1; } to { opacity: 0; } }\n@keyframes hb-xe8-in-next { from { opacity: 0; transform: translateX(6%) scale(1.04); } to { opacity: 1; transform: none; } }\n@keyframes hb-xe8-in-prev { from { opacity: 0; transform: translateX(-6%) scale(1.04); } to { opacity: 1; transform: none; } }\n@keyframes hb-xe8-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-xe8-layer, .hb-xe8-layer[data-state=\"closed\"], .hb-xe8-img, .hb-xe8-info { animation: none; }\n  .hb-xe8-layer[data-state=\"closed\"] { opacity: 0; }\n  .hb-xe8-img, .hb-xe8-frame[data-zoomed=\"true\"] .hb-xe8-img, .hb-xe8-thumb, .hb-xe8-nav, .hb-xe8-tile, .hb-xe8-icon { transition: none; }\n}\n`;\n\nconst focusable =\n  'a[href],button:not(:disabled),input:not(:disabled),select:not(:disabled),textarea:not(:disabled),[tabindex]:not([tabindex=\"-1\"])';\n\nfunction useLayer(\n  open: boolean,\n  embedded: boolean,\n  panel: React.RefObject<HTMLElement | null>,\n  onClose: () => void,\n  userOpened: React.RefObject<boolean>,\n) {\n  const closeRef = React.useRef(onClose);\n  React.useEffect(() => {\n    closeRef.current = onClose;\n  });\n  React.useEffect(() => {\n    if (!open) return;\n    const node = panel.current;\n    const steal = !embedded || userOpened.current;\n    const previous = document.activeElement as HTMLElement | null;\n    const html = document.documentElement;\n    const overflow = html.style.overflow;\n    if (!embedded) html.style.overflow = \"hidden\";\n    if (steal && node) {\n      const target = node.querySelector<HTMLElement>(\"[data-autofocus]\") ?? node.querySelector<HTMLElement>(focusable) ?? node;\n      target.focus({ preventScroll: true });\n    }\n    const onKey = (e: KeyboardEvent) => {\n      if (!node) return;\n      if (embedded && !node.contains(document.activeElement)) return;\n      if (e.key === \"Escape\") {\n        e.preventDefault();\n        closeRef.current();\n        return;\n      }\n      if (e.key !== \"Tab\") return;\n      const items = Array.from(node.querySelectorAll<HTMLElement>(focusable)).filter((el) => el.getClientRects().length > 0);\n      if (!items.length) {\n        e.preventDefault();\n        node.focus();\n        return;\n      }\n      const first = items[0];\n      const last = items[items.length - 1];\n      const active = document.activeElement;\n      if (!node.contains(active)) {\n        e.preventDefault();\n        first.focus();\n      } else if (e.shiftKey && (active === first || active === node)) {\n        e.preventDefault();\n        last.focus();\n      } else if (!e.shiftKey && active === last) {\n        e.preventDefault();\n        first.focus();\n      }\n    };\n    document.addEventListener(\"keydown\", onKey);\n    return () => {\n      document.removeEventListener(\"keydown\", onKey);\n      if (!embedded) html.style.overflow = overflow;\n      if (steal && previous && previous.isConnected && previous !== document.body) previous.focus({ preventScroll: true });\n    };\n  }, [open, embedded, panel, userOpened]);\n}\n\nfunction bg(img: LightboxImage): React.CSSProperties {\n  return { background: img.background };\n}\n\nexport function ModalLightboxZoom({\n  open,\n  defaultOpen,\n  onOpenChange,\n  embedded = false,\n  images = defaultImages,\n  index,\n  defaultIndex = 0,\n  onIndexChange,\n  gallery = true,\n  zoom = 2.2,\n  accent = \"#ededed\",\n  className = \"\",\n  style,\n  ...rest\n}: ModalLightboxZoomProps) {\n  const [inner, setInner] = React.useState(defaultOpen ?? embedded);\n  const isOpen = open ?? inner;\n  const [present, setPresent] = React.useState(isOpen);\n  const [innerIndex, setInnerIndex] = React.useState(defaultIndex);\n  const [dir, setDir] = React.useState<\"next\" | \"prev\">(\"next\");\n  const [zoomed, setZoomed] = React.useState(false);\n  const [info, setInfo] = React.useState(true);\n  const userOpened = React.useRef(false);\n  const layer = React.useRef<HTMLDivElement>(null);\n  const frame = React.useRef<HTMLDivElement>(null);\n  const swipe = React.useRef<{ x: number; y: number; moved: boolean } | null>(null);\n  const id = React.useId();\n  const count = images.length;\n  const current = Math.min(Math.max(index ?? innerIndex, 0), Math.max(count - 1, 0));\n  const img = images[current];\n\n  if (isOpen && !present) setPresent(true);\n\n  const setOpen = React.useCallback(\n    (next: boolean) => {\n      if (next) userOpened.current = true;\n      else setZoomed(false);\n      if (open === undefined) setInner(next);\n      onOpenChange?.(next);\n    },\n    [open, onOpenChange],\n  );\n  const close = React.useCallback(() => setOpen(false), [setOpen]);\n\n  const go = React.useCallback(\n    (to: number, direction?: \"next\" | \"prev\") => {\n      if (!count) return;\n      const next = (to + count) % count;\n      setDir(direction ?? (next >= current ? \"next\" : \"prev\"));\n      setZoomed(false);\n      if (index === undefined) setInnerIndex(next);\n      onIndexChange?.(next);\n    },\n    [count, current, index, onIndexChange],\n  );\n\n  React.useEffect(() => {\n    if (isOpen || !present) return;\n    const t = setTimeout(() => setPresent(false), 250);\n    return () => clearTimeout(t);\n  }, [isOpen, present]);\n\n  React.useEffect(() => {\n    if (!isOpen) return;\n    const el = layer.current?.querySelector<HTMLElement>('[aria-current=\"true\"]');\n    el?.scrollIntoView({ block: \"nearest\", inline: \"center\", behavior: \"smooth\" });\n  }, [current, isOpen]);\n\n  useLayer(isOpen, embedded, layer, close, userOpened);\n\n  function onKeyDown(e: React.KeyboardEvent<HTMLDivElement>) {\n    if (e.key === \"ArrowRight\") {\n      e.preventDefault();\n      go(current + 1, \"next\");\n    } else if (e.key === \"ArrowLeft\") {\n      e.preventDefault();\n      go(current - 1, \"prev\");\n    } else if (e.key === \"z\" || e.key === \"+\" || e.key === \"=\") {\n      setZoomed((z) => !z);\n    } else if (e.key === \"i\") {\n      setInfo((v) => !v);\n    }\n  }\n\n  function aim(e: React.PointerEvent<HTMLDivElement>) {\n    const f = frame.current;\n    if (!f) return;\n    const r = f.getBoundingClientRect();\n    const x = Math.min(Math.max((e.clientX - r.left) / r.width, 0), 1) * 100;\n    const y = Math.min(Math.max((e.clientY - r.top) / r.height, 0), 1) * 100;\n    f.style.setProperty(\"--hb-xe8-ox\", `${x.toFixed(1)}%`);\n    f.style.setProperty(\"--hb-xe8-oy\", `${y.toFixed(1)}%`);\n  }\n\n  function openAt(i: number) {\n    if (index === undefined) setInnerIndex(i);\n    onIndexChange?.(i);\n    setDir(\"next\");\n    setOpen(true);\n  }\n\n  const vars = { \"--hb-xe8-accent\": accent, \"--hb-xe8-zoom\": zoom, ...style } as React.CSSProperties;\n  const chevron = (d: string) => (\n    <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n      <path d={d} />\n    </svg>\n  );\n\n  return (\n    <div className={`hb-xe8 ${className}`} data-embedded={embedded || undefined} style={vars} {...rest}>\n      <style href=\"hb-xe8-css\" precedence=\"default\">{css}</style>\n      {gallery && (\n        <div className=\"hb-xe8-grid\" role=\"group\" aria-label=\"Photo gallery\">\n          {images.slice(0, 5).map((im, i) => (\n            <button\n              key={im.title}\n              type=\"button\"\n              className=\"hb-xe8-tile\"\n              style={bg(im)}\n              aria-label={i === 4 && count > 5 ? `Open ${im.title}, ${count - 5} more photos` : `Open ${im.title}`}\n              aria-haspopup=\"dialog\"\n              onClick={() => openAt(i)}\n            >\n              {i === 4 && count > 5 && <span className=\"hb-xe8-more\">+{count - 5}</span>}\n            </button>\n          ))}\n        </div>\n      )}\n      {present && img && (\n        <div\n          ref={layer}\n          role=\"dialog\"\n          aria-modal=\"true\"\n          aria-label={`Photo viewer, ${img.title}`}\n          tabIndex={-1}\n          className=\"hb-xe8-layer\"\n          data-state={isOpen ? \"open\" : \"closed\"}\n          onKeyDown={onKeyDown}\n        >\n          <div className=\"hb-xe8-bar\">\n            <span className=\"hb-xe8-count\"><b>{current + 1}</b> / {count}</span>\n            <span className=\"hb-xe8-name\" id={`${id}-t`}>{img.title}</span>\n            <button type=\"button\" className=\"hb-xe8-icon\" aria-label=\"Photo details\" aria-pressed={info} onClick={() => setInfo((v) => !v)}>\n              <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" aria-hidden=\"true\"><circle cx=\"8\" cy=\"8\" r=\"6\" /><path d=\"M8 7.2v3.6M8 5.2v.1\" /></svg>\n            </button>\n            <button type=\"button\" className=\"hb-xe8-icon\" aria-label={zoomed ? \"Zoom out\" : \"Zoom in\"} aria-pressed={zoomed} onClick={() => setZoomed((z) => !z)}>\n              <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" aria-hidden=\"true\">\n                <circle cx=\"7\" cy=\"7\" r=\"4.5\" />\n                <path d={zoomed ? \"M5 7h4M10.5 10.5 14 14\" : \"M5 7h4M7 5v4M10.5 10.5 14 14\"} />\n              </svg>\n            </button>\n            <button type=\"button\" className=\"hb-xe8-icon\" aria-label=\"Close viewer\" data-autofocus=\"\" onClick={close}>\n              {chevron(\"m4 4 8 8m0-8-8 8\")}\n            </button>\n          </div>\n          <div className=\"hb-xe8-stage\">\n            <button type=\"button\" className=\"hb-xe8-nav\" data-side=\"prev\" aria-label=\"Previous photo\" onClick={() => go(current - 1, \"prev\")}>\n              {chevron(\"M10 3.5 5.5 8l4.5 4.5\")}\n            </button>\n            <div\n              ref={frame}\n              className=\"hb-xe8-frame\"\n              data-zoomed={zoomed ? \"true\" : undefined}\n              onPointerDown={(e) => {\n                swipe.current = { x: e.clientX, y: e.clientY, moved: false };\n                if (zoomed) aim(e);\n              }}\n              onPointerMove={(e) => {\n                const s = swipe.current;\n                if (s && Math.abs(e.clientX - s.x) > 8) s.moved = true;\n                if (zoomed) aim(e);\n              }}\n              onPointerUp={(e) => {\n                const s = swipe.current;\n                swipe.current = null;\n                if (!s) return;\n                const dx = e.clientX - s.x;\n                if (!zoomed && s.moved && Math.abs(dx) > 50 && Math.abs(dx) > Math.abs(e.clientY - s.y)) {\n                  go(current + (dx < 0 ? 1 : -1), dx < 0 ? \"next\" : \"prev\");\n                  return;\n                }\n                if (!s.moved) {\n                  aim(e);\n                  setZoomed((z) => !z);\n                }\n              }}\n            >\n              <div key={current} className=\"hb-xe8-img\" data-dir={dir} style={bg(img)} role=\"img\" aria-label={img.alt ?? `${img.title}, ${img.location}`} />\n              {info && !zoomed && (\n                <div className=\"hb-xe8-info\">\n                  <b>{img.title}</b>\n                  <span>{img.location}</span>\n                  {img.meta && <span>{img.meta}</span>}\n                </div>\n              )}\n            </div>\n            <button type=\"button\" className=\"hb-xe8-nav\" data-side=\"next\" aria-label=\"Next photo\" onClick={() => go(current + 1, \"next\")}>\n              {chevron(\"M6 3.5 10.5 8 6 12.5\")}\n            </button>\n          </div>\n          <div className=\"hb-xe8-strip\" role=\"tablist\" aria-label=\"All photos\">\n            {images.map((im, i) => (\n              <button\n                key={im.title}\n                type=\"button\"\n                role=\"tab\"\n                aria-selected={i === current}\n                aria-current={i === current ? \"true\" : undefined}\n                aria-label={im.title}\n                className=\"hb-xe8-thumb\"\n                style={bg(im)}\n                onClick={() => go(i)}\n              />\n            ))}\n          </div>\n          <span className=\"hb-xe8-sr\" aria-live=\"polite\">{`Photo ${current + 1} of ${count}: ${img.title}`}</span>\n        </div>\n      )}\n    </div>\n  );\n}\n"
    }
  ]
}