{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/WHhM5RoDFqoT9Ya8Ru5L/zxXhq9Apgm6af1qwdNaK/CMS_Scroll_Bar.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export default function TableOfContents(props){const[headings,setHeadings]=useState([]);const[activeId,setActiveId]=useState(\"\");useEffect(()=>{// Get all h1-h6 elements from the content\nconst elements=document.querySelectorAll(\"h3, h5\");const headingElements=Array.from(elements);// Add IDs to headings if they don't have them\nheadingElements.forEach(heading=>{if(!heading.id){var _heading_textContent;heading.id=((_heading_textContent=heading.textContent)===null||_heading_textContent===void 0?void 0:_heading_textContent.toLowerCase().replace(/[^a-z0-9]+/g,\"-\").replace(/(^-|-$)+/g,\"\"))||\"\";}});setHeadings(headingElements);// Set up intersection observer\nconst observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{if(entry.isIntersecting){setActiveId(entry.target.id);}});},{rootMargin:\"-20% 0px -80% 0px\"});// Observe all headings\nheadingElements.forEach(element=>observer.observe(element));return()=>observer.disconnect();},[props.content]);const handleClick=id=>{const element=document.getElementById(id);if(element){const offset=120;const elementPosition=element.getBoundingClientRect().top;const offsetPosition=elementPosition+window.pageYOffset-offset;window.scrollTo({top:offsetPosition,behavior:\"smooth\"});}};return /*#__PURE__*/_jsx(\"nav\",{className:\"toc\",style:{height:\"100%\",width:\"100%\",overflow:\"auto\",boxSizing:\"border-box\",display:\"flex\",flexDirection:\"column\",gap:\"20px\"},children:headings.map(heading=>/*#__PURE__*/_jsx(motion.div,{style:{marginLeft:`0px`},children:/*#__PURE__*/_jsx(motion.a,{href:`#${heading.id}`,onClick:e=>{e.preventDefault();handleClick(heading.id);},style:{color:activeId===heading.id?\"#4965F2\":\"#1a1a1a\",textDecoration:\"none\",fontSize:16,fontWeight:600,fontFamily:\"General Sans\",display:\"block\",transition:\"all 0.2s ease\"},whileHover:{x:5},children:heading.textContent})},heading.id))});}// Add Framer property controls\naddPropertyControls(TableOfContents,{content:{type:ControlType.String,title:\"Content Field\",defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TableOfContents\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CMS_Scroll_Bar.map"],
  "mappings": "uJAAsL,SAARA,EAAiCC,EAAM,CAAC,GAAK,CAACC,EAASC,CAAW,EAAEC,EAAS,CAAC,CAAC,EAAO,CAACC,EAASC,CAAW,EAAEF,EAAS,EAAE,EAAEG,EAAU,IAAI,CACtT,IAAMC,EAAS,SAAS,iBAAiB,QAAQ,EAAQC,EAAgB,MAAM,KAAKD,CAAQ,EAC5FC,EAAgB,QAAQC,GAAS,CAAC,GAAG,CAACA,EAAQ,GAAG,CAAC,IAAIC,EAAqBD,EAAQ,KAAKC,EAAqBD,EAAQ,eAAe,MAAMC,IAAuB,OAAO,OAAOA,EAAqB,YAAY,EAAE,QAAQ,cAAc,GAAG,EAAE,QAAQ,YAAY,EAAE,IAAI,EAAG,CAAC,CAAC,EAAER,EAAYM,CAAe,EACzS,IAAMG,EAAS,IAAI,qBAAqBC,GAAS,CAACA,EAAQ,QAAQC,GAAO,CAAIA,EAAM,gBAAgBR,EAAYQ,EAAM,OAAO,EAAE,CAAG,CAAC,CAAE,EAAE,CAAC,WAAW,mBAAmB,CAAC,EACtK,OAAAL,EAAgB,QAAQM,GAASH,EAAS,QAAQG,CAAO,CAAC,EAAQ,IAAIH,EAAS,WAAW,CAAE,EAAE,CAACX,EAAM,OAAO,CAAC,EAAE,IAAMe,EAAYC,GAAI,CAAC,IAAMF,EAAQ,SAAS,eAAeE,CAAE,EAAE,GAAGF,EAAQ,CAA4E,IAAMG,EAA1CH,EAAQ,sBAAsB,EAAE,IAAyCI,EAAO,YAAY,IAAOA,EAAO,SAAS,CAAC,IAAID,EAAe,SAAS,QAAQ,CAAC,CAAE,CAAC,EAAE,OAAoBE,EAAK,MAAM,CAAC,UAAU,MAAM,MAAM,CAAC,OAAO,OAAO,MAAM,OAAO,SAAS,OAAO,UAAU,aAAa,QAAQ,OAAO,cAAc,SAAS,IAAI,MAAM,EAAE,SAASlB,EAAS,IAAIQ,GAAsBU,EAAKC,EAAO,IAAI,CAAC,MAAM,CAAC,WAAW,KAAK,EAAE,SAAsBD,EAAKC,EAAO,EAAE,CAAC,KAAK,IAAIX,EAAQ,EAAE,GAAG,QAAQY,GAAG,CAACA,EAAE,eAAe,EAAEN,EAAYN,EAAQ,EAAE,CAAE,EAAE,MAAM,CAAC,MAAML,IAAWK,EAAQ,GAAG,UAAU,UAAU,eAAe,OAAO,SAAS,GAAG,WAAW,IAAI,WAAW,eAAe,QAAQ,QAAQ,WAAW,eAAe,EAAE,WAAW,CAAC,EAAE,CAAC,EAAE,SAASA,EAAQ,WAAW,CAAC,CAAC,EAAEA,EAAQ,EAAE,CAAC,CAAC,CAAC,CAAE,CACp+Ba,EAAoBvB,EAAgB,CAAC,QAAQ,CAAC,KAAKwB,EAAY,OAAO,MAAM,gBAAgB,aAAa,EAAE,CAAC,CAAC",
  "names": ["TableOfContents", "props", "headings", "setHeadings", "ye", "activeId", "setActiveId", "ue", "elements", "headingElements", "heading", "_heading_textContent", "observer", "entries", "entry", "element", "handleClick", "id", "offsetPosition", "window", "p", "motion", "e", "addPropertyControls", "ControlType"]
}
