Liferay.Loader.define("@liferay/object-web@1.0.108/js/components/Layout/LayoutScreen/ObjectLayoutBox",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/modal","liferay!frontend-js-react-web$react","../../Panel/Panel","../objectLayoutContext","./HeaderDropdown","./ModalAddObjectLayoutField","./ObjectLayoutRows"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=y(a("@frontend-taglib-clay$clayui/button")),n=a("@frontend-taglib-clay$clayui/form"),o=a("@frontend-taglib-clay$clayui/modal"),r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=b();if(t&&t.has(e))return t.get(e);var a={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=l?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(a,n,o):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),d=y(a("../../Panel/Panel")),u=a("../objectLayoutContext"),c=y(a("./HeaderDropdown")),i=y(a("./ModalAddObjectLayoutField")),f=y(a("./ObjectLayoutRows"));function b(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return b=function(){return e},e}function y(e){return e&&e.__esModule?e:{default:e}}var s=({boxIndex:e,collapsable:t,label:a,objectLayoutRows:b,tabIndex:y,type:s})=>{const[{isViewOnly:g,objectDefinition:p},m]=(0,u.useLayoutContext)(),[L,j]=(0,r.useState)(!1),{observer:O,onClose:x}=(0,o.useModal)({onClose:()=>j(!1)}),E=Liferay.FeatureFlags["LPS-158672"]&&("comments"===s&&!p.enabledComments||"categorization"===s&&!p.enabledCategorization)||g;return r.default.createElement(r.default.Fragment,null,r.default.createElement(d.default,null,r.default.createElement(d.default.Header,{contentRight:r.default.createElement(r.default.Fragment,null,r.default.createElement(n.ClayToggle,{"aria-label":Liferay.Language.get("collapsible"),disabled:E,label:Liferay.Language.get("collapsible"),onToggle:t=>{m({payload:{attribute:{key:"collapsable",value:t},boxIndex:e,tabIndex:y},type:u.TYPES.CHANGE_OBJECT_LAYOUT_BOX_ATTRIBUTE})},toggled:t}),"regular"===s&&r.default.createElement(l.default,{className:"ml-4",disabled:g,displayType:"secondary",onClick:()=>j(!0),small:!0},Liferay.Language.get("add-field")),r.default.createElement(c.default,{deleteElement:()=>{m({payload:{boxIndex:e,tabIndex:y},type:u.TYPES.DELETE_OBJECT_LAYOUT_BOX})},disabled:E})),disabled:E,title:a,type:s}),!!(null==b?void 0:b.length)&&r.default.createElement(d.default.Body,null,r.default.createElement(f.default,{boxIndex:e,objectLayoutRows:b,tabIndex:y}))),L&&r.default.createElement(i.default,{boxIndex:e,observer:O,onClose:x,tabIndex:y}))};t.default=s}}));
//# sourceMappingURL=ObjectLayoutBox.js.map