{"version":3,"file":"Motion.BpUS47Ej.mjs","names":["useRef","_Fragment","__esmMin","init_ssg_sandbox_shims","de","l","p","c","J","init_npm_react_18_3_1","ce","window","RenderTarget","init_framer_DxfB3JJo","prefersReducedMotion","textNodesOf","walker","root","nodes","withCountUp","ref","frame","originals","render","text","n","progress","node","first","start","t0","tick","now","observer","entries","child","Component","props","withPhotoZoom","photo","zoom","img","EASE","scale","withArticleSpacing","init_Motion","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/2KlMkzfxPqP5TsOkpeH9/CrH9VdkUPRI3YEY3LoaS/Motion.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{RenderTarget}from\"framer\";import{forwardRef,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})});};}/**\n * Article spacing\n * Put it on a CMS rich text: photos in the text get room above and below.\n */export function withArticleSpacing(Component){return /*#__PURE__*/forwardRef((props,ref)=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`[data-framer-component-type=RichTextContainer] img{display:block;width:100%;height:auto;margin:36px 0 !important}`}),/*#__PURE__*/_jsx(Component,{ref:ref,...props})]}));}\nexport const __FramerMetadata__ = {\"exports\":{\"withPhotoZoom\":{\"type\":\"reactHoc\",\"name\":\"withPhotoZoom\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withArticleSpacing\":{\"type\":\"reactHoc\",\"name\":\"withArticleSpacing\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCountUp\":{\"type\":\"reactHoc\",\"name\":\"withCountUp\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Motion.map"],"mappings":"A,yMAA2M,SAASc,GAAsB,CAAC,OAAcH,IAAS,QAAa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