{"version":3,"file":"LeadCaptureButton.BhhQLHTY.mjs","names":["useRef","useState","React.useState","useState","React.useCallback"],"sources":["https:/framerusercontent.com/modules/jfK7C7JmdHGaVBsvt1V7/AGG8ARtz8MurBNtcvgvB/DotLottie.js","https:/framerusercontent.com/modules/9LoEdcESFphJNKKFj1k9/cTUxX22loR8m4eLLOSOX/LeadCaptureButton.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef,useState}from\"react\";const placeholderUrl=\"https://lottie.host/d826e0a7-b7e8-4072-8afe-c943ed2dd2ca/DpX3m5yT5Z.lottie\";/**\n * DOT LOTTIE\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 200\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function DotLottie(props){return /*#__PURE__*/_jsx(OptimizationFriendly,{loading:/*#__PURE__*/_jsx(\"div\",{}),loaded:/*#__PURE__*/_jsx(LottiePlayer,{...props})});}function LottiePlayer(props){/* Checks */const isCanvas=RenderTarget.current()===RenderTarget.canvas;const lottieInstanceRef=useRef(null);const shouldPlay=isCanvas||props.hover===true||props.autoplay===false?null:true;/* File or URL */let src;switch(props.srcType){case\"url\":src=props.srcUrl;break;case\"file\":src=props.srcFile;break;default:src=placeholderUrl;break;}/* Progress */const[isReady,setIsReady]=useState(false);/* For canvas states */useEffect(()=>{if(!lottieInstanceRef.current)return;lottieInstanceRef.current.addEventListener(\"ready\",()=>setIsReady(true));},[]);useEffect(()=>{if(!lottieInstanceRef.current)return;lottieInstanceRef.current.seek(`${props.progress}%`);},[isReady,props.progress]);const lastVariant=useRef();/* For component variant support */useEffect(()=>{if(isCanvas)return;if(lastVariant.current!==props.autoplay){if(!lottieInstanceRef.current)return;if(props.autoplay===true){lottieInstanceRef.current.play();}if(props.autoplay===false){lottieInstanceRef.current.pause();}}lastVariant.current=props.autoplay;},[props.autoplay]);return(// @ts-ignore\n/*#__PURE__*/_jsx(\"dotlottie-player\",{src:src,ref:lottieInstanceRef,autoplay:shouldPlay,loop:props.loop?true:null,hover:props.hover?true:null,controls:props.controls?true:null,background:props.background?props.background:null,speed:props.speed,direction:props.direction,style:{...props.style,width:\"100%\",height:\"100%\"}},src));}DotLottie.defaultProps={srcUrl:placeholderUrl,autoplay:true,background:\"#05F\",controls:false,direction:1,hover:false,loop:true,speed:1};DotLottie.displayName=\"Dot Lottie\";addPropertyControls(DotLottie,{srcType:{type:ControlType.Enum,displaySegmentedControl:true,title:\"Source\",options:[\"url\",\"file\"],optionTitles:[\"URL\",\"File\"]},srcUrl:{type:ControlType.String,title:\"Link\",placeholder:\"../example.lottie\",hidden:props=>props.srcType===\"file\"},srcFile:{type:ControlType.File,title:\"File\",allowedFileTypes:[\"lottie\",\"json\"],hidden:props=>props.srcType===\"url\"},autoplay:{type:ControlType.Boolean,title:\"Autoplay\",defaultValue:true},background:{type:ControlType.Color,title:\"Backdrop\",defaultValue:\"#05F\"},controls:{type:ControlType.Boolean,title:\"Controls\"},direction:{type:ControlType.Enum,title:\"Direction\",defaultValue:\"1\",displaySegmentedControl:true,segmentedControlDirection:\"horizontal\",options:[\"1\",\"-1\"],optionTitles:[\"Normal\",\"Reverse\"]},hover:{type:ControlType.Boolean,title:\"Hover Play\"},loop:{type:ControlType.Boolean,title:\"Loop\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:1,min:1,max:10,unit:\"x\",step:.5,displayStepper:true},progress:{type:ControlType.Number,title:\"Progress\",defaultValue:0,min:0,max:100,step:1,description:\"This component is made for Lottie files. [Learn more here](https://dotlottie.io/).\"}});/* For SSG */function OptimizationFriendly({loading,loaded}){const[isLoading,setLoading]=React.useState(true);// We can't load web-components in ssg on the server,\n// so we defer rendering until we hit the client.\nReact.useEffect(()=>{import(\"https://unpkg.com/@dotlottie/player-component@2.7.12/dist/dotlottie-player.js\").then(()=>{setLoading(false);});},[]);return isLoading?loading:loaded;}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DotLottie\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"200\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerDisableUnlink\":\"*\",\"framerIntrinsicWidth\":\"200\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DotLottie.map","import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useSubmitLead}from\"https://framerusercontent.com/modules/mIFsx1SKduyE5CUnCQgs/QEHQC3Hdq9w7c80nfA97/LeadCaptureQuery.js\";export default function LeadCaptureButton({source,label=\"Submit\",wrapperName=\"resultsRequestForm\",backgroundColor=\"#ff5d1a\",textColor=\"#ffffff\",hoverBackgroundColor=\"#e14e12\",hoverTextColor=\"#ffffff\",borderRadius=9999,paddingX=24,paddingY=12,fontSize=16,fontWeight=600,fontFamily=\"Inter, sans-serif\",fullWidth=false,emailErrorMessage=\"We need your email to send the receipt.\",formSelector}){const[hover,setHover]=useState(false);const[loading,setLoading]=useState(false);const[success,setSuccess]=useState(false);const{submitLead}=useSubmitLead();const findForm=React.useCallback(()=>{if(formSelector){const manual=document.querySelector(formSelector);if(manual)return manual;}const wrapper=document.querySelector(`[data-framer-name=\"${wrapperName}\"]`);const inWrapper=wrapper?.querySelector(\"form\");if(inWrapper)return inWrapper;const candidates=Array.from(document.querySelectorAll(\"form\"));if(wrapper){const inside=candidates.find(f=>wrapper.contains(f));if(inside)return inside;}return candidates[0]??null;},[wrapperName,formSelector]);const getInput=(form,name)=>form.elements.namedItem(name)||form.querySelector(`[name=\"${CSS.escape(name)}\"]`)||form.querySelector(`[data-name=\"${CSS.escape(name)}\"]`);const getVal=(form,name)=>{const el=getInput(form,name);return el?(el.value||\"\").trim():\"\";};const handleSubmit=async()=>{const form=findForm();if(!form){alert(\"Form not found. Please check your setup.\");return;}if(!form.checkValidity()){form.reportValidity();return;}const emailVal=getVal(form,\"email\");if(!emailVal){getInput(form,\"email\")?.focus();alert(emailErrorMessage);return;}try{setLoading(true);setSuccess(false);await submitLead({email:emailVal,source:source});// ✅ Show success state\nsetSuccess(true);// Optional: reset after 3 seconds\nsetTimeout(()=>setSuccess(false),3e3);}catch(err){console.error(\"Lead submission failed:\",err);alert(\"Something went wrong. Please try again.\");}finally{setLoading(false);}};return /*#__PURE__*/_jsx(\"button\",{onClick:handleSubmit,onMouseEnter:()=>setHover(true),onMouseLeave:()=>setHover(false),disabled:loading||success,style:{display:fullWidth?\"block\":\"inline-block\",width:fullWidth?\"100%\":\"auto\",backgroundColor:success?\"#ffffff\":hover?hoverBackgroundColor:backgroundColor,color:success?\"#000000\":hover?hoverTextColor:textColor,border:\"none\",borderRadius,padding:`${paddingY}px ${paddingX}px`,fontSize,fontWeight,fontFamily,cursor:loading?\"default\":\"pointer\",opacity:loading?.8:1,transition:\"background 0.2s ease, color 0.2s ease, opacity 0.2s ease\"},children:success?\"Thank you!\":loading?\"Submitting...\":label});}addPropertyControls(LeadCaptureButton,{source:{type:ControlType.String,title:\"Source\",defaultValue:\"kit-sample-report\",description:\"Lead source identifier\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LeadCaptureButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"wQASG,SAAwB,EAAU,EAAM,CAAC,OAAoB,EAAK,EAAqB,CAAC,QAAqB,EAAK,MAAM,EAAE,CAAC,CAAC,OAAoB,EAAK,EAAa,CAAC,GAAG,EAAM,CAAC,CAAC,CAAC,CAAE,SAAS,EAAa,EAAM,CAAa,IAAM,EAAS,EAAa,SAAS,GAAG,EAAa,OAAa,EAAkBA,EAAO,KAAK,CAAO,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