Liferay.Loader.define("data-engine-js-components-web@1.0.55/js/core/reducers/pageValidationReducer.es",["module","exports","require","../../utils/strings","../../utils/visitors.es","../actions/eventTypes.es"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){switch(t.type){case o.EVENT_TYPES.PAGE.VALIDATION_FAILED:{const{newPages:r,pageIndex:o}=t.payload,i=new s.PagesVisitor(null!=r?r:e.pages);let c,l=null,u=null;const p=i.mapFields(((e,t,r,n,s)=>{const i=s===o;return i&&void 0!==e.errorMessage&&""!==e.errorMessage&&!e.valid&&null==l&&(l=e.label,u=document.querySelector("[name='".concat(e.name,"']")),c=e.name),a(a({},e),{},{displayErrors:i,pageValidationFailed:!0})}),!0,!0);return u&&("hidden"!==u.type?u.focus():document.getElementsByName(c)[0]&&document.getElementsByName(c)[0].parentElement&&document.getElementsByName(c)[0].parentElement.scrollIntoView()),{forceAriaUpdate:Date.now(),invalidFormMessage:(0,n.sub)(Liferay.Language.get("this-form-is-invalid-check-field-x"),[l]),pages:p}}default:return e}};var n=r("../../utils/strings"),s=r("../../utils/visitors.es"),o=r("../actions/eventTypes.es");function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}}}));
//# sourceMappingURL=pageValidationReducer.es.js.map