@liforma/client 0.4.15 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/next/index.js +619 -608
- package/dist/next/index.js.map +1 -1
- package/dist/next/react/ExperienceThumbnail.d.ts.map +1 -1
- package/dist/next/thumbnail/avatarPlate.d.ts +11 -0
- package/dist/next/thumbnail/avatarPlate.d.ts.map +1 -0
- package/dist/next/thumbnail/avatarPlate.test.d.ts +2 -0
- package/dist/next/thumbnail/avatarPlate.test.d.ts.map +1 -0
- package/dist/next/thumbnail/expandAssetUrl.d.ts +3 -2
- package/dist/next/thumbnail/expandAssetUrl.d.ts.map +1 -1
- package/dist/next/thumbnail/index.d.ts +2 -0
- package/dist/next/thumbnail/index.d.ts.map +1 -1
- package/dist/next/thumbnail/toGalleryThumbUrl.d.ts +7 -3
- package/dist/next/thumbnail/toGalleryThumbUrl.d.ts.map +1 -1
- package/dist/next/thumbnail.js +211 -200
- package/dist/next/thumbnail.js.map +1 -1
- package/dist/npm/index.js +496 -492
- package/dist/npm/index.js.map +1 -1
- package/dist/npm/thumbnail/avatarPlate.d.ts +11 -0
- package/dist/npm/thumbnail/avatarPlate.d.ts.map +1 -0
- package/dist/npm/thumbnail/expandAssetUrl.d.ts +3 -2
- package/dist/npm/thumbnail/expandAssetUrl.d.ts.map +1 -1
- package/dist/npm/thumbnail/index.d.ts +2 -0
- package/dist/npm/thumbnail/index.d.ts.map +1 -1
- package/dist/npm/thumbnail/index.js +123 -110
- package/dist/npm/thumbnail/index.js.map +1 -1
- package/dist/npm/thumbnail/toGalleryThumbUrl.d.ts +7 -3
- package/dist/npm/thumbnail/toGalleryThumbUrl.d.ts.map +1 -1
- package/dist/npm/v2/liforma-experience-thumbnail.d.ts.map +1 -1
- package/dist/react/index.js +749 -738
- package/dist/react/index.js.map +1 -1
- package/dist/react/react/ExperienceThumbnail.d.ts.map +1 -1
- package/dist/react/thumbnail/avatarPlate.d.ts +11 -0
- package/dist/react/thumbnail/avatarPlate.d.ts.map +1 -0
- package/dist/react/thumbnail/avatarPlate.test.d.ts +2 -0
- package/dist/react/thumbnail/avatarPlate.test.d.ts.map +1 -0
- package/dist/react/thumbnail/expandAssetUrl.d.ts +3 -2
- package/dist/react/thumbnail/expandAssetUrl.d.ts.map +1 -1
- package/dist/react/thumbnail/index.d.ts +2 -0
- package/dist/react/thumbnail/index.d.ts.map +1 -1
- package/dist/react/thumbnail/toGalleryThumbUrl.d.ts +7 -3
- package/dist/react/thumbnail/toGalleryThumbUrl.d.ts.map +1 -1
- package/dist/react/thumbnail.js +211 -200
- package/dist/react/thumbnail.js.map +1 -1
- package/dist/sdk/v2/client.js +1 -1
- package/dist/sdk/v2/client.js.map +1 -1
- package/dist/sdk/v2/thumbnail.js +2 -2
- package/dist/sdk/v2/thumbnail.js.map +1 -1
- package/dist/svelte/ExperienceThumbnail.svelte +3 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thumbnail.js","names":[],"sources":["../../src/thumbnail/types.ts","../../src/thumbnail/locationPlate.ts","../../src/thumbnail/expandAssetUrl.ts","../../src/thumbnail/toGalleryThumbUrl.ts","../../src/shims/localStack.ts","../../src/thumbnail/hostedLaunchUrl.ts","../../src/thumbnail/thumbLoadScheduler.ts","../../src/thumbnail/lazyLoad.ts","../../src/thumbnail/scrollParallax.ts","../../src/thumbnail/styles.ts","../../src/thumbnail/ensureStyles.ts","../../src/thumbnail/plateDelivery.ts","../../src/react/ExperienceThumbnail.tsx"],"sourcesContent":["/**\n * Catalog-shaped layered gallery preview.\n * Values may be absolute URLs or Liforma paths (`/avatars/…`, `/locations/…/scene`).\n */\nexport type GalleryThumb = {\n\treadonly avatarImage: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n};\n\nexport type ThumbnailInteractionKind = 'anchor' | 'button' | 'presentational';\n\nexport type ResolveThumbnailInteractionInput = {\n\treadonly href?: string | null;\n\treadonly hasClickHandler?: boolean;\n\treadonly experienceId?: string | null;\n};\n\nexport type ThumbnailLayers = {\n\treadonly avatarImage: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n\treadonly fallbackImage?: string;\n};\n\n/** Shared props across Svelte / React / Next (React uses `onClick`). */\nexport type ExperienceThumbnailBaseProps = {\n\treadonly galleryThumb?: GalleryThumb;\n\treadonly avatarImage?: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n\treadonly alt: string;\n\treadonly experienceId?: string;\n\treadonly href?: string;\n\treadonly target?: string;\n\treadonly rel?: string;\n\treadonly returnUrl?: string;\n\treadonly playerBaseUrl?: string;\n\treadonly parallax?: boolean;\n\t/** Same as `<Experience fit>`: `full` (default), `medium`, or `face`. */\n\treadonly fit?: 'full' | 'face' | 'medium';\n\treadonly lazy?: boolean;\n\treadonly className?: string;\n\treadonly fallbackImage?: string;\n\treadonly normalizeUrls?: boolean;\n\t/** CDN origin for catalog paths. Default `https://cdn.liforma.ai`. */\n\treadonly cdnBaseUrl?: string;\n};\n\nexport function thumbnailFitClass(fit?: 'full' | 'face' | 'medium'): string {\n\tif (fit === 'face') return 'liforma-et--fit-face';\n\tif (fit === 'medium') return 'liforma-et--fit-medium';\n\treturn '';\n}\n","/** Location colour plates used by ExperienceThumbnail (no zoom/portrait crops). */\nexport const THUMBNAIL_LOCATION_PLATE_SIZES = ['256x256', '400x225', '800x450', '1672x941'] as const;\nexport type ThumbnailLocationPlateSize = (typeof THUMBNAIL_LOCATION_PLATE_SIZES)[number];\n\nconst LOCATION_SIZE_RE = /(-)(\\d+x\\d+)(\\.(?:webp|avif))(\\?|$)/i;\n\n/**\n * Square / portrait hosts keep the gallery crop. Landscape hosts use a 16:9 plate\n * so cover-fit fills height instead of clipping the top and bottom of a square.\n * Unmeasured boxes stay on `256x256`. Hosts 225px tall or smaller use `400x225`.\n */\nexport function pickThumbnailLocationPlateSize(\n\twidth: number,\n\theight: number\n): ThumbnailLocationPlateSize {\n\tif (!Number.isFinite(width) || !Number.isFinite(height) || width < 1 || height < 1) {\n\t\treturn '256x256';\n\t}\n\tif (width <= height) return '256x256';\n\tif (height <= 225) return '400x225';\n\tif (width > 800 || height > 450) return '1672x941';\n\treturn '800x450';\n}\n\nexport function rewriteThumbnailLocationPlateSize(\n\turl: string,\n\tsize: ThumbnailLocationPlateSize\n): string {\n\tconst trimmed = url.trim();\n\tif (!trimmed) return trimmed;\n\treturn trimmed.replace(\n\t\tLOCATION_SIZE_RE,\n\t\t(_match, dash: string, _current: string, ext: string, end: string) =>\n\t\t\t`${dash}${size}${ext}${end}`\n\t);\n}\n\n/** Observe the thumb host and report CSS box size (for plate picking). */\nexport function attachThumbnailBox(\n\telement: HTMLElement,\n\tonBox: (width: number, height: number) => void\n): () => void {\n\tconst emit = () => {\n\t\tonBox(element.clientWidth, element.clientHeight);\n\t};\n\temit();\n\tif (typeof ResizeObserver === 'undefined') {\n\t\treturn () => {};\n\t}\n\tconst observer = new ResizeObserver(emit);\n\tobserver.observe(element);\n\treturn () => observer.disconnect();\n}\n","import {\n\trewriteThumbnailLocationPlateSize,\n\ttype ThumbnailLocationPlateSize\n} from './locationPlate';\n\n/** Default origin for Liforma gallery plates (catalog paths have no host). */\nexport const DEFAULT_THUMBNAIL_CDN_BASE_URL = 'https://cdn.liforma.ai';\n\nconst LOCATION_SIZE_STEM_RE = /-(256x256|400x225|400x450|800x450|836x971|1672x941|167x94)$/i;\n\nexport function normalizeThumbnailCdnBaseUrl(cdnBaseUrl?: string): string {\n\tconst trimmed = cdnBaseUrl?.trim().replace(/\\/$/, '');\n\treturn trimmed || DEFAULT_THUMBNAIL_CDN_BASE_URL;\n}\n\nfunction isHttpUrl(value: string): boolean {\n\treturn /^https?:\\/\\//i.test(value) || value.startsWith('//');\n}\n\nfunction absoluteHttpUrl(value: string): string {\n\tif (value.startsWith('//')) return `https:${value}`;\n\treturn value;\n}\n\nfunction splitPathAndSearch(value: string): { pathname: string; search: string } {\n\tconst q = value.indexOf('?');\n\tif (q === -1) return { pathname: value, search: '' };\n\treturn { pathname: value.slice(0, q), search: value.slice(q) };\n}\n\nfunction joinCdn(cdnBase: string, pathname: string, search = ''): string {\n\tconst path = pathname.startsWith('/') ? pathname : `/${pathname}`;\n\treturn `${cdnBase}${path}${search}`;\n}\n\n/**\n * Expand a catalog location path (or keep a full URL) to a sized plate URL.\n *\n * `/locations/modern/city/office/interior-desk-daytime` →\n * `{cdn}/locations/modern/city/office/interior-desk-daytime-800x450.webp`\n */\nexport function expandThumbnailLocationUrl(\n\tref: string,\n\tlocationPlateSize: ThumbnailLocationPlateSize,\n\tcdnBaseUrl?: string\n): string {\n\tconst raw = ref.trim();\n\tif (!raw) return raw;\n\tconst cdnBase = normalizeThumbnailCdnBaseUrl(cdnBaseUrl);\n\n\tif (isHttpUrl(raw)) {\n\t\treturn rewriteThumbnailLocationPlateSize(absoluteHttpUrl(raw), locationPlateSize);\n\t}\n\n\tconst { pathname: rawPath, search } = splitPathAndSearch(raw.replace(/\\\\/g, '/'));\n\tlet pathname = rawPath;\n\n\tif (!pathname.startsWith('/')) {\n\t\tpathname = `/locations/${pathname.replace(/^locations\\//i, '')}`;\n\t} else if (/^\\/locations\\//i.test(pathname)) {\n\t\t/* already a location path */\n\t} else if (/^\\/avatars\\//i.test(pathname)) {\n\t\treturn joinCdn(cdnBase, pathname, search);\n\t} else {\n\t\treturn raw;\n\t}\n\n\tif (/\\.webp$/i.test(pathname) && !LOCATION_SIZE_STEM_RE.test(pathname.replace(/\\.webp$/i, ''))) {\n\t\treturn joinCdn(cdnBase, pathname, search);\n\t}\n\n\tlet stem = pathname.replace(/^\\/locations\\//i, '').replace(/\\.webp$/i, '');\n\tstem = stem.replace(LOCATION_SIZE_STEM_RE, '');\n\treturn `${cdnBase}/locations/${stem}-${locationPlateSize}.webp${search}`;\n}\n\n/**\n * Expand a catalog avatar path (or keep a full URL) onto the public CDN.\n * `/avatars/{id}` → `{cdn}/avatars/{id}/256/{id}_neutral.webp`\n */\nexport function expandThumbnailAvatarUrl(ref: string, cdnBaseUrl?: string): string {\n\tconst raw = ref.trim();\n\tif (!raw) return raw;\n\tconst cdnBase = normalizeThumbnailCdnBaseUrl(cdnBaseUrl);\n\n\tif (isHttpUrl(raw)) {\n\t\treturn absoluteHttpUrl(raw);\n\t}\n\n\tconst { pathname: rawPath, search } = splitPathAndSearch(raw.replace(/\\\\/g, '/'));\n\tlet pathname = rawPath;\n\n\tif (!pathname.startsWith('/')) {\n\t\tif (/^avatars\\//i.test(pathname)) {\n\t\t\tpathname = `/${pathname}`;\n\t\t} else if (/^[^/]+$/.test(pathname) && !search) {\n\t\t\treturn `${cdnBase}/avatars/${pathname}/256/${pathname}_neutral.webp`;\n\t\t} else {\n\t\t\treturn raw;\n\t\t}\n\t}\n\n\tif (!/^\\/avatars\\//i.test(pathname)) {\n\t\treturn raw;\n\t}\n\n\tconst rest = pathname.replace(/^\\/avatars\\//i, '').replace(/\\/+$/, '');\n\tif (rest && !rest.includes('/') && !search) {\n\t\treturn `${cdnBase}/avatars/${rest}/256/${rest}_neutral.webp`;\n\t}\n\n\treturn joinCdn(cdnBase, pathname, search);\n}\n","import {\n\texpandThumbnailAvatarUrl,\n\texpandThumbnailLocationUrl,\n\tnormalizeThumbnailCdnBaseUrl\n} from './expandAssetUrl';\nimport type { ThumbnailLocationPlateSize } from './locationPlate';\n\nconst AVATAR_TIER_RE = /(\\/avatars\\/[^/]+\\/)(\\d+)(\\/)/i;\nconst AVATAR_CH_PLATE_RE = /_CH(\\.webp)/i;\n\nexport type { ThumbnailLocationPlateSize };\n\nfunction isLocationRef(raw: string): boolean {\n\tif (/\\/locations\\//i.test(raw) || /^locations\\//i.test(raw)) return true;\n\tif (/^https?:\\/\\//i.test(raw) || raw.startsWith('//')) return false;\n\tif (/^\\/?avatars\\//i.test(raw)) return false;\n\tif (raw.startsWith('/')) return false;\n\treturn raw.includes('/');\n}\n\n/**\n * Rewrite known Liforma CDN URLs to gallery thumb tiers.\n * Avatars: /{tier}/ → /256/; locations: -{WxH}.webp → the requested plate\n * (`256x256` by default, `400x225` / `800x450` / `1672x941` for landscape hosts).\n * Catalog paths (`/locations/…/scene`, `/avatars/{id}`) expand onto the CDN first.\n * Unrecognized URLs are returned unchanged.\n */\nexport function toGalleryThumbUrl(\n\turl: string,\n\tlocationPlateSize: ThumbnailLocationPlateSize = '256x256',\n\tcdnBaseUrl?: string\n): string {\n\tconst raw = url.trim();\n\tif (!raw) return raw;\n\n\tif (isLocationRef(raw)) {\n\t\treturn expandThumbnailLocationUrl(raw, locationPlateSize, cdnBaseUrl);\n\t}\n\n\tlet next = expandThumbnailAvatarUrl(raw, cdnBaseUrl);\n\tnext = next.replace(AVATAR_TIER_RE, (_match, prefix: string, tier: string, slash: string) => {\n\t\tif (tier === '256') return `${prefix}${tier}${slash}`;\n\t\treturn `${prefix}256${slash}`;\n\t});\n\treturn next.replace(AVATAR_CH_PLATE_RE, '_neutral$1');\n}\n\nexport function resolveThumbnailLayers(input: {\n\treadonly galleryThumb?: {\n\t\treadonly avatarImage?: string;\n\t\treadonly backgroundImage?: string;\n\t\treadonly foregroundImage?: string;\n\t};\n\treadonly avatarImage?: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n\treadonly fallbackImage?: string;\n\t/** When false, keep caller absolute URLs (lightbox / preview). Paths still expand. Default true. */\n\treadonly normalize?: boolean;\n\t/** Location plate when expanding or rewriting location assets. Default `256x256`. */\n\treadonly locationPlateSize?: ThumbnailLocationPlateSize;\n\t/** CDN origin for catalog paths. Default `https://cdn.liforma.ai`. */\n\treadonly cdnBaseUrl?: string;\n}): {\n\treadonly avatarImage: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n\treadonly fallbackImage?: string;\n} | null {\n\tconst avatarSource =\n\t\tinput.avatarImage?.trim() ||\n\t\tinput.galleryThumb?.avatarImage?.trim() ||\n\t\t'';\n\tif (!avatarSource) return null;\n\n\tconst backgroundSource =\n\t\tinput.backgroundImage?.trim() || input.galleryThumb?.backgroundImage?.trim() || '';\n\tconst foregroundSource =\n\t\tinput.foregroundImage?.trim() || input.galleryThumb?.foregroundImage?.trim() || '';\n\tconst fallbackSource = input.fallbackImage?.trim() || '';\n\tconst plate = input.locationPlateSize ?? '256x256';\n\tconst cdnBaseUrl = normalizeThumbnailCdnBaseUrl(input.cdnBaseUrl);\n\tconst rewriteKnown = input.normalize !== false;\n\n\tconst rewriteAvatar = (ref: string) => {\n\t\tif (!rewriteKnown && /^https?:\\/\\//i.test(ref.trim())) return ref.trim();\n\t\treturn toGalleryThumbUrl(ref, plate, cdnBaseUrl);\n\t};\n\tconst rewriteLocation = (ref: string) => {\n\t\tif (!rewriteKnown && /^https?:\\/\\//i.test(ref.trim())) return ref.trim();\n\t\treturn expandThumbnailLocationUrl(ref, plate, cdnBaseUrl);\n\t};\n\n\treturn {\n\t\tavatarImage: rewriteAvatar(avatarSource),\n\t\t...(backgroundSource ? { backgroundImage: rewriteLocation(backgroundSource) } : {}),\n\t\t...(foregroundSource ? { foregroundImage: rewriteLocation(foregroundSource) } : {}),\n\t\t...(fallbackSource ? { fallbackImage: rewriteAvatar(fallbackSource) } : {})\n\t};\n}\n","/**\n * Opt-in local monorepo stack (api :3001, player :3002).\n * Never inferred from hostname alone — third-party demos run on localhost against production.\n */\nexport function useExplicitLocalStack(): boolean {\n\tif ((globalThis as { __LIFORMA_STACK?: string }).__LIFORMA_STACK === 'local') {\n\t\treturn true;\n\t}\n\n\tif (typeof location === 'undefined') {\n\t\treturn false;\n\t}\n\n\ttry {\n\t\treturn new URLSearchParams(location.search).get('stack') === 'local';\n\t} catch {\n\t\treturn false;\n\t}\n}\n","import { useExplicitLocalStack } from '../shims/localStack.ts';\nimport type { ResolveThumbnailInteractionInput, ThumbnailInteractionKind } from './types';\n\nconst PRODUCTION_PLAYER_ORIGIN = 'https://player.liforma.ai';\nconst LOCAL_PLAYER_ORIGIN = 'http://localhost:3002';\n\n/** Priority: href → click-only → hosted (experienceId) → presentational. */\nexport function resolveThumbnailInteraction(\n\tinput: ResolveThumbnailInteractionInput\n): ThumbnailInteractionKind {\n\tif (input.href?.trim()) return 'anchor';\n\tif (input.hasClickHandler) return 'button';\n\tif (input.experienceId?.trim()) return 'anchor';\n\treturn 'presentational';\n}\n\nexport function resolvePlayerBaseUrl(playerBaseUrl?: string): string {\n\tconst configured = playerBaseUrl?.trim();\n\tif (configured) return configured.replace(/\\/$/, '');\n\n\tif (useExplicitLocalStack()) {\n\t\treturn LOCAL_PLAYER_ORIGIN;\n\t}\n\n\treturn PRODUCTION_PLAYER_ORIGIN;\n}\n\n/**\n * Build hosted player launch URL: `{player}/{experienceId}?returnUrl=…`\n * When `returnUrl` is omitted, callers should assign on click (SSR-safe) or pass an explicit URL.\n */\nexport function buildHostedLaunchUrl(options: {\n\treadonly experienceId: string;\n\treadonly returnUrl?: string;\n\treadonly playerBaseUrl?: string;\n}): string {\n\tconst experienceId = options.experienceId.trim();\n\tconst base = resolvePlayerBaseUrl(options.playerBaseUrl);\n\tconst url = new URL(`${base}/${encodeURIComponent(experienceId)}`);\n\tconst returnUrl = options.returnUrl?.trim();\n\tif (returnUrl) {\n\t\turl.searchParams.set('returnUrl', returnUrl);\n\t}\n\treturn url.toString();\n}\n\n/** Resolve href for anchor mode (app link or hosted launch). */\nexport function resolveThumbnailHref(options: {\n\treadonly href?: string;\n\treadonly experienceId?: string;\n\treadonly returnUrl?: string;\n\treadonly playerBaseUrl?: string;\n\t/** When true and returnUrl omitted, use window.location.href (browser only). */\n\treadonly useCurrentPageAsReturnUrl?: boolean;\n}): string | undefined {\n\tconst href = options.href?.trim();\n\tif (href) return href;\n\n\tconst experienceId = options.experienceId?.trim();\n\tif (!experienceId) return undefined;\n\n\tlet returnUrl = options.returnUrl?.trim();\n\tif (!returnUrl && options.useCurrentPageAsReturnUrl && typeof window !== 'undefined') {\n\t\treturnUrl = window.location.href;\n\t}\n\n\treturn buildHostedLaunchUrl({\n\t\texperienceId,\n\t\t...(returnUrl ? { returnUrl } : {}),\n\t\tplayerBaseUrl: options.playerBaseUrl\n\t});\n}\n","/** Touch / coarse pointers — limit how many thumbs start loading at once. */\nexport const COARSE_THUMB_LOAD_CONCURRENCY = 4;\n/** Delay before a started thumb frees its queue slot for the next card. */\nexport const COARSE_THUMB_LOAD_STAGGER_MS = 160;\n\nexport function prefersCoarsePointer(): boolean {\n\tif (typeof window === 'undefined') return false;\n\treturn window.matchMedia('(hover: none), (pointer: coarse)').matches;\n}\n\ntype QueuedLoad = {\n\treadonly start: () => void;\n\tcancelled: boolean;\n};\n\nlet inflight = 0;\nconst waiting: QueuedLoad[] = [];\n\nfunction maxConcurrent(): number {\n\treturn prefersCoarsePointer() ? COARSE_THUMB_LOAD_CONCURRENCY : Number.POSITIVE_INFINITY;\n}\n\nfunction staggerMs(): number {\n\treturn prefersCoarsePointer() ? COARSE_THUMB_LOAD_STAGGER_MS : 0;\n}\n\nfunction pump(): void {\n\tconst limit = maxConcurrent();\n\twhile (inflight < limit && waiting.length > 0) {\n\t\tconst next = waiting.shift();\n\t\tif (!next || next.cancelled) continue;\n\t\tinflight += 1;\n\t\tnext.start();\n\t\tconst delay = staggerMs();\n\t\tif (delay <= 0) {\n\t\t\tinflight = Math.max(0, inflight - 1);\n\t\t\tcontinue;\n\t\t}\n\t\twindow.setTimeout(() => {\n\t\t\tinflight = Math.max(0, inflight - 1);\n\t\t\tpump();\n\t\t}, delay);\n\t}\n}\n\n/**\n * On coarse pointers, start thumb image loads in small waves so old devices\n * are not hit with dozens of concurrent decodes. Fine pointers start immediately.\n * Returns a cancel function (no-op after start has run).\n */\nexport function scheduleThumbLoad(start: () => void): () => void {\n\tif (!prefersCoarsePointer()) {\n\t\tstart();\n\t\treturn () => {};\n\t}\n\n\tconst item: QueuedLoad = { start, cancelled: false };\n\twaiting.push(item);\n\tpump();\n\n\treturn () => {\n\t\titem.cancelled = true;\n\t};\n}\n\n/** Test helper — clear queue state between vitest cases. */\nexport function resetThumbLoadSchedulerForTests(): void {\n\tinflight = 0;\n\twaiting.length = 0;\n}\n","import { prefersCoarsePointer, scheduleThumbLoad } from './thumbLoadScheduler';\n\nexport type LazyThumbOptions = {\n\treadonly rootMargin?: string;\n\treadonly onVisibleChange: (visible: boolean) => void;\n};\n\n/** Desktop: prefetch earlier. Coarse/touch: tighter margin to cut burst loads. */\nexport function getDefaultLazyRootMargin(): string {\n\treturn prefersCoarsePointer() ? '96px 0px' : '280px 0px';\n}\n\nfunction parseVerticalRootMarginPx(rootMargin: string): number {\n\tconst first = rootMargin.trim().split(/\\s+/)[0] ?? '0px';\n\tconst value = Number.parseFloat(first);\n\treturn Number.isFinite(value) ? Math.abs(value) : 280;\n}\n\nfunction isNearViewport(element: HTMLElement, marginPx: number): boolean {\n\tif (typeof window === 'undefined') return false;\n\tconst rect = element.getBoundingClientRect();\n\treturn rect.bottom >= -marginPx && rect.top <= window.innerHeight + marginPx;\n}\n\n/** Observe the thumb and enable image loads when near the viewport. */\nexport function attachLazyThumb(element: HTMLElement, options: LazyThumbOptions): () => void {\n\tconst { onVisibleChange } = options;\n\tconst rootMargin = options.rootMargin ?? getDefaultLazyRootMargin();\n\tconst marginPx = parseVerticalRootMarginPx(rootMargin);\n\tlet visible = false;\n\tlet loadStarted = false;\n\tlet cancelScheduled: (() => void) | null = null;\n\n\tconst requestLoad = () => {\n\t\tif (loadStarted) return;\n\t\tcancelScheduled?.();\n\t\tcancelScheduled = scheduleThumbLoad(() => {\n\t\t\tcancelScheduled = null;\n\t\t\tloadStarted = true;\n\t\t\tonVisibleChange(true);\n\t\t});\n\t};\n\n\tconst setVisible = (next: boolean) => {\n\t\tif (next === visible) return;\n\t\tvisible = next;\n\t\tif (next) {\n\t\t\trequestLoad();\n\t\t\treturn;\n\t\t}\n\t\t// Keep images once started; only cancel a queued (not-yet-started) load.\n\t\tcancelScheduled?.();\n\t\tcancelScheduled = null;\n\t\tonVisibleChange(false);\n\t};\n\n\tif (typeof IntersectionObserver === 'undefined') {\n\t\trequestLoad();\n\t\treturn () => {\n\t\t\tcancelScheduled?.();\n\t\t\tcancelScheduled = null;\n\t\t};\n\t}\n\n\tconst observer = new IntersectionObserver(\n\t\t(entries) => {\n\t\t\tsetVisible(entries.some((entry) => entry.isIntersecting));\n\t\t},\n\t\t{ root: null, rootMargin, threshold: 0 }\n\t);\n\n\tobserver.observe(element);\n\n\tif (isNearViewport(element, marginPx)) {\n\t\tsetVisible(true);\n\t}\n\n\treturn () => {\n\t\tcancelScheduled?.();\n\t\tcancelScheduled = null;\n\t\tobserver.disconnect();\n\t};\n}\n\nexport function attachImageReady(element: HTMLImageElement, onReady: () => void): () => void {\n\tconst notify = () => onReady();\n\tif (element.complete) {\n\t\tqueueMicrotask(notify);\n\t} else {\n\t\telement.addEventListener('load', notify, { once: true });\n\t\telement.addEventListener('error', notify, { once: true });\n\t}\n\treturn () => {\n\t\telement.removeEventListener('load', notify);\n\t\telement.removeEventListener('error', notify);\n\t};\n}\n","/** Touch devices without hover — drive thumbnail parallax from scroll position. */\nexport function prefersScrollLinkedParallax(): boolean {\n\tif (typeof window === 'undefined') return false;\n\tif (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return false;\n\treturn window.matchMedia('(hover: none), (pointer: coarse)').matches;\n}\n\n/**\n * Map an element's vertical centre in the viewport to horizontal parallax in [-1, 1].\n */\nexport function horizontalParallaxFromViewportY(rect: DOMRect, viewportHeight: number): number {\n\tconst centerY = rect.top + rect.height / 2;\n\tconst t = centerY / Math.max(viewportHeight, 1);\n\treturn (t - 0.5) * 2;\n}\n\nexport type ScrollLinkedParallaxOptions = {\n\treadonly onParallax: (x: number) => void;\n\treadonly pointerActive?: () => boolean;\n};\n\ntype ScrollParallaxSubscriber = {\n\treadonly element: HTMLElement;\n\treadonly onParallax: (x: number) => void;\n\treadonly pointerActive?: () => boolean;\n};\n\nconst subscribers = new Set<ScrollParallaxSubscriber>();\nlet listening = false;\nlet frame = 0;\n\nfunction syncAll(): void {\n\tframe = 0;\n\tif (subscribers.size === 0 || typeof window === 'undefined') return;\n\tconst viewportHeight = window.innerHeight;\n\tfor (const entry of subscribers) {\n\t\tif (entry.pointerActive?.()) continue;\n\t\tconst rect = entry.element.getBoundingClientRect();\n\t\t// Skip off-screen thumbs — avoids N layout reads + framework updates per scroll.\n\t\tif (rect.bottom < -64 || rect.top > viewportHeight + 64) continue;\n\t\tentry.onParallax(horizontalParallaxFromViewportY(rect, viewportHeight));\n\t}\n}\n\nfunction scheduleSync(): void {\n\tif (frame !== 0) return;\n\tframe = requestAnimationFrame(syncAll);\n}\n\nfunction ensureListening(): void {\n\tif (listening || typeof window === 'undefined') return;\n\tlistening = true;\n\twindow.addEventListener('scroll', scheduleSync, { passive: true });\n\twindow.addEventListener('resize', scheduleSync, { passive: true });\n}\n\nfunction stopListeningIfIdle(): void {\n\tif (subscribers.size > 0 || !listening || typeof window === 'undefined') return;\n\tlistening = false;\n\tif (frame !== 0) {\n\t\tcancelAnimationFrame(frame);\n\t\tframe = 0;\n\t}\n\twindow.removeEventListener('scroll', scheduleSync);\n\twindow.removeEventListener('resize', scheduleSync);\n}\n\n/**\n * Subscribe to scroll/resize and update horizontal parallax from viewport Y.\n * Uses one shared window listener for all thumbs (old iPads with large galleries).\n */\nexport function attachScrollLinkedParallax(\n\telement: HTMLElement,\n\toptions: ScrollLinkedParallaxOptions\n): () => void {\n\tif (!prefersScrollLinkedParallax()) return () => {};\n\n\tconst entry: ScrollParallaxSubscriber = {\n\t\telement,\n\t\tonParallax: options.onParallax,\n\t\tpointerActive: options.pointerActive\n\t};\n\tsubscribers.add(entry);\n\tensureListening();\n\n\tif (!entry.pointerActive?.()) {\n\t\toptions.onParallax(\n\t\t\thorizontalParallaxFromViewportY(element.getBoundingClientRect(), window.innerHeight)\n\t\t);\n\t}\n\n\treturn () => {\n\t\tsubscribers.delete(entry);\n\t\tstopListeningIfIdle();\n\t};\n}\n\n/** Test helper — clear shared scroll state between vitest cases. */\nexport function resetScrollLinkedParallaxForTests(): void {\n\tsubscribers.clear();\n\tif (typeof window !== 'undefined' && listening) {\n\t\twindow.removeEventListener('scroll', scheduleSync);\n\t\twindow.removeEventListener('resize', scheduleSync);\n\t}\n\tlistening = false;\n\tif (frame !== 0) {\n\t\tcancelAnimationFrame(frame);\n\t\tframe = 0;\n\t}\n}\n","/** Shared styles for ExperienceThumbnail (class prefix `liforma-et`). */\nexport const EXPERIENCE_THUMBNAIL_CSS = `\n:host {\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tmin-height: 0;\n}\n\n.liforma-et {\n\t--liforma-et-parallax-x: 0;\n\t--liforma-et-parallax-y: 0;\n\t--liforma-et-bg-scale: 1;\n\t--liforma-et-fg-scale: 1;\n\t--liforma-et-avatar-scale: 1;\n\t--liforma-et-bg-shift: 0px;\n\t--liforma-et-fg-shift: 0px;\n\t--liforma-et-avatar-shift: 0px;\n\t--liforma-et-reveal-duration: 420ms;\n\n\tbox-sizing: border-box;\n\tposition: relative;\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tmin-height: 0;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tborder-radius: 0;\n\toverflow: hidden;\n\tbackground: #111;\n\tcolor: inherit;\n\ttext-decoration: none;\n\tcursor: inherit;\n\t-webkit-tap-highlight-color: transparent;\n}\n\na.liforma-et,\nbutton.liforma-et {\n\tcursor: pointer;\n}\n\nbutton.liforma-et {\n\tfont: inherit;\n\tappearance: none;\n}\n\n.liforma-et__placeholder {\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 0;\n\tbackground:\n\t\tradial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 58%),\n\t\tlinear-gradient(180deg, #1a1a1a 0%, #101010 100%);\n\topacity: 1;\n\ttransition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n.liforma-et--revealed .liforma-et__placeholder {\n\topacity: 0;\n}\n\n.liforma-et__media {\n\topacity: 0;\n\ttransition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n.liforma-et__media--ready {\n\topacity: 1;\n}\n\n.liforma-et__background {\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 1;\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: cover;\n\tobject-position: center center;\n\ttransform: translate(\n\t\t\tcalc(var(--liforma-et-parallax-x) * var(--liforma-et-bg-shift)),\n\t\t\tcalc(var(--liforma-et-parallax-y) * var(--liforma-et-bg-shift))\n\t\t)\n\t\tscale(var(--liforma-et-bg-scale));\n\ttransform-origin: center center;\n\ttransition:\n\t\topacity var(--liforma-et-reveal-duration) ease,\n\t\ttransform 160ms ease;\n}\n\n.liforma-et__avatar {\n\tposition: relative;\n\tz-index: 2;\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: contain;\n\tobject-position: center bottom;\n\ttransform: scale(var(--liforma-et-avatar-scale))\n\t\ttranslate(\n\t\t\tcalc(var(--liforma-et-parallax-x) * var(--liforma-et-avatar-shift)),\n\t\t\tcalc(var(--liforma-et-parallax-y) * var(--liforma-et-avatar-shift))\n\t\t);\n\ttransform-origin: center center;\n\ttransition:\n\t\topacity var(--liforma-et-reveal-duration) ease,\n\t\ttransform 160ms ease;\n}\n\n/* Gallery plates are typically square in a square tile — contain vs cover is a no-op\n without a zoom. Scale the whole scene from the upper third so Face matches\n player fit (location + avatar crop together). */\n.liforma-et--fit-face {\n\t--liforma-et-avatar-scale: 1.85;\n\t--liforma-et-bg-scale: 1.85;\n\t--liforma-et-fg-scale: 1.85;\n}\n\n.liforma-et--fit-face .liforma-et__avatar,\n.liforma-et--fit-face .liforma-et__background,\n.liforma-et--fit-face .liforma-et__foreground {\n\ttransform-origin: 50% 18%;\n}\n\n.liforma-et--fit-face .liforma-et__avatar {\n\tobject-fit: cover;\n\tobject-position: 50% 18%;\n}\n\n/* Bust / medium: less zoom than face so upper chest stays in frame (player 3.75H window). */\n.liforma-et--fit-medium {\n\t--liforma-et-avatar-scale: 1.35;\n\t--liforma-et-bg-scale: 1.35;\n\t--liforma-et-fg-scale: 1.35;\n}\n\n.liforma-et--fit-medium .liforma-et__avatar,\n.liforma-et--fit-medium .liforma-et__background,\n.liforma-et--fit-medium .liforma-et__foreground {\n\ttransform-origin: 50% 28%;\n}\n\n.liforma-et--fit-medium .liforma-et__avatar {\n\tobject-fit: cover;\n\tobject-position: 50% 28%;\n}\n\n.liforma-et__foreground {\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 3;\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: cover;\n\tobject-position: center center;\n\tpointer-events: none;\n\ttransform: translate(\n\t\t\tcalc(var(--liforma-et-parallax-x) * var(--liforma-et-fg-shift) * -1),\n\t\t\tcalc(var(--liforma-et-parallax-y) * var(--liforma-et-fg-shift) * -1)\n\t\t)\n\t\tscale(var(--liforma-et-fg-scale));\n\ttransform-origin: center center;\n\ttransition:\n\t\topacity var(--liforma-et-reveal-duration) ease,\n\t\ttransform 160ms ease;\n}\n\n.liforma-et--parallax {\n\t--liforma-et-bg-scale: 1.08;\n\t--liforma-et-fg-scale: 1.05;\n\t--liforma-et-avatar-scale: 1.08;\n\t--liforma-et-bg-shift: 10px;\n\t--liforma-et-fg-shift: 4px;\n\t--liforma-et-avatar-shift: 4px;\n}\n\n/* Promote layers only while parallax is active — avoids N compositor surfaces on galleries. */\n.liforma-et--parallax .liforma-et__background,\n.liforma-et--parallax .liforma-et__foreground,\n.liforma-et--parallax .liforma-et__avatar {\n\twill-change: transform;\n}\n\n.liforma-et--parallax.liforma-et--fit-face {\n\t--liforma-et-avatar-scale: 1.95;\n\t--liforma-et-bg-scale: 1.95;\n\t--liforma-et-fg-scale: 1.95;\n\t--liforma-et-avatar-shift: 0px;\n}\n\n.liforma-et--parallax.liforma-et--fit-medium {\n\t--liforma-et-avatar-scale: 1.42;\n\t--liforma-et-bg-scale: 1.42;\n\t--liforma-et-fg-scale: 1.42;\n\t--liforma-et-avatar-shift: 0px;\n}\n\n.liforma-et--scroll-parallax .liforma-et__background,\n.liforma-et--scroll-parallax .liforma-et__foreground,\n.liforma-et--scroll-parallax .liforma-et__avatar {\n\ttransition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t.liforma-et {\n\t\t--liforma-et-reveal-duration: 0ms;\n\t}\n\n\t.liforma-et--parallax {\n\t\t--liforma-et-bg-scale: 1;\n\t\t--liforma-et-fg-scale: 1;\n\t\t--liforma-et-avatar-scale: 1;\n\t\t--liforma-et-bg-shift: 0px;\n\t\t--liforma-et-fg-shift: 0px;\n\t\t--liforma-et-avatar-shift: 0px;\n\t}\n\n\t.liforma-et--parallax.liforma-et--fit-face {\n\t\t--liforma-et-avatar-scale: 1.85;\n\t\t--liforma-et-bg-scale: 1.85;\n\t\t--liforma-et-fg-scale: 1.85;\n\t}\n\n\t.liforma-et__background,\n\t.liforma-et__foreground,\n\t.liforma-et__avatar {\n\t\ttransition: none;\n\t}\n}\n`.trim();\n","let styleMounted = false;\n\n/** Inject shared thumbnail CSS once per document. */\nexport function ensureExperienceThumbnailStyles(css: string): void {\n\tif (typeof document === 'undefined' || styleMounted) return;\n\tif (document.querySelector('style[data-liforma-et]')) {\n\t\tstyleMounted = true;\n\t\treturn;\n\t}\n\tconst style = document.createElement('style');\n\tstyle.setAttribute('data-liforma-et', '');\n\tstyle.textContent = css;\n\tdocument.head.appendChild(style);\n\tstyleMounted = true;\n}\n","/**\n * CDN colour-plate delivery for thumbnails (avatars + locations).\n * Catalogue identity stays `.webp`; fetch uses `.avif` when the browser can decode it.\n * Depth maps stay WebP. Costume rendered composites have AVIF siblings from the compose worker.\n */\n\nconst AVIF_PROBE_DATA_URI =\n\t'data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=';\n\nlet avifSupportPromise: Promise<boolean> | null = null;\n\n/** True when this URL is a colour plate WebP that may have an AVIF sibling (not depth). */\nexport function isColourPlateWebpUrl(url: string): boolean {\n\tconst trimmed = url.trim();\n\tif (!trimmed || trimmed.startsWith('blob:') || trimmed.startsWith('data:')) return false;\n\tconst pathOnly = trimmed.split(/[?#]/)[0] ?? trimmed;\n\tconst isAvatar = /\\/avatars\\//i.test(pathOnly);\n\tconst isLocation = /\\/locations\\//i.test(pathOnly);\n\tif (!isAvatar && !isLocation) return false;\n\tif (/\\.depth\\.webp$/i.test(pathOnly)) return false;\n\treturn /\\.webp$/i.test(pathOnly);\n}\n\n/** Rewrite a colour-plate `.webp` path to `.avif`, preserving query/hash. */\nexport function toAvifPlateUrl(url: string): string | null {\n\tif (!isColourPlateWebpUrl(url)) return null;\n\tconst qIndex = url.search(/[?#]/);\n\tif (qIndex < 0) return url.replace(/\\.webp$/i, '.avif');\n\tconst path = url.slice(0, qIndex);\n\tconst suffix = url.slice(qIndex);\n\treturn `${path.replace(/\\.webp$/i, '.avif')}${suffix}`;\n}\n\nexport function supportsAvifDecode(): Promise<boolean> {\n\tif (typeof Image === 'undefined') return Promise.resolve(false);\n\tif (!avifSupportPromise) {\n\t\tavifSupportPromise = new Promise<boolean>((resolve) => {\n\t\t\tconst img = new Image();\n\t\t\timg.onload = () => resolve(img.naturalWidth > 0 && img.naturalHeight > 0);\n\t\t\timg.onerror = () => resolve(false);\n\t\t\timg.src = AVIF_PROBE_DATA_URI;\n\t\t});\n\t}\n\treturn avifSupportPromise;\n}\n\nexport function resetAvifDecodeSupportCacheForTests(): void {\n\tavifSupportPromise = null;\n}\n\n/** WebP catalogue URL → AVIF sibling when `useAvif` is true. */\nexport function thumbnailPlateSrc(url: string, useAvif: boolean): string {\n\tif (!useAvif) return url;\n\treturn toAvifPlateUrl(url) ?? url;\n}\n\n/** Colour-plate `.avif` → catalogue `.webp` (compose worker / missing sibling). */\nexport function thumbnailColourPlateWebpFallbackUrl(url: string): string | null {\n\tconst trimmed = url.trim();\n\tconst qIndex = trimmed.search(/[?#]/);\n\tconst pathOnly = qIndex < 0 ? trimmed : trimmed.slice(0, qIndex);\n\tif (!/\\.avif$/i.test(pathOnly)) return null;\n\tconst webpPath = pathOnly.replace(/\\.avif$/i, '.webp');\n\treturn qIndex < 0 ? webpPath : `${webpPath}${trimmed.slice(qIndex)}`;\n}\n\n/** 400×225 is colour-only; if missing, step up to the published 800×450 sibling. */\nexport function thumbnailLocationPlateFallbackUrl(url: string): string | null {\n\tconst trimmed = url.trim();\n\tif (!/-400x225\\.(webp|avif)(?:$|[?#])/i.test(trimmed)) return null;\n\treturn trimmed.replace(/-400x225\\.(webp|avif)/i, '-800x450.$1');\n}\n","'use client';\n\nimport {\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n\ttype CSSProperties,\n\ttype MouseEvent as ReactMouseEvent,\n\ttype PointerEvent as ReactPointerEvent\n} from 'react';\n\nimport {\n\tattachLazyThumb,\n\tattachScrollLinkedParallax,\n\tattachThumbnailBox,\n\tensureExperienceThumbnailStyles,\n\tEXPERIENCE_THUMBNAIL_CSS,\n\thorizontalParallaxFromViewportY,\n\tpickThumbnailLocationPlateSize,\n\tresolveThumbnailHref,\n\tresolveThumbnailInteraction,\n\tresolveThumbnailLayers,\n\tthumbnailFitClass,\n\tthumbnailColourPlateWebpFallbackUrl,\n\tthumbnailLocationPlateFallbackUrl,\n\tthumbnailPlateSrc,\n\tsupportsAvifDecode,\n\ttype GalleryThumb\n} from '../thumbnail/index';\n\nexport type ExperienceThumbnailProps = {\n\treadonly galleryThumb?: GalleryThumb;\n\treadonly avatarImage?: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n\treadonly alt: string;\n\treadonly experienceId?: string;\n\treadonly href?: string;\n\treadonly target?: string;\n\treadonly rel?: string;\n\treadonly onClick?: (event: ReactMouseEvent<HTMLElement>) => void;\n\treadonly returnUrl?: string;\n\treadonly playerBaseUrl?: string;\n\treadonly parallax?: boolean;\n\treadonly fit?: 'full' | 'face' | 'medium';\n\treadonly lazy?: boolean;\n\treadonly className?: string;\n\treadonly fallbackImage?: string;\n\treadonly normalizeUrls?: boolean;\n\treadonly cdnBaseUrl?: string;\n};\n\nfunction mediaClass(base: string, ready: boolean): string {\n\treturn `${base} liforma-et__media${ready ? ' liforma-et__media--ready' : ''}`;\n}\n\nexport function ExperienceThumbnail(props: ExperienceThumbnailProps) {\n\tconst {\n\t\tgalleryThumb,\n\t\tavatarImage,\n\t\tbackgroundImage,\n\t\tforegroundImage,\n\t\talt,\n\t\texperienceId,\n\t\thref,\n\t\ttarget,\n\t\trel,\n\t\tonClick,\n\t\treturnUrl,\n\t\tplayerBaseUrl,\n\t\tparallax = true,\n\t\tfit = 'full',\n\t\tlazy = true,\n\t\tclassName = '',\n\t\tfallbackImage,\n\t\tnormalizeUrls = true,\n\t\tcdnBaseUrl\n\t} = props;\n\n\tconst rootRef = useRef<HTMLElement | null>(null);\n\tconst pointerDownRef = useRef(false);\n\tconst [boxW, setBoxW] = useState(0);\n\tconst [boxH, setBoxH] = useState(0);\n\n\tconst locationPlateSize = pickThumbnailLocationPlateSize(boxW, boxH);\n\tconst layers = useMemo(\n\t\t() =>\n\t\t\tresolveThumbnailLayers({\n\t\t\t\tgalleryThumb,\n\t\t\t\tavatarImage,\n\t\t\t\tbackgroundImage,\n\t\t\t\tforegroundImage,\n\t\t\t\tfallbackImage,\n\t\t\t\tnormalize: normalizeUrls,\n\t\t\t\tlocationPlateSize,\n\t\t\t\tcdnBaseUrl\n\t\t\t}),\n\t\t[\n\t\t\tgalleryThumb,\n\t\t\tavatarImage,\n\t\t\tbackgroundImage,\n\t\t\tforegroundImage,\n\t\t\tfallbackImage,\n\t\t\tnormalizeUrls,\n\t\t\tlocationPlateSize,\n\t\t\tcdnBaseUrl\n\t\t]\n\t);\n\n\tconst interaction = resolveThumbnailInteraction({\n\t\thref,\n\t\thasClickHandler: typeof onClick === 'function',\n\t\texperienceId\n\t});\n\tconst isHostedLaunch =\n\t\tinteraction === 'anchor' && !href?.trim() && Boolean(experienceId?.trim());\n\tconst hasScene = Boolean(layers?.backgroundImage);\n\tconst parallaxEnabled = parallax !== false;\n\n\tconst [shouldLoad, setShouldLoad] = useState(!lazy);\n\tconst [useAvif, setUseAvif] = useState(false);\n\tconst [plateFormatReady, setPlateFormatReady] = useState(false);\n\tconst [backgroundTriedFallback, setBackgroundTriedFallback] = useState(false);\n\tconst [foregroundTriedFallback, setForegroundTriedFallback] = useState(false);\n\tconst [avatarTriedWebpFallback, setAvatarTriedWebpFallback] = useState(false);\n\tconst [hovering, setHovering] = useState(false);\n\tconst [scrollParallax, setScrollParallax] = useState(false);\n\tconst [parallaxX, setParallaxX] = useState(0);\n\tconst [parallaxY, setParallaxY] = useState(0);\n\tconst [avatarLoadFailed, setAvatarLoadFailed] = useState(false);\n\tconst [backgroundReady, setBackgroundReady] = useState(false);\n\tconst [avatarReady, setAvatarReady] = useState(false);\n\tconst [foregroundReady, setForegroundReady] = useState(false);\n\tconst [resolvedHref, setResolvedHref] = useState<string | undefined>();\n\n\tconst resolvedAvatarImage = layers\n\t\t? avatarLoadFailed && layers.fallbackImage\n\t\t\t? layers.fallbackImage\n\t\t\t: layers.avatarImage\n\t\t: '';\n\n\tuseEffect(() => {\n\t\tensureExperienceThumbnailStyles(EXPERIENCE_THUMBNAIL_CSS);\n\t\tvoid supportsAvifDecode().then((ok) => {\n\t\t\tsetUseAvif(ok);\n\t\t\tsetPlateFormatReady(true);\n\t\t});\n\t}, []);\n\n\tuseEffect(() => {\n\t\tsetResolvedHref(\n\t\t\tresolveThumbnailHref({\n\t\t\t\thref,\n\t\t\t\texperienceId,\n\t\t\t\treturnUrl,\n\t\t\t\tplayerBaseUrl,\n\t\t\t\tuseCurrentPageAsReturnUrl: isHostedLaunch && !returnUrl?.trim()\n\t\t\t})\n\t\t);\n\t}, [href, experienceId, returnUrl, playerBaseUrl, isHostedLaunch]);\n\n\tuseEffect(() => {\n\t\tsetBackgroundReady(false);\n\t\tsetAvatarReady(false);\n\t\tsetForegroundReady(false);\n\t\tsetAvatarLoadFailed(false);\n\t\tsetBackgroundTriedFallback(false);\n\t\tsetForegroundTriedFallback(false);\n\t\tsetAvatarTriedWebpFallback(false);\n\t}, [layers?.backgroundImage, layers?.foregroundImage, resolvedAvatarImage]);\n\n\tuseEffect(() => {\n\t\tconst el = rootRef.current;\n\t\tif (!el) return;\n\t\treturn attachThumbnailBox(el, (width, height) => {\n\t\t\tsetBoxW(width);\n\t\t\tsetBoxH(height);\n\t\t});\n\t}, [interaction, resolvedHref]);\n\n\tuseEffect(() => {\n\t\tconst el = rootRef.current;\n\t\tif (!el) return;\n\t\tif (!lazy) {\n\t\t\tsetShouldLoad(true);\n\t\t\treturn;\n\t\t}\n\t\treturn attachLazyThumb(el, {\n\t\t\tonVisibleChange: (visible) => {\n\t\t\t\tif (visible) setShouldLoad(true);\n\t\t\t}\n\t\t});\n\t}, [lazy, layers, interaction, resolvedHref]);\n\n\tuseEffect(() => {\n\t\tconst el = rootRef.current;\n\t\tif (!el || !parallaxEnabled) return;\n\t\treturn attachScrollLinkedParallax(el, {\n\t\t\tonParallax: (x) => {\n\t\t\t\tsetScrollParallax(true);\n\t\t\t\tif (!pointerDownRef.current) {\n\t\t\t\t\tsetParallaxX(x);\n\t\t\t\t\tsetParallaxY(0);\n\t\t\t\t}\n\t\t\t},\n\t\t\tpointerActive: () => pointerDownRef.current\n\t\t});\n\t}, [parallaxEnabled, layers, interaction, resolvedHref]);\n\n\tconst onPointerMove = (event: ReactPointerEvent<HTMLElement>) => {\n\t\tif (!parallaxEnabled || scrollParallax) return;\n\t\tconst rect = event.currentTarget.getBoundingClientRect();\n\t\tif (rect.width <= 0 || rect.height <= 0) return;\n\t\tsetParallaxX(((event.clientX - rect.left) / rect.width - 0.5) * 2);\n\t\tsetParallaxY(((event.clientY - rect.top) / rect.height - 0.5) * 2);\n\t};\n\n\tconst clearPointer = (thumb: HTMLElement) => {\n\t\tconst wasDown = pointerDownRef.current;\n\t\tpointerDownRef.current = false;\n\t\tsetHovering(false);\n\t\tif (scrollParallax && wasDown) {\n\t\t\tsetParallaxX(\n\t\t\t\thorizontalParallaxFromViewportY(thumb.getBoundingClientRect(), window.innerHeight)\n\t\t\t);\n\t\t\tsetParallaxY(0);\n\t\t} else if (!scrollParallax) {\n\t\t\tsetParallaxX(0);\n\t\t\tsetParallaxY(0);\n\t\t}\n\t};\n\n\tconst onPointerDown = (event: ReactPointerEvent<HTMLElement>) => {\n\t\tif (!parallaxEnabled) return;\n\t\tpointerDownRef.current = true;\n\t\tif (event.pointerType === 'mouse') setHovering(true);\n\t\tconst thumb = event.currentTarget;\n\t\tconst onGlobalEnd = () => {\n\t\t\tclearPointer(thumb);\n\t\t\twindow.removeEventListener('pointerup', onGlobalEnd);\n\t\t\twindow.removeEventListener('pointercancel', onGlobalEnd);\n\t\t};\n\t\twindow.addEventListener('pointerup', onGlobalEnd);\n\t\twindow.addEventListener('pointercancel', onGlobalEnd);\n\t};\n\n\tconst handleClick = (event: ReactMouseEvent<HTMLElement>) => {\n\t\tonClick?.(event);\n\t\tif (event.defaultPrevented) return;\n\t\tif (isHostedLaunch && !returnUrl?.trim()) {\n\t\t\tconst next = resolveThumbnailHref({\n\t\t\t\texperienceId,\n\t\t\t\tplayerBaseUrl,\n\t\t\t\tuseCurrentPageAsReturnUrl: true\n\t\t\t});\n\t\t\tif (\n\t\t\t\tnext &&\n\t\t\t\tevent.button === 0 &&\n\t\t\t\t!event.metaKey &&\n\t\t\t\t!event.ctrlKey &&\n\t\t\t\t!event.shiftKey\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\twindow.location.assign(next);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (!layers) return null;\n\n\tconst parallaxLayersActive = parallaxEnabled && (hovering || scrollParallax);\n\t/** Fade placeholder as soon as any layer can paint — don't wait for the slowest plate. */\n\tconst revealThumb =\n\t\tshouldLoad && plateFormatReady && (avatarReady || backgroundReady || foregroundReady);\n\n\tconst rootClass = [\n\t\t'liforma-et',\n\t\thasScene ? 'liforma-et--scene' : '',\n\t\tthumbnailFitClass(fit),\n\t\tparallaxLayersActive ? 'liforma-et--parallax' : '',\n\t\tscrollParallax ? 'liforma-et--scroll-parallax' : '',\n\t\tshouldLoad && !revealThumb ? 'liforma-et--loading' : '',\n\t\trevealThumb ? 'liforma-et--revealed' : '',\n\t\tclassName\n\t]\n\t\t.filter(Boolean)\n\t\t.join(' ');\n\n\tconst style = {\n\t\t['--liforma-et-parallax-x' as string]: parallaxX,\n\t\t['--liforma-et-parallax-y' as string]: parallaxY\n\t} as CSSProperties;\n\n\tconst markReady = (img: HTMLImageElement, setReady: (v: boolean) => void) => {\n\t\tif (img.complete) setReady(true);\n\t};\n\n\tconst media = (\n\t\t<>\n\t\t\t<span className=\"liforma-et__placeholder\" aria-hidden=\"true\" />\n\t\t\t{shouldLoad && plateFormatReady && layers.backgroundImage ? (\n\t\t\t\t<img\n\t\t\t\t\tclassName={mediaClass('liforma-et__background', backgroundReady)}\n\t\t\t\t\tsrc={thumbnailPlateSrc(layers.backgroundImage, useAvif)}\n\t\t\t\t\talt=\"\"\n\t\t\t\t\tdecoding=\"async\"\n\t\t\t\t\tref={(node) => {\n\t\t\t\t\t\tif (node) markReady(node, setBackgroundReady);\n\t\t\t\t\t}}\n\t\t\t\t\tonLoad={() => setBackgroundReady(true)}\n\t\t\t\t\tonError={(event) => {\n\t\t\t\t\t\tconst img = event.currentTarget;\n\t\t\t\t\t\tconst fallback = thumbnailLocationPlateFallbackUrl(img.src);\n\t\t\t\t\t\tif (fallback && !backgroundTriedFallback) {\n\t\t\t\t\t\t\tsetBackgroundTriedFallback(true);\n\t\t\t\t\t\t\timg.src = fallback;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetBackgroundReady(true);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t\t{shouldLoad && plateFormatReady && resolvedAvatarImage ? (\n\t\t\t\t<img\n\t\t\t\t\tclassName={mediaClass('liforma-et__avatar', avatarReady)}\n\t\t\t\t\tsrc={thumbnailPlateSrc(resolvedAvatarImage, useAvif)}\n\t\t\t\t\talt=\"\"\n\t\t\t\t\tdecoding=\"async\"\n\t\t\t\t\tref={(node) => {\n\t\t\t\t\t\tif (node) markReady(node, setAvatarReady);\n\t\t\t\t\t}}\n\t\t\t\t\tonLoad={() => setAvatarReady(true)}\n\t\t\t\t\tonError={(event) => {\n\t\t\t\t\t\tconst img = event.currentTarget;\n\t\t\t\t\t\tconst webp = thumbnailColourPlateWebpFallbackUrl(img.src);\n\t\t\t\t\t\tif (webp && !avatarTriedWebpFallback) {\n\t\t\t\t\t\t\tsetAvatarTriedWebpFallback(true);\n\t\t\t\t\t\t\timg.src = webp;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (layers.fallbackImage) setAvatarLoadFailed(true);\n\t\t\t\t\t\telse setAvatarReady(true);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t\t{shouldLoad && plateFormatReady && layers.foregroundImage ? (\n\t\t\t\t<img\n\t\t\t\t\tclassName={mediaClass('liforma-et__foreground', foregroundReady)}\n\t\t\t\t\tsrc={thumbnailPlateSrc(layers.foregroundImage, useAvif)}\n\t\t\t\t\talt=\"\"\n\t\t\t\t\tdecoding=\"async\"\n\t\t\t\t\tref={(node) => {\n\t\t\t\t\t\tif (node) markReady(node, setForegroundReady);\n\t\t\t\t\t}}\n\t\t\t\t\tonLoad={() => setForegroundReady(true)}\n\t\t\t\t\tonError={(event) => {\n\t\t\t\t\t\tconst img = event.currentTarget;\n\t\t\t\t\t\tconst fallback = thumbnailLocationPlateFallbackUrl(img.src);\n\t\t\t\t\t\tif (fallback && !foregroundTriedFallback) {\n\t\t\t\t\t\t\tsetForegroundTriedFallback(true);\n\t\t\t\t\t\t\timg.src = fallback;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetForegroundReady(true);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t</>\n\t);\n\n\tconst pointerProps = {\n\t\tonPointerDown,\n\t\tonPointerUp: (event: ReactPointerEvent<HTMLElement>) => clearPointer(event.currentTarget),\n\t\tonPointerCancel: (event: ReactPointerEvent<HTMLElement>) =>\n\t\t\tclearPointer(event.currentTarget),\n\t\tonPointerEnter: (event: ReactPointerEvent<HTMLElement>) => {\n\t\t\tif (parallaxEnabled && event.pointerType === 'mouse') setHovering(true);\n\t\t},\n\t\tonPointerMove,\n\t\tonPointerLeave: () => {\n\t\t\tif (!pointerDownRef.current) {\n\t\t\t\tsetHovering(false);\n\t\t\t\tif (!scrollParallax) {\n\t\t\t\t\tsetParallaxX(0);\n\t\t\t\t\tsetParallaxY(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tconst setRootRef = (node: HTMLElement | null) => {\n\t\trootRef.current = node;\n\t};\n\n\tif (interaction === 'anchor' && resolvedHref) {\n\t\treturn (\n\t\t\t<a\n\t\t\t\tref={setRootRef}\n\t\t\t\tclassName={rootClass}\n\t\t\t\tstyle={style}\n\t\t\t\thref={resolvedHref}\n\t\t\t\ttarget={target}\n\t\t\t\trel={rel}\n\t\t\t\taria-label={alt}\n\t\t\t\tonClick={handleClick}\n\t\t\t\t{...pointerProps}\n\t\t\t>\n\t\t\t\t{media}\n\t\t\t</a>\n\t\t);\n\t}\n\n\tif (interaction === 'button') {\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tref={setRootRef}\n\t\t\t\tclassName={rootClass}\n\t\t\t\tstyle={style}\n\t\t\t\taria-label={alt}\n\t\t\t\tonClick={handleClick}\n\t\t\t\t{...pointerProps}\n\t\t\t>\n\t\t\t\t{media}\n\t\t\t</button>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tref={setRootRef}\n\t\t\tclassName={rootClass}\n\t\t\tstyle={style}\n\t\t\trole={alt ? 'img' : undefined}\n\t\t\taria-label={alt || undefined}\n\t\t\taria-hidden={alt ? undefined : true}\n\t\t\t{...pointerProps}\n\t\t>\n\t\t\t{media}\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;AAiDA,SAAgB,EAAkB,GAA0C;CAG3E,OAFI,MAAQ,SAAe,yBACvB,MAAQ,WAAiB,2BACtB;AACR;;;ACjDA,IAAM,IAAmB;AAOzB,SAAgB,EACf,GACA,GAC6B;CAO7B,OANI,CAAC,OAAO,SAAS,CAAK,KAAK,CAAC,OAAO,SAAS,CAAM,KAAK,IAAQ,KAAK,IAAS,KAG7E,KAAS,IAAe,YACxB,KAAU,MAAY,YACtB,IAAQ,OAAO,IAAS,MAAY,aACjC;AACR;AAEA,SAAgB,EACf,GACA,GACS;CACT,IAAM,IAAU,EAAI,KAAK;CAEzB,OADK,KACE,EAAQ,QACd,IACC,GAAQ,GAAc,GAAkB,GAAa,MACrD,GAAG,IAAO,IAAO,IAAM,GACzB;AACD;AAGA,SAAgB,GACf,GACA,GACa;CACb,IAAM,UAAa;EAClB,EAAM,EAAQ,aAAa,EAAQ,YAAY;CAChD;CAEA,IADA,EAAK,GACD,OAAO,iBAAmB,KAC7B,aAAa,CAAC;CAEf,IAAM,IAAW,IAAI,eAAe,CAAI;CAExC,OADA,EAAS,QAAQ,CAAO,SACX,EAAS,WAAW;AAClC;AC5CA,IAAM,IAAwB;AAE9B,SAAgB,EAA6B,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;YAEH;CACM,CAAA,IAKT,kBAAC,OAAD;EACC,KAAK;EACL,WAAW;EACJ;EACP,MAAM,IAAM,QAAQ,KAAA;EACpB,cAAY,KAAO,KAAA;EACnB,eAAa,IAAM,KAAA,IAAY;EAC/B,GAAI;YAEH;CACG,CAAA;AAEP"}
|
|
1
|
+
{"version":3,"file":"thumbnail.js","names":[],"sources":["../../src/thumbnail/types.ts","../../src/thumbnail/avatarPlate.ts","../../src/thumbnail/locationPlate.ts","../../src/thumbnail/expandAssetUrl.ts","../../src/thumbnail/toGalleryThumbUrl.ts","../../src/shims/localStack.ts","../../src/thumbnail/hostedLaunchUrl.ts","../../src/thumbnail/thumbLoadScheduler.ts","../../src/thumbnail/lazyLoad.ts","../../src/thumbnail/scrollParallax.ts","../../src/thumbnail/styles.ts","../../src/thumbnail/ensureStyles.ts","../../src/thumbnail/plateDelivery.ts","../../src/react/ExperienceThumbnail.tsx"],"sourcesContent":["/**\n * Catalog-shaped layered gallery preview.\n * Values may be absolute URLs or Liforma paths (`/avatars/…`, `/locations/…/scene`).\n */\nexport type GalleryThumb = {\n\treadonly avatarImage: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n};\n\nexport type ThumbnailInteractionKind = 'anchor' | 'button' | 'presentational';\n\nexport type ResolveThumbnailInteractionInput = {\n\treadonly href?: string | null;\n\treadonly hasClickHandler?: boolean;\n\treadonly experienceId?: string | null;\n};\n\nexport type ThumbnailLayers = {\n\treadonly avatarImage: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n\treadonly fallbackImage?: string;\n};\n\n/** Shared props across Svelte / React / Next (React uses `onClick`). */\nexport type ExperienceThumbnailBaseProps = {\n\treadonly galleryThumb?: GalleryThumb;\n\treadonly avatarImage?: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n\treadonly alt: string;\n\treadonly experienceId?: string;\n\treadonly href?: string;\n\treadonly target?: string;\n\treadonly rel?: string;\n\treadonly returnUrl?: string;\n\treadonly playerBaseUrl?: string;\n\treadonly parallax?: boolean;\n\t/** Same as `<Experience fit>`: `full` (default), `medium`, or `face`. */\n\treadonly fit?: 'full' | 'face' | 'medium';\n\treadonly lazy?: boolean;\n\treadonly className?: string;\n\treadonly fallbackImage?: string;\n\treadonly normalizeUrls?: boolean;\n\t/** CDN origin for catalog paths. Default `https://cdn.liforma.ai`. */\n\treadonly cdnBaseUrl?: string;\n};\n\nexport function thumbnailFitClass(fit?: 'full' | 'face' | 'medium'): string {\n\tif (fit === 'face') return 'liforma-et--fit-face';\n\tif (fit === 'medium') return 'liforma-et--fit-medium';\n\treturn '';\n}\n","/** Avatar colour-plate tiers published on the CDN (`/avatars/{id}/{tier}/…`). */\nexport const THUMBNAIL_AVATAR_PLATE_SIZES = ['256', '512', '1024'] as const;\nexport type ThumbnailAvatarPlateSize = (typeof THUMBNAIL_AVATAR_PLATE_SIZES)[number];\n\nconst AVATAR_TIER_RE = /(\\/avatars\\/[^/]+\\/)(\\d+)(\\/)/i;\n\n/**\n * Pick avatar CDN tier from the host CSS box.\n * Unmeasured boxes stay on `256` (gallery default). Hosts larger than a 256\n * plate use `512`; spotlight-scale hosts (long edge above 512) use `1024`.\n */\nexport function pickThumbnailAvatarPlateSize(\n\twidth: number,\n\theight: number\n): ThumbnailAvatarPlateSize {\n\tif (!Number.isFinite(width) || !Number.isFinite(height) || width < 1 || height < 1) {\n\t\treturn '256';\n\t}\n\tconst edge = Math.max(width, height);\n\tif (edge > 512) return '1024';\n\tif (edge > 280) return '512';\n\treturn '256';\n}\n\nexport function rewriteThumbnailAvatarPlateSize(\n\turl: string,\n\tsize: ThumbnailAvatarPlateSize\n): string {\n\tconst trimmed = url.trim();\n\tif (!trimmed) return trimmed;\n\treturn trimmed.replace(\n\t\tAVATAR_TIER_RE,\n\t\t(_match, prefix: string, _tier: string, slash: string) => `${prefix}${size}${slash}`\n\t);\n}\n","/** Location colour plates used by ExperienceThumbnail (no zoom/portrait crops). */\nexport const THUMBNAIL_LOCATION_PLATE_SIZES = ['256x256', '400x225', '800x450', '1672x941'] as const;\nexport type ThumbnailLocationPlateSize = (typeof THUMBNAIL_LOCATION_PLATE_SIZES)[number];\n\nconst LOCATION_SIZE_RE = /(-)(\\d+x\\d+)(\\.(?:webp|avif))(\\?|$)/i;\n\n/**\n * Square / portrait hosts keep the gallery crop. Landscape hosts use a 16:9 plate\n * so cover-fit fills height instead of clipping the top and bottom of a square.\n * Unmeasured boxes stay on `256x256`. Hosts 225px tall or smaller use `400x225`.\n */\nexport function pickThumbnailLocationPlateSize(\n\twidth: number,\n\theight: number\n): ThumbnailLocationPlateSize {\n\tif (!Number.isFinite(width) || !Number.isFinite(height) || width < 1 || height < 1) {\n\t\treturn '256x256';\n\t}\n\tif (width <= height) return '256x256';\n\tif (height <= 225) return '400x225';\n\tif (width > 800 || height > 450) return '1672x941';\n\treturn '800x450';\n}\n\nexport function rewriteThumbnailLocationPlateSize(\n\turl: string,\n\tsize: ThumbnailLocationPlateSize\n): string {\n\tconst trimmed = url.trim();\n\tif (!trimmed) return trimmed;\n\treturn trimmed.replace(\n\t\tLOCATION_SIZE_RE,\n\t\t(_match, dash: string, _current: string, ext: string, end: string) =>\n\t\t\t`${dash}${size}${ext}${end}`\n\t);\n}\n\n/** Observe the thumb host and report CSS box size (for plate picking). */\nexport function attachThumbnailBox(\n\telement: HTMLElement,\n\tonBox: (width: number, height: number) => void\n): () => void {\n\tconst emit = () => {\n\t\tonBox(element.clientWidth, element.clientHeight);\n\t};\n\temit();\n\tif (typeof ResizeObserver === 'undefined') {\n\t\treturn () => {};\n\t}\n\tconst observer = new ResizeObserver(emit);\n\tobserver.observe(element);\n\treturn () => observer.disconnect();\n}\n","import {\n\trewriteThumbnailAvatarPlateSize,\n\ttype ThumbnailAvatarPlateSize\n} from './avatarPlate';\nimport {\n\trewriteThumbnailLocationPlateSize,\n\ttype ThumbnailLocationPlateSize\n} from './locationPlate';\n\n/** Default origin for Liforma gallery plates (catalog paths have no host). */\nexport const DEFAULT_THUMBNAIL_CDN_BASE_URL = 'https://cdn.liforma.ai';\n\nconst LOCATION_SIZE_STEM_RE = /-(256x256|400x225|400x450|800x450|836x971|1672x941|167x94)$/i;\n\nexport function normalizeThumbnailCdnBaseUrl(cdnBaseUrl?: string): string {\n\tconst trimmed = cdnBaseUrl?.trim().replace(/\\/$/, '');\n\treturn trimmed || DEFAULT_THUMBNAIL_CDN_BASE_URL;\n}\n\nfunction isHttpUrl(value: string): boolean {\n\treturn /^https?:\\/\\//i.test(value) || value.startsWith('//');\n}\n\nfunction absoluteHttpUrl(value: string): string {\n\tif (value.startsWith('//')) return `https:${value}`;\n\treturn value;\n}\n\nfunction splitPathAndSearch(value: string): { pathname: string; search: string } {\n\tconst q = value.indexOf('?');\n\tif (q === -1) return { pathname: value, search: '' };\n\treturn { pathname: value.slice(0, q), search: value.slice(q) };\n}\n\nfunction joinCdn(cdnBase: string, pathname: string, search = ''): string {\n\tconst path = pathname.startsWith('/') ? pathname : `/${pathname}`;\n\treturn `${cdnBase}${path}${search}`;\n}\n\n/**\n * Expand a catalog location path (or keep a full URL) to a sized plate URL.\n *\n * `/locations/modern/city/office/interior-desk-daytime` →\n * `{cdn}/locations/modern/city/office/interior-desk-daytime-800x450.webp`\n */\nexport function expandThumbnailLocationUrl(\n\tref: string,\n\tlocationPlateSize: ThumbnailLocationPlateSize,\n\tcdnBaseUrl?: string\n): string {\n\tconst raw = ref.trim();\n\tif (!raw) return raw;\n\tconst cdnBase = normalizeThumbnailCdnBaseUrl(cdnBaseUrl);\n\n\tif (isHttpUrl(raw)) {\n\t\treturn rewriteThumbnailLocationPlateSize(absoluteHttpUrl(raw), locationPlateSize);\n\t}\n\n\tconst { pathname: rawPath, search } = splitPathAndSearch(raw.replace(/\\\\/g, '/'));\n\tlet pathname = rawPath;\n\n\tif (!pathname.startsWith('/')) {\n\t\tpathname = `/locations/${pathname.replace(/^locations\\//i, '')}`;\n\t} else if (/^\\/locations\\//i.test(pathname)) {\n\t\t/* already a location path */\n\t} else if (/^\\/avatars\\//i.test(pathname)) {\n\t\treturn joinCdn(cdnBase, pathname, search);\n\t} else {\n\t\treturn raw;\n\t}\n\n\tif (/\\.webp$/i.test(pathname) && !LOCATION_SIZE_STEM_RE.test(pathname.replace(/\\.webp$/i, ''))) {\n\t\treturn joinCdn(cdnBase, pathname, search);\n\t}\n\n\tlet stem = pathname.replace(/^\\/locations\\//i, '').replace(/\\.webp$/i, '');\n\tstem = stem.replace(LOCATION_SIZE_STEM_RE, '');\n\treturn `${cdnBase}/locations/${stem}-${locationPlateSize}.webp${search}`;\n}\n\n/**\n * Expand a catalog avatar path (or keep a full URL) onto the public CDN.\n * `/avatars/{id}` → `{cdn}/avatars/{id}/{tier}/{id}_neutral.webp`\n */\nexport function expandThumbnailAvatarUrl(\n\tref: string,\n\tcdnBaseUrl?: string,\n\tavatarPlateSize: ThumbnailAvatarPlateSize = '256'\n): string {\n\tconst raw = ref.trim();\n\tif (!raw) return raw;\n\tconst cdnBase = normalizeThumbnailCdnBaseUrl(cdnBaseUrl);\n\tconst tier = avatarPlateSize;\n\n\tif (isHttpUrl(raw)) {\n\t\treturn rewriteThumbnailAvatarPlateSize(absoluteHttpUrl(raw), tier);\n\t}\n\n\tconst { pathname: rawPath, search } = splitPathAndSearch(raw.replace(/\\\\/g, '/'));\n\tlet pathname = rawPath;\n\n\tif (!pathname.startsWith('/')) {\n\t\tif (/^avatars\\//i.test(pathname)) {\n\t\t\tpathname = `/${pathname}`;\n\t\t} else if (/^[^/]+$/.test(pathname) && !search) {\n\t\t\treturn `${cdnBase}/avatars/${pathname}/${tier}/${pathname}_neutral.webp`;\n\t\t} else {\n\t\t\treturn raw;\n\t\t}\n\t}\n\n\tif (!/^\\/avatars\\//i.test(pathname)) {\n\t\treturn raw;\n\t}\n\n\tconst rest = pathname.replace(/^\\/avatars\\//i, '').replace(/\\/+$/, '');\n\tif (rest && !rest.includes('/') && !search) {\n\t\treturn `${cdnBase}/avatars/${rest}/${tier}/${rest}_neutral.webp`;\n\t}\n\n\treturn rewriteThumbnailAvatarPlateSize(joinCdn(cdnBase, pathname, search), tier);\n}\n","import type { ThumbnailAvatarPlateSize } from './avatarPlate';\nimport {\n\texpandThumbnailAvatarUrl,\n\texpandThumbnailLocationUrl,\n\tnormalizeThumbnailCdnBaseUrl\n} from './expandAssetUrl';\nimport type { ThumbnailLocationPlateSize } from './locationPlate';\n\nconst AVATAR_CH_PLATE_RE = /_CH(\\.webp)/i;\n\nexport type { ThumbnailAvatarPlateSize, ThumbnailLocationPlateSize };\n\nfunction isLocationRef(raw: string): boolean {\n\tif (/\\/locations\\//i.test(raw) || /^locations\\//i.test(raw)) return true;\n\tif (/^https?:\\/\\//i.test(raw) || raw.startsWith('//')) return false;\n\tif (/^\\/?avatars\\//i.test(raw)) return false;\n\tif (raw.startsWith('/')) return false;\n\treturn raw.includes('/');\n}\n\n/**\n * Rewrite known Liforma CDN URLs to gallery thumb tiers.\n * Avatars: /{tier}/ → the requested plate (`256` by default, `512` / `1024` for larger hosts);\n * locations: -{WxH}.webp → the requested plate\n * (`256x256` by default, `400x225` / `800x450` / `1672x941` for landscape hosts).\n * Catalog paths (`/locations/…/scene`, `/avatars/{id}`) expand onto the CDN first.\n * Unrecognized URLs are returned unchanged.\n */\nexport function toGalleryThumbUrl(\n\turl: string,\n\tlocationPlateSize: ThumbnailLocationPlateSize = '256x256',\n\tcdnBaseUrl?: string,\n\tavatarPlateSize: ThumbnailAvatarPlateSize = '256'\n): string {\n\tconst raw = url.trim();\n\tif (!raw) return raw;\n\n\tif (isLocationRef(raw)) {\n\t\treturn expandThumbnailLocationUrl(raw, locationPlateSize, cdnBaseUrl);\n\t}\n\n\tconst next = expandThumbnailAvatarUrl(raw, cdnBaseUrl, avatarPlateSize);\n\treturn next.replace(AVATAR_CH_PLATE_RE, '_neutral$1');\n}\n\nexport function resolveThumbnailLayers(input: {\n\treadonly galleryThumb?: {\n\t\treadonly avatarImage?: string;\n\t\treadonly backgroundImage?: string;\n\t\treadonly foregroundImage?: string;\n\t};\n\treadonly avatarImage?: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n\treadonly fallbackImage?: string;\n\t/** When false, keep caller absolute URLs (lightbox / preview). Paths still expand. Default true. */\n\treadonly normalize?: boolean;\n\t/** Location plate when expanding or rewriting location assets. Default `256x256`. */\n\treadonly locationPlateSize?: ThumbnailLocationPlateSize;\n\t/** Avatar plate when expanding or rewriting avatar assets. Default `256`. */\n\treadonly avatarPlateSize?: ThumbnailAvatarPlateSize;\n\t/** CDN origin for catalog paths. Default `https://cdn.liforma.ai`. */\n\treadonly cdnBaseUrl?: string;\n}): {\n\treadonly avatarImage: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n\treadonly fallbackImage?: string;\n} | null {\n\tconst avatarSource =\n\t\tinput.avatarImage?.trim() ||\n\t\tinput.galleryThumb?.avatarImage?.trim() ||\n\t\t'';\n\tif (!avatarSource) return null;\n\n\tconst backgroundSource =\n\t\tinput.backgroundImage?.trim() || input.galleryThumb?.backgroundImage?.trim() || '';\n\tconst foregroundSource =\n\t\tinput.foregroundImage?.trim() || input.galleryThumb?.foregroundImage?.trim() || '';\n\tconst fallbackSource = input.fallbackImage?.trim() || '';\n\tconst plate = input.locationPlateSize ?? '256x256';\n\tconst avatarPlate = input.avatarPlateSize ?? '256';\n\tconst cdnBaseUrl = normalizeThumbnailCdnBaseUrl(input.cdnBaseUrl);\n\tconst rewriteKnown = input.normalize !== false;\n\n\tconst rewriteAvatar = (ref: string) => {\n\t\tif (!rewriteKnown && /^https?:\\/\\//i.test(ref.trim())) return ref.trim();\n\t\treturn toGalleryThumbUrl(ref, plate, cdnBaseUrl, avatarPlate);\n\t};\n\tconst rewriteLocation = (ref: string) => {\n\t\tif (!rewriteKnown && /^https?:\\/\\//i.test(ref.trim())) return ref.trim();\n\t\treturn expandThumbnailLocationUrl(ref, plate, cdnBaseUrl);\n\t};\n\n\treturn {\n\t\tavatarImage: rewriteAvatar(avatarSource),\n\t\t...(backgroundSource ? { backgroundImage: rewriteLocation(backgroundSource) } : {}),\n\t\t...(foregroundSource ? { foregroundImage: rewriteLocation(foregroundSource) } : {}),\n\t\t...(fallbackSource ? { fallbackImage: rewriteAvatar(fallbackSource) } : {})\n\t};\n}\n","/**\n * Opt-in local monorepo stack (api :3001, player :3002).\n * Never inferred from hostname alone — third-party demos run on localhost against production.\n */\nexport function useExplicitLocalStack(): boolean {\n\tif ((globalThis as { __LIFORMA_STACK?: string }).__LIFORMA_STACK === 'local') {\n\t\treturn true;\n\t}\n\n\tif (typeof location === 'undefined') {\n\t\treturn false;\n\t}\n\n\ttry {\n\t\treturn new URLSearchParams(location.search).get('stack') === 'local';\n\t} catch {\n\t\treturn false;\n\t}\n}\n","import { useExplicitLocalStack } from '../shims/localStack.ts';\nimport type { ResolveThumbnailInteractionInput, ThumbnailInteractionKind } from './types';\n\nconst PRODUCTION_PLAYER_ORIGIN = 'https://player.liforma.ai';\nconst LOCAL_PLAYER_ORIGIN = 'http://localhost:3002';\n\n/** Priority: href → click-only → hosted (experienceId) → presentational. */\nexport function resolveThumbnailInteraction(\n\tinput: ResolveThumbnailInteractionInput\n): ThumbnailInteractionKind {\n\tif (input.href?.trim()) return 'anchor';\n\tif (input.hasClickHandler) return 'button';\n\tif (input.experienceId?.trim()) return 'anchor';\n\treturn 'presentational';\n}\n\nexport function resolvePlayerBaseUrl(playerBaseUrl?: string): string {\n\tconst configured = playerBaseUrl?.trim();\n\tif (configured) return configured.replace(/\\/$/, '');\n\n\tif (useExplicitLocalStack()) {\n\t\treturn LOCAL_PLAYER_ORIGIN;\n\t}\n\n\treturn PRODUCTION_PLAYER_ORIGIN;\n}\n\n/**\n * Build hosted player launch URL: `{player}/{experienceId}?returnUrl=…`\n * When `returnUrl` is omitted, callers should assign on click (SSR-safe) or pass an explicit URL.\n */\nexport function buildHostedLaunchUrl(options: {\n\treadonly experienceId: string;\n\treadonly returnUrl?: string;\n\treadonly playerBaseUrl?: string;\n}): string {\n\tconst experienceId = options.experienceId.trim();\n\tconst base = resolvePlayerBaseUrl(options.playerBaseUrl);\n\tconst url = new URL(`${base}/${encodeURIComponent(experienceId)}`);\n\tconst returnUrl = options.returnUrl?.trim();\n\tif (returnUrl) {\n\t\turl.searchParams.set('returnUrl', returnUrl);\n\t}\n\treturn url.toString();\n}\n\n/** Resolve href for anchor mode (app link or hosted launch). */\nexport function resolveThumbnailHref(options: {\n\treadonly href?: string;\n\treadonly experienceId?: string;\n\treadonly returnUrl?: string;\n\treadonly playerBaseUrl?: string;\n\t/** When true and returnUrl omitted, use window.location.href (browser only). */\n\treadonly useCurrentPageAsReturnUrl?: boolean;\n}): string | undefined {\n\tconst href = options.href?.trim();\n\tif (href) return href;\n\n\tconst experienceId = options.experienceId?.trim();\n\tif (!experienceId) return undefined;\n\n\tlet returnUrl = options.returnUrl?.trim();\n\tif (!returnUrl && options.useCurrentPageAsReturnUrl && typeof window !== 'undefined') {\n\t\treturnUrl = window.location.href;\n\t}\n\n\treturn buildHostedLaunchUrl({\n\t\texperienceId,\n\t\t...(returnUrl ? { returnUrl } : {}),\n\t\tplayerBaseUrl: options.playerBaseUrl\n\t});\n}\n","/** Touch / coarse pointers — limit how many thumbs start loading at once. */\nexport const COARSE_THUMB_LOAD_CONCURRENCY = 4;\n/** Delay before a started thumb frees its queue slot for the next card. */\nexport const COARSE_THUMB_LOAD_STAGGER_MS = 160;\n\nexport function prefersCoarsePointer(): boolean {\n\tif (typeof window === 'undefined') return false;\n\treturn window.matchMedia('(hover: none), (pointer: coarse)').matches;\n}\n\ntype QueuedLoad = {\n\treadonly start: () => void;\n\tcancelled: boolean;\n};\n\nlet inflight = 0;\nconst waiting: QueuedLoad[] = [];\n\nfunction maxConcurrent(): number {\n\treturn prefersCoarsePointer() ? COARSE_THUMB_LOAD_CONCURRENCY : Number.POSITIVE_INFINITY;\n}\n\nfunction staggerMs(): number {\n\treturn prefersCoarsePointer() ? COARSE_THUMB_LOAD_STAGGER_MS : 0;\n}\n\nfunction pump(): void {\n\tconst limit = maxConcurrent();\n\twhile (inflight < limit && waiting.length > 0) {\n\t\tconst next = waiting.shift();\n\t\tif (!next || next.cancelled) continue;\n\t\tinflight += 1;\n\t\tnext.start();\n\t\tconst delay = staggerMs();\n\t\tif (delay <= 0) {\n\t\t\tinflight = Math.max(0, inflight - 1);\n\t\t\tcontinue;\n\t\t}\n\t\twindow.setTimeout(() => {\n\t\t\tinflight = Math.max(0, inflight - 1);\n\t\t\tpump();\n\t\t}, delay);\n\t}\n}\n\n/**\n * On coarse pointers, start thumb image loads in small waves so old devices\n * are not hit with dozens of concurrent decodes. Fine pointers start immediately.\n * Returns a cancel function (no-op after start has run).\n */\nexport function scheduleThumbLoad(start: () => void): () => void {\n\tif (!prefersCoarsePointer()) {\n\t\tstart();\n\t\treturn () => {};\n\t}\n\n\tconst item: QueuedLoad = { start, cancelled: false };\n\twaiting.push(item);\n\tpump();\n\n\treturn () => {\n\t\titem.cancelled = true;\n\t};\n}\n\n/** Test helper — clear queue state between vitest cases. */\nexport function resetThumbLoadSchedulerForTests(): void {\n\tinflight = 0;\n\twaiting.length = 0;\n}\n","import { prefersCoarsePointer, scheduleThumbLoad } from './thumbLoadScheduler';\n\nexport type LazyThumbOptions = {\n\treadonly rootMargin?: string;\n\treadonly onVisibleChange: (visible: boolean) => void;\n};\n\n/** Desktop: prefetch earlier. Coarse/touch: tighter margin to cut burst loads. */\nexport function getDefaultLazyRootMargin(): string {\n\treturn prefersCoarsePointer() ? '96px 0px' : '280px 0px';\n}\n\nfunction parseVerticalRootMarginPx(rootMargin: string): number {\n\tconst first = rootMargin.trim().split(/\\s+/)[0] ?? '0px';\n\tconst value = Number.parseFloat(first);\n\treturn Number.isFinite(value) ? Math.abs(value) : 280;\n}\n\nfunction isNearViewport(element: HTMLElement, marginPx: number): boolean {\n\tif (typeof window === 'undefined') return false;\n\tconst rect = element.getBoundingClientRect();\n\treturn rect.bottom >= -marginPx && rect.top <= window.innerHeight + marginPx;\n}\n\n/** Observe the thumb and enable image loads when near the viewport. */\nexport function attachLazyThumb(element: HTMLElement, options: LazyThumbOptions): () => void {\n\tconst { onVisibleChange } = options;\n\tconst rootMargin = options.rootMargin ?? getDefaultLazyRootMargin();\n\tconst marginPx = parseVerticalRootMarginPx(rootMargin);\n\tlet visible = false;\n\tlet loadStarted = false;\n\tlet cancelScheduled: (() => void) | null = null;\n\n\tconst requestLoad = () => {\n\t\tif (loadStarted) return;\n\t\tcancelScheduled?.();\n\t\tcancelScheduled = scheduleThumbLoad(() => {\n\t\t\tcancelScheduled = null;\n\t\t\tloadStarted = true;\n\t\t\tonVisibleChange(true);\n\t\t});\n\t};\n\n\tconst setVisible = (next: boolean) => {\n\t\tif (next === visible) return;\n\t\tvisible = next;\n\t\tif (next) {\n\t\t\trequestLoad();\n\t\t\treturn;\n\t\t}\n\t\t// Keep images once started; only cancel a queued (not-yet-started) load.\n\t\tcancelScheduled?.();\n\t\tcancelScheduled = null;\n\t\tonVisibleChange(false);\n\t};\n\n\tif (typeof IntersectionObserver === 'undefined') {\n\t\trequestLoad();\n\t\treturn () => {\n\t\t\tcancelScheduled?.();\n\t\t\tcancelScheduled = null;\n\t\t};\n\t}\n\n\tconst observer = new IntersectionObserver(\n\t\t(entries) => {\n\t\t\tsetVisible(entries.some((entry) => entry.isIntersecting));\n\t\t},\n\t\t{ root: null, rootMargin, threshold: 0 }\n\t);\n\n\tobserver.observe(element);\n\n\tif (isNearViewport(element, marginPx)) {\n\t\tsetVisible(true);\n\t}\n\n\treturn () => {\n\t\tcancelScheduled?.();\n\t\tcancelScheduled = null;\n\t\tobserver.disconnect();\n\t};\n}\n\nexport function attachImageReady(element: HTMLImageElement, onReady: () => void): () => void {\n\tconst notify = () => onReady();\n\tif (element.complete) {\n\t\tqueueMicrotask(notify);\n\t} else {\n\t\telement.addEventListener('load', notify, { once: true });\n\t\telement.addEventListener('error', notify, { once: true });\n\t}\n\treturn () => {\n\t\telement.removeEventListener('load', notify);\n\t\telement.removeEventListener('error', notify);\n\t};\n}\n","/** Touch devices without hover — drive thumbnail parallax from scroll position. */\nexport function prefersScrollLinkedParallax(): boolean {\n\tif (typeof window === 'undefined') return false;\n\tif (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return false;\n\treturn window.matchMedia('(hover: none), (pointer: coarse)').matches;\n}\n\n/**\n * Map an element's vertical centre in the viewport to horizontal parallax in [-1, 1].\n */\nexport function horizontalParallaxFromViewportY(rect: DOMRect, viewportHeight: number): number {\n\tconst centerY = rect.top + rect.height / 2;\n\tconst t = centerY / Math.max(viewportHeight, 1);\n\treturn (t - 0.5) * 2;\n}\n\nexport type ScrollLinkedParallaxOptions = {\n\treadonly onParallax: (x: number) => void;\n\treadonly pointerActive?: () => boolean;\n};\n\ntype ScrollParallaxSubscriber = {\n\treadonly element: HTMLElement;\n\treadonly onParallax: (x: number) => void;\n\treadonly pointerActive?: () => boolean;\n};\n\nconst subscribers = new Set<ScrollParallaxSubscriber>();\nlet listening = false;\nlet frame = 0;\n\nfunction syncAll(): void {\n\tframe = 0;\n\tif (subscribers.size === 0 || typeof window === 'undefined') return;\n\tconst viewportHeight = window.innerHeight;\n\tfor (const entry of subscribers) {\n\t\tif (entry.pointerActive?.()) continue;\n\t\tconst rect = entry.element.getBoundingClientRect();\n\t\t// Skip off-screen thumbs — avoids N layout reads + framework updates per scroll.\n\t\tif (rect.bottom < -64 || rect.top > viewportHeight + 64) continue;\n\t\tentry.onParallax(horizontalParallaxFromViewportY(rect, viewportHeight));\n\t}\n}\n\nfunction scheduleSync(): void {\n\tif (frame !== 0) return;\n\tframe = requestAnimationFrame(syncAll);\n}\n\nfunction ensureListening(): void {\n\tif (listening || typeof window === 'undefined') return;\n\tlistening = true;\n\twindow.addEventListener('scroll', scheduleSync, { passive: true });\n\twindow.addEventListener('resize', scheduleSync, { passive: true });\n}\n\nfunction stopListeningIfIdle(): void {\n\tif (subscribers.size > 0 || !listening || typeof window === 'undefined') return;\n\tlistening = false;\n\tif (frame !== 0) {\n\t\tcancelAnimationFrame(frame);\n\t\tframe = 0;\n\t}\n\twindow.removeEventListener('scroll', scheduleSync);\n\twindow.removeEventListener('resize', scheduleSync);\n}\n\n/**\n * Subscribe to scroll/resize and update horizontal parallax from viewport Y.\n * Uses one shared window listener for all thumbs (old iPads with large galleries).\n */\nexport function attachScrollLinkedParallax(\n\telement: HTMLElement,\n\toptions: ScrollLinkedParallaxOptions\n): () => void {\n\tif (!prefersScrollLinkedParallax()) return () => {};\n\n\tconst entry: ScrollParallaxSubscriber = {\n\t\telement,\n\t\tonParallax: options.onParallax,\n\t\tpointerActive: options.pointerActive\n\t};\n\tsubscribers.add(entry);\n\tensureListening();\n\n\tif (!entry.pointerActive?.()) {\n\t\toptions.onParallax(\n\t\t\thorizontalParallaxFromViewportY(element.getBoundingClientRect(), window.innerHeight)\n\t\t);\n\t}\n\n\treturn () => {\n\t\tsubscribers.delete(entry);\n\t\tstopListeningIfIdle();\n\t};\n}\n\n/** Test helper — clear shared scroll state between vitest cases. */\nexport function resetScrollLinkedParallaxForTests(): void {\n\tsubscribers.clear();\n\tif (typeof window !== 'undefined' && listening) {\n\t\twindow.removeEventListener('scroll', scheduleSync);\n\t\twindow.removeEventListener('resize', scheduleSync);\n\t}\n\tlistening = false;\n\tif (frame !== 0) {\n\t\tcancelAnimationFrame(frame);\n\t\tframe = 0;\n\t}\n}\n","/** Shared styles for ExperienceThumbnail (class prefix `liforma-et`). */\nexport const EXPERIENCE_THUMBNAIL_CSS = `\n:host {\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tmin-height: 0;\n}\n\n.liforma-et {\n\t--liforma-et-parallax-x: 0;\n\t--liforma-et-parallax-y: 0;\n\t--liforma-et-bg-scale: 1;\n\t--liforma-et-fg-scale: 1;\n\t--liforma-et-avatar-scale: 1;\n\t--liforma-et-bg-shift: 0px;\n\t--liforma-et-fg-shift: 0px;\n\t--liforma-et-avatar-shift: 0px;\n\t--liforma-et-reveal-duration: 420ms;\n\n\tbox-sizing: border-box;\n\tposition: relative;\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tmin-height: 0;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tborder-radius: 0;\n\toverflow: hidden;\n\tbackground: #111;\n\tcolor: inherit;\n\ttext-decoration: none;\n\tcursor: inherit;\n\t-webkit-tap-highlight-color: transparent;\n}\n\na.liforma-et,\nbutton.liforma-et {\n\tcursor: pointer;\n}\n\nbutton.liforma-et {\n\tfont: inherit;\n\tappearance: none;\n}\n\n.liforma-et__placeholder {\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 0;\n\tbackground:\n\t\tradial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 58%),\n\t\tlinear-gradient(180deg, #1a1a1a 0%, #101010 100%);\n\topacity: 1;\n\ttransition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n.liforma-et--revealed .liforma-et__placeholder {\n\topacity: 0;\n}\n\n.liforma-et__media {\n\topacity: 0;\n\ttransition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n.liforma-et__media--ready {\n\topacity: 1;\n}\n\n.liforma-et__background {\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 1;\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: cover;\n\tobject-position: center center;\n\ttransform: translate(\n\t\t\tcalc(var(--liforma-et-parallax-x) * var(--liforma-et-bg-shift)),\n\t\t\tcalc(var(--liforma-et-parallax-y) * var(--liforma-et-bg-shift))\n\t\t)\n\t\tscale(var(--liforma-et-bg-scale));\n\ttransform-origin: center center;\n\ttransition:\n\t\topacity var(--liforma-et-reveal-duration) ease,\n\t\ttransform 160ms ease;\n}\n\n.liforma-et__avatar {\n\tposition: relative;\n\tz-index: 2;\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: contain;\n\tobject-position: center bottom;\n\ttransform: scale(var(--liforma-et-avatar-scale))\n\t\ttranslate(\n\t\t\tcalc(var(--liforma-et-parallax-x) * var(--liforma-et-avatar-shift)),\n\t\t\tcalc(var(--liforma-et-parallax-y) * var(--liforma-et-avatar-shift))\n\t\t);\n\ttransform-origin: center center;\n\ttransition:\n\t\topacity var(--liforma-et-reveal-duration) ease,\n\t\ttransform 160ms ease;\n}\n\n/* Gallery plates are typically square in a square tile — contain vs cover is a no-op\n without a zoom. Scale the whole scene from the upper third so Face matches\n player fit (location + avatar crop together). */\n.liforma-et--fit-face {\n\t--liforma-et-avatar-scale: 1.85;\n\t--liforma-et-bg-scale: 1.85;\n\t--liforma-et-fg-scale: 1.85;\n}\n\n.liforma-et--fit-face .liforma-et__avatar,\n.liforma-et--fit-face .liforma-et__background,\n.liforma-et--fit-face .liforma-et__foreground {\n\ttransform-origin: 50% 18%;\n}\n\n.liforma-et--fit-face .liforma-et__avatar {\n\tobject-fit: cover;\n\tobject-position: 50% 18%;\n}\n\n/* Bust / medium: less zoom than face so upper chest stays in frame (player 3.75H window). */\n.liforma-et--fit-medium {\n\t--liforma-et-avatar-scale: 1.35;\n\t--liforma-et-bg-scale: 1.35;\n\t--liforma-et-fg-scale: 1.35;\n}\n\n.liforma-et--fit-medium .liforma-et__avatar,\n.liforma-et--fit-medium .liforma-et__background,\n.liforma-et--fit-medium .liforma-et__foreground {\n\ttransform-origin: 50% 28%;\n}\n\n.liforma-et--fit-medium .liforma-et__avatar {\n\tobject-fit: cover;\n\tobject-position: 50% 28%;\n}\n\n.liforma-et__foreground {\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 3;\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: cover;\n\tobject-position: center center;\n\tpointer-events: none;\n\ttransform: translate(\n\t\t\tcalc(var(--liforma-et-parallax-x) * var(--liforma-et-fg-shift) * -1),\n\t\t\tcalc(var(--liforma-et-parallax-y) * var(--liforma-et-fg-shift) * -1)\n\t\t)\n\t\tscale(var(--liforma-et-fg-scale));\n\ttransform-origin: center center;\n\ttransition:\n\t\topacity var(--liforma-et-reveal-duration) ease,\n\t\ttransform 160ms ease;\n}\n\n.liforma-et--parallax {\n\t--liforma-et-bg-scale: 1.08;\n\t--liforma-et-fg-scale: 1.05;\n\t--liforma-et-avatar-scale: 1.08;\n\t--liforma-et-bg-shift: 10px;\n\t--liforma-et-fg-shift: 4px;\n\t--liforma-et-avatar-shift: 4px;\n}\n\n/* Promote layers only while parallax is active — avoids N compositor surfaces on galleries. */\n.liforma-et--parallax .liforma-et__background,\n.liforma-et--parallax .liforma-et__foreground,\n.liforma-et--parallax .liforma-et__avatar {\n\twill-change: transform;\n}\n\n.liforma-et--parallax.liforma-et--fit-face {\n\t--liforma-et-avatar-scale: 1.95;\n\t--liforma-et-bg-scale: 1.95;\n\t--liforma-et-fg-scale: 1.95;\n\t--liforma-et-avatar-shift: 0px;\n}\n\n.liforma-et--parallax.liforma-et--fit-medium {\n\t--liforma-et-avatar-scale: 1.42;\n\t--liforma-et-bg-scale: 1.42;\n\t--liforma-et-fg-scale: 1.42;\n\t--liforma-et-avatar-shift: 0px;\n}\n\n.liforma-et--scroll-parallax .liforma-et__background,\n.liforma-et--scroll-parallax .liforma-et__foreground,\n.liforma-et--scroll-parallax .liforma-et__avatar {\n\ttransition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t.liforma-et {\n\t\t--liforma-et-reveal-duration: 0ms;\n\t}\n\n\t.liforma-et--parallax {\n\t\t--liforma-et-bg-scale: 1;\n\t\t--liforma-et-fg-scale: 1;\n\t\t--liforma-et-avatar-scale: 1;\n\t\t--liforma-et-bg-shift: 0px;\n\t\t--liforma-et-fg-shift: 0px;\n\t\t--liforma-et-avatar-shift: 0px;\n\t}\n\n\t.liforma-et--parallax.liforma-et--fit-face {\n\t\t--liforma-et-avatar-scale: 1.85;\n\t\t--liforma-et-bg-scale: 1.85;\n\t\t--liforma-et-fg-scale: 1.85;\n\t}\n\n\t.liforma-et__background,\n\t.liforma-et__foreground,\n\t.liforma-et__avatar {\n\t\ttransition: none;\n\t}\n}\n`.trim();\n","let styleMounted = false;\n\n/** Inject shared thumbnail CSS once per document. */\nexport function ensureExperienceThumbnailStyles(css: string): void {\n\tif (typeof document === 'undefined' || styleMounted) return;\n\tif (document.querySelector('style[data-liforma-et]')) {\n\t\tstyleMounted = true;\n\t\treturn;\n\t}\n\tconst style = document.createElement('style');\n\tstyle.setAttribute('data-liforma-et', '');\n\tstyle.textContent = css;\n\tdocument.head.appendChild(style);\n\tstyleMounted = true;\n}\n","/**\n * CDN colour-plate delivery for thumbnails (avatars + locations).\n * Catalogue identity stays `.webp`; fetch uses `.avif` when the browser can decode it.\n * Depth maps stay WebP. Costume rendered composites have AVIF siblings from the compose worker.\n */\n\nconst AVIF_PROBE_DATA_URI =\n\t'data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=';\n\nlet avifSupportPromise: Promise<boolean> | null = null;\n\n/** True when this URL is a colour plate WebP that may have an AVIF sibling (not depth). */\nexport function isColourPlateWebpUrl(url: string): boolean {\n\tconst trimmed = url.trim();\n\tif (!trimmed || trimmed.startsWith('blob:') || trimmed.startsWith('data:')) return false;\n\tconst pathOnly = trimmed.split(/[?#]/)[0] ?? trimmed;\n\tconst isAvatar = /\\/avatars\\//i.test(pathOnly);\n\tconst isLocation = /\\/locations\\//i.test(pathOnly);\n\tif (!isAvatar && !isLocation) return false;\n\tif (/\\.depth\\.webp$/i.test(pathOnly)) return false;\n\treturn /\\.webp$/i.test(pathOnly);\n}\n\n/** Rewrite a colour-plate `.webp` path to `.avif`, preserving query/hash. */\nexport function toAvifPlateUrl(url: string): string | null {\n\tif (!isColourPlateWebpUrl(url)) return null;\n\tconst qIndex = url.search(/[?#]/);\n\tif (qIndex < 0) return url.replace(/\\.webp$/i, '.avif');\n\tconst path = url.slice(0, qIndex);\n\tconst suffix = url.slice(qIndex);\n\treturn `${path.replace(/\\.webp$/i, '.avif')}${suffix}`;\n}\n\nexport function supportsAvifDecode(): Promise<boolean> {\n\tif (typeof Image === 'undefined') return Promise.resolve(false);\n\tif (!avifSupportPromise) {\n\t\tavifSupportPromise = new Promise<boolean>((resolve) => {\n\t\t\tconst img = new Image();\n\t\t\timg.onload = () => resolve(img.naturalWidth > 0 && img.naturalHeight > 0);\n\t\t\timg.onerror = () => resolve(false);\n\t\t\timg.src = AVIF_PROBE_DATA_URI;\n\t\t});\n\t}\n\treturn avifSupportPromise;\n}\n\nexport function resetAvifDecodeSupportCacheForTests(): void {\n\tavifSupportPromise = null;\n}\n\n/** WebP catalogue URL → AVIF sibling when `useAvif` is true. */\nexport function thumbnailPlateSrc(url: string, useAvif: boolean): string {\n\tif (!useAvif) return url;\n\treturn toAvifPlateUrl(url) ?? url;\n}\n\n/** Colour-plate `.avif` → catalogue `.webp` (compose worker / missing sibling). */\nexport function thumbnailColourPlateWebpFallbackUrl(url: string): string | null {\n\tconst trimmed = url.trim();\n\tconst qIndex = trimmed.search(/[?#]/);\n\tconst pathOnly = qIndex < 0 ? trimmed : trimmed.slice(0, qIndex);\n\tif (!/\\.avif$/i.test(pathOnly)) return null;\n\tconst webpPath = pathOnly.replace(/\\.avif$/i, '.webp');\n\treturn qIndex < 0 ? webpPath : `${webpPath}${trimmed.slice(qIndex)}`;\n}\n\n/** 400×225 is colour-only; if missing, step up to the published 800×450 sibling. */\nexport function thumbnailLocationPlateFallbackUrl(url: string): string | null {\n\tconst trimmed = url.trim();\n\tif (!/-400x225\\.(webp|avif)(?:$|[?#])/i.test(trimmed)) return null;\n\treturn trimmed.replace(/-400x225\\.(webp|avif)/i, '-800x450.$1');\n}\n","'use client';\n\nimport {\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n\ttype CSSProperties,\n\ttype MouseEvent as ReactMouseEvent,\n\ttype PointerEvent as ReactPointerEvent\n} from 'react';\n\nimport {\n\tattachLazyThumb,\n\tattachScrollLinkedParallax,\n\tattachThumbnailBox,\n\tensureExperienceThumbnailStyles,\n\tEXPERIENCE_THUMBNAIL_CSS,\n\thorizontalParallaxFromViewportY,\n\tpickThumbnailAvatarPlateSize,\n\tpickThumbnailLocationPlateSize,\n\tresolveThumbnailHref,\n\tresolveThumbnailInteraction,\n\tresolveThumbnailLayers,\n\tthumbnailFitClass,\n\tthumbnailColourPlateWebpFallbackUrl,\n\tthumbnailLocationPlateFallbackUrl,\n\tthumbnailPlateSrc,\n\tsupportsAvifDecode,\n\ttype GalleryThumb\n} from '../thumbnail/index';\n\nexport type ExperienceThumbnailProps = {\n\treadonly galleryThumb?: GalleryThumb;\n\treadonly avatarImage?: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n\treadonly alt: string;\n\treadonly experienceId?: string;\n\treadonly href?: string;\n\treadonly target?: string;\n\treadonly rel?: string;\n\treadonly onClick?: (event: ReactMouseEvent<HTMLElement>) => void;\n\treadonly returnUrl?: string;\n\treadonly playerBaseUrl?: string;\n\treadonly parallax?: boolean;\n\treadonly fit?: 'full' | 'face' | 'medium';\n\treadonly lazy?: boolean;\n\treadonly className?: string;\n\treadonly fallbackImage?: string;\n\treadonly normalizeUrls?: boolean;\n\treadonly cdnBaseUrl?: string;\n};\n\nfunction mediaClass(base: string, ready: boolean): string {\n\treturn `${base} liforma-et__media${ready ? ' liforma-et__media--ready' : ''}`;\n}\n\nexport function ExperienceThumbnail(props: ExperienceThumbnailProps) {\n\tconst {\n\t\tgalleryThumb,\n\t\tavatarImage,\n\t\tbackgroundImage,\n\t\tforegroundImage,\n\t\talt,\n\t\texperienceId,\n\t\thref,\n\t\ttarget,\n\t\trel,\n\t\tonClick,\n\t\treturnUrl,\n\t\tplayerBaseUrl,\n\t\tparallax = true,\n\t\tfit = 'full',\n\t\tlazy = true,\n\t\tclassName = '',\n\t\tfallbackImage,\n\t\tnormalizeUrls = true,\n\t\tcdnBaseUrl\n\t} = props;\n\n\tconst rootRef = useRef<HTMLElement | null>(null);\n\tconst pointerDownRef = useRef(false);\n\tconst [boxW, setBoxW] = useState(0);\n\tconst [boxH, setBoxH] = useState(0);\n\n\tconst locationPlateSize = pickThumbnailLocationPlateSize(boxW, boxH);\n\tconst avatarPlateSize = pickThumbnailAvatarPlateSize(boxW, boxH);\n\tconst layers = useMemo(\n\t\t() =>\n\t\t\tresolveThumbnailLayers({\n\t\t\t\tgalleryThumb,\n\t\t\t\tavatarImage,\n\t\t\t\tbackgroundImage,\n\t\t\t\tforegroundImage,\n\t\t\t\tfallbackImage,\n\t\t\t\tnormalize: normalizeUrls,\n\t\t\t\tlocationPlateSize,\n\t\t\t\tavatarPlateSize,\n\t\t\t\tcdnBaseUrl\n\t\t\t}),\n\t\t[\n\t\t\tgalleryThumb,\n\t\t\tavatarImage,\n\t\t\tbackgroundImage,\n\t\t\tforegroundImage,\n\t\t\tfallbackImage,\n\t\t\tnormalizeUrls,\n\t\t\tlocationPlateSize,\n\t\t\tavatarPlateSize,\n\t\t\tcdnBaseUrl\n\t\t]\n\t);\n\n\tconst interaction = resolveThumbnailInteraction({\n\t\thref,\n\t\thasClickHandler: typeof onClick === 'function',\n\t\texperienceId\n\t});\n\tconst isHostedLaunch =\n\t\tinteraction === 'anchor' && !href?.trim() && Boolean(experienceId?.trim());\n\tconst hasScene = Boolean(layers?.backgroundImage);\n\tconst parallaxEnabled = parallax !== false;\n\n\tconst [shouldLoad, setShouldLoad] = useState(!lazy);\n\tconst [useAvif, setUseAvif] = useState(false);\n\tconst [plateFormatReady, setPlateFormatReady] = useState(false);\n\tconst [backgroundTriedFallback, setBackgroundTriedFallback] = useState(false);\n\tconst [foregroundTriedFallback, setForegroundTriedFallback] = useState(false);\n\tconst [avatarTriedWebpFallback, setAvatarTriedWebpFallback] = useState(false);\n\tconst [hovering, setHovering] = useState(false);\n\tconst [scrollParallax, setScrollParallax] = useState(false);\n\tconst [parallaxX, setParallaxX] = useState(0);\n\tconst [parallaxY, setParallaxY] = useState(0);\n\tconst [avatarLoadFailed, setAvatarLoadFailed] = useState(false);\n\tconst [backgroundReady, setBackgroundReady] = useState(false);\n\tconst [avatarReady, setAvatarReady] = useState(false);\n\tconst [foregroundReady, setForegroundReady] = useState(false);\n\tconst [resolvedHref, setResolvedHref] = useState<string | undefined>();\n\n\tconst resolvedAvatarImage = layers\n\t\t? avatarLoadFailed && layers.fallbackImage\n\t\t\t? layers.fallbackImage\n\t\t\t: layers.avatarImage\n\t\t: '';\n\n\tuseEffect(() => {\n\t\tensureExperienceThumbnailStyles(EXPERIENCE_THUMBNAIL_CSS);\n\t\tvoid supportsAvifDecode().then((ok) => {\n\t\t\tsetUseAvif(ok);\n\t\t\tsetPlateFormatReady(true);\n\t\t});\n\t}, []);\n\n\tuseEffect(() => {\n\t\tsetResolvedHref(\n\t\t\tresolveThumbnailHref({\n\t\t\t\thref,\n\t\t\t\texperienceId,\n\t\t\t\treturnUrl,\n\t\t\t\tplayerBaseUrl,\n\t\t\t\tuseCurrentPageAsReturnUrl: isHostedLaunch && !returnUrl?.trim()\n\t\t\t})\n\t\t);\n\t}, [href, experienceId, returnUrl, playerBaseUrl, isHostedLaunch]);\n\n\tuseEffect(() => {\n\t\tsetBackgroundReady(false);\n\t\tsetAvatarReady(false);\n\t\tsetForegroundReady(false);\n\t\tsetAvatarLoadFailed(false);\n\t\tsetBackgroundTriedFallback(false);\n\t\tsetForegroundTriedFallback(false);\n\t\tsetAvatarTriedWebpFallback(false);\n\t}, [layers?.backgroundImage, layers?.foregroundImage, resolvedAvatarImage]);\n\n\tuseEffect(() => {\n\t\tconst el = rootRef.current;\n\t\tif (!el) return;\n\t\treturn attachThumbnailBox(el, (width, height) => {\n\t\t\tsetBoxW(width);\n\t\t\tsetBoxH(height);\n\t\t});\n\t}, [interaction, resolvedHref]);\n\n\tuseEffect(() => {\n\t\tconst el = rootRef.current;\n\t\tif (!el) return;\n\t\tif (!lazy) {\n\t\t\tsetShouldLoad(true);\n\t\t\treturn;\n\t\t}\n\t\treturn attachLazyThumb(el, {\n\t\t\tonVisibleChange: (visible) => {\n\t\t\t\tif (visible) setShouldLoad(true);\n\t\t\t}\n\t\t});\n\t}, [lazy, layers, interaction, resolvedHref]);\n\n\tuseEffect(() => {\n\t\tconst el = rootRef.current;\n\t\tif (!el || !parallaxEnabled) return;\n\t\treturn attachScrollLinkedParallax(el, {\n\t\t\tonParallax: (x) => {\n\t\t\t\tsetScrollParallax(true);\n\t\t\t\tif (!pointerDownRef.current) {\n\t\t\t\t\tsetParallaxX(x);\n\t\t\t\t\tsetParallaxY(0);\n\t\t\t\t}\n\t\t\t},\n\t\t\tpointerActive: () => pointerDownRef.current\n\t\t});\n\t}, [parallaxEnabled, layers, interaction, resolvedHref]);\n\n\tconst onPointerMove = (event: ReactPointerEvent<HTMLElement>) => {\n\t\tif (!parallaxEnabled || scrollParallax) return;\n\t\tconst rect = event.currentTarget.getBoundingClientRect();\n\t\tif (rect.width <= 0 || rect.height <= 0) return;\n\t\tsetParallaxX(((event.clientX - rect.left) / rect.width - 0.5) * 2);\n\t\tsetParallaxY(((event.clientY - rect.top) / rect.height - 0.5) * 2);\n\t};\n\n\tconst clearPointer = (thumb: HTMLElement) => {\n\t\tconst wasDown = pointerDownRef.current;\n\t\tpointerDownRef.current = false;\n\t\tsetHovering(false);\n\t\tif (scrollParallax && wasDown) {\n\t\t\tsetParallaxX(\n\t\t\t\thorizontalParallaxFromViewportY(thumb.getBoundingClientRect(), window.innerHeight)\n\t\t\t);\n\t\t\tsetParallaxY(0);\n\t\t} else if (!scrollParallax) {\n\t\t\tsetParallaxX(0);\n\t\t\tsetParallaxY(0);\n\t\t}\n\t};\n\n\tconst onPointerDown = (event: ReactPointerEvent<HTMLElement>) => {\n\t\tif (!parallaxEnabled) return;\n\t\tpointerDownRef.current = true;\n\t\tif (event.pointerType === 'mouse') setHovering(true);\n\t\tconst thumb = event.currentTarget;\n\t\tconst onGlobalEnd = () => {\n\t\t\tclearPointer(thumb);\n\t\t\twindow.removeEventListener('pointerup', onGlobalEnd);\n\t\t\twindow.removeEventListener('pointercancel', onGlobalEnd);\n\t\t};\n\t\twindow.addEventListener('pointerup', onGlobalEnd);\n\t\twindow.addEventListener('pointercancel', onGlobalEnd);\n\t};\n\n\tconst handleClick = (event: ReactMouseEvent<HTMLElement>) => {\n\t\tonClick?.(event);\n\t\tif (event.defaultPrevented) return;\n\t\tif (isHostedLaunch && !returnUrl?.trim()) {\n\t\t\tconst next = resolveThumbnailHref({\n\t\t\t\texperienceId,\n\t\t\t\tplayerBaseUrl,\n\t\t\t\tuseCurrentPageAsReturnUrl: true\n\t\t\t});\n\t\t\tif (\n\t\t\t\tnext &&\n\t\t\t\tevent.button === 0 &&\n\t\t\t\t!event.metaKey &&\n\t\t\t\t!event.ctrlKey &&\n\t\t\t\t!event.shiftKey\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\twindow.location.assign(next);\n\t\t\t}\n\t\t}\n\t};\n\n\tif (!layers) return null;\n\n\tconst parallaxLayersActive = parallaxEnabled && (hovering || scrollParallax);\n\t/** Fade placeholder as soon as any layer can paint — don't wait for the slowest plate. */\n\tconst revealThumb =\n\t\tshouldLoad && plateFormatReady && (avatarReady || backgroundReady || foregroundReady);\n\n\tconst rootClass = [\n\t\t'liforma-et',\n\t\thasScene ? 'liforma-et--scene' : '',\n\t\tthumbnailFitClass(fit),\n\t\tparallaxLayersActive ? 'liforma-et--parallax' : '',\n\t\tscrollParallax ? 'liforma-et--scroll-parallax' : '',\n\t\tshouldLoad && !revealThumb ? 'liforma-et--loading' : '',\n\t\trevealThumb ? 'liforma-et--revealed' : '',\n\t\tclassName\n\t]\n\t\t.filter(Boolean)\n\t\t.join(' ');\n\n\tconst style = {\n\t\t['--liforma-et-parallax-x' as string]: parallaxX,\n\t\t['--liforma-et-parallax-y' as string]: parallaxY\n\t} as CSSProperties;\n\n\tconst markReady = (img: HTMLImageElement, setReady: (v: boolean) => void) => {\n\t\tif (img.complete) setReady(true);\n\t};\n\n\tconst media = (\n\t\t<>\n\t\t\t<span className=\"liforma-et__placeholder\" aria-hidden=\"true\" />\n\t\t\t{shouldLoad && plateFormatReady && layers.backgroundImage ? (\n\t\t\t\t<img\n\t\t\t\t\tclassName={mediaClass('liforma-et__background', backgroundReady)}\n\t\t\t\t\tsrc={thumbnailPlateSrc(layers.backgroundImage, useAvif)}\n\t\t\t\t\talt=\"\"\n\t\t\t\t\tdecoding=\"async\"\n\t\t\t\t\tref={(node) => {\n\t\t\t\t\t\tif (node) markReady(node, setBackgroundReady);\n\t\t\t\t\t}}\n\t\t\t\t\tonLoad={() => setBackgroundReady(true)}\n\t\t\t\t\tonError={(event) => {\n\t\t\t\t\t\tconst img = event.currentTarget;\n\t\t\t\t\t\tconst fallback = thumbnailLocationPlateFallbackUrl(img.src);\n\t\t\t\t\t\tif (fallback && !backgroundTriedFallback) {\n\t\t\t\t\t\t\tsetBackgroundTriedFallback(true);\n\t\t\t\t\t\t\timg.src = fallback;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetBackgroundReady(true);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t\t{shouldLoad && plateFormatReady && resolvedAvatarImage ? (\n\t\t\t\t<img\n\t\t\t\t\tclassName={mediaClass('liforma-et__avatar', avatarReady)}\n\t\t\t\t\tsrc={thumbnailPlateSrc(resolvedAvatarImage, useAvif)}\n\t\t\t\t\talt=\"\"\n\t\t\t\t\tdecoding=\"async\"\n\t\t\t\t\tref={(node) => {\n\t\t\t\t\t\tif (node) markReady(node, setAvatarReady);\n\t\t\t\t\t}}\n\t\t\t\t\tonLoad={() => setAvatarReady(true)}\n\t\t\t\t\tonError={(event) => {\n\t\t\t\t\t\tconst img = event.currentTarget;\n\t\t\t\t\t\tconst webp = thumbnailColourPlateWebpFallbackUrl(img.src);\n\t\t\t\t\t\tif (webp && !avatarTriedWebpFallback) {\n\t\t\t\t\t\t\tsetAvatarTriedWebpFallback(true);\n\t\t\t\t\t\t\timg.src = webp;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (layers.fallbackImage) setAvatarLoadFailed(true);\n\t\t\t\t\t\telse setAvatarReady(true);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t\t{shouldLoad && plateFormatReady && layers.foregroundImage ? (\n\t\t\t\t<img\n\t\t\t\t\tclassName={mediaClass('liforma-et__foreground', foregroundReady)}\n\t\t\t\t\tsrc={thumbnailPlateSrc(layers.foregroundImage, useAvif)}\n\t\t\t\t\talt=\"\"\n\t\t\t\t\tdecoding=\"async\"\n\t\t\t\t\tref={(node) => {\n\t\t\t\t\t\tif (node) markReady(node, setForegroundReady);\n\t\t\t\t\t}}\n\t\t\t\t\tonLoad={() => setForegroundReady(true)}\n\t\t\t\t\tonError={(event) => {\n\t\t\t\t\t\tconst img = event.currentTarget;\n\t\t\t\t\t\tconst fallback = thumbnailLocationPlateFallbackUrl(img.src);\n\t\t\t\t\t\tif (fallback && !foregroundTriedFallback) {\n\t\t\t\t\t\t\tsetForegroundTriedFallback(true);\n\t\t\t\t\t\t\timg.src = fallback;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetForegroundReady(true);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t</>\n\t);\n\n\tconst pointerProps = {\n\t\tonPointerDown,\n\t\tonPointerUp: (event: ReactPointerEvent<HTMLElement>) => clearPointer(event.currentTarget),\n\t\tonPointerCancel: (event: ReactPointerEvent<HTMLElement>) =>\n\t\t\tclearPointer(event.currentTarget),\n\t\tonPointerEnter: (event: ReactPointerEvent<HTMLElement>) => {\n\t\t\tif (parallaxEnabled && event.pointerType === 'mouse') setHovering(true);\n\t\t},\n\t\tonPointerMove,\n\t\tonPointerLeave: () => {\n\t\t\tif (!pointerDownRef.current) {\n\t\t\t\tsetHovering(false);\n\t\t\t\tif (!scrollParallax) {\n\t\t\t\t\tsetParallaxX(0);\n\t\t\t\t\tsetParallaxY(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tconst setRootRef = (node: HTMLElement | null) => {\n\t\trootRef.current = node;\n\t};\n\n\tif (interaction === 'anchor' && resolvedHref) {\n\t\treturn (\n\t\t\t<a\n\t\t\t\tref={setRootRef}\n\t\t\t\tclassName={rootClass}\n\t\t\t\tstyle={style}\n\t\t\t\thref={resolvedHref}\n\t\t\t\ttarget={target}\n\t\t\t\trel={rel}\n\t\t\t\taria-label={alt}\n\t\t\t\tonClick={handleClick}\n\t\t\t\t{...pointerProps}\n\t\t\t>\n\t\t\t\t{media}\n\t\t\t</a>\n\t\t);\n\t}\n\n\tif (interaction === 'button') {\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tref={setRootRef}\n\t\t\t\tclassName={rootClass}\n\t\t\t\tstyle={style}\n\t\t\t\taria-label={alt}\n\t\t\t\tonClick={handleClick}\n\t\t\t\t{...pointerProps}\n\t\t\t>\n\t\t\t\t{media}\n\t\t\t</button>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tref={setRootRef}\n\t\t\tclassName={rootClass}\n\t\t\tstyle={style}\n\t\t\trole={alt ? 'img' : undefined}\n\t\t\taria-label={alt || undefined}\n\t\t\taria-hidden={alt ? undefined : true}\n\t\t\t{...pointerProps}\n\t\t>\n\t\t\t{media}\n\t\t</div>\n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