{"version":3,"file":"BlogContents.CtaPXhke.mjs","names":["__esmMin","init_npm_react_18_3_1","window","ce","init_jsx_runtime","c","p","init_ssg_sandbox_shims","addPropertyControls","init_framer_BWFVvmND","ControlType","BlogContents","props","ids","items","slug","it","heads","want","norm","el","h","i","offset","hash","go","id","reduce","styles","title","css","BLUE","INK","SURFACE","HAIR","DISPLAY","BODY","__FramerMetadata__","init_BlogContents","s","\"exports\"","\"default\"","\"type\"","\"name\"","\"slots\"","\"annotations\"","\"framerSupportedLayoutWidth\"","\"framerSupportedLayoutHeight\"","\"framerContractVersion\"","\"__FramerMetadata__\""],"sources":["https:/framerusercontent.com/modules/Br9YpaWVFNTAlQPmKzDw/cetZWOpFpPOWcWfiIfvL/BlogContents.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const BLUE=\"var(--token-ec97e04b-5c71-4c59-9ee6-2ff4b796445f, rgb(0, 60, 126))\";const INK=\"var(--token-c68e3660-eb25-4b35-9444-e958e7126dc2, rgb(10, 10, 10))\";const SURFACE=\"var(--token-644b04f6-09a6-4c8e-8937-d877ea913b89, rgb(252, 252, 252))\";const HAIR=\"var(--token-1bda220a-9120-4189-862b-8bb0f2f10893, rgba(6, 6, 58, 0.13))\";const DISPLAY='\"Poppins\", \"Poppins Placeholder\", sans-serif';const BODY='\"Open Sans\", \"Open Sans Placeholder\", sans-serif';const norm=s=>(s||\"\").replace(/[‘’]/g,\"'\").replace(/\\s+/g,\" \").trim().toLowerCase();const slug=s=>norm(s).replace(/'/g,\"\").replace(/[^a-z0-9]+/g,\"-\").replace(/^-+|-+$/g,\"\");/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function BlogContents(props){const{title,items=[],offset=110}=props;const ids=items.map(it=>slug(it.heading||it.label));useEffect(()=>{if(typeof document===\"undefined\")return;const heads=Array.from(document.querySelectorAll(\"h2\"));items.forEach((it,i)=>{const want=norm(it.heading||it.label);const el=heads.find(h=>norm(h.textContent||\"\")===want);if(el&&!el.id)el.id=ids[i];if(el)el.style.scrollMarginTop=`${offset}px`;});const hash=decodeURIComponent(window.location.hash.slice(1));if(hash&&ids.includes(hash)){document.getElementById(hash)?.scrollIntoView({block:\"start\"});}},[items,offset]);const go=(e,id)=>{const el=document.getElementById(id);if(!el)return;e.preventDefault();const reduce=window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;el.scrollIntoView({behavior:reduce?\"auto\":\"smooth\",block:\"start\"});history.replaceState(null,\"\",`#${id}`);};return /*#__PURE__*/_jsx(\"div\",{style:styles.wrap,children:/*#__PURE__*/_jsxs(\"nav\",{\"aria-label\":title,className:\"blog-contents\",style:styles.box,children:[/*#__PURE__*/_jsx(\"style\",{children:css}),/*#__PURE__*/_jsx(\"p\",{style:styles.title,children:title}),/*#__PURE__*/_jsx(\"ol\",{style:styles.list,children:items.map((it,i)=>/*#__PURE__*/_jsx(\"li\",{style:styles.item,children:/*#__PURE__*/_jsxs(\"a\",{href:`#${ids[i]}`,onClick:e=>go(e,ids[i]),className:\"blog-contents__link\",style:styles.link,children:[/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:styles.num,children:String(i+1).padStart(2,\"0\")}),/*#__PURE__*/_jsx(\"span\",{className:\"blog-contents__label\",children:it.label})]})},ids[i]))})]})});}const css=`\n.blog-contents__link { font-size: 0.95rem; }\n@media (min-width: 810px) { .blog-contents__link { font-size: 1rem; } }\n@media (min-width: 1200px) { .blog-contents__link { font-size: 1.125rem; } }\n.blog-contents__link:hover .blog-contents__label { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }\n.blog-contents__link:focus-visible { outline: 2px solid ${BLUE}; outline-offset: 2px; border-radius: 4px; }\n.blog-contents__link:active .blog-contents__label { color: ${BLUE}; }\n`;const styles={wrap:{width:\"100%\",boxSizing:\"border-box\",paddingTop:20},box:{width:\"100%\",boxSizing:\"border-box\",background:SURFACE,border:`1px solid ${HAIR}`,borderRadius:8,padding:\"18px 20px 8px 20px\"},title:{margin:\"0 0 10px 0\",fontFamily:DISPLAY,fontWeight:600,fontSize:15,lineHeight:1.3,color:BLUE},list:{listStyle:\"none\",margin:0,padding:0,columns:\"2 250px\",columnGap:32},item:{breakInside:\"avoid\",borderTop:`1px solid ${HAIR}`},link:{display:\"flex\",alignItems:\"baseline\",gap:12,padding:\"10px 0\",textDecoration:\"none\",color:INK,fontFamily:BODY,lineHeight:1.45},num:{flex:\"0 0 22px\",fontFamily:DISPLAY,fontWeight:600,fontSize:14,color:BLUE,fontVariantNumeric:\"tabular-nums\"}};addPropertyControls(BlogContents,{title:{type:ControlType.String,title:\"Title\",defaultValue:\"In this guide\"},items:{type:ControlType.Array,title:\"Sections\",control:{type:ControlType.Object,controls:{label:{type:ControlType.String,title:\"Label\"},heading:{type:ControlType.String,title:\"Exact H2 text\"}}},defaultValue:[{label:\"First section\",heading:\"\"},{label:\"Second section\",heading:\"\"}]},offset:{type:ControlType.Number,title:\"Scroll offset\",defaultValue:110,min:0,max:300,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BlogContents\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BlogContents.map"],"mappings":"A,+LAGG,SAAwBW,EAAa,EAAM,CAAC,GAAK,CAAC,QAAM,QAAM,CAAC,EAAE,SAAO,KAAKC,EAAYC,EAAIC,EAAM,IAAI,GAAIC,EAAKC,EAAG,SAASA,EAAG,KAAK,CAAC,EAAEb,MAAc,CAAC,GAAG,OAAO,SAAW,IAAY,OAAO,IAAMc,EAAM,MAAM,KAAK,SAAS,iBAAiB,IAAI,CAAC,EAAEH,EAAM,SAAS,EAAG,IAAI,CAAC,IA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