{"version":3,"file":"PlatformSectionScroll.BMW13qlb.mjs","names":["useEffect","_jsx","__esmMin","init_ssg_sandbox_shims","init_jsx_runtime","c","init_npm_react_18_3_1","ce","window","stickyOffset","el","cs","t","naturalTop","prev","y","node","scrollToId","id","smooth","top","readTarget","KEY","h","SectionScroll","onClick","m","fromLink","timers","target","init_PlatformSectionScroll"],"sources":["https:/framerusercontent.com/modules/iofdn1jEFxoRzMhFKXQK/z0QlMndzakg9oJ6cLdWi/PlatformSectionScroll.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";// Section scroll helper (placed on the Home page and the Platform page).\n// The Platform cards are sticky with scroll effects, so Framer's own jump to\n// a section overshoots and the next cards cover the one that was clicked.\n// Home page: remembers which Platform section a link points to.\n// Platform page: scrolls so that card sits on top of the stack.\nconst KEY=\"drisk-section-target\";function stickyOffset(el){const cs=getComputedStyle(el);// Not sticky (phone): leave room for the top menu bar.\nif(cs.position!==\"sticky\")return 80;const t=parseFloat(cs.top);return isNaN(t)?0:t;}// Where the card sits in the page before it sticks (ignores transforms).\nfunction naturalTop(el){const prev=el.style.position;el.style.position=\"static\";let y=0;let node=el;while(node){y+=node.offsetTop;node=node.offsetParent;}el.style.position=prev;return y;}function scrollToId(id,smooth){const el=document.getElementById(id);if(!el)return false;const top=Math.max(0,naturalTop(el)-stickyOffset(el));window.scrollTo({top,behavior:smooth?\"smooth\":\"auto\"});return true;}function readTarget(){let id=\"\";try{id=sessionStorage.getItem(KEY)||\"\";sessionStorage.removeItem(KEY);}catch(e){}if(id)return{id,fromLink:true};const h=decodeURIComponent(window.location.hash.slice(1));if(h&&/^[\\w-]+$/.test(h))id=h;return{id,fromLink:false};}/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function SectionScroll(){useEffect(()=>{if(typeof window===\"undefined\")return;// Remember the section when a link to /platform#section is clicked.\nconst onClick=e=>{const a=e.target?.closest?.(\"a\");const href=a?.getAttribute(\"href\")||\"\";const m=href.match(/platform\\/?#([\\w-]+)/);if(!m)return;try{sessionStorage.setItem(KEY,m[1]);}catch(err){}};document.addEventListener(\"click\",onClick,true);// On arrival, scroll to the remembered section. Retries run after\n// Framer's own jump and while images and fonts settle.\nconst{id,fromLink}=readTarget();const timers=[];const target=id?document.getElementById(id):null;// Correct links from the Home cards and the sticky Platform cards;\n// other anchors work as normal.\nif(target&&(fromLink||getComputedStyle(target).position===\"sticky\")){[60,350,900,1600].forEach(t=>timers.push(setTimeout(()=>scrollToId(id,false),t)));}return()=>{document.removeEventListener(\"click\",onClick,true);timers.forEach(clearTimeout);};},[]);// Invisible placeholder so the canvas has something to render.\nreturn /*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{width:\"100%\",height:\"100%\",pointerEvents:\"none\"}});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SectionScroll\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PlatformSectionScroll.map"],"mappings":"A,gIAKiC,SAASS,EAAaC,EAAG,CAAC,IAAMC,EAAG,iBAAiBD,CAAE,EACvF,GAAGC,EAAG,WAAW,SAAS,MAAO,IAAG,IAAMC,EAAE,WAAWD,EAAG,GAAG,EAAE,OAAO,MAAMC,CAAC,EAAE,EAAEA,CAAE,CACnF,SAASC,EAAWH,EAAG,CAAC,IAAMI,EAAKJ,EAAG,MAAM,SAASA,EAAG,MAAM,SAAS,SAAS,IAAIK,EAAE,EAAMC,EAAKN,EAAG,KAAMM,GAAMD,GAAGC,EAAK,UAAUA,EAAKA,EAAK,aAAqC,MAAvBN,GAAG,MAAM,SAASI,EAAYC,CAAE,CAAC,SAASE,EAAWC,EAAGC,EAAO,CAAC,IAAMT,EAAG,SAAS,eAAeQ,CAAE,EAAE,G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