{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/RrgaH2dTM7ajTeKyxPg3/c6huhi3upEcVvS2bJqDK/TableOfContent.js", "ssg:https://framerusercontent.com/modules/xKMMmCLHiNf5uyHgLgTo/STaXRSqRrrTlggnk2DHR/tpNv4JwJI.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{useEffect,useState}from\"react\";// Made with love by Cl\u00E9ment. https://lionneclement.com/\n// Full tutorial: https://lionneclement.com/tutorial/how-to-create-table-of-contents-cms-collections-framer\n//UPDATE:\n//This is a modified version in collaboration with Tay Rush. https://twitter.com/taylorrushmore\n// https://www.youtube.com/@taylorrushmore/\nconst HEADING_TO_DISPLAY=[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"];const SCROLL_MARGIN_TOP=160;const onHoverStyle={opacity:.75,cursor:\"pointer\"};const useStore=createStore({headings:[]});export function withTableOfContent(Component){return props=>{const[store]=useStore();const[activeSection,setActiveSection]=useState(\"\");const scrollToId=id=>{const element=document.getElementById(id);if(element){element.scrollIntoView({behavior:\"smooth\"});}};useEffect(()=>{const handleScroll=()=>{const sections=store.headings.map(heading=>document.getElementById(heading.id));const scrollPosition=window.scrollY-650;for(let i=sections.length-1;i>=0;i--){if(sections[i].offsetTop<=scrollPosition){setActiveSection(store.headings[i].id);break;}}};window.addEventListener(\"scroll\",handleScroll);return()=>{window.removeEventListener(\"scroll\",handleScroll);};},[store.headings]);return /*#__PURE__*/_jsx(_Fragment,{children:store.headings.length>0&&window?store.headings.sort((a,b)=>a.originalIndex-b.originalIndex).filter(({type})=>HEADING_TO_DISPLAY.includes(type)).map(({id,heading,type},index)=>/*#__PURE__*/_jsx(Component,{...props,variant:activeSection===id?`${type}-active`:type,title:heading,onClick:()=>scrollToId(id),whileHover:onHoverStyle})):/*#__PURE__*/_jsx(Component,{...props})});};}export function withContent(Component){return props=>{const[store,setStore]=useStore();const[newProps,setNewProps]=useState(props);useEffect(()=>{setStore({headings:formatTableOfContent(newProps.children.props.children)});},[newProps]);useEffect(()=>{const formatHeadings=()=>{const newChildren=[];props.children.props.children.length>0&&props.children.props.children.forEach((item,index)=>{const children=item.props.children;if([\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"].includes(item.type)){const{formattedId}=formatHeading(children,index);// Create a new object for the modified item\nconst newItem={...item,props:{...item.props,id:formattedId}};newChildren.push(newItem);}else{newChildren.push(item);}});// Return a new props object with the modified children\nreturn{...props,children:{...props.children,props:{...props.children.props,children:newChildren}}};};setNewProps(formatHeadings());},[props]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`.framer-text {\n                    scroll-margin-top: ${SCROLL_MARGIN_TOP}px;\n                }`}),/*#__PURE__*/_jsx(Component,{...newProps})]});};}const formatTableOfContent=children=>{const result=[];children.length>0&&children.filter(({type})=>[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"].includes(type)).map((item,index)=>{const children=item.props.children;const{formattedId,formattedHeading}=formatHeading(children,index);result.push({id:formattedId,heading:formattedHeading,type:item.type,originalIndex:index});});return result;};const formatHeading=(children,index)=>{let formattedHeading=\"\";let formattedId=\"\";if(typeof children===\"string\"){formattedHeading=children;}else if(Array.isArray(children)){formattedHeading=children.map(item=>{console.log(\"item\",item);if(typeof item===\"string\")return item.trim();if(item.type===\"br\")return\"\";return item.props.children.trim();}).join(\" \");}else if(typeof children===\"object\"){if(typeof children.props.children===\"string\"){formattedHeading=children.props.children;}}else{formattedHeading=index.toString();}formattedId=formattedHeading.trim().toLowerCase().replace(/[^a-z]+/g,\"-\").replace(/^-+|-+$/g,\"\");return{formattedId,formattedHeading};};\nexport const __FramerMetadata__ = {\"exports\":{\"withContent\":{\"type\":\"reactHoc\",\"name\":\"withContent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTableOfContent\":{\"type\":\"reactHoc\",\"name\":\"withTableOfContent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TableOfContent.map", "// Generated by Framer (0afc761)\nimport{fontStore}from\"framer\";fontStore.loadFonts([\"GF;IBM Plex Sans-700\",\"GF;IBM Plex Sans-700italic\"]);export const fonts=[{explicitInter:true,fonts:[{family:\"IBM Plex Sans\",openType:true,source:\"google\",style:\"normal\",url:\"https://fonts.gstatic.com/s/ibmplexsans/v21/zYXGKVElMYYaJe8bpLHnCwDKr932-G7dytD-Dmu1swZSAXcomDVmadSDDV5zBaI5loa26g.woff2\",weight:\"700\"},{family:\"IBM Plex Sans\",openType:true,source:\"google\",style:\"italic\",url:\"https://fonts.gstatic.com/s/ibmplexsans/v21/zYXEKVElMYYaJe8bpLHnCwDKhdTEG46kmUZQCX598fQbM4jw8V78x9OWIhp8RKg4tIOm6vje.woff2\",weight:\"700\"}]}];export const css=[\".framer-dd5uk .framer-styles-preset-neypcw:not(.rich-text-wrapper), .framer-dd5uk .framer-styles-preset-neypcw.rich-text-wrapper h1 { --framer-font-family: \\\"IBM Plex Sans\\\", \\\"IBM Plex Sans Placeholder\\\", sans-serif; --framer-font-family-italic: \\\"IBM Plex Sans\\\", \\\"IBM Plex Sans Placeholder\\\", sans-serif; --framer-font-open-type-features: 'blwf' on, 'cv09' on, 'cv03' on, 'cv04' on, 'cv11' on; --framer-font-size: 40px; --framer-font-style: normal; --framer-font-style-italic: italic; --framer-font-variation-axes: normal; --framer-font-weight: 700; --framer-font-weight-italic: 700; --framer-letter-spacing: -0.04em; --framer-line-height: 1.4em; --framer-paragraph-spacing: 0px; --framer-text-alignment: start; --framer-text-color: var(--token-4d6c804b-293b-43c4-9966-4ac7f15f6d03, #d0d6e0); --framer-text-decoration: none; --framer-text-stroke-color: initial; --framer-text-stroke-width: initial; --framer-text-transform: none; }\"];export const className=\"framer-dd5uk\";\nexport const __FramerMetadata__ = {\"exports\":{\"fonts\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"className\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"css\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],
  "mappings": "4LAKA,IAAMA,EAAmB,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,IAAI,EAAQC,EAAkB,IAAUC,EAAa,CAAC,QAAQ,IAAI,OAAO,SAAS,EAAQC,EAASC,EAAY,CAAC,SAAS,CAAC,CAAC,CAAC,EAAS,SAASC,EAAmBC,EAAU,CAAC,OAAOC,GAAO,CAAC,GAAK,CAACC,CAAK,EAAEL,EAAS,EAAO,CAACM,EAAcC,CAAgB,EAAEC,EAAS,EAAE,EAAQC,EAAWC,GAAI,CAAC,IAAMC,EAAQ,SAAS,eAAeD,CAAE,EAAKC,GAASA,EAAQ,eAAe,CAAC,SAAS,QAAQ,CAAC,CAAG,EAAE,OAAAC,EAAU,IAAI,CAAC,IAAMC,EAAa,IAAI,CAAC,IAAMC,EAAST,EAAM,SAAS,IAAIU,GAAS,SAAS,eAAeA,EAAQ,EAAE,CAAC,EAAQC,EAAeC,EAAO,QAAQ,IAAI,QAAQC,EAAEJ,EAAS,OAAO,EAAEI,GAAG,EAAEA,IAAK,GAAGJ,EAASI,CAAC,EAAE,WAAWF,EAAe,CAACT,EAAiBF,EAAM,SAASa,CAAC,EAAE,EAAE,EAAE,KAAM,CAAE,EAAE,OAAAD,EAAO,iBAAiB,SAASJ,CAAY,EAAQ,IAAI,CAACI,EAAO,oBAAoB,SAASJ,CAAY,CAAE,CAAE,EAAE,CAACR,EAAM,QAAQ,CAAC,EAAsBc,EAAKC,EAAU,CAAC,SAASf,EAAM,SAAS,OAAO,GAAGY,EAAOZ,EAAM,SAAS,KAAK,CAACgB,EAAEC,IAAID,EAAE,cAAcC,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,KAAAC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,YAAAL,EAAY,iBAAAK,CAAgB,CAAE,ECRhjCC,EAAU,UAAU,CAAC,uBAAuB,4BAA4B,CAAC,EAAS,IAAMC,EAAM,CAAC,CAAC,cAAc,GAAK,MAAM,CAAC,CAAC,OAAO,gBAAgB,SAAS,GAAK,OAAO,SAAS,MAAM,SAAS,IAAI,2HAA2H,OAAO,KAAK,EAAE,CAAC,OAAO,gBAAgB,SAAS,GAAK,OAAO,SAAS,MAAM,SAAS,IAAI,6HAA6H,OAAO,KAAK,CAAC,CAAC,CAAC,EAAeC,EAAI,CAAC,i6BAAy6B,EAAeC,EAAU",
  "names": ["HEADING_TO_DISPLAY", "SCROLL_MARGIN_TOP", "onHoverStyle", "useStore", "createStore", "withTableOfContent", "Component", "props", "store", "activeSection", "setActiveSection", "ye", "scrollToId", "id", "element", "ue", "handleScroll", "sections", "heading", "scrollPosition", "window", "i", "p", "l", "a", "b", "type", "index", "withContent", "setStore", "newProps", "setNewProps", "formatTableOfContent", "newChildren", "item", "children", "formattedId", "formatHeading", "newItem", "u", "result", "formattedHeading", "fontStore", "fonts", "css", "className"]
}
