{"version":3,"file":"AIButton.CvUIPLd3.mjs","names":["useState","useMemo"],"sources":["https:/framerusercontent.com/modules/cwIF1OBCkeGn1Zf9Dtk1/Vtxk3Vj7YFgTKEDh6euV/AIButton.js"],"sourcesContent":["// Animated button with AI-powered visual effects\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo,useState,startTransition}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function AIButton(props){const{text,backgroundColor,textColor,glowColor,font,borderRadius,paddingX,paddingY,loadingDuration,spinnerColor,url,style}=props;const[isLoading,setIsLoading]=useState(false);const particles=useMemo(()=>{return Array.from({length:20},(_,i)=>({id:i,x:Math.random()*100,y:Math.random()*100,size:Math.random()*2+1,duration:Math.random()*1.5+1,delay:Math.random()*2}));},[]);const handleClick=()=>{if(isLoading)return;startTransition(()=>setIsLoading(true));setTimeout(()=>{startTransition(()=>setIsLoading(false));if(url&&typeof window!==\"undefined\"){window.open(url,\"_blank\");}},loadingDuration*1e3);};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",display:\"inline-block\",width:\"100%\",height:\"100%\"},children:[particles.map(particle=>/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",width:`${particle.size}px`,height:`${particle.size}px`,borderRadius:\"50%\",background:glowColor,boxShadow:`0 0 10px ${glowColor}`,left:`${particle.x}%`,top:`${particle.y}%`,pointerEvents:\"none\"},animate:{y:[0,-20,0],x:[0,Math.random()*10-5,0],opacity:[0,1,0],scale:[0,1,0]},transition:{duration:particle.duration,repeat:Number.POSITIVE_INFINITY,delay:particle.delay,ease:\"easeInOut\"}},particle.id)),/*#__PURE__*/_jsxs(motion.button,{style:{...style,position:\"relative\",background:backgroundColor,color:textColor,border:\"none\",borderRadius:`${borderRadius}px`,padding:`${paddingY}px ${paddingX}px`,cursor:isLoading?\"not-allowed\":\"pointer\",overflow:\"hidden\",...font,minWidth:\"max-content\",opacity:isLoading?.8:1,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},whileHover:isLoading?{}:{scale:1.05},whileTap:isLoading?{}:{scale:.95},onClick:handleClick,disabled:isLoading,children:[/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:0,left:0,right:0,bottom:0,background:`linear-gradient(90deg, transparent, ${glowColor}, transparent)`,opacity:.5},animate:{x:[\"-100%\",\"200%\"]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:\"linear\"}}),/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:\"50%\",left:\"50%\",width:\"100%\",height:\"100%\",background:`radial-gradient(circle, ${glowColor} 0%, transparent 70%)`,transform:\"translate(-50%, -50%)\",opacity:.3},animate:{scale:[1,1.2,1],opacity:[.3,.5,.3]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,ease:\"easeInOut\"}}),/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:0,left:0,right:0,bottom:0,boxShadow:`0 0 20px ${glowColor}`,borderRadius:`${borderRadius}px`,opacity:.6},animate:{opacity:[.4,.8,.4]},transition:{duration:1.5,repeat:Number.POSITIVE_INFINITY,ease:\"easeInOut\"}}),/*#__PURE__*/_jsxs(\"span\",{style:{position:\"relative\",zIndex:1,display:\"flex\",alignItems:\"center\",gap:\"8px\"},children:[isLoading&&/*#__PURE__*/_jsx(motion.div,{style:{width:\"16px\",height:\"16px\",border:`2px solid ${spinnerColor}`,borderTopColor:\"transparent\",borderRadius:\"50%\"},animate:{rotate:360},transition:{duration:.8,repeat:Number.POSITIVE_INFINITY,ease:\"linear\"}}),isLoading?\"Loading...\":text]})]})]});}addPropertyControls(AIButton,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Start Free Trial\"},url:{type:ControlType.String,title:\"URL\",defaultValue:\"https://www.framer.com\",placeholder:\"https://example.com\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},glowColor:{type:ControlType.Color,title:\"Glow Color\",defaultValue:\"#0099FF\"},spinnerColor:{type:ControlType.Color,title:\"Spinner Color\",defaultValue:\"#FFFFFF\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"20px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:50,step:1},paddingX:{type:ControlType.Number,title:\"Padding X\",defaultValue:40,min:0,max:100,step:1},paddingY:{type:ControlType.Number,title:\"Padding Y\",defaultValue:20,min:0,max:100,step:1},loadingDuration:{type:ControlType.Number,title:\"Loading Duration\",defaultValue:.8,min:.5,max:10,step:.5,unit:\"s\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AIButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AIButton.map"],"mappings":"yPAIG,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,OAAK,kBAAgB,YAAU,YAAU,OAAK,eAAa,WAAS,WAAS,kBAAgB,eAAa,MAAI,SAAO,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAO,EAAUC,MAAoB,MAAM,KAAK,CAAC,OAAO,GAAG,EAAE,EAAE,KAAK,CAAC,GAAG,EAAE,EAAE,KAAK,QAAQ,CAAC,IAAI,EAAE,KAAK,QAAQ,CAAC,IAAI,KAAK,KAAK,QAAQ,CAAC,EAAE,EAAE,SAAS,KAAK,QAAQ,CAAC,IAAI,EAAE,MAAM,KAAK,QAAQ,CAAC,EAAE,EAAE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