{"version":3,"file":"TOC.B5_o7ItK.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/7m6y01I65bobqvBpZjxe/85OJyy58SLgCPfl1iTGI/TOC.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const defaultItems=[{label:\"Sobre o Cliente\",sectionId:\"sobre-o-cliente\"},{label:\"O Desafio\",sectionId:\"o-desafio\"},{label:\"A Solu\\xe7\\xe3o\",sectionId:\"a-solucao\"},{label:\"Caracter\\xedsticas\",sectionId:\"caracteristicas\"},{label:\"Resultados\",sectionId:\"resultados\"},{label:\"Depoimento\",sectionId:\"depoimento\"},{label:\"Perspectivas\",sectionId:\"perspectivas\"}];export default function TOC({items,fontSize,textColor,activeTextColor,activeBg,borderRadius,topOffset,maxHeight}){const[activeId,setActiveId]=useState(\"\");const sections=items&&items.length>0?items:defaultItems;useEffect(()=>{const handleScroll=()=>{let current=\"\";for(const section of sections){const el=document.getElementById(section.sectionId);if(el){const rect=el.getBoundingClientRect();if(rect.top<=topOffset+40){current=section.sectionId;}}}setActiveId(current);};window.addEventListener(\"scroll\",handleScroll,{passive:true});handleScroll();return()=>window.removeEventListener(\"scroll\",handleScroll);},[sections,topOffset]);const handleClick=sectionId=>{const el=document.getElementById(sectionId);if(el){const y=el.getBoundingClientRect().top+window.scrollY-topOffset;window.scrollTo({top:y,behavior:\"smooth\"});}};return /*#__PURE__*/_jsx(\"div\",{style:{position:\"sticky\",top:topOffset,width:\"100%\",maxHeight:maxHeight,overflowY:\"auto\",fontFamily:\"'General Sans', sans-serif\",display:\"flex\",flexDirection:\"column\",gap:4},children:sections.map((item,i)=>{const isActive=activeId===item.sectionId;return /*#__PURE__*/_jsx(\"div\",{onClick:()=>handleClick(item.sectionId),style:{padding:\"12px 16px\",fontSize:fontSize,fontWeight:500,color:isActive?activeTextColor:textColor,backgroundColor:isActive?activeBg:\"transparent\",borderRadius:borderRadius,cursor:\"pointer\",transition:\"all 0.2s ease\",lineHeight:1.4},children:item.label},i);})});}TOC.defaultProps={items:defaultItems,fontSize:15,textColor:\"rgba(0,0,0,0.65)\",activeTextColor:\"#111111\",activeBg:\"rgba(42,73,255,0.08)\",borderRadius:8,topOffset:100,maxHeight:\"70vh\"};addPropertyControls(TOC,{items:{type:ControlType.Array,title:\"Itens\",control:{type:ControlType.Object,controls:{label:{type:ControlType.String,title:\"Texto\",defaultValue:\"Se\\xe7\\xe3o\"},sectionId:{type:ControlType.String,title:\"ID da Se\\xe7\\xe3o\",defaultValue:\"secao\"}}}},fontSize:{type:ControlType.Number,title:\"Tamanho da Fonte\",min:12,max:20,step:1,defaultValue:15},textColor:{type:ControlType.Color,title:\"Cor do Texto\",defaultValue:\"rgba(0,0,0,0.65)\"},activeTextColor:{type:ControlType.Color,title:\"Cor do Texto Ativo\",defaultValue:\"#111111\"},activeBg:{type:ControlType.Color,title:\"Fundo Ativo\",defaultValue:\"rgba(42,73,255,0.08)\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",min:0,max:16,step:2,defaultValue:8},topOffset:{type:ControlType.Number,title:\"Offset do Topo (px)\",min:0,max:200,step:10,defaultValue:100},maxHeight:{type:ControlType.String,title:\"Altura M\\xe1xima\",defaultValue:\"70vh\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TOC\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TOC.map"],"mappings":"+LAA2e,SAAwB,EAAI,CAAC,QAAM,WAAS,YAAU,kBAAgB,WAAS,eAAa,YAAU,aAAW,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAS,EAAE,EAAQ,EAAS,GAAO,EAAM,OAAO,EAAE,EAAM,EAAa,MAAc,CAAC,IAAM,MAAiB,CAAC,IAAI,EAAQ,GAAG,IAAI,IAAM,KAAW,EAAS,CAAC,IAAM,EAAG,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