{"version":3,"file":"ToC_1.Ch_hhTpX.mjs","names":["useRef","useState","ScrollToPlugin"],"sources":["https:/framerusercontent.com/modules/Fi583J1raHRpqZaeMhU3/BBaKAiJZOFgIK2dkpx7T/Blog_FullSizeImage.js","https:/framerusercontent.com/modules/AyKZ0pHt0QgqpXsSW94B/TlAspEd6oBYOs3johqlh/ToC_1.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";export function withFullWidthFramerImage(Component){return props=>{const ref=useRef(null);useEffect(()=>{if(ref.current){const images=ref.current.querySelectorAll(\".framer-image\");images.forEach(img=>{img.style.display=\"block\";img.style.marginLeft=\"auto\";img.style.marginRight=\"auto\";img.style.width=\"100%\";img.style.height=\"auto\"// Maintains aspect ratio\n;});}},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withFullWidthFramerImage\":{\"type\":\"reactHoc\",\"name\":\"withFullWidthFramerImage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Blog_FullSizeImage.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{gsap}from\"gsap\";import{ScrollToPlugin}from\"gsap/ScrollToPlugin\";// For this to work properly you need to\n// Set the table of contents target to have a class of toc-target\ngsap.registerPlugin(ScrollToPlugin);export default function TableOfContents(props){const[tocItems,setTocItems]=useState([]);const[activeSectionId,setActiveSectionId]=useState(\"\");useEffect(()=>{const headings=document.querySelectorAll(\".toc-target h2, .toc-target h3, .toc-target h4, .toc-target h5, .toc-target h6\");const items=Array.from(headings).map((heading,index)=>{const id=heading.id||`toc-target-heading-${index}`;heading.id=id;return{id,title:heading.textContent||\"Untitled\",level:parseInt(heading.tagName.substring(1),10)-1};});setTocItems(items);const onScroll=()=>{let found=false;items.forEach(item=>{const element=document.getElementById(item.id);const bounding=element.getBoundingClientRect();if(bounding.top<window.innerHeight&&bounding.bottom>=0&&!found){setActiveSectionId(item.id);found=true;}});if(!found)setActiveSectionId(\"\");};window.addEventListener(\"scroll\",onScroll);onScroll()// Initial check\n;return()=>window.removeEventListener(\"scroll\",onScroll);},[]);const handleScrollToSection=id=>{gsap.to(window,{duration:1,ease:\"power2.inOut\",scrollTo:{y:`#${id}`,offsetY:props.scrollOffset}});};if(tocItems.length===0){return null// Do not render anything if there are no TOC items\n;}return /*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                .toc-container {\n                    z-index: 1;\n                }\n                .toc-link {\n                    cursor: pointer;\n                    color: ${props.enabledColor};\n                    text-decoration: ${props.textDecoration};\n                    font-family: ${props.fontName};\n                    font-size: ${props.fontSize};\n                    line-height: ${props.lineHeight};\n                    margin: ${props.margins};\n                    width: 100%;\n                    transition: all 0.3s ease-in-out;\n                    padding-left: 0px;\n                    border-left: 2px solid transparent;\n                }\n                .toc-link.active {\n                    color: ${props.hoverColor};\n                    border-left: 2px solid ${props.highlightColor};\n                    padding-left: 8px;\n                }\n                .toc-link:hover {\n                    color: ${props.hoverColor};\n                }\n            `}),/*#__PURE__*/_jsx(\"ul\",{style:{listStyleType:\"none\",padding:0,margin:0},className:\"toc-container\",children:tocItems.map(item=>/*#__PURE__*/_jsx(\"li\",{style:{marginLeft:`${(item.level-1)*props.listMarginLeft}px`},children:/*#__PURE__*/_jsx(\"div\",{className:`toc-link ${activeSectionId===item.id?\"active\":\"\"}`,onClick:()=>handleScrollToSection(item.id),children:item.title})},item.id))})]});}TableOfContents.defaultProps={fontName:\"Inter\",fontSize:\"16px\",lineHeight:\"24px\",listMarginLeft:16,textDecoration:\"None\",enabledColor:\"#000000\",hoverColor:\"#0000FF\",highlightColor:\"#182FFF\",margins:\"4px 0px\",scrollOffset:80};addPropertyControls(TableOfContents,{fontName:{title:\"Font Name\",type:ControlType.String,defaultValue:\"Inter\"},fontSize:{title:\"Font Size\",type:ControlType.String,defaultValue:\"16px\"},lineHeight:{title:\"Line Height\",type:ControlType.String,defaultValue:\"16px\"},textDecoration:{title:\"Text Decoration\",type:ControlType.String,defaultValue:\"None\"},margins:{title:\"Margin\",type:ControlType.String,defaultValue:\"4px 0px\"},enabledColor:{title:\"Enabled Color\",type:ControlType.Color,defaultValue:\"#000000\"},hoverColor:{title:\"Hover Color\",type:ControlType.Color,defaultValue:\"#FF0000\"},highlightColor:{title:\"Highlight Color\",type:ControlType.Color,defaultValue:\"#FF0000\"},listMarginLeft:{title:\"Indentation per level\",description:\"in pixels\",type:ControlType.Number,defaultValue:16},scrollOffset:{title:\"Scroll Offset\",description:\"Use this if you have a sticky nav.\",type:ControlType.Number,defaultValue:80}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TableOfContents\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ToC_1.map"],"mappings":"gRAA+E,SAAgB,EAAyB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAIA,EAAO,IAAI,EAC5J,OAD8J,MAAc,CAAI,EAAI,SAAoE,EAA1C,QAAQ,iBAAiB,eAAsB,CAAC,CAAC,QAAQ,GAAK,CAAC,EAAI,MAAM,QAAQ,QAAQ,EAAI,MAAM,WAAW,OAAO,EAAI,MAAM,YAAY,OAAO,EAAI,MAAM,MAAM,OAAO,EAAI,MAAM,OAAO,MAClZ,CAAC,CAAG,EAAE,CAAC,CAAC,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAU,KAAG,CAAC,CAAE,CAAE,iBAD1B,IAAoC,KCE1C,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,EAAS,GAAaC,EAAS,CAAC,CAAC,EAAO,CAAC,EAAgB,GAAoBA,EAAS,EAAE,EAAE,MAAc,CAAC,IAAM,EAAS,SAAS,iBAAiB,gFAAgF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