{"version":3,"file":"TimelineRailFX.B03CCpTH.mjs","names":["useState","useRef","__esmMin","init_ssg_sandbox_shims","window","_e","de","c","init_jsx_runtime","init_npm_react_18_3_1","ce","withStickyTop","wide","setWide","check","PIN_FROM","Component","props","OFFSET","init_StickyTopFX","withTimelineRail","ref","root","markers","stages","fill","track","reduced","raf","last","paint","i","on","j","m","ACTIVE","IDLE","label","STEP","onScroll","mid","best","bestD","r","s","d","first","span","done","p","init_TimelineRailFX"],"sources":["https:/framerusercontent.com/modules/Lbr7Tjjzu5QzLielQN0o/CvOhfa1OZkcywlcCospG/StickyTopFX.js","https:/framerusercontent.com/modules/wvZ0C3a1Tqs17Dk4OqRE/IMwjnsvGPpB0unE1JNbg/TimelineRailFX.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";// FX — Sticky Offset. Framer's DSL will not write a `top` value onto a stack child, so a layer\n// marked position:sticky ships with top:auto and never pins. This supplies it.\n//\n// ⚠️ DESKTOP ONLY, and that gating is not optional. Below the breakpoint the rail is\n// position:relative, and a `top` on a relative box does not pin it, it SHIFTS IT DOWN — which\n// on Callow opened a dead gap and pushed a form out through the bottom of its section.\nconst PIN_FROM=1200;const OFFSET=96;export function withStickyTop(Component){return function StickyTop(props){const[wide,setWide]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;const check=()=>setWide(window.innerWidth>=PIN_FROM);check();window.addEventListener(\"resize\",check);return()=>window.removeEventListener(\"resize\",check);},[]);return /*#__PURE__*/_jsx(Component,{...props,style:wide?{...props.style,top:OFFSET}:props.style});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withStickyTop\":{\"type\":\"reactHoc\",\"name\":\"withStickyTop\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StickyTopFX.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";// FX — Timeline Rail. Binds the pinned rail to the stage on screen, and draws the\n// rule down it as you move through the year.\n//\n// ⚠️ WHY THIS IS CODE. Framer's own scroll targets SNAP rather than scrub, and\n// onScroll truncates a section list to two, so a native binding cannot drive five\n// states or a continuous fill. This reads each stage's box against the viewport\n// centre and measures progress across the whole run.\n//\n// No content lives here. Every label and every elapsed figure is a text layer the\n// buyer edits. Delete this and the rail is a static list that still reads correctly,\n// it simply stops following you.\nconst ACTIVE=\"rgb(34, 31, 27)\";const IDLE=\"rgb(110, 103, 94)\"// Stone 600, 5.12:1 on the ground (was 3.02:1)\n;const STEP=8;export function withTimelineRail(Component){return function TimelineRail(props){const ref=useRef(null);useEffect(()=>{const root=ref.current;if(!root||typeof window===\"undefined\")return;const markers=Array.from(root.querySelectorAll('[data-framer-name^=\"Marker — \"]'));const stages=Array.from(root.querySelectorAll('[data-framer-name^=\"Stage — \"]'));const fill=root.querySelector('[data-framer-name=\"Track Fill\"]');const track=root.querySelector('[data-framer-name=\"Track\"]');if(!markers.length||markers.length!==stages.length)return;const reduced=window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;let raf=0;let last=-1;const paint=i=>{if(i===last)return;last=i;markers.forEach((m,j)=>{const on=j===i;const parts=Array.from(m.querySelectorAll(\"p\"));parts.forEach(t=>{t.style.transition=reduced?\"none\":\"color 260ms ease\";t.style.color=on?ACTIVE:IDLE;});const label=m.querySelector('[data-framer-name=\"Marker Label\"]');if(label){label.style.transition=reduced?\"none\":\"transform 260ms cubic-bezier(0.16,1,0.3,1)\";label.style.transform=on?`translateX(${STEP}px)`:\"translateX(0px)\";}m.setAttribute(\"aria-current\",on?\"step\":\"false\");});};const onScroll=()=>{cancelAnimationFrame(raf);raf=requestAnimationFrame(()=>{const mid=window.innerHeight/2;let best=0;let bestD=Infinity;stages.forEach((s,i)=>{const r=s.getBoundingClientRect();const d=Math.abs(r.top+r.height/2-mid);if(d<bestD){bestD=d;best=i;}});paint(best);if(fill&&track&&stages.length){const first=stages[0].getBoundingClientRect();const lastR=stages[stages.length-1].getBoundingClientRect();const span=lastR.bottom-first.top;const done=span>0?(mid-first.top)/span:0;const p=Math.max(0,Math.min(1,done));fill.style.height=Math.round(track.getBoundingClientRect().height*p)+\"px\";}});};onScroll();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\":{\"withTimelineRail\":{\"type\":\"reactHoc\",\"name\":\"withTimelineRail\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TimelineRailFX.map"],"mappings":"A,8IAMoC,SAAgBW,EAAc,EAAU,CAAC,OAAO,SAAmB,EAAM,CAAC,GAAK,CAACC,EAAKC,GAASb,EAAS,EAAK,EAAuN,OAArNU,MAAc,CAAC,GAAUN,IAAS,OAAY,OAAO,IAAMU,MAAUD,EAAQT,EAAO,YAAYW,CAAQ,EAAkD,OAAhDD,EAAM,EAAEV,EAAO,iBAAiB,SAASU,CAAK,MAAYV,EAAO,oBAAoB,SAASU,CAAK,CAAE,EAAE,CAAC,CAAC,EAAsB,gBAAKE,EAAU,CAAC,GAAGC,EAAM,MAAML,EAAK,CAAC,GAAGK,EAAM,MAAM,IAAIC,CAAM,EAAED,EAAM,KAAK,CAAC,CAAE,CAAE,C,kDAArc,EAAS,KAAW,EAAO,E,OCMnB,SAAgBG,EAAiB,EAAU,CAAC,OAAO,SAAsB,EAAM,CAAC,IAAMC,EAAIpB,EAAO,IAAI,EAA02D,OAAx2DS,MAAc,CAAC,IAAMY,EAAKD,EAAI,QAAQ,GAAG,CAACC,GAAalB,IAAS,OAAY,OAAO,IAAMmB,EAAQ,MAAM,KAAKD,EAAK,iBAAiB,iCAAiC,CAAC,EAAQE,EAAO,MAAM,KAAKF,EAAK,iBAAiB,gCA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