{"version":3,"file":"SmoothScroll_Prod.BFD4Py4o.mjs","names":["React.useContext","React.useMemo","React.Fragment","React.forwardRef","useRef","React.useId","useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/78n59O0V7gIdrAg4pkht/596F7qUMLcLn2todvJpM/bmYTKVqj0.js","https:/framerusercontent.com/modules/Yppqt3Cs3Y8TZqvASnXl/CzcVr5U1VFk6uNcyYvJq/SmoothScroll_Prod.js"],"sourcesContent":["// Generated by Framer (64bdc4e)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addFonts,addPropertyControls,ControlType,cx,useComponentViewport,useLocaleInfo,useVariantState,withCSS}from\"framer\";import{LayoutGroup,motion,MotionConfigContext}from\"framer-motion\";import*as React from\"react\";import{useRef}from\"react\";const cycleOrder=[\"QuD9qpJJ3\",\"HvdG04LGV\",\"zYoVaBQP2\"];const serializationHash=\"framer-7JxRD\";const variantClassNames={HvdG04LGV:\"framer-v-8c70yj\",QuD9qpJJ3:\"framer-v-xnut19\",zYoVaBQP2:\"framer-v-1un8xnl\"};function addPropertyOverrides(overrides,...variants){const nextOverrides={};variants?.forEach(variant=>variant&&Object.assign(nextOverrides,overrides[variant]));return nextOverrides;}const transition1={bounce:.2,delay:0,duration:.4,type:\"spring\"};const Transition=({value,children})=>{const config=React.useContext(MotionConfigContext);const transition=value??config.transition;const contextValue=React.useMemo(()=>({...config,transition}),[JSON.stringify(transition)]);return /*#__PURE__*/_jsx(MotionConfigContext.Provider,{value:contextValue,children:children});};const Variants=motion.create(React.Fragment);const humanReadableVariantMap={\"Variant 1\":\"QuD9qpJJ3\",\"Variant 2\":\"HvdG04LGV\",\"Variant 3\":\"zYoVaBQP2\"};const getProps=({height,id,width,...props})=>{return{...props,variant:humanReadableVariantMap[props.variant]??props.variant??\"QuD9qpJJ3\"};};const createLayoutDependency=(props,variants)=>{if(props.layoutDependency)return variants.join(\"-\")+props.layoutDependency;return variants.join(\"-\");};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const fallbackRef=useRef(null);const refBinding=ref??fallbackRef;const defaultLayoutId=React.useId();const{activeLocale,setLocale}=useLocaleInfo();const componentViewport=useComponentViewport();const{style,className,layoutId,variant,...restProps}=getProps(props);const{baseVariant,classNames,clearLoadingGesture,gestureHandlers,gestureVariant,isLoading,setGestureState,setVariant,variants}=useVariantState({cycleOrder,defaultVariant:\"QuD9qpJJ3\",ref:refBinding,variant,variantClassNames});const layoutDependency=createLayoutDependency(props,variants);const sharedStyleClassNames=[];const scopingClassNames=cx(serializationHash,...sharedStyleClassNames);return /*#__PURE__*/_jsx(LayoutGroup,{id:layoutId??defaultLayoutId,children:/*#__PURE__*/_jsx(Variants,{animate:variants,initial:false,children:/*#__PURE__*/_jsx(Transition,{value:transition1,children:/*#__PURE__*/_jsx(motion.div,{...restProps,...gestureHandlers,className:cx(scopingClassNames,\"framer-xnut19\",className,classNames),\"data-framer-name\":\"Variant 1\",layoutDependency:layoutDependency,layoutId:\"QuD9qpJJ3\",ref:refBinding,style:{backgroundColor:\"rgb(253, 254, 254)\",...style},variants:{HvdG04LGV:{backgroundColor:\"rgb(22, 23, 25)\"},zYoVaBQP2:{backgroundColor:\"rgb(255, 194, 0)\"}},...addPropertyOverrides({HvdG04LGV:{\"data-framer-name\":\"Variant 2\"},zYoVaBQP2:{\"data-framer-name\":\"Variant 3\"}},baseVariant,gestureVariant)})})})});});const css=[\"@supports (aspect-ratio: 1) { body { --framer-aspect-ratio-supported: auto; } }\",\".framer-7JxRD.framer-12ct8ac, .framer-7JxRD .framer-12ct8ac { display: block; }\",\".framer-7JxRD.framer-xnut19 { height: 376px; overflow: hidden; position: relative; width: 527px; }\"];/**\n * This is a generated Framer component.\n * @framerIntrinsicHeight 376\n * @framerIntrinsicWidth 527\n * @framerCanvasComponentVariantDetails {\"propertyName\":\"variant\",\"data\":{\"default\":{\"layout\":[\"fixed\",\"fixed\"]},\"HvdG04LGV\":{\"layout\":[\"fixed\",\"fixed\"]},\"zYoVaBQP2\":{\"layout\":[\"fixed\",\"fixed\"]}}}\n * @framerImmutableVariables true\n * @framerDisplayContentsDiv false\n * @framerAutoSizeImages true\n * @framerComponentViewportWidth true\n * @framerColorSyntax true\n */const FramerbmYTKVqj0=withCSS(Component,css,\"framer-7JxRD\");export default FramerbmYTKVqj0;FramerbmYTKVqj0.displayName=\"color-change\";FramerbmYTKVqj0.defaultProps={height:376,width:527};addPropertyControls(FramerbmYTKVqj0,{variant:{options:[\"QuD9qpJJ3\",\"HvdG04LGV\",\"zYoVaBQP2\"],optionTitles:[\"Variant 1\",\"Variant 2\",\"Variant 3\"],title:\"Variant\",type:ControlType.Enum}});addFonts(FramerbmYTKVqj0,[{explicitInter:true,fonts:[]}],{supportsExplicitInterCodegen:true});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FramerbmYTKVqj0\",\"slots\":[],\"annotations\":{\"framerImmutableVariables\":\"true\",\"framerIntrinsicWidth\":\"527\",\"framerCanvasComponentVariantDetails\":\"{\\\"propertyName\\\":\\\"variant\\\",\\\"data\\\":{\\\"default\\\":{\\\"layout\\\":[\\\"fixed\\\",\\\"fixed\\\"]},\\\"HvdG04LGV\\\":{\\\"layout\\\":[\\\"fixed\\\",\\\"fixed\\\"]},\\\"zYoVaBQP2\\\":{\\\"layout\\\":[\\\"fixed\\\",\\\"fixed\\\"]}}}\",\"framerAutoSizeImages\":\"true\",\"framerDisplayContentsDiv\":\"false\",\"framerComponentViewportWidth\":\"true\",\"framerColorSyntax\":\"true\",\"framerIntrinsicHeight\":\"376\",\"framerContractVersion\":\"1\"}},\"Props\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./bmYTKVqj0.map","import{jsx as _jsx,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import Lenis from\"lenis\";// import Lenis from \"@studio-freight/lenis\"\nimport{useEffect,useRef}from\"react\";/**\n * @framerDisableUnlink\n */export default function SmoothScroll(props){const{intensity}=props;const lenis=useRef(null);useEffect(()=>{if(lenis.current)lenis.current.scrollTo(0,{immediate:true});},[lenis]);// Check Overlay overflow\nuseEffect(()=>{const overlayElement=document.getElementById(\"overlay\");if(overlayElement){const checkOverflow=()=>{const htmlStyle=window.getComputedStyle(document.documentElement);const isOverflowHidden=htmlStyle.overflow===\"hidden\";if(isOverflowHidden){overlayElement.setAttribute(\"data-lenis-prevent\",\"true\");}};// Set up MutationObserver for the html element\nconst htmlObserver=new MutationObserver(mutations=>{for(const mutation of mutations){if(mutation.type===\"attributes\"&&mutation.attributeName===\"style\"){checkOverflow();}}});// Observe the html element for style changes\nhtmlObserver.observe(document.documentElement,{attributes:true,attributeFilter:[\"style\"]});// Initial check\ncheckOverflow();return()=>{htmlObserver.disconnect();};}},[]);// useEffect(() => {\n//     const overlayElement = document.getElementById(\"overlay\")\n//     if (overlayElement) {\n//         const handleMutation = (mutationsList, observer) => {\n//             for (const mutation of mutationsList) {\n//                 if (\n//                     mutation.type === \"childList\" &&\n//                     overlayElement.children.length > 0\n//                 ) {\n//                     // Check if the html tag has the style \"overflow: hidden;\"\n//                     const htmlElement = document.documentElement\n//                     console.log(htmlElement, \"htmlElement\")\n//                     const computedStyle =\n//                         window.getComputedStyle(htmlElement)\n//                     console.log(\"computedStyle\", computedStyle)\n//                     const isOverflowHidden =\n//                         computedStyle.overflow === \"hidden\"\n//                     console.log(\"isOverflowHidden\", isOverflowHidden)\n//                     if (isOverflowHidden) {\n//                         overlayElement.setAttribute(\n//                             \"data-lenis-prevent\",\n//                             \"true\"\n//                         )\n//                     }\n//                 }\n//             }\n//         }\n//         const observer = new MutationObserver(handleMutation)\n//         observer.observe(overlayElement, {\n//             childList: true,\n//             attributes: true,\n//             subtree: true,\n//         })\n//         return () => observer.disconnect()\n//     }\n// }, [])\nuseEffect(()=>{const allElements=document.getElementsByTagName(\"*\");for(let i=0;i<allElements.length;i++){const element=allElements[i];const computedStyle=window.getComputedStyle(element);if(computedStyle.getPropertyValue(\"overflow\")===\"auto\"){element.setAttribute(\"data-lenis-prevent\",\"true\");}}},[]);useEffect(()=>{lenis.current=new Lenis({duration:intensity/10});const raf=time=>{if(lenis.current){lenis.current.raf(time);requestAnimationFrame(raf);}};requestAnimationFrame(raf);return()=>{if(lenis.current){lenis.current.destroy();lenis.current=null;}};},[]);useEffect(()=>{const styleElement=document.createElement(\"style\");styleElement.textContent=`\nhtml.lenis {\nheight: auto;\n}\n.lenis.lenis-smooth {\n\nscroll-behavior: auto !important;\n}\n.lenis.lenis-smooth [data-lenis-prevent] {\n\noverscroll-behavior: contain;\n}\n.lenis.lenis-stopped {\n\noverflow: hidden;\n}\n.lenis.lenis-scrolling iframe {\n\npointer-events: none;\n}\n`;document.head.appendChild(styleElement);return()=>{document.head.removeChild(styleElement);};},[]);//https://github.com/darkroomengineering/lenis?tab=readme-ov-file#anchor-links\nuseEffect(()=>{// Get all anchor links and store click handlers with their targets\nconst anchorLinksData=[...document.querySelectorAll(\"a[href]\")].filter(anchor=>anchor.href.includes(\"#\")).map(anchor=>{const href=`#${anchor.href.split(\"#\").pop()}`;const decodedHref=decodeURIComponent(href);let scrollMargin=0;const targetElement=document.querySelector(decodedHref);if(targetElement){scrollMargin=parseInt(window.getComputedStyle(targetElement).scrollMarginTop);}return{href,scrollMargin,anchorElement:anchor};});const handleClick=(e,href,scrollMargin)=>{e.preventDefault();lenis.current.scrollTo(href,{offset:-scrollMargin});};const handlers=anchorLinksData.map(({href,scrollMargin})=>e=>handleClick(e,href,scrollMargin));anchorLinksData.forEach(({anchorElement},index)=>{anchorElement.addEventListener(\"click\",handlers[index]);});return()=>{anchorLinksData.forEach(({anchorElement},index)=>{anchorElement.removeEventListener(\"click\",handlers[index]);});};},[lenis]);return /*#__PURE__*/_jsx(_Fragment,{});}SmoothScroll.displayName=\"Smooth Scroll\";addPropertyControls(SmoothScroll,{intensity:{title:\"Intensity\",type:ControlType.Number,defaultValue:10,description:\"More components at [Framer University](https://frameruni.link/cc).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmoothScroll\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SmoothScroll_Prod.map"],"mappings":"kYAC2e,SAAS,EAAqB,EAAU,GAAG,EAAS,CAAC,IAAM,EAAc,CAAC,EAAuF,OAArF,GAAU,QAAQ,GAAS,GAAS,OAAO,OAAO,EAAc,EAAU,EAAQ,CAAC,EAAS,CAAc,qCAAvnB,IAA2H,IAAkE,IAA4B,EAAiC,EAAW,CAAC,YAAY,YAAY,WAAW,EAAQ,EAAkB,eAAqB,EAAkB,CAAC,UAAU,kBAAkB,UAAU,kBAAkB,UAAU,kBAAkB,EAA+L,EAAY,CAAC,OAAO,GAAG,MAAM,EAAE,SAAS,GAAG,KAAK,QAAQ,EAAQ,GAAY,CAAC,QAAM,cAAY,CAAC,IAAM,EAAOA,EAAiB,CAAmB,EAAQ,EAAW,GAAO,EAAO,WAAiB,EAAaC,OAAmB,CAAC,GAAG,EAAO,YAAU,GAAG,CAAC,KAAK,UAAU,CAAU,CAAC,CAAC,EAAE,OAAoB,EAAK,EAAoB,SAAS,CAAC,MAAM,EAAsB,UAAQ,CAAC,CAAE,EAAQ,EAAS,EAAO,OAAOC,CAAc,EAAQ,EAAwB,CAAC,YAAY,YAAY,YAAY,YAAY,YAAY,WAAW,EAAQ,GAAU,CAAC,SAAO,KAAG,QAAM,GAAG,MAAgB,CAAC,GAAG,EAAM,QAAQ,EAAwB,EAAM,UAAU,EAAM,SAAS,WAAW,GAAU,GAAwB,EAAM,IAAe,EAAM,iBAAwB,EAAS,KAAK,GAAG,EAAE,EAAM,iBAAwB,EAAS,KAAK,GAAG,EAU58C,EAAgB,EAV69CC,EAAiB,SAAS,EAAM,EAAI,CAAC,IAAM,EAAYC,EAAO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