Liferay.Loader.define("layout-reports-web@1.0.56/js/App",["module","exports","require","@liferay/frontend-js-react-web","frontend-js-web","liferay!frontend-js-react-web$react","./components/LayoutReports","./context/StoreContext","../css/main.scss","./components/SidebarHeader","./context/ConstantsContext"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function App(e){const{isPanelStateOpen:t}=e,r=document.getElementById("layoutReportsPanelToggleId"),l=document.getElementById("layoutReportsPanelId"),d=Liferay.SideNavigation.instance(r);t&&r.setAttribute("aria-pressed",!0);(0,a.useEffect)((()=>{d.on("open.lexicon.sidenav",(()=>{(0,o.setSessionValue)("com.liferay.layout.reports.web_layoutReportsPanelState","open"),r.setAttribute("aria-pressed",!0),l.focus()})),d.on("closed.lexicon.sidenav",(()=>{(0,o.setSessionValue)("com.liferay.layout.reports.web_layoutReportsPanelState","closed"),r.setAttribute("aria-pressed",!1),r.focus()})),Liferay.once("screenLoad",(()=>{Liferay.SideNavigation.destroy(r)}))}),[r,l,d]);const[f,p]=(0,a.useState)(!1);return(0,n.useEventListener)("keydown",(e=>{"Escape"===e.key&&d.toggle()}),!1,l),(0,n.useEventListener)("mouseenter",(()=>p(!0)),{once:!0},r),(0,n.useEventListener)("focus",(()=>p(!0)),{once:!0},r),a.default.createElement(c.ConstantsContextProvider,{constants:e},a.default.createElement(i.StoreContextProvider,null,a.default.createElement(u.default,null),a.default.createElement(SidebarBody,null,a.default.createElement(s.default,{eventTriggered:f}))))};var n=r("@liferay/frontend-js-react-web"),o=r("frontend-js-web"),a=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),s=_interopRequireDefault(r("./components/LayoutReports")),i=r("./context/StoreContext");r("../css/main.scss");var u=_interopRequireDefault(r("./components/SidebarHeader")),c=r("./context/ConstantsContext");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}const SidebarBody=({children:e})=>a.default.createElement("div",{className:"sidebar-body"},e)}}));
//# sourceMappingURL=App.js.map