Liferay.Loader.define("commerce-organization-web@5.0.44/js/menu/UserMenuContent",["module","exports","require","@frontend-taglib-clay$clayui/drop-down","frontend-js-web","liferay!frontend-js-react-web$react","../ChartContext","../data/users","../utils/constants","../utils/index"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function AccountMenuContent({closeMenu:e,data:t,parentData:r}){const{chartInstanceRef:c}=(0,o.useContext)(i.default);const s=[];(0,d.hasPermission)(t,l.ACTION_KEYS.user.REMOVE)&&s.push(o.default.createElement(n.default.Item,{key:"remove",onClick:function handleRemove(){(0,a.openConfirmModal)({message:(0,a.sub)(Liferay.Language.get("x-will-be-removed-from-x"),t.name,r.name),onConfirm:n=>{n&&("organization"===r.type?u.removeUserFromOrganization:u.removeUserFromAccount)(t.emailAddress,r.id).then((()=>{c.current.deleteNodes([t],!1),e()}))}})}},Liferay.Language.get("remove")));(0,d.hasPermission)(t,l.ACTION_KEYS.user.DELETE)&&s.push(o.default.createElement(n.default.Item,{key:"delete",onClick:function handleDelete(){(0,a.openConfirmModal)({message:(0,a.sub)(Liferay.Language.get("x-will-be-deleted"),t.name),onConfirm:r=>{r&&(0,u.deleteUser)(t.id).then((()=>{c.current.deleteNodes([t],!0),e()}))}})}},Liferay.Language.get("delete")));return s};var n=_interopRequireDefault(r("@frontend-taglib-clay$clayui/drop-down")),a=r("frontend-js-web"),o=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 a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),i=_interopRequireDefault(r("../ChartContext")),u=r("../data/users"),l=r("../utils/constants"),d=r("../utils/index");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}}}}));
//# sourceMappingURL=UserMenuContent.js.map