{"version":3,"file":"ImageMotion.DkVvm96K.mjs","names":["useState","useCallback","__esmMin","init_npm_react_18_3_1","ne","init_ssg_sandbox_shims","window","_e","p","c","J","init_jsx_runtime","ce","init_framer_D1IzEvwH","useIsStaticRenderer","enqueue","queue","flushTimer","flush","now","a","b","start","nextFree","STEP","q","assignRef","ref","value","build","isStatic","frameEl","setFrameEl","driftEl","setDriftEl","maskEl","setMaskEl","phase","setPhase","reveal","setRef","node","forwardedRef","t","el","drift","mask","reduce","animations","cancelled","io","entries","opts","HIDDEN","SHOWN","raf","update","r","vh","mode","y","onScroll","Component","props","hidden","layer","STYLES","withImageMotion","withHeroParallax","init_ImageMotion"],"sources":["https:/framerusercontent.com/modules/FMVM39VR6WI8NuqlySIE/22fZQBv6MugQAreLE2Xk/ImageMotion.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{forwardRef,useCallback,useEffect,useState}from\"react\";import{useIsStaticRenderer}from\"framer\";// Image motion for clipped photo frames.\n//\n// withImageMotion  wraps a clipped frame that holds an oversized image layer. The frame\n//                  wipes open from the bottom edge while it slides up, the photo inside\n//                  settles from a deep zoom and lags behind the mask, then a scroll-linked\n//                  drift keeps the photo moving slower than the page.\n// withHeroParallax the drift only, for a hero photo that is already on screen at load.\n//\n// The drift runs on a CSS view timeline, so it stays on the compositor and never\n// competes with the main thread. Browsers without view timelines fall back to a\n// single rAF loop that writes one transform.\nconst HIDDEN=\"inset(100% 0% 0% 0%)\";const SHOWN=\"inset(0% 0% 0% 0%)\";const STYLES=`\n@keyframes rosetta-drift { from { transform: translate3d(0, -8%, 0); } to { transform: translate3d(0, 8%, 0); } }\n@keyframes rosetta-hero-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, 9%, 0); } }\n@media (prefers-reduced-motion: no-preference) {\n  @supports (animation-timeline: view()) {\n    [data-rosetta-view] { view-timeline: --rosetta-vt block; }\n    [data-rosetta-drift=\"cover\"] { animation: rosetta-drift linear both; animation-timeline: --rosetta-vt; animation-range: cover 0% cover 100%; }\n    [data-rosetta-drift=\"exit\"] { animation: rosetta-hero-drift linear both; animation-timeline: --rosetta-vt; animation-range: exit 0% exit 100%; }\n  }\n}\n`;// Frames that come into view together open one after another, left to right, and a frame\n// that arrives while others are still queued waits for its turn.\nconst STEP=300;const queue=[];let flushTimer=0;let nextFree=0;function enqueue(left,run){queue.push({left,run});if(!flushTimer)flushTimer=window.setTimeout(flush,120);}function flush(){flushTimer=0;const now=performance.now();queue.splice(0).sort((a,b)=>a.left-b.left).forEach(q=>{const start=Math.max(now,nextFree);nextFree=start+STEP;q.run(start-now);});}function assignRef(ref,value){if(typeof ref===\"function\")ref(value);else if(ref&&typeof ref===\"object\")ref.current=value;}function build(Component,mode,reveal){return /*#__PURE__*/forwardRef((props,forwardedRef)=>{const isStatic=useIsStaticRenderer();// Elements live in state so the effects re-bind if the frame is remounted after hydration.\nconst[frameEl,setFrameEl]=useState(null);const[driftEl,setDriftEl]=useState(null);const[maskEl,setMaskEl]=useState(null);const[phase,setPhase]=useState(reveal?\"idle\":\"done\");const setRef=useCallback(node=>{if(node&&node.setAttribute)node.setAttribute(\"data-rosetta-view\",\"\");setFrameEl(node);assignRef(forwardedRef,node);},[forwardedRef]);// Never leave the photo hidden if the frame or IntersectionObserver never resolve.\nuseEffect(()=>{if(isStatic||!reveal)return;const t=window.setTimeout(()=>setPhase(p=>frameEl&&driftEl&&maskEl?p:\"done\"),3e3);return()=>window.clearTimeout(t);},[isStatic,frameEl,driftEl,maskEl]);// Reveal: mask wipe, slide, and the counter-motion of the photo inside.\nuseEffect(()=>{if(isStatic||!reveal)return;const el=frameEl;const drift=driftEl;const mask=maskEl;const reduce=window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;if(!el||!drift||!mask)return;if(reduce||typeof IntersectionObserver===\"undefined\"||typeof el.animate!==\"function\"){setPhase(\"done\");return;}let animations=[];let cancelled=false;const io=new IntersectionObserver(entries=>{if(!entries.some(e=>e.isIntersecting))return;io.disconnect();const run=delay=>{if(cancelled)return;const opts=(duration,easing)=>({duration,easing,delay,fill:\"both\"});const wipe=mask.animate({clipPath:[HIDDEN,SHOWN]},opts(1250,\"cubic-bezier(0.83, 0, 0.17, 1)\"));const slide=mask.animate({translate:[\"0 56px\",\"0 0\"]},opts(1450,\"cubic-bezier(0.16, 1, 0.3, 1)\"));const zoom=drift.animate({scale:[\"1.32\",\"1\"]},opts(1800,\"cubic-bezier(0.16, 1, 0.3, 1)\"));const lag=drift.animate({translate:[\"0 12%\",\"0 0\"]},opts(1550,\"cubic-bezier(0.16, 1, 0.3, 1)\"));animations=[wipe,slide,zoom,lag];Promise.all(animations.map(a=>a.finished)).then(()=>{if(cancelled)return;setPhase(\"done\");// Let React drop the hidden style first, so cancelling cannot flash it.\nwindow.setTimeout(()=>animations.forEach(a=>a.cancel()),120);}).catch(()=>{});};enqueue(el.getBoundingClientRect().left,run);},{threshold:.01,rootMargin:\"0px 0px -10% 0px\"});io.observe(el);return()=>{cancelled=true;io.disconnect();animations.forEach(a=>a.cancel());};},[isStatic,frameEl,driftEl,maskEl]);// Fallback drift for browsers without CSS view timelines.\nuseEffect(()=>{if(isStatic)return;if(typeof CSS!==\"undefined\"&&CSS.supports&&CSS.supports(\"animation-timeline: view()\"))return;if(window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return;const el=frameEl;const drift=driftEl;if(!el||!drift)return;let raf=0;const update=()=>{raf=0;const r=el.getBoundingClientRect();const vh=window.innerHeight;const p=mode===\"exit\"?-r.top/Math.max(r.height,1):(vh-r.top)/(vh+r.height);const t=Math.min(1,Math.max(0,p));const y=mode===\"exit\"?t*9:(t*2-1)*8;drift.style.transform=`translate3d(0, ${y.toFixed(3)}%, 0)`;};const onScroll=()=>{if(!raf)raf=requestAnimationFrame(update);};update();window.addEventListener(\"scroll\",onScroll,{passive:true});window.addEventListener(\"resize\",onScroll);return()=>{window.removeEventListener(\"scroll\",onScroll);window.removeEventListener(\"resize\",onScroll);if(raf)cancelAnimationFrame(raf);};},[isStatic,frameEl,driftEl]);if(isStatic)return /*#__PURE__*/_jsx(Component,{...props,ref:forwardedRef});const hidden=phase===\"idle\"?{clipPath:HIDDEN}:null;const layer={position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",pointerEvents:\"none\"};// The mask sits below the frame on purpose: a clip-path on the observed frame\n// itself would make IntersectionObserver report it as never visible.\nreturn /*#__PURE__*/_jsxs(Component,{...props,ref:setRef,children:[/*#__PURE__*/_jsx(\"div\",{ref:setMaskEl,style:{...layer,...hidden},children:/*#__PURE__*/_jsx(\"div\",{ref:setDriftEl,\"data-rosetta-drift\":mode,style:{...layer,willChange:\"transform\"},children:props.children})}),/*#__PURE__*/_jsx(\"style\",{children:STYLES})]});});}export function withImageMotion(Component){return build(Component,\"cover\",true);}export function withHeroParallax(Component){return build(Component,\"exit\",false);}\nexport const __FramerMetadata__ = {\"exports\":{\"withHeroParallax\":{\"type\":\"reactHoc\",\"name\":\"withHeroParallax\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withImageMotion\":{\"type\":\"reactHoc\",\"name\":\"withImageMotion\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageMotion.map"],"mappings":"A,8MAuB8D,SAASe,EAAQ,EAAK,EAAI,CAACC,EAAM,KAAK,CAAC,OAAK,KAAG,CAAC,EAAE,AAAeC,IAAWX,EAAO,WAAWY,EAAM,GAAG,CAAE,CAAC,SAASA,GAAO,CAAC,EAAW,EAAE,IAAMC,EAAI,YAAY,IAAI,EAAEH,EAAM,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,IAAII,EAAE,KAAKC,EAAE,IAAI,CAAC,CAAC,QAAQ,GAAG,CAAC,IAAMC,EAAM,KAAK,IAAIH,EAAII,CAAQ,EAAE,EAASD,EAAME,EAAKC,EAAE,IAAIH,EAAMH,CAAG,CAAE,CAAC,CAAE,CAAC,SAASO,EAAU,EAA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