Liferay.Loader.define("data-engine-js-components-web@1.0.112/js/core/utils/fieldDeletedHandler",["module","exports","require","../../utils/FormSupport.es","../../utils/fieldSupport","../../utils/rulesSupport"],(function(e,r,t){window;{Object.defineProperty(r,"__esModule",{value:!0}),r.handleFieldDeleted=handleFieldDeleted,r.default=void 0;var o=t("../../utils/FormSupport.es"),n=t("../../utils/fieldSupport"),i=t("../../utils/rulesSupport");function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach((function(r){_defineProperty(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function handleFieldDeleted(e,r,{activePage:t,editRule:l=!0,fieldName:u,removeEmptyRows:s=!0}){const{pages:d}=r;void 0===t&&(t=r.activePage);const p=d.map(((r,i)=>{if(t===i){const t=(0,n.removeField)(e,d,u,s);return _objectSpread(_objectSpread({},r),{},{rows:s?(0,o.removeEmptyRows)(t,i):t[i].rows})}return r}));return{focusedField:{},pages:p,rules:l?(0,i.formatRules)(p,r.rules):r.rules}}var l=handleFieldDeleted;r.default=l}}));
//# sourceMappingURL=fieldDeletedHandler.js.map