{"version":3,"file":"Animated_Line.TdLSaSb2.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/XgBEAdQ1fF1VILOFW7d0/TkSkU4ucLbfYxGc9Mlff/Animated_Line.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export function AnimatedLine({direction=\"horizontal\",duration=2,delay=0,lineColor=\"#000000\",triggerOnVisibility=false,replay=true,transitionType=\"ease\",customCurve=\"cubic-bezier(0.25, 0.8, 0.25, 1)\"}){const[animate,setAnimate]=useState(\"start\");const[hasAnimated,setHasAnimated]=useState(false);const ref=useRef(null);const handleVisibility=entries=>{const[entry]=entries;if(entry.isIntersecting){if(!triggerOnVisibility||replay||!hasAnimated){setTimeout(()=>setAnimate(\"end\"),delay*1e3)// Apply delay\n;setHasAnimated(true);}}else if(replay&&triggerOnVisibility){setAnimate(\"start\")// Reset animation state\n;}};useEffect(()=>{const observer=new IntersectionObserver(handleVisibility,{threshold:.1});if(ref.current){observer.observe(ref.current);}return()=>observer.disconnect();},[triggerOnVisibility,replay,delay]);useEffect(()=>{if(!triggerOnVisibility){setTimeout(()=>setAnimate(\"end\"),delay*1e3)// Apply delay for non-visibility-triggered animations\n;}},[triggerOnVisibility,delay]);const variants={start:{width:direction===\"horizontal\"?\"0%\":\"100%\",height:direction===\"vertical\"?\"0%\":\"100%\",transition:{duration,ease:transitionType===\"custom\"?customCurve:transitionType}},end:{width:direction===\"horizontal\"?\"100%\":\"100%\",height:direction===\"vertical\"?\"100%\":\"100%\",transition:{duration,ease:transitionType===\"custom\"?customCurve:transitionType}}};return /*#__PURE__*/_jsx(motion.div,{ref:ref,className:\"animated-line\",style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(motion.div,{variants:variants,initial:\"start\",animate:animate,style:{position:\"absolute\",top:0,left:0,backgroundColor:lineColor,width:direction===\"horizontal\"?\"0%\":\"100%\",height:direction===\"vertical\"?\"0%\":\"100%\"}})});}// Exposing properties for the property panel\naddPropertyControls(AnimatedLine,{direction:{type:ControlType.SegmentedEnum,title:\"Direction\",options:[\"horizontal\",\"vertical\"],defaultValue:\"horizontal\"},duration:{type:ControlType.Number,title:\"Duration (s)\",min:.1,max:10,step:.1,defaultValue:2},delay:{type:ControlType.Number,title:\"Delay (s)\",min:0,max:10,step:.1,defaultValue:0},lineColor:{type:ControlType.Color,title:\"Line Color\",defaultValue:\"#000000\"},triggerOnVisibility:{type:ControlType.Boolean,title:\"Trigger on Visibility\",defaultValue:false},replay:{type:ControlType.Boolean,title:\"Replay Animation\",defaultValue:true},transitionType:{type:ControlType.Enum,title:\"Transition Type\",options:[\"ease\",\"linear\",\"ease-in\",\"ease-out\",\"ease-in-out\",\"custom\"],defaultValue:\"ease\"},customCurve:{type:ControlType.String,title:\"Custom Curve\",defaultValue:\"cubic-bezier(0.25, 0.8, 0.25, 1)\",hidden(props){return props.transitionType!==\"custom\";}}});\nexport const __FramerMetadata__ = {\"exports\":{\"AnimatedLine\":{\"type\":\"reactComponent\",\"name\":\"AnimatedLine\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Animated_Line.map"],"mappings":"yOAA8K,SAAgB,EAAa,CAAC,YAAU,aAAa,WAAS,EAAE,QAAM,EAAE,YAAU,UAAU,sBAAoB,GAAM,SAAO,GAAK,iBAAe,OAAO,cAAY,oCAAoC,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAS,QAAQ,CAAM,CAAC,EAAY,GAAgBA,EAAS,GAAM,CAAO,EAAIC,EAAO,KAAK,CAAO,EAAiB,GAAS,CAAC,GAAK,CAAC,GAAO,EAAW,EAAM,gBAAmB,CAAC,GAAqB,GAAQ,CAAC,KAAa,eAAe,EAAW,MAAM,CAAC,EAAM,IAAI,CACppB,EAAe,GAAK,EAAW,GA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