Liferay.Loader.define("@liferay/content-dashboard-web@2.0.73/js/components/Sidebar",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/layout","@liferay/frontend-js-react-web","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.SidebarContext=void 0;var n=a("@frontend-taglib-clay$clayui/button"),r=d(a("@frontend-taglib-clay$clayui/layout")),l=a("@liferay/frontend-js-react-web"),o=d(a("liferay!frontend-js-react-web$classnames")),c=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var l=n?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(a,r,l):a[r]=e[r]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function d(e){return e&&e.__esModule?e:{default:e}}const e=c.default.createContext();t.SidebarContext=e;const u=()=>{},f=({children:e,className:t})=>c.default.createElement("div",{className:(0,o.default)("sidebar-body",t)},e),y=({actionsSlot:t,children:a,className:l,title:s})=>{const{onClose:d}=(0,c.useContext)(e);return c.default.createElement("section",{className:(0,o.default)("sidebar-header",{"is-sticky":Liferay.FeatureFlags["LPS-161013"]},l)},c.default.createElement(r.default.ContentRow,{className:"sidebar-section"},c.default.createElement(r.default.ContentCol,{className:"justify-content-center",expand:!0},c.default.createElement("p",{className:"font-weight-bold mb-0 pr-2"},s)),t&&c.default.createElement(r.default.ContentCol,null,t),c.default.createElement(r.default.ContentCol,null,c.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("close"),className:"component-action text-secondary","data-tooltip-align":"bottom",displayType:"unstyled",onClick:d,symbol:"times",title:Liferay.Language.get("close")}))),a)},b=({children:t,fetchData:a,onClose:n=u,open:r=!0})=>{const[o,s]=(0,c.useState)(!1),d=(0,l.useTimeout)();return(0,c.useEffect)((()=>{!1!==r?d((()=>s(!0)),100):s(!1)}),[d,r]),(0,c.useEffect)((()=>{o?document.body.classList.add("sidebar-open"):document.body.classList.remove("sidebar-open")}),[o]),c.default.createElement("div",{className:"cadmin"},c.default.createElement("div",{className:"content-dashboard sidebar sidebar-light sidebar-sm"},c.default.createElement(e.Provider,{value:{fetchData:a,onClose:n}},t)))};b.Body=f,b.Header=y;var i=b;t.default=i}}));
//# sourceMappingURL=Sidebar.js.map