{"version":3,"file":"SVGPathAnimation_2.23h4_SXp.mjs","names":["useRef","useId","useState","useMemo"],"sources":["https:/framerusercontent.com/modules/O8PmuD3FydoGlfG7ERdb/aSxUJcRjEBeMhxNK9mlH/SVGPathAnimation_2.js"],"sourcesContent":["// User request: \"can u make line consisten its like the widdth not proportional\" — rewrite from scratch and make line thickness consistent even when the component is stretched.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useId,useMemo,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useInView}from\"framer-motion\";/**\n * Animated Line\n *\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 120\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function SVGPathAnimation(props){const{trackColor=\"#CCCCCC\",trackOpacity=.12,glowColor=\"#FF8800\",glowBlur=10,glowSoftness=2,glowStyle=\"classic\",strokeWidth=6,strokeBehavior=\"consistent\",segmentLengthPercent=12,duration=3,curveDepth=60,gapWidthPercent=12,paddingPercent=6,overflow=\"visible\",style}=props;const isStatic=useIsStaticRenderer();const containerRef=useRef(null);const inView=useInView(containerRef,{amount:.2});const filterId=useId();// Fixed internal coordinate system for geometry.\nconst vbW=1e3;const vbH=120;// Measure container size so we can scale stroke in a consistent way even if the layer is stretched.\nconst[containerSize,setContainerSize]=useState({w:800,h:120});useEffect(()=>{if(typeof window===\"undefined\")return;if(!containerRef.current)return;const el=containerRef.current;const update=()=>{const rect=el.getBoundingClientRect();const w=Math.max(1,rect.width);const h=Math.max(1,rect.height);startTransition(()=>setContainerSize({w,h}));};update();if(typeof ResizeObserver===\"undefined\"){const onResize=()=>update();window.addEventListener(\"resize\",onResize);return()=>window.removeEventListener(\"resize\",onResize);}const ro=new ResizeObserver(()=>update());ro.observe(el);return()=>ro.disconnect();},[]);const padding=useMemo(()=>{const p=Math.max(0,Math.min(30,paddingPercent))/100;return vbH*p;},[paddingPercent]);const topY=padding;const bottomY=useMemo(()=>{const d=Math.max(0,Math.min(vbH,curveDepth));return Math.max(topY,Math.min(vbH-padding,topY+d));},[curveDepth,padding,topY]);const halfGap=useMemo(()=>{const g=Math.max(0,Math.min(60,gapWidthPercent))/100;return vbW*g/2;},[gapWidthPercent]);const centerX=vbW/2;const leftDropX=Math.max(0,centerX-halfGap);const rightDropX=Math.min(vbW,centerX+halfGap);const cornerRun=useMemo(()=>{// Keeps corners looking stable across settings.\nreturn Math.max(12,Math.min(140,(vbW-halfGap*2)*.12));},[halfGap]);const pathD=useMemo(()=>{const leftBefore=Math.max(0,leftDropX-cornerRun);const rightAfter=Math.min(vbW,rightDropX+cornerRun);return`M 0,${topY} L ${leftBefore},${topY} L ${leftDropX},${bottomY} L ${rightDropX},${bottomY} L ${rightAfter},${topY} L ${vbW},${topY}`;},[bottomY,cornerRun,leftDropX,rightDropX,topY]);const pathRef=useRef(null);const[pathLength,setPathLength]=useState(1e3);useEffect(()=>{if(!pathRef.current)return;const len=pathRef.current.getTotalLength();if(!Number.isFinite(len)||len<=0)return;startTransition(()=>setPathLength(len));},[pathD]);// Calculate dynamic viewBox height based on actual path bounds\nconst dynamicVbH=useMemo(()=>{const maxY=Math.max(topY,bottomY);const minY=Math.min(topY,bottomY);return Math.ceil(maxY-minY+padding*2);},[topY,bottomY,padding]);const segmentLength=useMemo(()=>{const pct=Math.max(1,Math.min(60,segmentLengthPercent))/100;return Math.max(4,pathLength*pct);},[pathLength,segmentLengthPercent]);// Stroke width handling\nconst effectiveStrokeWidth=useMemo(()=>{const sw=Math.max(.5,strokeWidth);if(strokeBehavior===\"svg-scale\"){// Traditional SVG behavior: stroke width scales with the SVG (and becomes distorted if stretched non-uniformly).\nreturn sw;}// Consistent behavior: keep stroke circular/consistent even under non-uniform stretching.\n// We use non-scaling-stroke and scale by the *min* dimension so it still grows/shrinks with the layer.\nconst reference=vbH;const minDim=Math.max(1,Math.min(containerSize.w,containerSize.h));const scale=minDim/reference;return sw*scale;},[containerSize.h,containerSize.w,strokeBehavior,strokeWidth]);const vectorEffect=strokeBehavior===\"consistent\"?\"non-scaling-stroke\":undefined;const shouldAnimate=!isStatic&&inView&&duration>0;// Calculate adjusted duration based on actual path length\n// This ensures consistent animation speed regardless of component width\nconst adjustedDuration=useMemo(()=>{// Reference path length (at default 800px width)\nconst referencePath=1e3;// Scale duration proportionally to path length\nconst ratio=pathLength/referencePath;return Math.max(.1,duration*ratio);},[duration,pathLength]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow},children:/*#__PURE__*/_jsxs(\"svg\",{width:\"100%\",height:\"100%\",viewBox:`0 0 ${vbW} ${dynamicVbH}`,preserveAspectRatio:\"none\",style:{display:\"block\",overflow},role:\"img\",\"aria-label\":\"Animated line\",children:[/*#__PURE__*/_jsx(\"defs\",{children:/*#__PURE__*/_jsxs(\"filter\",{id:filterId,x:\"-50%\",y:\"-50%\",width:\"200%\",height:\"200%\",children:[/*#__PURE__*/_jsx(\"feGaussianBlur\",{in:\"SourceGraphic\",stdDeviation:Math.max(0,glowBlur),result:\"outerBlur\"}),/*#__PURE__*/_jsx(\"feColorMatrix\",{in:\"outerBlur\",type:\"matrix\",values:\"1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 0.65 0\",result:\"outerGlow\"}),glowStyle===\"natural\"&&/*#__PURE__*/_jsx(\"feGaussianBlur\",{in:\"SourceGraphic\",stdDeviation:Math.max(0,glowSoftness),result:\"softStroke\"}),/*#__PURE__*/_jsxs(\"feMerge\",{children:[/*#__PURE__*/_jsx(\"feMergeNode\",{in:\"outerGlow\"}),/*#__PURE__*/_jsx(\"feMergeNode\",{in:glowStyle===\"natural\"?\"softStroke\":\"SourceGraphic\"})]})]})}),/*#__PURE__*/_jsx(\"path\",{d:pathD,fill:\"none\",stroke:trackColor,strokeWidth:effectiveStrokeWidth,opacity:Math.max(0,Math.min(1,trackOpacity)),strokeLinecap:\"round\",strokeLinejoin:\"round\",vectorEffect:vectorEffect}),/*#__PURE__*/_jsx(motion.path,{ref:pathRef,d:pathD,fill:\"none\",stroke:glowColor,strokeWidth:effectiveStrokeWidth,strokeLinecap:\"round\",strokeLinejoin:\"round\",vectorEffect:vectorEffect,filter:glowBlur>0||glowStyle===\"natural\"&&glowSoftness>0?`url(#${filterId})`:undefined,strokeDasharray:`${segmentLength} ${pathLength*3}`,initial:false,animate:shouldAnimate?{strokeDashoffset:[0,-(pathLength*3+segmentLength)]}:{strokeDashoffset:0},transition:shouldAnimate?{duration:adjustedDuration,repeat:Infinity,ease:\"linear\"}:undefined})]})});}SVGPathAnimation.displayName=\"Animated Line\";addPropertyControls(SVGPathAnimation,{trackColor:{type:ControlType.Color,title:\"Track\",defaultValue:\"#CCCCCC\"},trackOpacity:{type:ControlType.Number,title:\"Track Opacity\",defaultValue:.12,min:0,max:1,step:.01},glowColor:{type:ControlType.Color,title:\"Glow\",defaultValue:\"#FF8800\"},glowBlur:{type:ControlType.Number,title:\"Glow Blur\",defaultValue:10,min:0,max:30,step:1},glowStyle:{type:ControlType.Enum,title:\"Glow Style\",options:[\"classic\",\"natural\"],optionTitles:[\"Classic\",\"Natural\"],defaultValue:\"classic\",displaySegmentedControl:true},glowSoftness:{type:ControlType.Number,title:\"Glow Soft\",defaultValue:2,min:0,max:10,step:.5,unit:\"px\",hidden:({glowStyle})=>glowStyle!==\"natural\"},strokeWidth:{type:ControlType.Number,title:\"Line Width\",defaultValue:6,min:.5,max:40,step:.5,unit:\"px\"},strokeBehavior:{type:ControlType.Enum,title:\"Width Mode\",options:[\"consistent\",\"svg-scale\"],optionTitles:[\"Consistent\",\"SVG Scale\"],defaultValue:\"consistent\",displaySegmentedControl:true},segmentLengthPercent:{type:ControlType.Number,title:\"Segment Len\",defaultValue:12,min:1,max:60,step:1,unit:\"%\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:3,min:0,max:20,step:.1,unit:\"s\"},curveDepth:{type:ControlType.Number,title:\"Curve Depth\",defaultValue:60,min:0,max:110,step:1,unit:\"px\"},gapWidthPercent:{type:ControlType.Number,title:\"Gap Width\",defaultValue:12,min:0,max:60,step:1,unit:\"%\"},paddingPercent:{type:ControlType.Number,title:\"Padding\",defaultValue:6,min:0,max:30,step:1,unit:\"%\"},overflow:{type:ControlType.Enum,title:\"Overflow\",options:[\"visible\",\"hidden\"],optionTitles:[\"Visible\",\"Hidden\"],defaultValue:\"visible\",displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SVGPathAnimation\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"800\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"120\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SVGPathAnimation_2.map"],"mappings":"kSASG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,aAAW,UAAU,eAAa,IAAI,YAAU,UAAU,WAAS,GAAG,eAAa,EAAE,YAAU,UAAU,cAAY,EAAE,iBAAe,aAAa,uBAAqB,GAAG,WAAS,EAAE,aAAW,GAAG,kBAAgB,GAAG,iBAAe,EAAE,WAAS,UAAU,SAAO,EAAY,EAAS,EAAoB,EAAQ,EAAaA,EAAO,IAAI,EAAQ,EAAO,EAAU,EAAa,CAAC,OAAO,EAAE,CAAC,EAAQ,EAASC,EAAM,EACtc,EAAI,IACL,CAAC,EAAc,GAAkBC,EAAS,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,MAAc,CAAuC,GAA5B,IAAS,QAAsB,CAAC,EAAa,QAAQ,OAAO,IAAM,EAAG,EAAa,QAAc,MAAW,CAAC,IAAM,EAAK,EAAG,sBAAsB,EAAQ,EAAE,KAAK,IAAI,EA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