{"version":3,"file":"ImageReveal.D8cR53fb.mjs","names":["useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/WDH1RjCiGeu3rhNGIzKI/hs02VVT93jGZhKLVkkEk/ImageReveal.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef}from\"react\";import{RenderTarget}from\"framer\";/**\n * withImageReveal — the \"blinds\" image reveal from the Acre template (AcreMotion), ported for Prism.\n * Eight vertical strips, painted in the colour behind the image, cover it until it scrolls into view; then\n * they collapse upward one after another (70ms apart, 1.1s each). The strips sit in an absolutely positioned,\n * pointer-events-none layer inside the image frame, so layout, size and crop never change; the layer is\n * removed once the reveal has finished. Skipped on the Framer canvas and for reduced-motion visitors.\n */const EASE=\"cubic-bezier(0.22, 0.7, 0.2, 1)\";const PRISM_BG=\"rgb(1, 5, 19)\"// Background Color, used when no ancestor paints a solid colour\n;const reduced=()=>typeof window!==\"undefined\"&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;function onceInView(el,cb){const io=new IntersectionObserver(([entry])=>{if(entry.isIntersecting){cb();io.disconnect();}},{threshold:.1,rootMargin:\"0px 0px -6% 0px\"});io.observe(el);return()=>io.disconnect();}function backdropColour(el){for(let n=el.parentElement;n;n=n.parentElement){const c=getComputedStyle(n).backgroundColor;if(c&&c!==\"transparent\"&&!/rgba\\(.*,\\s*0\\)$/.test(c))return c;}return PRISM_BG;}function reveal(el){if(reduced())return()=>{};if(getComputedStyle(el).position===\"static\")el.style.position=\"relative\";const colour=backdropColour(el);const layer=document.createElement(\"span\");layer.setAttribute(\"aria-hidden\",\"true\");layer.style.cssText=\"position:absolute;inset:-1px;z-index:3;display:flex;pointer-events:none;overflow:hidden;border-radius:inherit\";const strips=Array.from({length:8},(_,i)=>{const s=document.createElement(\"i\");s.style.cssText=`flex:1;margin-right:-1px;background:${colour};transform-origin:top;transition:transform 1.1s ${EASE} ${i*70+150}ms`;layer.appendChild(s);return s;});el.appendChild(layer);let done=0;const stop=onceInView(el,()=>{strips.forEach(s=>s.style.transform=\"scaleY(0)\");done=window.setTimeout(()=>layer.remove(),150+7*70+1100+200);});return()=>{stop();clearTimeout(done);layer.remove();};}export function withImageReveal(Component){return /*#__PURE__*/forwardRef((props,forwarded)=>{const node=useRef(null);const marker=useRef(null);useEffect(()=>{if(RenderTarget.current()===RenderTarget.canvas)return;const el=node.current instanceof HTMLElement?node.current:(marker.current?.previousElementSibling);if(el)return reveal(el);},[]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Component,{...props,ref:el=>{node.current=el;if(typeof forwarded===\"function\")forwarded(el);else if(forwarded)forwarded.current=el;}}),/*#__PURE__*/_jsx(\"span\",{ref:marker,hidden:true,style:{display:\"none\"}})]});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withImageReveal\":{\"type\":\"reactHoc\",\"name\":\"withImageReveal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageReveal.map"],"mappings":"6MAO8G,SAAS,EAAW,EAAG,EAAG,CAAC,IAAM,EAAG,IAAI,sBAAsB,CAAC,KAAS,CAAI,EAAM,iBAAgB,EAAG,EAAE,EAAG,WAAW,EAAG,EAAE,CAAC,UAAU,GAAG,WAAW,iBAAiB,CAAC,EAAiB,OAAf,EAAG,QAAQ,CAAE,MAAY,EAAG,WAAW,CAAE,CAAC,SAAS,EAAe,EAAG,CAAC,IAAI,IAAI,EAAE,EAAG,cAAc,EAAE,EAAE,EAAE,cAAc,CAAC,IAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,gBAAgB,GAAG,GAAG,IAAI,eAAe,CAAC,mBAAmB,KAAK,CAAC,EAAE,OAAO,CAAE,CAAC,OAAO,CAAS,CAAC,SAAS,EAAO,EAAG,CAAC,GAAG,EAAQ,EAAE,UAAU,CAAC,EAAK,iBAAiB,CAAE,CAAC,CAAC,WAAW,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