{"version":3,"file":"StickyPin.CG4AnRu4.mjs","names":["useRef","useEffect","_jsx","__esmMin","init_ssg_sandbox_shims","window","de","init_jsx_runtime","c","init_npm_react_18_3_1","ce","makePinAtBottom","Component","maxWidth","props","ref","el","update","top","ro","withPinAtBottom","withPinAtBottomPhone","init_StickyPin"],"sources":["https:/framerusercontent.com/modules/urh1s2Vlcb1Jxtsy1BKl/uYR8KkrCk7NjY2cDGNoY/StickyPin.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";// Pins a sticky section once its bottom edge reaches the bottom of the\n// viewport, so tall sections are fully seen before the next one slides over.\n// Use on a layer that is already set to position: sticky.\nfunction makePinAtBottom(Component,maxWidth){return props=>{const ref=useRef(null);useEffect(()=>{const el=ref.current;if(!el)return;const update=()=>{// Only pin while the layer is actually sticky (phone layouts scroll normally)\nel.style.top=\"\";if(maxWidth&&window.innerWidth>maxWidth)return;if(getComputedStyle(el).position!==\"sticky\")return;const top=Math.min(0,window.innerHeight-el.offsetHeight);el.style.top=top+\"px\";};update();const ro=new ResizeObserver(update);ro.observe(el);window.addEventListener(\"resize\",update);return()=>{ro.disconnect();window.removeEventListener(\"resize\",update);};},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref});};}export function withPinAtBottom(Component){return makePinAtBottom(Component);}// Same, but only on the phone breakpoint (below 810px), so desktop and\n// tablet keep their own sticky behaviour.\nexport function withPinAtBottomPhone(Component){return makePinAtBottom(Component,809.98);}\nexport const __FramerMetadata__ = {\"exports\":{\"withPinAtBottomPhone\":{\"type\":\"reactHoc\",\"name\":\"withPinAtBottomPhone\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPinAtBottom\":{\"type\":\"reactHoc\",\"name\":\"withPinAtBottom\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StickyPin.map"],"mappings":"A,uIAGA,SAASW,EAAgBC,EAAUC,EAAS,CAAC,MAAOC,IAAO,CAAC,IAAMC,EAAIf,EAAO,IAAI,EACsS,OADpSC,MAAc,CAAC,IAAMe,EAAGD,EAAI,QAAQ,GAAG,CAACC,EAAG,OAAO,IAAMC,MAAW,CACvF,GAA/DD,EAAG,MAAM,IAAI,GAAMH,GAAUR,EAAO,WAAWQ,GAAmB,iBAAiBG,CAAE,CAAC,CAAC,WAAW,SAAS,OAAO,IAAME,EAAI,KAAK,IAAI,EAAEb,EAAO,YAAYW,EAAG,YAAY,EAAEA,EAAG,MAAM,IAAIE,EAAI,IAAK,EAAED,EAAO,EAAE,IAAME,EAAG,IAAI,eAAeF,CAAM,EAA0D,OAAxDE,EAAG,QAAQH,CAAE,EAAEX,EAAO,iBAAiB,SAASY,CAAM,MAAY,CAACE,EAAG,WAAW,EAAEd,EAAO,oBAAoB,SAASY,CAAM,CAAE,CAAE,EAAE,CAAC,CAAC,EAAsBf,gBAAKU,EAAU,CAAC,GAAGE,EAAUC,KAAG,CAAC,CAAE,CAAE,CAAC,SAAgBK,EAAgBR,EAAU,CAAC,OAAOD,EAAgBC,CAAS,CAAE,CAE9f,SAAgBS,EAAqBT,EAAU,CAAC,OAAOD,EAAgBC,EAAU,MAAM,CAAE,C"}