{"version":3,"file":"ScrollSteps.96iQpAl2.mjs","names":[],"sources":["https:/framerusercontent.com/modules/BTjXW66RhEAURNo3uZG3/ZAdTl9bMVLsgmpTYG0ql/ScrollSteps.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{useIsStaticRenderer}from\"framer\";/**\n * Drives the \"How it works\" pinned horizontal scroll on desktop:\n * translates #hiw-row, fills #hiw-fill-0..2, lights #hiw-cp/dot-0..3,\n * and fades #hiw-card-0..3 from 0.3 to 1 as progress passes each step.\n */export default function ScrollSteps(props){const isStatic=useIsStaticRenderer();const minWidth=props.minWidth??1200;useEffect(()=>{if(isStatic)return;const $=id=>document.getElementById(id);const clamp=(v,a,b)=>Math.min(b,Math.max(a,v));let raf=0;let cleared=false;let shift=0;const apply=()=>{raf=0;const track=$(\"hiw-track\");const sticky=$(\"hiw-sticky\");const row=$(\"hiw-row\");if(!track||!sticky||!row)return;// Only drive the row while the stage is actually pinned. Breakpoints that\n// switch Sticky Stage to relative (tablet/phone carousels) get no transform,\n// so the script follows whatever layout the page is showing.\nconst pinned=getComputedStyle(sticky).position===\"sticky\";if(window.innerWidth<minWidth||!pinned){if(!cleared){row.style.transform=\"\";shift=0;for(let i=0;i<4;i++){const c=$(\"hiw-card-\"+i);if(c)c.style.opacity=\"\";}cleared=true;}return;}cleared=false;const stickyTop=140;const rect=track.getBoundingClientRect();const range=Math.max(track.offsetHeight-sticky.offsetHeight,1);const p=clamp(-(rect.top-stickyTop)/range,0,1);// Slide until the LAST card's right edge meets the stage's right edge.\n// Measured from real rects (current shift removed) rather than\n// row.parentElement, which can be a Framer wrapper of a different width.\nconst last=$(\"hiw-card-3\")||row.lastElementChild;const stageRight=sticky.getBoundingClientRect().right;const lastRight=last?last.getBoundingClientRect().right+shift:stageRight;const maxShift=Math.max(lastRight-stageRight,0);shift=p*maxShift;row.style.transform=\"translateX(\"+(-shift).toFixed(1)+\"px)\";row.style.willChange=\"transform\";for(let k=0;k<3;k++){const f=$(\"hiw-fill-\"+k);if(f)f.style.width=(clamp(p*3-k,0,1)*100).toFixed(2)+\"%\";}for(let k=0;k<4;k++){const on=k===0||p*3>=k-.02;const dot=$(\"hiw-dot-\"+k);if(dot)dot.style.opacity=on?\"1\":\"0\";const cp=$(\"hiw-cp-\"+k);if(cp)cp.style.borderColor=on?\"#FF5127\":\"rgba(255,255,255,0.07)\";const card=$(\"hiw-card-\"+k);if(card)card.style.opacity=k===0?\"1\":(.3+.7*clamp(p*3-(k-1),0,1)).toFixed(3);}};const onScroll=()=>{if(!raf)raf=requestAnimationFrame(apply);};apply();window.addEventListener(\"scroll\",onScroll,{passive:true});window.addEventListener(\"resize\",onScroll);return()=>{window.removeEventListener(\"scroll\",onScroll);window.removeEventListener(\"resize\",onScroll);if(raf)cancelAnimationFrame(raf);};},[isStatic,minWidth]);return /*#__PURE__*/_jsx(\"div\",{style:{width:1,height:1}});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollSteps\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollSteps.map"],"mappings":"kLAIG,SAAwB,EAAY,EAAM,CAAC,IAAM,EAAS,EAAoB,EAAQ,EAAS,EAAM,UAAU,KAMo8B,OAN/7B,MAAc,CAAC,GAAG,EAAS,OAAO,IAAM,EAAE,GAAI,SAAS,eAAe,CAAE,EAAQ,GAAO,EAAE,EAAE,IAAI,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAM,EAAI,EAAM,EAAQ,GAAU,EAAM,EAAQ,MAAU,CAAC,EAAI,EAAE,IAAM,EAAM,EAAE,WAAW,EAAQ,EAAO,EAAE,YAAY,EAAQ,EAAI,EAAE,SAAS,EAAE,GAAG,CAAC,GAAO,CAAC,GAAQ,CAAC,EAAI,OAGvZ,IAAM,EAAO,iBAAiB,CAAM,CAAC,CAAC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