Liferay.Loader.define("product-navigation-control-menu@6.0.40/js/DragPreview",["module","exports","require","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","liferay!frontend-js-react-web$react-dnd"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=c(r("@frontend-taglib-clay$clayui/icon")),a=(c(r("liferay!frontend-js-react-web$prop-types")),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=n?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"))),i=r("liferay!frontend-js-react-web$react-dnd");function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function c(e){return e&&e.__esModule?e:{default:e}}const e=(e,t,r)=>{if(!e||!t.current)return{display:"none"};const n=t.current.getBoundingClientRect(),a=r?e.x+.5*n.width-window.innerWidth:e.x-.5*n.width,i=e.y-.5*n.height,o="translate(".concat(a,"px, ").concat(i,"px)");return{WebkitTransform:o,transform:o}};var f=({rtl:t})=>{const r=(0,a.useRef)(),{currentOffset:o,isDragging:c,item:f}=(0,i.useDragLayer)((e=>({currentOffset:e.getClientOffset(),isDragging:e.isDragging(),item:e.getItem()})));return c?a.default.createElement("div",{className:"sidebar__drag-preview"},a.default.createElement("div",{className:"sidebar__drag-preview__content text-truncate",ref:r,style:e(o,r,t)},f&&f.icon&&a.default.createElement(n.default,{className:"mr-3",symbol:f.icon}),f&&f.name?f.name:Liferay.Language.get("element"))):null};t.default=f}}));
//# sourceMappingURL=DragPreview.js.map