Liferay.Loader.define("commerce-organization-web@5.0.46/js/menu/MenuProvider",["module","exports","require","@frontend-taglib-clay$clayui/drop-down","liferay!frontend-js-react-web$react","./AccountMenuContent","./OrganizationMenuContent","./UserMenuContent"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function MenuProvider({alignElementRef:t,data:n,parentData:u}){const[o,i]=(0,a.useState)(!1),[c,l]=(0,a.useState)(!1),f=(0,a.useRef)(null);(0,a.useEffect)((()=>{i(!1),l(n)}),[n]),(0,a.useEffect)((()=>{c&&i(!0)}),[c]);const d=(0,a.useMemo)((()=>c&&e[c.type]),[c]),closeMenu=()=>{l(null),i(!1)};return a.default.createElement(r.default.Menu,{active:o,alignElementRef:t,onSetActive:closeMenu,ref:f},d&&a.default.createElement(d,{closeMenu:closeMenu,data:c,parentData:u}))};var r=_interopRequireDefault(n("@frontend-taglib-clay$clayui/drop-down")),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 n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var u=r?Object.getOwnPropertyDescriptor(e,a):null;u&&(u.get||u.set)?Object.defineProperty(n,a,u):n[a]=e[a]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react")),u=_interopRequireDefault(n("./AccountMenuContent")),o=_interopRequireDefault(n("./OrganizationMenuContent")),i=_interopRequireDefault(n("./UserMenuContent"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const e={account:u.default,organization:o.default,user:i.default}}}));
//# sourceMappingURL=MenuProvider.js.map