{"version":3,"file":"StackScale.Bh1vO2ve.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/fbxJwdYNvP6TjOnZNOHf/xKinqNWaSoBtgeQrQ95b/StackScale.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";export function withStackScale(Component){return props=>{const ref=useRef(null);useEffect(()=>{const el=ref.current;if(!el||typeof window===\"undefined\")return;let target=0,current=0,raf=0;const docTop=()=>{let y=0,n=el;while(n){y+=n.offsetTop;n=n.offsetParent;}return y;};const measure=()=>{const vh=window.innerHeight,top=docTop(),h=el.offsetHeight;target=Math.min(1,Math.max(0,(window.scrollY-(top-vh))/(vh+h)));};const render=()=>{current+=(target-current)*.08;if(Math.abs(target-current)<5e-4)current=target;el.style.transform=\"scale(\"+(1-.1*current).toFixed(4)+\")\";raf=current!==target?requestAnimationFrame(render):0;};const onScroll=()=>{measure();if(!raf)raf=requestAnimationFrame(render);};measure();current=target;render();window.addEventListener(\"scroll\",onScroll,{passive:true});window.addEventListener(\"resize\",onScroll);return()=>{window.removeEventListener(\"scroll\",onScroll);window.removeEventListener(\"resize\",onScroll);cancelAnimationFrame(raf);};},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withStackScale\":{\"type\":\"reactHoc\",\"name\":\"withStackScale\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StackScale.map"],"mappings":"uIAA+E,SAAgB,EAAe,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAIA,EAAO,IAAI,EAA63B,OAA33B,MAAc,CAAC,IAAM,EAAG,EAAI,QAAQ,GAAG,CAAC,GAAW,IAAS,OAAY,OAAO,IAAI,EAAO,EAAE,EAAQ,EAAE,EAAI,EAAQ,MAAW,CAAC,IAAI,EAAE,EAAE,EAAE,EAAG,KAAM,GAAG,GAAG,EAAE,UAAU,EAAE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