Liferay.Loader.define("dynamic-data-mapping-form-web@4.0.84/admin/js/hooks/useValidateFormWithObjects",["module","exports","require","data-engine-js-components-web","liferay!frontend-js-react-web$react"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.useValidateFormWithObjects=function(){const{formSettingsContext:t,objectFields:n,pages:o}=(0,r.useFormState)();return(0,a.useCallback)((a=>{if(!t)return!0;let s=!1,l=!1;if(new r.PagesVisitor(t.pages).visitFields((({fieldName:e,value:t})=>{"objectDefinitionId"===e?s=!!t[0]:"storageType"===e&&"object"===t[0]&&(l=!0)})),s&&l){const t=(0,r.getFields)(o),s=e(t),l=i(t,n);return!s.length&&!l.length||(a&&a({unmappedFormFields:s,unmappedRequiredObjectFields:l}),!1)}return!0}),[t,n,o])};var r=n("data-engine-js-components-web"),a=n("liferay!frontend-js-react-web$react");const e=e=>e.filter((e=>{const t=(0,r.getObjectFieldName)(e);return t&&!(0,r.getSelectedValue)(t.value)})),i=(e,t)=>{const n=t.filter((({required:e})=>e)),a=e.map((e=>{const t=(0,r.getObjectFieldName)(e);return t&&(0,r.getSelectedValue)(t.value)})).filter(Boolean);return n.filter((({name:e})=>-1===a.indexOf(e)))}}}));
//# sourceMappingURL=useValidateFormWithObjects.js.map