Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/app/components/layout-data-items/CollectionWithControls",["module","exports","require","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react","../../../core/hooks/useSetRef","../../../prop-types/index","../../config/constants/layoutDataItemTypes","../../contexts/ControlsContext","../../contexts/StoreContext","../../utils/getLayoutDataItemTopperUniqueClassName","../../utils/getResponsiveConfig","../topper/Topper","./Collection","./isHovered"],(function(e,t,o){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=m(o("liferay!frontend-js-react-web$classnames")),n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=y();if(t&&t.has(e))return t.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=r?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(o,n,a):o[n]=e[n]}o.default=e,t&&t.set(e,o);return o}(o("liferay!frontend-js-react-web$react")),a=m(o("../../../core/hooks/useSetRef")),l=(o("../../../prop-types/index"),o("../../config/constants/layoutDataItemTypes")),s=o("../../contexts/ControlsContext"),i=o("../../contexts/StoreContext"),u=m(o("../../utils/getLayoutDataItemTopperUniqueClassName")),f=o("../../utils/getResponsiveConfig"),c=m(o("../topper/Topper")),d=m(o("./Collection")),p=m(o("./isHovered"));function y(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return y=function(){return e},e}function m(e){return e&&e.__esModule?e:{default:e}}var v=n.default.forwardRef((({children:t,item:o},l)=>{const[s,p]=(0,n.useState)(!1),[y,m]=(0,a.default)(l),v=(0,i.useSelector)((e=>e.selectedViewportSize)),g=(0,f.getResponsiveConfig)(o.config,v),{display:C}=g.styles;return n.default.createElement(n.default.Fragment,null,n.default.createElement(e,{hovered:s,item:o,setHovered:p}),n.default.createElement(c.default,{className:(0,r.default)((0,u.default)(o.itemId),{"page-editor__topper--hovered":s}),item:o,itemElement:m,style:{display:C}},n.default.createElement(d.default,{item:o,ref:y},t)))}));t.default=v;const e=({hovered:e,item:t,setHovered:o})=>{const r=(0,s.useHoveredItemType)(),a=(0,s.useHoveredItemId)();return(0,n.useEffect)((()=>{if(t.type===l.LAYOUT_DATA_ITEM_TYPES.collection&&"collection"in t.config){const n=(0,p.default)({editableValue:t.config.collection,hoveredItemId:a,hoveredItemType:r});e!==n&&o(n)}}),[t,a,r,o,e]),null}}}));
//# sourceMappingURL=CollectionWithControls.js.map