Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/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(t,r){switch(r.type){case n.ADD_REDO_ACTION:{const{actionType:e,originalType:o}=r,n=t.redoHistory||[];return s(s({},t),{},{redoHistory:[s(s({},(0,i.getDerivedStateForUndo)({action:r,state:t,type:e})),{},{actionId:d++,originalType:o}),...n]})}case n.ADD_UNDO_ACTION:{const{actionType:o,originalType:n}=r,c=t.undoHistory||[],a=r.isRedo?t.redoHistory:[];return s(s({},t),{},{redoHistory:a,undoHistory:[s(s({},(0,i.getDerivedStateForUndo)({action:r,state:t,type:o})),{},{actionId:d++,originalType:n}),...c.slice(0,e-1)]})}case o.DELETE_SEGMENTS_EXPERIENCE:{const{segmentsExperienceId:e}=r.payload,o=t.undoHistory||[],n=t.redoHistory||[];return s(s({},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 s(s({},t),{},{redoHistory:r.redoHistory});case"UPDATE_STORE":return s({},r.store);case n.UPDATE_UNDO_ACTIONS:return s(s({},t),{},{undoHistory:r.undoHistory});default:return t}};var o=r("../../plugins/experience/actions"),n=r("../actions/types"),i=r("../components/undo/undoActions");function c(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 s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(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 d=0}}));
//# sourceMappingURL=undoReducer.js.map