{"version":3,"file":"Motion.DyDcPAhd.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/2KlMkzfxPqP5TsOkpeH9/15itXQtBOutPERe3P5UA/Motion.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{RenderTarget}from\"framer\";import{useEffect,useRef}from\"react\";const EASE=\"cubic-bezier(0.2, 0.7, 0.2, 1)\";function prefersReducedMotion(){return typeof window!==\"undefined\"&&window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches;}function textNodesOf(root){const walker=document.createTreeWalker(root,NodeFilter.SHOW_TEXT);const nodes=[];while(walker.nextNode())nodes.push(walker.currentNode);return nodes;}/**\n * Count up\n * Every number in the text counts up from zero the first time it scrolls into view.\n * Works in any language: it reads whatever the text layer shows (\"2 h 20\", \"50 min\", \"1,200 m²\").\n */export function withCountUp(Component){return props=>{const ref=useRef(null);useEffect(()=>{const root=ref.current;if(!root||RenderTarget.current()===RenderTarget.canvas||prefersReducedMotion())return;let frame=0;let originals;const render=progress=>{for(const{node,text}of originals){node.textContent=text.replace(/\\d+/g,n=>String(Math.round(Number(n)*progress)));}};originals=textNodesOf(root).map(node=>({node,text:node.textContent||\"\"}));const first=root.firstElementChild;// Below the fold: start from zero so the jump never shows\nif(first&&first.getBoundingClientRect().top>window.innerHeight)render(0);const start=()=>{const duration=1600;const t0=performance.now();const tick=now=>{const p=Math.min((now-t0)/duration,1);render(1-Math.pow(1-p,3));if(p<1)frame=requestAnimationFrame(tick);};frame=requestAnimationFrame(tick);};const observer=new IntersectionObserver(entries=>{if(entries.some(e=>e.isIntersecting)){observer.disconnect();start();}},{threshold:.6});Array.from(root.children).forEach(child=>observer.observe(child));return()=>{observer.disconnect();cancelAnimationFrame(frame);render(1);};},[]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{display:\"contents\"},children:/*#__PURE__*/_jsx(Component,{...props})});};}/**\n * Photo zoom\n * Put it on a card: hovering anywhere on the card slowly zooms the first photo inside it.\n * The photo frame needs Overflow: Clip so the zoom stays inside the frame.\n */export function withPhotoZoom(Component){return props=>{const ref=useRef(null);const photo=()=>ref.current?.querySelector(\"img\")??null;const zoom=scale=>{if(prefersReducedMotion())return;const img=photo();if(!img)return;img.style.transition=`transform 1.1s ${EASE}`;img.style.transform=`scale(${scale})`;};return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{display:\"contents\"},onMouseEnter:()=>zoom(1.06),onMouseLeave:()=>zoom(1),children:/*#__PURE__*/_jsx(Component,{...props})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withCountUp\":{\"type\":\"reactHoc\",\"name\":\"withCountUp\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPhotoZoom\":{\"type\":\"reactHoc\",\"name\":\"withPhotoZoom\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Motion.map"],"mappings":"wLAA4J,SAAS,GAAsB,CAAC,OAAc,IAAS,QAAa,EAAO,aAAa,kCAAkC,CAAC,CAAC,OAAQ,CAAC,SAAS,EAAY,EAAK,CAAC,IAAM,EAAO,SAAS,iBAAiB,EAAK,WAAW,SAAS,EAAQ,EAAM,CAAC,EAAE,KAAM,EAAO,SAAS,GAAE,EAAM,KAAK,EAAO,WAAW,EAAE,OAAO,CAAM,CAI9c,SAAgB,EAAY,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAIA,EAAO,IAAI,EACqf,OADnf,MAAc,CAAC,IAAM,EAAK,EAAI,QAAQ,GAAG,CAAC,GAAM,EAAa,QAAQ,IAAI,EAAa,QAAQ,EAAqB,EAAE,OAAO,IAAI,EAAM,EAAM,EAAgB,EAAO,GAAU,CAAC,IAAI,GAAK,CAAC,OAAK,UAAQ,EAAW,EAAK,YAAY,EAAK,QAAQ,OAAO,GAAG,OAAO,KAAK,MAAM,OAAO,CAAC,EAAE,CAAQ,CAAC,CAAC,CAAG,EAAE,EAAU,EAAY,CAAI,CAAC,CAAC,I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