{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/qGxcI8iqSo4Pu9ZVuXEu/mgFTAYhCCroDtPQ0a18q/Scroll_Progress_Bar.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,useRef}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion}from\"framer-motion\";/**\n * Scroll Progress Bar\n * A customizable progress bar that tracks scroll progress of a section or entire page\n *\n * @framerDisableUnlink\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 8\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight fixed\n */export default function ScrollSectionNav(props){const{trackingMode,sectionName,direction,backgroundColor,fillColor,style}=props;const[scrollProgress,setScrollProgress]=useState(0);const scrollElementRef=useRef(null);// Determine if reversed based on direction\nconst isReversed=direction===\"right\";useEffect(()=>{if(typeof window===\"undefined\")return;if(RenderTarget.current()===RenderTarget.canvas)return;let cleanup=()=>{};if(trackingMode===\"page\"){// Page scroll tracking\nconst handlePageScroll=()=>{const scrollTop=window.pageYOffset||document.documentElement.scrollTop;const scrollHeight=document.documentElement.scrollHeight;const clientHeight=document.documentElement.clientHeight;const maxScroll=scrollHeight-clientHeight;let progress=0;if(maxScroll>0){progress=scrollTop/maxScroll;}if(isReversed){progress=1-progress;}setScrollProgress(Math.min(1,Math.max(0,progress)));};window.addEventListener(\"scroll\",handlePageScroll,{passive:true});window.addEventListener(\"resize\",handlePageScroll);handlePageScroll();cleanup=()=>{window.removeEventListener(\"scroll\",handlePageScroll);window.removeEventListener(\"resize\",handlePageScroll);};}else if(trackingMode===\"section\"&&sectionName){// Section scroll tracking\nconst findAndTrackSection=()=>{// Clean the section name - don't modify it, use as-is first\nconst originalName=sectionName.trim();// Also prepare variations\nconst nameWithHash=originalName.startsWith(\"#\")?originalName:\"#\"+originalName;const nameWithoutHash=originalName.startsWith(\"#\")?originalName.substring(1):originalName;const lowerCaseName=originalName.toLowerCase();const lowerCaseWithHash=nameWithHash.toLowerCase();const lowerCaseWithoutHash=nameWithoutHash.toLowerCase();console.log(`Looking for section: \"${originalName}\"`);// Try to find the section with various methods\nlet targetElement=null;// Method 1: Direct data-framer-name match (exact)\ntargetElement=document.querySelector(`[data-framer-name=\"${originalName}\"]`)||document.querySelector(`[data-framer-name=\"${nameWithHash}\"]`)||document.querySelector(`[data-framer-name=\"${nameWithoutHash}\"]`);// Method 2: Case-insensitive search\nif(!targetElement){const allElements=document.querySelectorAll(\"[data-framer-name]\");targetElement=Array.from(allElements).find(el=>{const name=el.getAttribute(\"data-framer-name\")?.toLowerCase();return name===lowerCaseName||name===lowerCaseWithHash||name===lowerCaseWithoutHash;})||null;}// Method 3: Look for Framer's scroll containers\nif(!targetElement){// Framer often wraps scroll sections in containers\n// Look for elements with specific Framer classes or attributes\nconst scrollContainers=document.querySelectorAll('[data-framer-component-type=\"ScrollSection\"], [data-framer-scroll-section], .framer-scroll-section');for(const container of scrollContainers){// Check if this container or its children have our target name\nconst hasName=container.getAttribute(\"data-framer-name\")===originalName||container.querySelector(`[data-framer-name=\"${originalName}\"]`);if(hasName){targetElement=container;break;}}}if(!targetElement){console.error(`Section \"${originalName}\" not found`);console.log(\"Available sections:\");document.querySelectorAll(\"[data-framer-name]\").forEach(el=>{console.log(`- \"${el.getAttribute(\"data-framer-name\")}\"`);});return null;}console.log(\"Found section element:\",targetElement);// Now find the actual scrollable element\n// It could be the element itself or a child/parent\nlet scrollElement=null;// Check if the target element itself is scrollable\nconst checkScrollable=el=>{const style=window.getComputedStyle(el);const hasScrollX=(style.overflowX===\"auto\"||style.overflowX===\"scroll\")&&el.scrollWidth>el.clientWidth;const hasScrollY=(style.overflowY===\"auto\"||style.overflowY===\"scroll\")&&el.scrollHeight>el.clientHeight;return hasScrollX||hasScrollY;};if(checkScrollable(targetElement)){scrollElement=targetElement;}else{// Check children\nconst scrollableChild=targetElement.querySelector(\"*\");if(scrollableChild&&checkScrollable(scrollableChild)){scrollElement=scrollableChild;}else{// Check parent\nlet parent=targetElement.parentElement;while(parent&&parent!==document.body){if(checkScrollable(parent)){scrollElement=parent;break;}parent=parent.parentElement;}}}// Last resort: find any scrollable element within or around the target\nif(!scrollElement){const allDescendants=targetElement.querySelectorAll(\"*\");for(const el of allDescendants){if(checkScrollable(el)){scrollElement=el;break;}}}if(!scrollElement){console.error(\"No scrollable element found in section\");return null;}console.log(\"Scrollable element found:\",scrollElement);scrollElementRef.current=scrollElement;// Set up scroll tracking\nconst handleScroll=()=>{if(!scrollElement)return;let progress=0;const style=window.getComputedStyle(scrollElement);const hasScrollX=(style.overflowX===\"auto\"||style.overflowX===\"scroll\")&&scrollElement.scrollWidth>scrollElement.clientWidth;const hasScrollY=(style.overflowY===\"auto\"||style.overflowY===\"scroll\")&&scrollElement.scrollHeight>scrollElement.clientHeight;if(hasScrollX){const maxScroll=scrollElement.scrollWidth-scrollElement.clientWidth;if(maxScroll>0){progress=scrollElement.scrollLeft/maxScroll;}}else if(hasScrollY){const maxScroll=scrollElement.scrollHeight-scrollElement.clientHeight;if(maxScroll>0){progress=scrollElement.scrollTop/maxScroll;}}if(isReversed){progress=1-progress;}setScrollProgress(Math.min(1,Math.max(0,progress)));};scrollElement.addEventListener(\"scroll\",handleScroll,{passive:true});window.addEventListener(\"resize\",handleScroll);handleScroll()// Initial calculation\n;return()=>{scrollElement.removeEventListener(\"scroll\",handleScroll);window.removeEventListener(\"resize\",handleScroll);};};// Try to find section immediately\nlet cleanupFn=findAndTrackSection();// Retry after delay in case DOM is still loading\nconst retryTimeouts=[100,500,1e3,2e3];const timeoutIds=[];retryTimeouts.forEach(delay=>{const id=setTimeout(()=>{if(!scrollElementRef.current){const newCleanup=findAndTrackSection();if(newCleanup){if(cleanupFn)cleanupFn();cleanupFn=newCleanup;}}},delay);timeoutIds.push(id);});cleanup=()=>{timeoutIds.forEach(clearTimeout);if(cleanupFn)cleanupFn();};}return cleanup;},[trackingMode,sectionName,isReversed]);// Preview in canvas\nif(RenderTarget.current()===RenderTarget.canvas){return /*#__PURE__*/_jsx(\"div\",{style:{...style,backgroundColor,overflow:\"hidden\",position:\"relative\"},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",width:\"40%\",height:\"100%\",backgroundColor:fillColor,left:direction===\"left\"?0:\"auto\",right:direction===\"right\"?0:\"auto\",top:0}})});}return /*#__PURE__*/_jsx(\"div\",{style:{...style,backgroundColor,overflow:\"hidden\",position:\"relative\"},children:/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",backgroundColor:fillColor,height:\"100%\",width:`${scrollProgress*100}%`,top:0,...direction===\"left\"?{left:0}:{right:0}},initial:false,animate:{width:`${scrollProgress*100}%`},transition:{type:\"spring\",damping:30,stiffness:400}})});}// Property Controls\naddPropertyControls(ScrollSectionNav,{trackingMode:{type:ControlType.Enum,title:\"Track\",options:[\"page\",\"section\"],optionTitles:[\"Page\",\"Section\"],defaultValue:\"page\",displaySegmentedControl:true},sectionName:{type:ControlType.String,title:\"Section Name\",placeholder:\"test or #test\",description:\"Enter the exact name of your Scroll Section\",hidden:props=>props.trackingMode===\"page\"},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"left\",\"right\"],optionTitles:[\"\u2192\",\"\u2190\"],defaultValue:\"left\",displaySegmentedControl:true},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#E5E5E5\"},fillColor:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#0099FF\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollSectionNav\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"* @framerIntrinsicWidth 400\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"8\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Scroll_Progress_Bar.map"],
  "mappings": "kJAAAA,IASkB,SAARC,EAAkCC,EAA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C,KAAKqD,EAAY,KAAK,MAAM,QAAQ,QAAQ,CAAC,OAAO,SAAS,EAAE,aAAa,CAAC,OAAO,SAAS,EAAE,aAAa,OAAO,wBAAwB,EAAI,EAAE,YAAY,CAAC,KAAKA,EAAY,OAAO,MAAM,eAAe,YAAY,gBAAgB,YAAY,8CAA8C,OAAOpD,GAAOA,EAAM,eAAe,MAAM,EAAE,UAAU,CAAC,KAAKoD,EAAY,KAAK,MAAM,YAAY,QAAQ,CAAC,OAAO,OAAO,EAAE,aAAa,CAAC,SAAI,QAAG,EAAE,aAAa,OAAO,wBAAwB,EAAI,EAAE,gBAAgB,CAAC,KAAKA,EAAY,MAAM,MAAM,aAAa,aAAa,SAAS,EAAE,UAAU,CAAC,KAAKA,EAAY,MAAM,MAAM,OAAO,aAAa,SAAS,CAAC,CAAC",
  "names": ["init_ssg_sandbox_shims", "ScrollSectionNav", "props", "trackingMode", "sectionName", "direction", "backgroundColor", "fillColor", "style", "scrollProgress", "setScrollProgress", "ye", "scrollElementRef", "pe", "isReversed", "ue", "RenderTarget", "cleanup", "handlePageScroll", "scrollTop", "scrollHeight", "clientHeight", "maxScroll", "progress", "findAndTrackSection", "originalName", "nameWithHash", "nameWithoutHash", "lowerCaseName", "lowerCaseWithHash", "lowerCaseWithoutHash", "targetElement", "allElements", "el", "name", "scrollContainers", "container", "scrollElement", "checkScrollable", "hasScrollX", "hasScrollY", "scrollableChild", "parent", "allDescendants", "handleScroll", "cleanupFn", "retryTimeouts", "timeoutIds", "delay", "id", "newCleanup", "p", "motion", "addPropertyControls", "ControlType"]
}
