Liferay.Loader.define("@liferay/object-web@1.0.181/js/components/ObjectValidation/useObjectValidationForm",["module","exports","require","@liferay/object-js-components-web","../../utils/constants"],(function(e,i,a){window;Object.defineProperty(i,"__esModule",{value:!0}),i.useObjectValidationForm=function useObjectValidationForm({initialValues:e,onSubmit:i}){const{errors:a,handleChange:o,handleSubmit:l,setValues:u,values:r}=(0,t.useForm)({initialValues:e,onSubmit:i,validate:e=>{var i,a,o,l;const u={},r=null===(i=e.name)||void 0===i?void 0:i[n.defaultLanguageId],s=null===(a=e.errorLabel)||void 0===a?void 0:a[n.defaultLanguageId],d=e.script;return(0,t.invalidateRequired)(r)&&(u.name=t.REQUIRED_MSG),(0,t.invalidateRequired)(s)&&(u.errorLabel=t.REQUIRED_MSG),!(null===(o=e.engine)||void 0===o?void 0:o.startsWith("function#"))&&(0,t.invalidateRequired)(d)&&(u.script=t.REQUIRED_MSG),"groovy"===e.engine&&e.lineCount&&e.lineCount>2987&&(u.script=Liferay.Language.get("the-maximum-number-of-lines-available-is-2987")),Liferay.FeatureFlags["LPS-187846"]&&"partialValidation"===e.outputType&&!(null===(l=e.objectValidationRuleSettings)||void 0===l?void 0:l.length)&&(u.outputType=t.REQUIRED_MSG),u}});return{errors:a,handleChange:o,handleSubmit:l,setValues:u,values:r}};var t=a("@liferay/object-js-components-web"),n=a("../../utils/constants")}));
//# sourceMappingURL=useObjectValidationForm.js.map