Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.173/page_editor/app/components/topper/TopperEmpty",["module","exports","require","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$react","../../../prop_types/index","../../contexts/KeyboardMovementContext","../../contexts/StoreContext","../../selectors/selectCanUpdatePageStructure","../../utils/drag_and_drop/constants/targetPositions","../../utils/drag_and_drop/useDragAndDrop","../../utils/useDropContainerId"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function _default(e){let{children:t}=e,r=function _objectWithoutProperties(e,t){if(null==e)return{};var r,n,o=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["children"]);return(0,i.useSelector)(u.default)?o.default.createElement(TopperEmpty,r,t):t};var n=_interopRequireDefault(r("liferay!frontend-js-react-web$classnames")),o=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={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),a=(r("../../../prop_types/index"),r("../../contexts/KeyboardMovementContext")),i=r("../../contexts/StoreContext"),u=_interopRequireDefault(r("../../selectors/selectCanUpdatePageStructure")),c=r("../../utils/drag_and_drop/constants/targetPositions"),p=r("../../utils/drag_and_drop/useDragAndDrop"),l=_interopRequireDefault(r("../../utils/useDropContainerId"));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}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TopperEmpty({children:e,className:t,item:r}){const i=(0,o.useRef)(null),{isOverTarget:u,targetPosition:s,targetRef:d}=(0,p.useDropTarget)(r),{itemId:f}=(0,a.useMovementTarget)(),y=(0,a.useMovementTargetPosition)(),b=s||y,O=e.type===o.default.Fragment?e.props.children:e,g=(0,l.default)(),_=(0,p.useIsDroppable)()&&u||f===r.itemId;return o.default.Children.map(O,(e=>e?o.default.createElement(o.default.Fragment,null,o.default.cloneElement(e,_objectSpread(_objectSpread({},e.props),{},{className:(0,n.default)(e.props.className,t,{"drag-over-bottom":_&&b===c.TARGET_POSITIONS.BOTTOM,"drag-over-middle":_&&b===c.TARGET_POSITIONS.MIDDLE,"drag-over-top":_&&b===c.TARGET_POSITIONS.TOP,"drop-container":g===r.itemId,"page-editor__topper":!0}),ref:t=>{i.current=t,d(t),"function"==typeof e.ref?e.ref(t):e.ref&&"current"in e.ref&&(e.ref.current=t)}}))):e))}}}));
//# sourceMappingURL=TopperEmpty.js.map