Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.156/page_editor/app/hooks/app_hooks/usePreviewURL",["module","exports","require","liferay!frontend-js-react-web$react","../../config/constants/layoutTypes","../../config/index","../../contexts/DisplayPagePreviewItemContext","../../contexts/StoreContext","../../selectors/selectLanguageId","../../selectors/selectSegmentsExperienceId"],(function(e,t,o){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function usePreviewURL(){const e=(0,s.useDisplayPagePreviewItem)(),t=(0,i.useSelector)(c.default),o=(0,i.useSelector)(l.default);(0,r.useEffect)((()=>{const r=document.querySelector("[data-page-editor-layout-preview-base-url]");if(!(null==r?void 0:r.dataset.pageEditorLayoutPreviewBaseUrl))return;const s=new URL(null==r?void 0:r.dataset.pageEditorLayoutPreviewBaseUrl),setParameters=e=>{Object.entries(e).forEach((([e,t])=>{void 0!==t&&s.searchParams.set(e,t)}))};setParameters({languageId:t,segmentsExperienceId:o}),n.config.layoutType===a.LAYOUT_TYPES.display&&e&&setParameters(e.data),r.setAttribute("href",s.toString())}),[e,t,o])};var r=o("liferay!frontend-js-react-web$react"),a=o("../../config/constants/layoutTypes"),n=o("../../config/index"),s=o("../../contexts/DisplayPagePreviewItemContext"),i=o("../../contexts/StoreContext"),c=_interopRequireDefault(o("../../selectors/selectLanguageId")),l=_interopRequireDefault(o("../../selectors/selectSegmentsExperienceId"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=usePreviewURL.js.map