Liferay.Loader.define("dynamic-data-mapping-form-field-type@6.0.108/Captcha/Captcha.es",["module","exports","require","frontend-js-web","liferay!frontend-js-react-web$react","../FieldBase/ReactFieldBase.es"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r("frontend-js-web"),a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var c=n?Object.getOwnPropertyDescriptor(e,a):null;c&&(c.get||c.set)?Object.defineProperty(r,a,c):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),c=r("../FieldBase/ReactFieldBase.es");function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function f(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=e=>{let{html:t,name:r}=e,o=f(e,["html","name"]);const l=(0,a.useMemo)((()=>t),[]),u=(0,a.useRef)(null);return(0,a.useEffect)((()=>{window.grecaptcha&&window.grecaptcha.ready((()=>{try{window.grecaptcha.reset()}catch(e){console.warn("Could not reset reCAPTCHA")}}))}),[]),(0,a.useEffect)((()=>{u.current&&(0,n.runScriptsInElement)(u.current)}),[u]),(0,a.useEffect)((()=>{if(u.current){const e=r.indexOf("_ddm");Liferay.fire("".concat(r.substring(0,e),"_simplecaptcha_attachEvent"))}}),[u,r]),a.default.createElement(c.FieldBase,i({},o,{hideEditedFlag:!0,name:r,visible:!0}),a.default.createElement("div",{dangerouslySetInnerHTML:{__html:l},ref:u}),a.default.createElement("input",{id:r,type:"hidden"}))};t.default=l}}));
//# sourceMappingURL=Captcha.es.js.map