Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.130/page_editor/app/contexts/WidgetsManager",["module","exports","require","liferay!frontend-js-react-web$react","../actions/updateWidgets","../selectors/selectSegmentsExperienceId","../selectors/selectWidgetFragmentEntryLinks","../thunks/loadWidgets","./StoreContext"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const e=(0,i.useDispatch)(),t=(0,i.useSelector)((e=>{const t=(0,s.default)(e);return Object.values(e.fragmentEntryLinks).filter((e=>{let{portletId:r,removed:n}=e,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["portletId","removed"]);return r&&!n&&o.segmentsExperienceId===t})).map((({fragmentEntryLinkId:e})=>e)).join(",")})),r=(0,i.useSelectorRef)(a.default);return(0,n.useEffect)((()=>{e((0,o.default)({fragmentEntryLinks:r.current}))}),[t,r,e]),(0,n.useEffect)((()=>{const t=Liferay.on("addPortletConfigurationTemplate",(()=>{e((0,l.default)({fragmentEntryLinks:r.current}))}));return()=>{t.detach()}}),[r,e]),null};var n=r("liferay!frontend-js-react-web$react"),o=u(r("../actions/updateWidgets")),s=u(r("../selectors/selectSegmentsExperienceId")),a=u(r("../selectors/selectWidgetFragmentEntryLinks")),l=u(r("../thunks/loadWidgets")),i=r("./StoreContext");function u(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=WidgetsManager.js.map