{"version":3,"file":"RecaptchaInput_2.CLUYH_-G.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/sK3yDkoWPMdKegT8dqyk/zbzY2fgSX8WZFMOWZK1J/RecaptchaInput_2.js"],"sourcesContent":["// RecaptchaInput: Framer reCAPTCHA input that is required by Framer Form. Fixes hidden input to allow required validation.\n//The error you’re seeing on the reCAPTCHA component onframer project canvas is normal — it won’t appear on the published domain.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * RecaptchaInput\n *\n * Framer reCAPTCHA input that is required by Framer Form. Hidden input is not readOnly so required validation works.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function RecaptchaInput(props){const{siteKey,size,errorMessage,style}=props;const containerRef=useRef(null);const inputRef=useRef(null);const[verified,setVerified]=useState(false);const[error,setError]=useState(\"\");// Load reCAPTCHA script\nuseEffect(()=>{if(typeof window===\"undefined\"||!siteKey)return;const existingScript=document.querySelector(\"#google-recaptcha-script\");if(!existingScript){const script=document.createElement(\"script\");script.id=\"google-recaptcha-script\";script.src=`https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoad&render=explicit&_=${Date.now()}`;script.async=true;script.defer=true;document.body.appendChild(script);}else{if(window.grecaptcha?.render){window.onRecaptchaLoad();}}window.onRecaptchaLoad=()=>{if(!window.grecaptcha||!containerRef.current)return;try{window.grecaptcha.render(containerRef.current,{sitekey:siteKey.trim(),size,callback:token=>{startTransition(()=>{const valid=!!token;setVerified(valid);setError(valid?\"\":errorMessage);});},\"expired-callback\":()=>{startTransition(()=>{setVerified(false);setError(errorMessage);});},\"error-callback\":()=>{startTransition(()=>{setVerified(false);setError(\"Invalid site key or configuration.\");});}});}catch(err){console.error(\"reCAPTCHA render error:\",err);setError(\"Failed to render reCAPTCHA.\");}};},[siteKey,size]);// Trigger input + change events for Framer Form validation\nuseEffect(()=>{if(!inputRef.current)return;const input=inputRef.current;const event=new Event(\"input\",{bubbles:true});const change=new Event(\"change\",{bubbles:true});input.value=verified?\"1\":\"\";input.dispatchEvent(event);input.dispatchEvent(change);},[verified]);if(!siteKey||siteKey.trim().length<30){return /*#__PURE__*/_jsx(\"div\",{style:{color:\"#c00\",fontSize:13},children:\"⚠️ Invalid reCAPTCHA site key. Add a valid key in Property Controls.\"});}if(RenderTarget.current()===RenderTarget.thumbnail)return null;return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:\"flex-start\",...style},children:[/*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{minHeight:size===\"compact\"?60:80,width:size===\"compact\"?180:304}}),error&&/*#__PURE__*/_jsx(\"span\",{style:{color:\"#c00\",fontSize:13,marginTop:6},children:error}),/*#__PURE__*/_jsx(\"input\",{ref:inputRef,type:\"text\",name:\"recaptcha\",value:verified?\"1\":\"\",required:true,style:{opacity:0,height:0,width:0,position:\"absolute\"},tabIndex:-1,\"aria-hidden\":\"true\",autoComplete:\"off\"})]});}addPropertyControls(RecaptchaInput,{siteKey:{type:ControlType.String,title:\"Site Key\",placeholder:\"Paste reCAPTCHA site key\"},size:{type:ControlType.Enum,title:\"Size\",options:[\"normal\",\"compact\"],optionTitles:[\"Normal\",\"Compact\"],defaultValue:\"normal\",displaySegmentedControl:true},errorMessage:{type:ControlType.String,title:\"Error Message\",defaultValue:\"Please verify you are not a robot.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RecaptchaInput\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RecaptchaInput_2.map"],"mappings":"sNASG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC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