Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.130/page_editor/app/components/app-hooks/useURLParser",["module","exports","require","liferay!frontend-js-react-web$react","../../../core/hooks/useSessionState","../../actions/switchSidebarPanel","../../config/constants/highlightedCommentIdKey","../../contexts/ControlsContext","../../contexts/StoreContext","../../utils/getFragmentItem"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const e=(0,c.useSelector)((e=>e.fragmentEntryLinks)),[,t]=(0,n.useSessionState)(r.HIGHLIGHTED_COMMENT_ID_KEY),a=(0,c.useSelector)((e=>e.layoutData)),l=(0,c.useDispatch)(),f=(0,i.useSelectItem)(),m=(0,s.useCallback)((t=>{const{fragmentEntryLinkId:s}=Object.values(e).find((e=>e.comments.find((e=>e.commentId===t||e.children.find((e=>e.commentId===t))))))||{fragmentEntryLinkId:null},{itemId:n}=(0,d.default)(a,s)||{};n&&(f(n),l((0,o.default)({sidebarOpen:!0,sidebarPanelId:"comments"})))}),[l,e,a,f]);(0,s.useEffect)((()=>{const e=new URL(window.location.href);if(e.searchParams.has("messageId")){let a;t(e.searchParams.get("messageId")),m(e.searchParams.get("messageId")),e.searchParams.delete("messageId"),Liferay.SPA&&Liferay.SPA.app&&(a=Liferay.SPA.app.skipLoadPopstate,Liferay.SPA.app.skipLoadPopstate=!0),history.replaceState(null,document.head.title,e.href),requestAnimationFrame((()=>{Liferay.SPA&&Liferay.SPA.app&&"boolean"==typeof a&&(Liferay.SPA.app.skipLoadPopstate=a)}))}}),[m,t])};var s=a("liferay!frontend-js-react-web$react"),n=a("../../../core/hooks/useSessionState"),o=l(a("../../actions/switchSidebarPanel")),r=a("../../config/constants/highlightedCommentIdKey"),i=a("../../contexts/ControlsContext"),c=a("../../contexts/StoreContext"),d=l(a("../../utils/getFragmentItem"));function l(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=useURLParser.js.map