Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.145/page_editor/app/components/layout-data-items/ContainerWithControls",["module","exports","require","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react","../../../core/hooks/useSetRef","../../../prop-types/index","../../config/constants/containerWidthTypes","../../contexts/ControlsContext","../../contexts/StoreContext","../../selectors/selectCanUpdateItemConfiguration","../../utils/getLayoutDataItemTopperUniqueClassName","../../utils/getResponsiveConfig","../topper/Topper","./Container","./isHovered"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=_interopRequireDefault(r("liferay!frontend-js-react-web$classnames")),n=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={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=o?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(r,n,a):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),a=_interopRequireDefault(r("../../../core/hooks/useSetRef")),i=(r("../../../prop-types/index"),r("../../config/constants/containerWidthTypes")),l=r("../../contexts/ControlsContext"),u=r("../../contexts/StoreContext"),s=_interopRequireDefault(r("../../selectors/selectCanUpdateItemConfiguration")),d=_interopRequireDefault(r("../../utils/getLayoutDataItemTopperUniqueClassName")),f=r("../../utils/getResponsiveConfig"),c=_interopRequireDefault(r("../topper/Topper")),p=_interopRequireDefault(r("./Container")),m=_interopRequireDefault(r("./isHovered"));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}}var _=n.default.forwardRef((({children:e,item:t},r)=>{const l=(0,u.useSelector)(s.default),[m,_]=(0,n.useState)(!1),g=(0,u.useSelector)((e=>e.selectedViewportSize)),[v,y]=(0,a.default)(r),C=(0,f.getResponsiveConfig)(t.config,g),{widthType:R}=C;return n.default.createElement(n.default.Fragment,null,n.default.createElement(HoverHandler,{hovered:m,item:t,setHovered:_}),n.default.createElement(c.default,{className:(0,o.default)((0,d.default)(t.itemId),{"container-fluid":R===i.CONTAINER_WIDTH_TYPES.fixed,"container-fluid-max-xl":R===i.CONTAINER_WIDTH_TYPES.fixed,"p-0":R===i.CONTAINER_WIDTH_TYPES.fixed,"page-editor__topper--hovered":m}),item:t,itemElement:y},n.default.createElement(p.default,{className:(0,o.default)({"page-editor__container":l}),item:t,ref:v},e)))}));t.default=_;const HoverHandler=({hovered:e,item:t,setHovered:r})=>{const o=(0,l.useHoveredItemType)(),a=(0,l.useHoveredItemId)();return(0,n.useEffect)((()=>{var n,i;const l=null===(n=t.config)||void 0===n||null===(i=n.styles)||void 0===i?void 0:i.backgroundImage;if((null==l?void 0:l.classNameId)&&(null==l?void 0:l.classPK)){const t=(0,m.default)({editableValue:l,hoveredItemId:a,hoveredItemType:o});e!==t&&r(t)}}),[e,a,o,t,r]),null}}}));
//# sourceMappingURL=ContainerWithControls.js.map