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