Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.169/page_editor/app/components/undo/undoUpdateRowColumns",["module","exports","require","../../actions/updateRowColumns","../../services/LayoutService","../../utils/setIn"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.undoAction=function undoAction({action:e}){const{deletedColumnIds:t,layoutDataItem:n,previousNumberOfColumns:i}=e;return async(e,s)=>{const{segmentsExperienceId:r}=s();if(t.length){await u.default.unmarkItemsForDeletion({itemIds:t.reverse(),onNetworkStatus:e,segmentsExperienceId:r});const{layoutData:s,pageContents:d}=await u.default.updateItemConfig({itemConfig:(0,a.setIn)(n.config,"numberOfColumns",i),itemId:n.itemId,onNetworkStatus:e,segmentsExperienceId:r});e((0,o.default)({itemId:n.itemId,layoutData:s,numberOfColumns:i,pageContents:d}))}else{const{layoutData:t,pageContents:a}=await u.default.updateRowColumns({itemId:n.itemId,numberOfColumns:i,onNetworkStatus:e,segmentsExperienceId:r});e((0,o.default)({itemId:n.itemId,layoutData:t,numberOfColumns:i,pageContents:a}))}}},t.getDerivedStateForUndo=function getDerivedStateForUndo({action:e,state:t}){const{itemId:n}=e,{layoutData:o}=t,u=o.items[n],a=e.numberOfColumns,i=u.config.numberOfColumns;return{deletedColumnIds:u.children.slice(a,i),layoutDataItem:u,previousNumberOfColumns:i}};var o=_interopRequireDefault(n("../../actions/updateRowColumns")),u=_interopRequireDefault(n("../../services/LayoutService")),a=n("../../utils/setIn");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=undoUpdateRowColumns.js.map