{"version":3,"file":"PathShimmer.cZfAz2i7.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/i5TaOKMMO9MVAMjAIXQD/pXHz8lD5mLsSY9VYgg70/PathShimmer.js"],"sourcesContent":["// SVG path shimmer component - animates a shimmer effect along an SVG path\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion}from\"framer-motion\";/**\n * SVG Path Shimmer\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function PathShimmer(props){const{useFile=false,svgFile=\"\",svgPath=\"M50,200 Q200,50 350,200 T650,200\",strokeColor=\"#CCCCCC\",strokeWidth=3,shimmerColor=\"#0099FF\",shimmerWidth=50,shimmerSpeed=2,shimmerOpacity=.8,showGlow=true,glowIntensity=10,loop=true,autoPlay=true,backgroundColor=\"#FFFFFF\",direction=\"ltr\",delay=0,fps=60}=props;const pathRef=useRef(null);const[pathLength,setPathLength]=useState(0);const[extractedPath,setExtractedPath]=useState(\"\");const[viewBox,setViewBox]=useState(null);const isStatic=useIsStaticRenderer();const[isLoading,setIsLoading]=useState(false);// Extract path from uploaded SVG file\nuseEffect(()=>{if(useFile&&svgFile&&typeof window!==\"undefined\"){startTransition(()=>setIsLoading(true));fetch(svgFile).then(response=>response.text()).then(svgText=>{const parser=new DOMParser;const svgDoc=parser.parseFromString(svgText,\"image/svg+xml\");const pathElement=svgDoc.querySelector(\"path\");if(pathElement){const d=pathElement.getAttribute(\"d\");if(d){startTransition(()=>{setExtractedPath(d);setIsLoading(false);});}}else{startTransition(()=>setIsLoading(false));}}).catch(error=>{console.error(\"Error loading SVG file:\",error);startTransition(()=>setIsLoading(false));});}else if(!useFile){startTransition(()=>setIsLoading(false));}},[useFile,svgFile]);const currentPath=useFile&&extractedPath?extractedPath:svgPath;// Calculate viewBox from path bounds\nuseEffect(()=>{if(pathRef.current&&typeof window!==\"undefined\"){const length=pathRef.current.getTotalLength();startTransition(()=>setPathLength(length));try{const bbox=pathRef.current.getBBox();const padding=showGlow?Math.max(strokeWidth,glowIntensity)*2:strokeWidth*2;const vb=`${bbox.x-padding} ${bbox.y-padding} ${bbox.width+padding*2} ${bbox.height+padding*2}`;startTransition(()=>setViewBox(vb));}catch(e){// Fallback to default viewBox if getBBox fails\nconsole.error(\"Error calculating viewBox:\",e);}}},[currentPath,strokeWidth,glowIntensity,showGlow]);// Calculate initial viewBox synchronously for consistent rendering\nconst getInitialViewBox=()=>{if(viewBox)return viewBox;// Create a temporary SVG to measure the path\nif(typeof window!==\"undefined\"){const tempSvg=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");const tempPath=document.createElementNS(\"http://www.w3.org/2000/svg\",\"path\");tempPath.setAttribute(\"d\",currentPath);tempSvg.appendChild(tempPath);tempSvg.style.position=\"absolute\";tempSvg.style.visibility=\"hidden\";document.body.appendChild(tempSvg);try{const bbox=tempPath.getBBox();const padding=showGlow?Math.max(strokeWidth,glowIntensity)*2:strokeWidth*2;document.body.removeChild(tempSvg);return`${bbox.x-padding} ${bbox.y-padding} ${bbox.width+padding*2} ${bbox.height+padding*2}`;}catch(e){document.body.removeChild(tempSvg);return\"0 0 700 400\";}}return\"0 0 700 400\";};const currentViewBox=getInitialViewBox();const containerStyle={width:\"100%\",height:\"100%\",minHeight:\"5px\",minWidth:\"5px\",backgroundColor,display:\"flex\",alignItems:\"flex-start\",justifyContent:\"flex-start\"};// Don't render SVG if we're waiting for a custom file to load\nif(useFile&&isLoading){return /*#__PURE__*/_jsx(\"div\",{style:containerStyle});}// Don't render if using file mode but no path extracted yet\nif(useFile&&!extractedPath){return /*#__PURE__*/_jsx(\"div\",{style:containerStyle});}if(isStatic){return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsxs(\"svg\",{width:\"100%\",height:\"100%\",viewBox:currentViewBox,preserveAspectRatio:\"xMidYMid meet\",style:{overflow:\"visible\",minHeight:\"5px\",minWidth:\"5px\"},children:[/*#__PURE__*/_jsx(\"defs\",{children:/*#__PURE__*/_jsxs(\"filter\",{id:\"glow\",children:[/*#__PURE__*/_jsx(\"feGaussianBlur\",{stdDeviation:glowIntensity,result:\"coloredBlur\"}),/*#__PURE__*/_jsxs(\"feMerge\",{children:[/*#__PURE__*/_jsx(\"feMergeNode\",{in:\"coloredBlur\"}),/*#__PURE__*/_jsx(\"feMergeNode\",{in:\"SourceGraphic\"})]})]})}),/*#__PURE__*/_jsx(\"path\",{d:currentPath,stroke:strokeColor,strokeWidth:strokeWidth,fill:\"none\",strokeLinecap:\"round\",strokeLinejoin:\"round\"}),/*#__PURE__*/_jsx(\"path\",{d:currentPath,stroke:shimmerColor,strokeWidth:strokeWidth,fill:\"none\",strokeLinecap:\"round\",strokeLinejoin:\"round\",opacity:shimmerOpacity,strokeDasharray:`${shimmerWidth} ${pathLength}`,strokeDashoffset:pathLength*.3,filter:showGlow?\"url(#glow)\":undefined})]})});}return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsxs(\"svg\",{width:\"100%\",height:\"100%\",viewBox:currentViewBox,preserveAspectRatio:\"xMidYMid meet\",style:{overflow:\"visible\",minHeight:\"5px\",minWidth:\"5px\"},children:[/*#__PURE__*/_jsx(\"defs\",{children:/*#__PURE__*/_jsxs(\"filter\",{id:\"glow-animated\",children:[/*#__PURE__*/_jsx(\"feGaussianBlur\",{stdDeviation:glowIntensity,result:\"coloredBlur\"}),/*#__PURE__*/_jsxs(\"feMerge\",{children:[/*#__PURE__*/_jsx(\"feMergeNode\",{in:\"coloredBlur\"}),/*#__PURE__*/_jsx(\"feMergeNode\",{in:\"SourceGraphic\"})]})]})}),/*#__PURE__*/_jsx(\"path\",{ref:pathRef,d:currentPath,stroke:strokeColor,strokeWidth:strokeWidth,fill:\"none\",strokeLinecap:\"round\",strokeLinejoin:\"round\"}),/*#__PURE__*/_jsx(motion.path,{d:currentPath,stroke:shimmerColor,strokeWidth:strokeWidth,fill:\"none\",strokeLinecap:\"round\",strokeLinejoin:\"round\",opacity:shimmerOpacity,strokeDasharray:`${shimmerWidth} ${pathLength}`,filter:showGlow?\"url(#glow-animated)\":undefined,initial:{strokeDashoffset:direction===\"ltr\"?pathLength:-pathLength},animate:autoPlay?{strokeDashoffset:direction===\"ltr\"?-pathLength:pathLength}:{},transition:{duration:shimmerSpeed,repeat:loop?Infinity:0,ease:\"linear\",delay:delay}})]})});}addPropertyControls(PathShimmer,{useFile:{type:ControlType.Boolean,title:\"Source\",defaultValue:false,enabledTitle:\"File\",disabledTitle:\"Path\"},svgFile:{type:ControlType.File,title:\"SVG File\",allowedFileTypes:[\"svg\"],hidden:({useFile})=>!useFile},svgPath:{type:ControlType.String,title:\"SVG Path\",defaultValue:\"M50,200 Q200,50 350,200 T650,200\",displayTextArea:true,hidden:({useFile})=>useFile},strokeColor:{type:ControlType.Color,title:\"Stroke Color\",defaultValue:\"#CCCCCC\"},strokeWidth:{type:ControlType.Number,title:\"Stroke Width\",defaultValue:3,min:1,max:20,step:1},shimmerColor:{type:ControlType.Color,title:\"Shimmer Color\",defaultValue:\"#0099FF\"},shimmerWidth:{type:ControlType.Number,title:\"Shimmer Width\",defaultValue:50,min:10,max:200,step:5},shimmerSpeed:{type:ControlType.Number,title:\"Speed\",defaultValue:2,min:.5,max:10,step:.5,unit:\"s\"},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:0,min:0,max:10,step:.1,unit:\"s\"},shimmerOpacity:{type:ControlType.Number,title:\"Shimmer Opacity\",defaultValue:.8,min:0,max:1,step:.1},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"ltr\",\"rtl\"],optionTitles:[\"Left to Right\",\"Right to Left\"],defaultValue:\"ltr\",displaySegmentedControl:true},showGlow:{type:ControlType.Boolean,title:\"Glow\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},glowIntensity:{type:ControlType.Number,title:\"Glow Intensity\",defaultValue:10,min:0,max:30,step:1,hidden:({showGlow})=>!showGlow},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},autoPlay:{type:ControlType.Boolean,title:\"Auto Play\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},fps:{type:ControlType.Number,title:\"FPS\",defaultValue:60,min:1,max:120,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PathShimmer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicHeight\":\"400\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicWidth\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PathShimmer.map"],"mappings":"wQASG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,UAAQ,GAAM,UAAQ,GAAG,UAAQ,mCAAmC,cAAY,UAAU,cAAY,EAAE,eAAa,UAAU,eAAa,GAAG,eAAa,EAAE,iBAAe,GAAG,WAAS,GAAK,gBAAc,GAAG,OAAK,GAAK,WAAS,GAAK,kBAAgB,UAAU,YAAU,MAAM,QAAM,EAAE,MAAI,IAAI,EAAY,EAAQA,EAAO,IAAI,EAAO,CAAC,EAAW,GAAeC,EAAS,CAAC,EAAO,CAAC,EAAc,GAAkBA,EAAS,EAAE,EAAO,CAAC,EAAQ,GAAYA,EAAS,IAAI,EAAQ,EAAS,EAAoB,EAAO,CAAC,EAAU,GAAcA,EAAS,EAAK,EAC/kB,MAAc,CAAI,GAAS,GAAgB,IAAS,QAAa,MAAoB,EAAa,EAAI,CAAC,EAAE,MAAM,CAAO,CAAC,CAAC,KAAK,GAAU,EAAS,KAAK,CAAC,CAAC,CAAC,KAAK,GAAS,CAAyF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