{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/xKEdCtUgx6JlkIG5emeQ/q8TrPTU6giJXE1kYHtEE/TableOfContents.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{cloneElement}from\"react\";const headingLinkOffset=-24;const headingIdPrefix=\"\";const headingTypes=[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"];export function TableOfContentsOverride(Component){return props=>{var _props_children_props,_props_children;const children=props===null||props===void 0?void 0:(_props_children=props.children)===null||_props_children===void 0?void 0:(_props_children_props=_props_children.props)===null||_props_children_props===void 0?void 0:_props_children_props.children;if(children){const newChildren=[];const headings=[];const ids=[];let i=0;while(i<children.length){var _child_props;const child=children[i];const text=child===null||child===void 0?void 0:(_child_props=child.props)===null||_child_props===void 0?void 0:_child_props.children;if(typeof text==\"string\"&&headingTypes.includes(child.type)){let id=headingIdPrefix+text.toLowerCase().trim().replace(/[^a-z0-9\\s]/g,\"\").replace(/\\s+/g,\"-\").replace(/-+/g,\"-\");if(ids.includes(id)){for(let j=2;j<100;j++){if(!ids.includes(`${id}-${j}`)){id=`${id}-${j}`;break;}}}headings.push(text);ids.push(id);newChildren.push(/*#__PURE__*/cloneElement(child,{style:{...child.props.style,position:\"relative\"}},/*#__PURE__*/_jsx(\"div\",{id:id,style:{position:\"absolute\",pointerEvents:\"none\",top:headingLinkOffset}}),child.props.children));}else if(child.type===\"img\"){// Add lazy loading to images\nnewChildren.push(/*#__PURE__*/cloneElement(child,{loading:\"lazy\"}));}else{newChildren.push(child);}i++;}const component=/*#__PURE__*/_jsx(Component,{...props});return /*#__PURE__*/cloneElement(component,{\"data-framestack-heading-titles\":JSON.stringify(headings),\"data-framestack-heading-ids\":JSON.stringify(ids),children:{...component.props.children,props:{...component.props.children.props,children:newChildren}}});}return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"TableOfContentsOverride\":{\"type\":\"reactHoc\",\"name\":\"TableOfCont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,EAAG,MAAM,CAAC,SAAS,WAAW,cAAc,OAAO,IAAIhB,CAAiB,CAAC,CAAC,EAAEc,EAAM,MAAM,QAAQ,CAAC,CAAE,MAASA,EAAM,OAAO,MACr1CL,EAAY,KAAkBS,EAAaJ,EAAM,CAAC,QAAQ,MAAM,CAAC,CAAC,EAAQL,EAAY,KAAKK,CAAK,EAAGF,GAAI,CAAC,IAAMQ,EAAuBD,EAAKf,EAAU,CAAC,GAAGC,CAAK,CAAC,EAAE,OAAoBa,EAAaE,EAAU,CAAC,iCAAiC,KAAK,UAAUV,CAAQ,EAAE,8BAA8B,KAAK,UAAUC,CAAG,EAAE,SAAS,CAAC,GAAGS,EAAU,MAAM,SAAS,MAAM,CAAC,GAAGA,EAAU,MAAM,SAAS,MAAM,SAASX,CAAW,CAAC,CAAC,CAAC,CAAE,CAAC,OAAoBU,EAAKf,EAAU,CAAC,GAAGC,CAAK,CAAC,CAAE,CAAE",
  "names": ["headingLinkOffset", "headingIdPrefix", "headingTypes", "TableOfContentsOverride", "Component", "props", "_props_children_props", "_props_children", "children", "newChildren", "headings", "ids", "i", "_child_props", "child", "text", "id", "j", "q", "p", "component"]
}
