Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.169/page_editor/app/components/EditModeSelector",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/drop-down","frontend-js-web","liferay!frontend-js-react-web$react","../actions/togglePermission","../contexts/StoreContext","../selectors/selectCanSwitchEditMode"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function EditModeSelector(){const t=(0,c.useSelector)(u.default),n=(0,c.useDispatch)(),[d,s]=(0,o.useState)(t?e.pageDesign:e.contentEditing),f=(0,c.useSelector)((e=>e.permissions)),g=(0,o.useRef)();return(0,o.useEffect)((()=>{f.UPDATE?g.current="UPDATE":f.UPDATE_LAYOUT_BASIC?g.current="UPDATE_LAYOUT_BASIC":g.current="UPDATE_LAYOUT_LIMITED"}),[]),o.default.createElement(a.default,{alignmentPosition:a.Align.BottomLeft,closeOnClick:!0,menuElementAttrs:{className:"page-editor__edit-mode-dropdown-menu",containerProps:{className:"cadmin"}},trigger:o.default.createElement(r.default,{"aria-label":(0,i.sub)(Liferay.Language.get("page-edition-mode-x"),d),className:"form-control-select page-editor__edit-mode-selector text-left",disabled:!t,displayType:"secondary",size:"sm",type:"button"},o.default.createElement("span",null,d))},o.default.createElement(a.default.ItemList,null,o.default.createElement(a.default.Item,{onClick:()=>{s(e.pageDesign),n((0,l.default)(g.current,!0))}},e.pageDesign),o.default.createElement(a.default.Item,{onClick:()=>{s(e.contentEditing),n((0,l.default)(g.current,!1))}},e.contentEditing)))};var r=_interopRequireDefault(n("@frontend-taglib-clay$clayui/button")),a=_interopRequireWildcard(n("@frontend-taglib-clay$clayui/drop-down")),i=n("frontend-js-web"),o=_interopRequireWildcard(n("liferay!frontend-js-react-web$react")),l=_interopRequireDefault(n("../actions/togglePermission")),c=n("../contexts/StoreContext"),u=_interopRequireDefault(n("../selectors/selectCanSwitchEditMode"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}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 i=r?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const e={contentEditing:Liferay.Language.get("content-editing"),pageDesign:Liferay.Language.get("page-design")}}}));
//# sourceMappingURL=EditModeSelector.js.map