Liferay.Loader.define("dynamic-data-mapping-form-web@4.0.150/admin/js/components/NavigationBar.es",["module","exports","require","@liferay/frontend-js-react-web","liferay!frontend-js-react-web$react","../hooks/useBack.es"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.NavigationBar=function NavigationBar({history:t,location:a}){(0,o.useBack)();const s=(0,n.useCallback)((r=>{if("button"===r.target.type||"SPAN"===r.target.tagName){r.preventDefault();const n="button"===r.target.type?r.target:r.target.parentElement,o=Number(n.parentElement.dataset.navItemIndex),i=e[o];document.querySelector(".forms-navigation-bar li > .active").classList.remove("active"),n.classList.add("active");(i===a.pathname?t.replace:t.push)(i)}}),[t,a.pathname]);return(0,r.useEventListener)("click",s,!0,document.body.querySelector(".forms-navigation-bar")),(0,n.useLayoutEffect)((()=>{let e=i[a.pathname];"/rules/editor"===a.pathname&&(e=1),document.querySelector(".forms-navigation-bar li[data-nav-item-index='".concat(e,"'] > button")).classList.add("active")}),[]),null};var r=a("@liferay/frontend-js-react-web"),n=a("liferay!frontend-js-react-web$react"),o=a("../hooks/useBack.es");const e={0:"/",1:"/rules",2:"/report"},i={"/":0,"/report":2,"/rules":1}}}));
//# sourceMappingURL=NavigationBar.es.js.map