Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.179/page_editor/plugins/experience/thunks/removeExperience",["module","exports","require","../../../app/config/index","../../../app/services/ExperienceService","../actions/deleteExperience","../actions/selectExperience"],(function(e,n,t){window;{Object.defineProperty(n,"__esModule",{value:!0}),n.default=function removeExperience({segmentsExperienceId:e,selectedExperienceId:n}){return(t,p)=>{if(e===n){const n=p().loadedSegmentsExperiences;return r.default.selectExperience({body:{loadFragmentEntryLinks:!n.includes(i.config.defaultSegmentsExperienceId),segmentsExperienceId:i.config.defaultSegmentsExperienceId},dispatch:t}).then((({fragmentEntryLinks:e,portletIds:n})=>t((0,d.default)({fragmentEntryLinks:e,portletIds:n,segmentsExperienceId:i.config.defaultSegmentsExperienceId})))).then((()=>{r.default.removeExperience({body:{segmentsExperienceId:e},dispatch:t}).then((()=>t((0,c.default)({segmentsExperienceId:e}))))}))}return r.default.removeExperience({body:{segmentsExperienceId:e},dispatch:t}).then((()=>t((0,c.default)({segmentsExperienceId:e}))))}};var i=t("../../../app/config/index"),r=_interopRequireDefault(t("../../../app/services/ExperienceService")),c=_interopRequireDefault(t("../actions/deleteExperience")),d=_interopRequireDefault(t("../actions/selectExperience"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=removeExperience.js.map