{"version":3,"file":"ReCaptcha.DOe_cPLG.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/DE6BySIbrF4lpw2I5OBL/CTp1gZeoERNklO2DHHca/ReCaptcha.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * Google reCAPTCHA v2 Component for Framer\n * Nelon Meele\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 78\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function ReCaptcha(props){const{siteKey,theme,size,name,required,successMessage,errorMessage,bottomSpacing,onVerify,onExpire,onError}=props;const[isVerified,setIsVerified]=useState(false);const[isScriptLoaded,setIsScriptLoaded]=useState(false);const[recaptchaId,setRecaptchaId]=useState(null);const[showError,setShowError]=useState(false);const containerRef=useRef(null);const uniqueId=useRef(`recaptcha-${Math.random().toString(36).substring(2,11)}`);const loadReCaptchaScript=()=>{if(typeof window===\"undefined\"||window.grecaptcha||document.querySelector('script[src*=\"recaptcha\"]')){setIsScriptLoaded(true);return;}const script=document.createElement(\"script\");script.src=`https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoaded&render=explicit`;script.async=true;script.defer=true;window.onRecaptchaLoaded=()=>{setIsScriptLoaded(true);};document.head.appendChild(script);};useEffect(()=>{if(RenderTarget.current()===RenderTarget.canvas){return;}loadReCaptchaScript();const handleFormSubmit=e=>{const form=e.target.closest(\"form\");if(!form)return;const recaptchaElement=form.querySelector(`input[name=\"${name}\"]`);if(!recaptchaElement)return;if(required&&!isVerified){e.preventDefault();e.stopPropagation();setShowError(true);containerRef.current?.scrollIntoView({behavior:\"smooth\",block:\"center\"});setTimeout(()=>{setShowError(false);},3e3);return false;}};document.addEventListener(\"submit\",handleFormSubmit,true);return()=>{document.removeEventListener(\"submit\",handleFormSubmit,true);if(recaptchaId!==null&&window.grecaptcha){window.grecaptcha.reset(recaptchaId);}delete window.onRecaptchaLoaded;};},[name,required,isVerified]);useEffect(()=>{if(!isScriptLoaded||!containerRef.current||!siteKey||RenderTarget.current()===RenderTarget.canvas){return;}if(recaptchaId!==null&&window.grecaptcha){window.grecaptcha.reset(recaptchaId);setIsVerified(false);}try{const id=window.grecaptcha.render(containerRef.current,{sitekey:siteKey,theme:theme,size:size,callback:token=>{setIsVerified(true);setShowError(false);if(onVerify){onVerify({token});}},\"expired-callback\":()=>{setIsVerified(false);if(onExpire){onExpire();}},\"error-callback\":err=>{setIsVerified(false);if(onError){onError({error:err});}}});setRecaptchaId(id);}catch(error){console.error(\"Error rendering reCAPTCHA:\",error);if(onError){onError({error});}}},[isScriptLoaded,siteKey,theme,size,onVerify,onExpire,onError]);if(RenderTarget.current()===RenderTarget.canvas){return /*#__PURE__*/_jsx(\"div\",{style:styles.canvasContainer,children:/*#__PURE__*/_jsxs(\"div\",{style:styles.canvasPlaceholder,children:[/*#__PURE__*/_jsx(\"div\",{style:styles.logoContainer,children:/*#__PURE__*/_jsxs(\"svg\",{style:styles.logo,width:\"27\",height:\"27\",xmlns:\"http://www.w3.org/2000/svg\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M27 13.5C27 20.9558 20.9558 27 13.5 27C6.04416 27 0 20.9558 0 13.5C0 6.04416 6.04416 0 13.5 0C20.9558 0 27 6.04416 27 13.5Z\",fill:\"white\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M13.5 4.0575C8.226 4.0575 4.0575 8.226 4.0575 13.5C4.0575 18.774 8.226 22.9425 13.5 22.9425C15.147 22.9425 16.6905 22.4973 18.0158 21.7298C18.7193 21.35 18.8753 20.419 18.4955 19.7155C18.1158 19.012 17.1847 18.856 16.4812 19.2358C15.6285 19.7183 14.596 19.9628 13.5 19.9628C9.873 19.9628 7.0373 17.127 7.0373 13.5C7.0373 9.873 9.873 7.0373 13.5 7.0373C15.7073 7.0373 17.6175 8.2283 18.6683 10.0035C18.9705 10.5465 19.0688 10.854 19.1355 11.2928C19.1873 11.6348 19.1648 11.9408 19.0553 12.4425H13.9253C13.1498 12.4425 12.5235 13.0688 12.5235 13.8443C12.5235 14.6197 13.1498 15.246 13.9253 15.246H21.4628C22.2383 15.246 22.8645 14.6197 22.8645 13.8443V13.5C22.8645 13.446 22.865 13.392 22.8638 13.338C22.8525 12.1035 22.7073 11.2185 22.3755 10.2578C20.8223 6.5205 17.446 4.0575 13.5 4.0575Z\",fill:\"#1C3AA9\"})]})}),/*#__PURE__*/_jsx(\"div\",{style:styles.canvasText,children:\"reCAPTCHA\"}),/*#__PURE__*/_jsxs(\"div\",{style:styles.canvasTheme,children:[\"Theme: \",/*#__PURE__*/_jsx(\"strong\",{children:theme})]}),/*#__PURE__*/_jsxs(\"div\",{style:styles.canvasSize,children:[\"Size: \",/*#__PURE__*/_jsx(\"strong\",{children:size})]}),required&&/*#__PURE__*/_jsxs(\"div\",{style:styles.canvasRequired,children:[\"Required: \",/*#__PURE__*/_jsx(\"strong\",{children:\"Yes\"})]})]})});}return /*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:name,value:isVerified?\"verified\":\"\",required:required}),/*#__PURE__*/_jsxs(\"div\",{style:{...styles.container,marginBottom:`${bottomSpacing}px`},children:[/*#__PURE__*/_jsx(\"div\",{id:uniqueId.current,ref:containerRef}),isVerified&&successMessage&&/*#__PURE__*/_jsx(\"div\",{style:styles.successMessage,children:successMessage}),showError&&required&&/*#__PURE__*/_jsx(\"div\",{style:styles.errorMessage,children:errorMessage})]})]});}const styles={container:{display:\"flex\",flexDirection:\"column\",alignItems:\"flex-start\",marginBottom:\"40px\",position:\"relative\",width:\"100%\"},successMessage:{color:\"#4CAF50\",fontSize:\"14px\",marginTop:\"8px\",position:\"absolute\",top:\"100%\"},errorMessage:{color:\"#FF3B30\",fontSize:\"14px\",marginTop:\"8px\",fontWeight:\"500\",position:\"absolute\",top:\"100%\"},canvasContainer:{width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",backgroundColor:\"#f9f9f9\",border:\"1px solid #d3d3d3\",borderRadius:\"4px\"},canvasPlaceholder:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",width:\"100%\",height:\"100%\",padding:\"10px\"},logoContainer:{display:\"flex\",marginBottom:\"8px\"},logo:{width:\"27px\",height:\"27px\"},canvasText:{fontSize:\"16px\",fontWeight:\"500\",marginBottom:\"5px\"},canvasTheme:{fontSize:\"12px\",color:\"#666\",marginBottom:\"4px\"},canvasSize:{fontSize:\"12px\",color:\"#666\",marginBottom:\"4px\"},canvasRequired:{fontSize:\"12px\",color:\"#666\"}};ReCaptcha.defaultProps={bottomSpacing:40,errorMessage:\"Please complete the reCAPTCHA verification\",name:\"g-recaptcha-response\",required:true,siteKey:\"\",size:\"normal\",successMessage:\"Verification successful!\",theme:\"light\"};addPropertyControls(ReCaptcha,{bottomSpacing:{type:ControlType.Number,title:\"Bottom Spacing\",defaultValue:40,min:10,max:100,step:1,displayStepper:true},errorMessage:{type:ControlType.String,title:\"Error Message\",defaultValue:\"Please complete the reCAPTCHA verification\",placeholder:\"Error message when submission is attempted without verification\"},name:{type:ControlType.String,title:\"Input Name\",defaultValue:\"g-recaptcha-response\",placeholder:\"g-recaptcha-response\"},onError:{type:ControlType.EventHandler},onExpire:{type:ControlType.EventHandler},onVerify:{type:ControlType.EventHandler},required:{type:ControlType.Boolean,title:\"Required\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},siteKey:{type:ControlType.String,title:\"Site Key\",defaultValue:\"\",placeholder:\"Enter your reCAPTCHA site key\"},size:{type:ControlType.Enum,title:\"Size\",defaultValue:\"normal\",options:[\"normal\",\"compact\"],optionTitles:[\"Normal\",\"Compact\"]},successMessage:{type:ControlType.String,title:\"Success Message\",defaultValue:\"Verification successful!\",placeholder:\"Leave empty to hide\"},theme:{type:ControlType.Enum,title:\"Theme\",defaultValue:\"light\",options:[\"light\",\"dark\"],optionTitles:[\"Light\",\"Dark\"]}});ReCaptcha.displayName=\"reCAPTCHA\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ReCaptcha\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicHeight\":\"78\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"300\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ReCaptcha.map"],"mappings":"qNAOG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,UAAQ,QAAM,OAAK,OAAK,WAAS,iBAAe,eAAa,gBAAc,WAAS,WAAS,WAAS,EAAW,CAAC,EAAW,GAAeA,EAAS,GAAM,CAAM,CAAC,EAAe,GAAmBA,EAAS,GAAM,CAAM,CAAC,EAAY,GAAgBA,EAAS,KAAK,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAO,EAAaC,EAAO,KAAK,CAAO,EAASA,EAAO,aAAa,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,UAAU,EAAE,GAAG,GAAG,CAAO,MAAwB,CAAC,GAAU,IAAS,QAAa,EAAO,YAAY,SAAS,cAAc,2BAA2B,CAAC,CAAC,EAAkB,GAAK,CAAC,OAAQ,IAAM,EAAO,SAAS,cAAc,SAAS,CAAC,EAAO,IAAI,mFAAmF,EAAO,MAAM,GAAK,EAAO,MAAM,GAAK,EAAO,sBAAsB,CAAC,EAAkB,GAAK,EAAG,SAAS,KAAK,YAAY,EAAO,EAA2vG,OAAxvG,MAAc,CAAC,GAAG,EAAa,SAAS,GAAG,EAAa,OAAQ,OAAQ,GAAqB,CAAC,IAAM,EAAiB,GAAG,CAAC,IAAM,EAAK,EAAE,OAAO,QAAQ,OAAO,CAAK,MAAmC,EAAK,cAAc,eAAe,EAAK,IAAI,EAAgC,GAAU,CAAC,EAA0L,OAA9K,EAAE,gBAAgB,CAAC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