Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.179/page_editor/plugins/experience/reducers/utils",["module","exports","require"],(function(e,t,r){window;{function ownKeys(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 _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}Object.defineProperty(t,"__esModule",{value:!0}),t.addExperience=function addExperience(e,t){return _objectSpread(_objectSpread({},e),{},{availableSegmentsExperiences:_objectSpread(_objectSpread({},e.availableSegmentsExperiences),{},{[t.segmentsExperienceId]:t})})},t.deleteExperienceById=function deleteExperienceById(e,t){const r=_objectSpread({},e.availableSegmentsExperiences);return delete r[t],_objectSpread(_objectSpread({},e),{},{availableSegmentsExperiences:r})},t.removeLayoutDataItemById=function removeLayoutDataItemById(e,t){const r=e.layoutDataList.filter((e=>e.segmentsExperienceId!==t));return _objectSpread(_objectSpread({},e),{},{layoutDataList:r})},t.selectExperience=function selectExperience(e,t){let r=e;e.loadedSegmentsExperiences.includes(t)||(r=_objectSpread(_objectSpread({},r),{},{loadedSegmentsExperiences:[...r.loadedSegmentsExperiences,t]}));return _objectSpread(_objectSpread({},r),{},{segmentsExperienceId:t})},t.setExperienceLock=function setExperienceLock(e,t){const r=t.hasLockedSegmentsExperiment;return _objectSpread(_objectSpread({},e),{},{lockedSegmentsExperience:r})},t.setExperimentStatus=function setExperimentStatus(e,t){const r=e.availableSegmentsExperiences[t];return _objectSpread(_objectSpread({},e),{},{segmentsExperimentStatus:r.segmentsExperimentStatus})},t.storeNewLayoutData=function storeNewLayoutData(e,t,r){const n=e;return n.layoutDataList.push({layoutData:r,segmentsExperienceId:t}),n},t.switchLayoutData=function switchLayoutData(e,{currentExperienceId:t,targetExperienceId:r}){let n=e;const{layoutData:a,layoutDataList:o}=n,c=e.layoutDataList.find((e=>e.segmentsExperienceId===r));return n=_objectSpread(_objectSpread({},n),{},{layoutData:c.layoutData,layoutDataList:o.map((e=>t===e.segmentsExperienceId?_objectSpread(_objectSpread({},e),{},{layoutData:a}):e))}),n}}}));
//# sourceMappingURL=utils.js.map