{"version":3,"file":"Section_menu.wheQLiHu.mjs","names":["useState","useRef","__esmMin","init_ssg_sandbox_shims","window","_e","de","init_jsx_runtime","c","p","init_npm_react_18_3_1","ce","init_framer_BisrWwwE","addPropertyControls","ControlType","ScrollSpyNav","props","activeSection","setActiveSection","scrollContainerRef","style","sectionNames","name","scrollOffset","observer","entries","entry","formattedId","element","activeLink","container","scrollLeft","handleSectionClick","targetElement","scrollNav","direction","arrowButtonStyle","isActive","e","activeBgColor","activeTextColor","inactiveTextColor","init_Section_menu"],"sources":["https:/framerusercontent.com/modules/3OcdXm1E32GHBlUnbtCj/vpLs3somBFyqEn5a0yy3/Section_menu.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function ScrollSpyNav(props){const{sectionNames,activeBgColor,activeTextColor,inactiveTextColor,scrollOffset}=props;const[activeSection,setActiveSection]=useState(\"\");const scrollContainerRef=useRef(null);// 1. ScrollSpy Logic & CSS Scroll-Margin Injection\nuseEffect(()=>{if(typeof window===\"undefined\")return;// --- BULLETPROOF FIX ---\n// Injects CSS into the page to force the browser to respect your sticky header height\nconst style=document.createElement(\"style\");const cssRules=sectionNames.map(name=>{const formattedId=name.toLowerCase().replace(/\\s+/g,\"-\");return`#${formattedId} { scroll-margin-top: ${scrollOffset}px !important; }`;}).join(\"\\n\");style.innerHTML=cssRules;document.head.appendChild(style);// --- OBSERVER LOGIC ---\nconst observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{if(entry.isIntersecting){setActiveSection(entry.target.id);}});},// Adjusted slightly so the highlight happens when the title clears the sticky header\n{rootMargin:`-${scrollOffset}px 0px -70% 0px`});sectionNames.forEach(name=>{const formattedId=name.toLowerCase().replace(/\\s+/g,\"-\");const element=document.getElementById(formattedId);if(element)observer.observe(element);});return()=>{observer.disconnect();document.head.removeChild(style)// Clean up styles on unmount\n;};},[sectionNames,scrollOffset]);// 2. Auto-scroll the nav bar to keep the active item visible/centered\nuseEffect(()=>{if(activeSection&&scrollContainerRef.current){const activeLink=scrollContainerRef.current.querySelector(`[data-section=\"${activeSection}\"]`);if(activeLink){const container=scrollContainerRef.current;const scrollLeft=activeLink.offsetLeft-container.offsetWidth/2+activeLink.offsetWidth/2;container.scrollTo({left:scrollLeft,behavior:\"smooth\"});}}},[activeSection]);// 3. Smooth scroll (Now uses the native browser behavior which respects our CSS injection)\nconst handleSectionClick=(e,name)=>{e.preventDefault();const formattedId=name.toLowerCase().replace(/\\s+/g,\"-\");const targetElement=document.getElementById(formattedId);if(targetElement){targetElement.scrollIntoView({behavior:\"smooth\",block:\"start\"});}};// 4. Manual horizontal scroll logic for the arrows\nconst scrollNav=direction=>{if(scrollContainerRef.current){const scrollAmount=250;scrollContainerRef.current.scrollBy({left:direction===\"left\"?-scrollAmount:scrollAmount,behavior:\"smooth\"});}};const ArrowLeft=()=>/*#__PURE__*/_jsx(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"#1B4B82\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M19 12H5M12 19l-7-7 7-7\"})});const ArrowRight=()=>/*#__PURE__*/_jsx(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"#1B4B82\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M5 12h14M12 5l7 7-7 7\"})});return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:\"16px\",width:\"100%\",padding:\"10px\"},children:[/*#__PURE__*/_jsx(\"button\",{onClick:()=>scrollNav(\"left\"),style:arrowButtonStyle,children:/*#__PURE__*/_jsx(ArrowLeft,{})}),/*#__PURE__*/_jsxs(\"div\",{ref:scrollContainerRef,style:{display:\"flex\",gap:\"8px\",overflowX:\"auto\",padding:\"4px\",backgroundColor:\"white\",borderRadius:\"50px\",border:\"1px solid #EBECEF\",boxShadow:\"0px 16px 20px rgba(0, 0, 0, 0.09)\",flex:1,scrollbarWidth:\"none\",msOverflowStyle:\"none\",position:\"relative\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`div::-webkit-scrollbar { display: none; }`}),sectionNames.map(name=>{const formattedId=name.toLowerCase().replace(/\\s+/g,\"-\");const isActive=activeSection===formattedId;return /*#__PURE__*/_jsx(\"a\",{href:`#${formattedId}`,\"data-section\":formattedId,onClick:e=>handleSectionClick(e,name),style:{padding:\"12px 24px\",borderRadius:\"30px\",backgroundColor:isActive?activeBgColor:\"transparent\",color:isActive?activeTextColor:inactiveTextColor,fontWeight:isActive?\"500\":\"400\",textDecoration:\"none\",whiteSpace:\"nowrap\",fontFamily:\"Inter, sans-serif\",fontSize:\"15px\",transition:\"all 0.3s ease\",cursor:\"pointer\"},children:name},name);})]}),/*#__PURE__*/_jsx(\"button\",{onClick:()=>scrollNav(\"right\"),style:arrowButtonStyle,children:/*#__PURE__*/_jsx(ArrowRight,{})})]});}const arrowButtonStyle={display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"48px\",height:\"48px\",borderRadius:\"50%\",backgroundColor:\"white\",border:\"1px solid #EBECEF\",boxShadow:\"0px 16px 20px rgba(0, 0, 0, 0.09)\",cursor:\"pointer\",flexShrink:0,transition:\"transform 0.2s ease\"};addPropertyControls(ScrollSpyNav,{sectionNames:{type:ControlType.Array,control:{type:ControlType.String},defaultValue:[\"Introduction\",\"Features\",\"Eligibility\",\"Benefits\",\"Required Documents\",\"Process\",\"FAQ\"],title:\"Section Names\"},scrollOffset:{type:ControlType.Number,defaultValue:160,min:0,max:500,title:\"Top Offset (px)\"},activeBgColor:{type:ControlType.Color,defaultValue:\"#3b5b82\",title:\"Active BG Color\"},activeTextColor:{type:ControlType.Color,defaultValue:\"#FFFFFF\",title:\"Active Text\"},inactiveTextColor:{type:ControlType.Color,defaultValue:\"#000000\",title:\"Inactive Text\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollSpyNav\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Section_menu.map"],"mappings":"A,6MAA0J,SAAwBe,EAAa,EAAM,CAAC,GAAK,CAAC,eAAa,gBAAc,kBAAgB,oBAAkB,gBAAcC,EAAW,CAACC,EAAcC,GAAkBlB,EAAS,EAAE,EAAQmB,EAAmBlB,EAAO,IAAI,EACpXU,MAAc,CAAC,GAAUP,IAAS,OAAY,OAE9C,IAAMgB,EAAM,SAAS,cAAc,OAAO,EAA6L,EAAM,UAAlLC,EAAa,IAAI,GAAsE,IAA7CC,EAAK,YAAY,CAAC,CAAC,QAAQ,OAAO,GAAyB,EAAE,wBAAwBC,EAAa,iBAAmB,CAAC,CAAC,KAAK;CAA6B,EAAE,SAAS,KAAK,YAAYH,CAAK,EAC/R,IAAMI,EAAS,IAAI,qBAAqB,GAAS,CAACC,EAAQ,QAAQ,GAAO,CAAIC,EAAM,gBAAgBR,EAAiBQ,EAAM,OAAO,EAAE,CAAG,CAAC,CAAE,EACzI,CAAC,WAAW,IAAIH,EAAa,gBAAgB,CAAC,EAAkL,OAAhLF,EAAa,QAAQ,GAAM,CAAC,IAAMM,EAAYL,EAAK,YAAY,CAAC,CAAC,QAAQ,OAAO,GAAG,EAAQM,EAAQ,SAAS,eAAeD,CAAW,EAAKC,GAAQJ,EAAS,QAAQI,CAAO,CAAE,CAAC,MAAY,CAACJ,EAAS,WAAW,EAAE,SAAS,KAAK,YAAYJ,CAAK,CAC/R,CAAE,EAAE,CAACC,EAAaE,CAAY,CAAC,EAChCZ,MAAc,CAAC,GAAGM,GAAeE,EAAmB,QAAQ,CAAC,IAAMU,EAAWV,EAAmB,QAAQ,cAAc,kBAAkBF,EAAc,GAAG,EAAE,GAAGY,EAAW,C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