"use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/regenerator"),s=require("react"),o=require("prop-types"),r=require("@material-ui/core"),i=require("./NonPriorityMenus.css.js"),c=require("../../../../IconButton/index.js"),u=require("../../../../IconMenu/index.js"),a=require("../../../../../icons/iconParkIcons.js");require("../../../../../icons/customIcons/icons/AddMessage.js"),require("../../../../../icons/customIcons/icons/Attention.js"),require("../../../../../icons/customIcons/icons/Collapse.js"),require("../../../../../icons/customIcons/icons/Dashboard.js"),require("../../../../../icons/customIcons/icons/Expand.js"),require("../../../../../icons/customIcons/icons/FolderClosed.js"),require("../../../../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../../../../icons/customIcons/icons/FolderOpened.js"),require("../../../../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../../../../icons/customIcons/icons/LessOrEqual.js"),require("../../../../../icons/customIcons/icons/Search.js"),require("../../../../../icons/customIcons/icons/Wellhub.js"),require("../../../../../icons/customIcons/icons/MultiRuler.js"),require("../../../../../icons/customIcons/icons/Checkbox.js"),require("../../../../../icons/customIcons/icons/CheckboxChecked.js"),require("../../../../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../../../../icons/customIcons/icons/Radio.js"),require("../../../../../icons/customIcons/icons/RadioChecked.js"),require("../../../../../icons/customIcons/icons/SimulFrac.js"),require("../../../../../icons/customIcons/icons/ZipperFrac.js"),require("../../../../../icons/customIcons/icons/CautionFilled.js"),require("../../../../../icons/customIcons/icons/MoreApp.js");var l=require("react/jsx-runtime");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=d(e),p=d(n),f=d(t),I=d(o),q="DevCenter_AppPriorityMenu",j=function(e){var n,t,o,d=e.toggleAppSettingsDialog,I=e.devCenterRouter,j=e.isMaximized,h=e.setIsMaximized,x=e.menuItems,g=e.isMobileView,C=e.setIsFullscreenModalMode,b=s.useState(!1),M=p.default(b,2),k=M[0],y=M[1],v=s.useState(null),S=p.default(v,2),w=S[0],F=S[1],R=(n=m.default(f.default.mark((function e(){var n;return f.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=!k)){e.next=7;break}return e.next=4,C(n);case 4:y(n),e.next=9;break;case 7:y(n),C(n);case 9:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)}),A=(t=m.default(f.default.mark((function e(n){return f.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C(!0);case 2:null==n||n(!0);case 3:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)});return l.jsxs(u,{"data-testid":"".concat(q,"_menu"),IconElement:l.jsx(a.HamburgerButtonIcon,{}),className:i.menuIcon,IconButtonComponent:c,iconButtonProps:{tooltipProps:{title:!g&&"Menu",placement:"top"},onClick:(o=m.default(f.default.mark((function e(n){return f.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return F(n.currentTarget),e.next=3,C(!0);case 3:y(!0);case 4:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})},classes:{iconButton:i.iconButton},menuProps:{anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"},getContentAnchorEl:null,onClick:R,onClose:R,open:k,anchorEl:w},children:[x.map((function(e){return l.jsxs(r.MenuItem,{className:i.menuItem,"data-testid":"".concat(q,"_").concat(e.title),onClick:function(){A(e.onClick),e.to&&I.push(e.to)},component:"li",to:e.to,children:["string"==typeof e.icon?l.jsx(r.Icon,{className:i.muiIcon,children:e.icon}):e.icon,l.jsx(r.ListItemText,{primary:e.title})]},e.title)})),!j&&l.jsxs(r.MenuItem,{className:i.menuItem,"data-testid":"".concat(q,"_fullScreenMenuItem"),onClick:function(){return A(h)},children:[l.jsx(a.FullScreenOneIcon,{}),"Full Screen"]}),l.jsxs(r.MenuItem,{className:i.menuItem,"data-testid":"".concat(q,"_settings"),onClick:function(){return A(d)},children:[l.jsx(a.SettingTwoIcon,{}),"Settings"]})]})};j.propTypes={toggleAppSettingsDialog:I.default.func.isRequired,isMaximized:I.default.bool.isRequired,isMobileView:I.default.bool,setIsMaximized:I.default.func.isRequired,devCenterRouter:I.default.shape({push:I.default.func}).isRequired,menuItems:I.default.arrayOf(I.default.shape({onClick:I.default.func,to:I.default.oneOfType([I.default.string,I.default.shape({})]),icon:I.default.string,title:I.default.string}))},j.defaultProps={menuItems:[],isMobileView:!1},module.exports=j;
