{"version":3,"file":"LazyPhoto.CBvwkGUI.mjs","names":["useRef","useState","__esmMin","init_npm_react_18_3_1","_e","de","init_jsx_runtime","c","ce","init_framer_DcGZRLrs","RenderTarget","addPropertyControls","ControlType","sqR","v","p","sq","r","placeholderFor","s","PLACEHOLDER_DARK","PLACEHOLDER","text","srcOf","oneLength","DEFAULT_SIZES","depth","ch","cdnSrcSet","src","u","w","shortHash","h","i","tag","url","fragment","tagSrcSet","srcSet","bits","part","LazyPhoto","props","target","onCanvas","near","eager","load","boxRef","inView","setInView","el","io","e","entries","showImg","chosen","image","fallbackPhoto","o","rawSrc","rawSet","sizesValue","sizes","px","py","radius","style","placeholder","init_LazyPhoto"],"sources":["https:/framerusercontent.com/modules/RbM2HI6ifxSpjQ23hBvp/YmNQofzfgajokJaIoRAp/LazyPhoto.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef,useState}from\"react\";// Brand squircle 60% (2026-10-04): the same CSS Framer publishes for \"Squircle 60%\". Browsers with CSS corner-shape draw the\n// squircle at the full radius; others (every iPhone browser, Safari) get a round corner at 0.71 x radius, which the site's\n// gm-squircle head block then clips to the true squircle. Fully round pills keep plain border-radius.\nfunction sqR(v){return String(typeof v===\"number\"?v+\"px\":v).trim().split(/\\s+/).map(p=>/^-?[\\d.]+$/.test(p)?p+\"px\":p).map(p=>parseFloat(p)===0?\"0\":\"calc(\"+p+\" * var(--one-if-corner-shape-supported, var(--corner-shape-fallback, 1)))\").join(\" \");}function sq(r){if(r===undefined||r===null||r===\"\")return{};if(r===0||r===\"0\"||r===\"0px\")return{borderRadius:0};return{[\"--corner-shape-fallback\"]:.71,borderRadius:sqR(r),cornerShape:\"superellipse(1.6)\"};}// LazyPhoto: a CMS photo for list cards that only downloads when it nears the screen.\n//\n// Why it exists (build-reports-v6/images.md, build-reports-v7/lazyphoto.md): Framer image fills have no lazy\n// setting, and its code generator leaves loading=\"lazy\" off list cards. On a phone, /venues downloaded every card\n// photo before the hero. This renders the same photo as a plain <img loading=\"lazy\" decoding=\"async\">.\n//\n// Rules learned from GalleryLightbox (the publish step's image optimizer rewrites code-component <img> tags):\n// - \"sizes\" must be ONE length. min()/max()/clamp() and calc arithmetic are fine. A media-condition list breaks\n//   once the optimizer wraps the value per breakpoint, so such a value falls back to the default here.\n// - Imgs that share a src get their sizes merged. A #fragment (lp-/lpe- plus a hash of sizes) keeps this src apart\n//   from Framer's own fills, the gallery and LazyPhotos of another width (a card vs a 55px event thumbnail).\n//   Browsers drop the fragment when they fetch, so the file, AVIF and the CDN cache stay the same.\n//   Never use a query param for this: it loses AVIF and every cache hit.\n// - The photo sits absolutely inside its frame, so it can never shift the layout.\n//\n// The frame that holds this keeps its own radius, squircle and Clip, so the corners match the old fill exactly.\n//\n// \"Fallback photo\" (v4, build-reports-v8/storefront.md): shown when Image is empty. Venue cards bind Image to the\n// CMS \"Storefront Photo\" and Fallback to \"Cover Photo\", so a venue without a storefront photo keeps its old photo.\n/**\n * @framerIntrinsicWidth 360\n * @framerIntrinsicHeight 270\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */// Shown while the photo loads, so a loading card is never see-through. Directory/Card follows the theme\n// (#F2F2F2 light, #141414 dark). The inner fallback is the brand Card token (#141414 in both modes), then a literal.\nconst PLACEHOLDER=\"var(--token-6bd6f173-246d-4162-b46d-e3fcfa96384c, var(--token-be3a6e02-37c0-4459-925b-15e7b7ad396c, #1C1C1C))\";// For photos on a section that is dark in both modes (e.g. /venues \"Ticketed events\"): the brand Card token.\nconst PLACEHOLDER_DARK=\"var(--token-be3a6e02-37c0-4459-925b-15e7b7ad396c, #1C1C1C)\";// \"theme\" (default): Directory/Card. \"dark\": always dark. \"frame\": no colour of its own, so the frame's own\n// solid fill shows while the photo loads (only for frames that have one). Accepts the option or its title.\nfunction placeholderFor(v){const s=typeof v===\"string\"?v.trim().toLowerCase():\"\";if(s.indexOf(\"dark\")!==-1||s===\"always dark\")return PLACEHOLDER_DARK;if(s.indexOf(\"frame\")!==-1)return undefined;return PLACEHOLDER;}const DEFAULT_SIZES=\"min(100vw, 420px)\";function text(v){return typeof v===\"string\"?v.trim():\"\";}// The image's address, or \"\" when the image is empty (an unset CMS image can arrive as undefined, null, \"\" or {}).\nfunction srcOf(v){if(typeof v===\"string\")return v.trim();return v&&typeof v===\"object\"?text(v.src):\"\";}// One length only. A top-level comma or a \"(min-width: …)\" style condition means a media list: use the default.\nfunction oneLength(v){const s=v.trim();if(!s)return DEFAULT_SIZES;let depth=0;for(const ch of s){if(ch===\"(\")depth++;else if(ch===\")\")depth--;else if(ch===\",\"&&depth===0)return DEFAULT_SIZES;}if(/\\(\\s*(min|max)-(width|height)\\s*:/i.test(s)||/^\\(/.test(s))return DEFAULT_SIZES;return s;}// Framer's image CDN resizes on request. Used only when an image arrives without a srcSet.\nfunction cdnSrcSet(src){if(src.indexOf(\"framerusercontent.com/images/\")===-1)return\"\";try{return[512,1024,2048].map(w=>{const u=new URL(src);u.searchParams.set(\"scale-down-to\",String(w));return`${u.toString()} ${w}w`;}).join(\", \");}catch(_){return\"\";}}// Short, stable hash of the sizes value (same on the server and in the browser). Photos in the same role\n// (same sizes) share a tag, so merging them is harmless. A card and a 55px event thumbnail of the same photo\n// get different tags, so the thumbnail never inherits the card's width and downloads a small file.\nfunction shortHash(s){let h=5381;for(let i=0;i<s.length;i++)h=(h<<5)+h+s.charCodeAt(i)|0;return(h>>>0).toString(36).slice(0,5);}function tag(url,fragment){if(!/^(https?:)?\\/\\//i.test(url))return url;return`${url.split(\"#\")[0]}#${fragment}`;}function tagSrcSet(srcSet,fragment){return srcSet.split(\",\").map(part=>{const bits=part.trim().split(/\\s+/);return bits[0]?[tag(bits[0],fragment),...bits.slice(1)].join(\" \"):\"\";}).filter(Boolean).join(\", \");}export default function LazyPhoto(props){const{image,fallbackPhoto,sizes=DEFAULT_SIZES,eager=false,radius=0,placeholder=\"theme\",load=\"native\",style}=props;const target=RenderTarget.current();// The canvas, thumbnails and exports always load right away, so screenshots never catch an empty card.\nconst onCanvas=target===RenderTarget.canvas||target===RenderTarget.thumbnail||target===RenderTarget.export;// \"Near view\" (Speed round 2, 2026-10-10, _speed-2026-10-10/round-2/PLAN.md T3): the <img> is added only when the\n// box comes within 400 px of the screen. For small thumbnails far down a page, which the browser's own lazy\n// loading fetches far too early under PageSpeed's network emulation. Never on the canvas or for an eager photo.\n// The box and its placeholder render exactly as with \"Native lazy\" (the default), so nothing shifts.\nconst near=!eager&&!onCanvas&&/near/i.test(text(load));const boxRef=useRef(null);const[inView,setInView]=useState(false);useEffect(()=>{if(!near||inView)return;const el=boxRef.current;if(!el||typeof IntersectionObserver===\"undefined\"){setInView(true);return;}const io=new IntersectionObserver(entries=>{for(const e of entries)if(e.isIntersecting){setInView(true);io.disconnect();break;}},{rootMargin:\"400px 0px\"});io.observe(el);return()=>io.disconnect();},[near,inView]);const showImg=!near||inView;// Image wins. When it is empty, the fallback shows (with its own alt text and focal point).\nconst chosen=srcOf(image)?image:fallbackPhoto;const o=chosen&&typeof chosen===\"object\"?chosen:null;const rawSrc=srcOf(chosen);const rawSet=text(o&&o.srcSet)||cdnSrcSet(rawSrc);// Eager and lazy copies, and copies with different sizes, never share a src, so the optimizer cannot mix their sizes.\nconst sizesValue=oneLength(text(sizes));const fragment=`${eager?\"lpe\":\"lp\"}-${shortHash(sizesValue)}`;const src=rawSrc?tag(rawSrc,fragment):\"\";const srcSet=rawSet?tagSrcSet(rawSet,fragment):\"\";const px=text(o&&o.positionX)||\"50%\";const py=text(o&&o.positionY)||\"50%\";const r=typeof radius===\"number\"&&radius>0?radius:0;return /*#__PURE__*/_jsx(\"div\",{ref:boxRef,style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:r?\"hidden\":undefined,...sq(r?r:undefined),background:placeholderFor(placeholder)},children:src&&showImg?/*#__PURE__*/_jsx(\"img\",{loading:eager||onCanvas?\"eager\":\"lazy\",decoding:\"async\",sizes:srcSet?sizesValue:undefined,srcSet:srcSet||undefined,src:src,alt:text(o&&o.alt),style:{position:\"absolute\",inset:0,display:\"block\",width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:`${px} ${py}`,...sq(r?r:undefined)}}):null});}LazyPhoto.displayName=\"LazyPhoto\";addPropertyControls(LazyPhoto,{image:{type:ControlType.ResponsiveImage,title:\"Image\",description:\"Bind to the same CMS photo the frame used.\"},fallbackPhoto:{type:ControlType.ResponsiveImage,title:\"Fallback photo\",description:\"Shows when Image is empty. Venue cards: Image = Storefront Photo, Fallback = Cover Photo.\"},sizes:{type:ControlType.String,title:\"Sizes\",defaultValue:DEFAULT_SIZES,description:\"ONE CSS length: the photo's widest rendered width. min()/max()/clamp() are fine. No media conditions.\"},eager:{type:ControlType.Boolean,title:\"Eager\",defaultValue:false,enabledTitle:\"Eager\",disabledTitle:\"Lazy\",description:\"Eager only for a photo that is in the first screen on a phone.\"},load:{type:ControlType.Enum,title:\"Load\",defaultValue:\"native\",options:[\"native\",\"near\"],optionTitles:[\"Native lazy\",\"Near view\"],hidden:p=>!!p.eager,description:\"Near view: the <img> is added when the box comes within 400 px of the screen. For small thumbnails far down a page.\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:0,min:0,max:200,step:1,unit:\"px\",displayStepper:true,description:\"Leave at 0 when the frame clips (keeps the frame's squircle).\"},placeholder:{type:ControlType.Enum,title:\"Placeholder\",defaultValue:\"theme\",options:[\"theme\",\"dark\",\"frame\"],optionTitles:[\"Follows theme\",\"Always dark\",\"Frame fill\"],description:\"Colour while the photo loads. Always dark for dark sections. Frame fill only if the frame has a solid fill.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LazyPhoto\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LazyPhoto.map"],"mappings":"A,gMAGA,SAASa,EAAI,EAAE,CAA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