{"version":3,"file":"TableOfContents.QfvQQLzf.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/OTFD74cLM0WRcnxbTkdJ/FDdcZf5xuYUud0j11yxk/TableOfContents.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";export default function TableOfContents(){const[headings,setHeadings]=useState([]);useEffect(()=>{const h2Elements=Array.from(document.querySelectorAll(\"h2\"));// Usuwamy dwa ostatnie elementy\n// (czyli 'Zobacz także...' i 'Zamów bezpłatną wycenę')\nconst filtered=h2Elements.slice(0,-2);const updatedHeadings=filtered.map((el,index)=>{if(!el.id){const slug=`section-${index}`;el.id=slug;}return{id:el.id,text:el.textContent||`Sekcja ${index+1}`};});setHeadings(updatedHeadings);},[]);const scrollToSection=id=>{const target=document.getElementById(id);if(target){target.scrollIntoView({behavior:\"smooth\"});}};// Styl typograficzny zgodny z resztą strony\nconst typographyStyle={fontFamily:\"Inter, sans-serif\",fontSize:\"18px\",fontWeight:400,color:\"#1a1a1a\"};// Styl dla nagłówka spisu treści\nconst headingStyle={...typographyStyle,fontWeight:600,marginBottom:\"0.5rem\"};// Styl dla elementów listy z zachowaniem koloru linkowego dla interaktywności\nconst listItemStyle={...typographyStyle,color:\"#2563eb\",cursor:\"pointer\"};return /*#__PURE__*/_jsxs(\"div\",{className:\"p-4 rounded-xl shadow-lg bg-white w-full max-w-md\",children:[/*#__PURE__*/_jsx(\"h3\",{style:headingStyle,className:\"mb-2\",children:\"Spis treści\"}),/*#__PURE__*/_jsx(\"ul\",{className:\"list-disc pl-5 space-y-1\",children:headings.map(({id,text})=>/*#__PURE__*/_jsx(\"li\",{style:listItemStyle,className:\"hover:underline\",onClick:()=>scrollToSection(id),children:text},id))})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TableOfContents\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TableOfContents.map"],"mappings":"0KAA+F,SAAwB,GAAiB,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAS,EAAE,CAAC,CAAC,MAAc,CAE1J,IAAM,EAFsK,MAAM,KAAK,SAAS,iBAAiB,KAAK,CAAC,CAEnO,MAAM,EAAE,GAAG,CAAgC,KAAK,EAAG,KAAS,AAAyC,EAAG,KAAtB,WAAW,IAA0B,CAAC,GAAG,EAAG,GAAG,KAAK,EAAG,aAAa,UAAU,EAAM,IAAI,EAAG,CAAC,EAAY,EAAgB,EAAG,EAAE,CAAC,CAAC,IAAM,EAAgB,GAAI,CAAC,IAAM,EAAO,SAAS,eAAe,EAAG,CAAI,GAAQ,EAAO,eAAe,CAAC,SAAS,SAAS,CAAC,EAC9V,EAAgB,CAAC,WAAW,oBAAoB,SAAS,OAAO,WAAW,IAAI,MAAM,UAAU,CAC/F,EAAa,CAAC,GAAG,EAAgB,WAAW,IAAI,aAAa,SAAS,CACtE,EAAc,CAAC,GAAG,EAAgB,MAAM,UAAU,OAAO,UAAU,CAAC,OAAoB,EAAM,MAAM,CAAC,UAAU,oDAAoD,SAAS,CAAc,EAAK,KAAK,CAAC,MAAM,EAAa,UAAU,OAAO,SAAS,cAAc,CAAC,CAAc,EAAK,KAAK,CAAC,UAAU,2BAA2B,SAAS,EAAS,KAAK,CAAC,KAAG,UAAqB,EAAK,KAAK,CAAC,MAAM,EAAc,UAAU,kBAAkB,YAAY,EAAgB,EAAG,CAAC,SAAS,EAAK,CAAC,EAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,kBAL/a,IAAsC"}