Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.145/page_editor/app/reducers/undoReducer",["module","exports","require","../../plugins/experience/actions","../actions/types","../components/undo/undoActions"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function undoReducer(t,r){switch(r.type){case n.ADD_REDO_ACTION:{const{actionType:e,originalType:o}=r,n=t.redoHistory||[];return _objectSpread(_objectSpread({},t),{},{redoHistory:[_objectSpread(_objectSpread({},(0,c.getDerivedStateForUndo)({action:r,state:t,type:e})),{},{actionId:i++,originalType:o}),...n]})}case n.ADD_UNDO_ACTION:{const{actionType:o,originalType:n}=r,d=t.undoHistory||[],s=r.isRedo?t.redoHistory:[];return _objectSpread(_objectSpread({},t),{},{redoHistory:s,undoHistory:[_objectSpread(_objectSpread({},(0,c.getDerivedStateForUndo)({action:r,state:t,type:o})),{},{actionId:i++,originalType:n}),...d.slice(0,e-1)]})}case o.DELETE_SEGMENTS_EXPERIENCE:{const{segmentsExperienceId:e}=r.payload,o=t.undoHistory||[],n=t.redoHistory||[];return _objectSpread(_objectSpread({},t),{},{redoHistory:n.filter((t=>t.segmentsExperienceId!==e&&t.nextSegmentsExperienceId!==e)),undoHistory:o.filter((t=>t.segmentsExperienceId!==e&&t.nextSegmentsExperienceId!==e))})}case n.UPDATE_REDO_ACTIONS:return _objectSpread(_objectSpread({},t),{},{redoHistory:r.redoHistory});case"UPDATE_STORE":return _objectSpread({},r.store);case n.UPDATE_UNDO_ACTIONS:return _objectSpread(_objectSpread({},t),{},{undoHistory:r.undoHistory});default:return t}};var o=r("../../plugins/experience/actions"),n=r("../actions/types"),c=r("../components/undo/undoActions");function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e=100;let i=0}}));
//# sourceMappingURL=undoReducer.js.map