text: /**
   * @license
   * Copyright (c) 2014, 2020, Oracle and/or its affiliates.
   * Licensed under The Universal Permissive License (UPL), Version 1.0
   * as shown at https://oss.oracle.com/licenses/upl/
   * @ignore
   */
  define(["ojs/ojcore","jquery","ojs/ojcontext","ojs/ojconfig","ojs/ojthemeutils","ojs/ojcomponentcore","ojs/ojanimation","ojs/ojlogger","ojdnd"],function(e,t,i,n,s,r,a,o){"use strict";var l={properties:{reorderHandle:{type:"string"},translations:{type:"object",value:{},properties:{labelCut:{type:"string"},labelPasteAfter:{type:"string"},labelPasteBefore:{type:"string"}}}},methods:{refresh:{},resizeTile:{},insertTile:{},removeTile:{},setProperty:{},getProperty:{},setProperties:{},getNodeBySubId:{},getSubIdByNode:{}},events:{ojAnimateStart:{},ojAnimateEnd:{},ojBeforeInsert:{},ojInsert:{},ojBeforeRemove:{},ojRemove:{},ojBeforeResize:{},ojResize:{},ojBeforeReorder:{},ojReorder:{}},extension:{}};function h(e,t,i,n,s,r){var a=h;null==a._agentTypeAndVersion&&(a._agentTypeAndVersion=a._getAgentTypeAndVersion(navigator.userAgent)),this._elem=e,this._rtl=t,this._automationEnabled=i,this._tilesSelector=n.tiles,this._transitionShowFromStyleClass=s.transitionShowFromStyleClass,this._addStyleClassNameFunc=r.addStyleClassName,this._removeStyleClassNameFunc=r.removeStyleClassName,this._getSizeStyleClassNameFunc=r.getSizeStyleClassName,this._getTileSpanFunc=r.getTileSpan,this._showTileOnEndFunc=r.showTileOnEndFunc,this._hideTileOnEndFunc=r.hideTileOnEndFunc,this._startAnimationFunc=r.startAnimationFunc,this._layoutOnEndFunc=r.layoutOnEndFunc,this._layoutCycleOnStartFunc=r.layoutCycleOnStartFunc,this._layoutCycleOnEndFunc=r.layoutCycleOnEndFunc,this._sortTilesOriginalOrderFunc=r.sortTilesOriginalOrderFunc,this._subtreeAttachedFunc=r.subtreeAttached,this._subtreeDetachedFunc=r.subtreeDetached,this._addBusyStateFunc=r.addBusyState;var o=document.createElement("div"),l=o.style;l.display="inline-block",l.overflow="hidden",l.visibility="hidden";var d=document.createElement("div");(l=d.style).display="inline-block",o.appendChild(d),e.insertBefore(o,e.firstChild),this._sizeDivWrapper=o,this._sizeDiv=d;var u=this;this._hideTilesFunc=function(){u._hideTiles()},this._resolveBusyStateFunc=function(){u._resolveBusyState()}}h.prototype.setup=function(e,t){var i=!1;return e?(i=!!this._layout(),this._reorderTilesForLayout()):(this._busyStateResolveFunc=this._addBusyStateFunc("performing layout (setup)"),this._layoutCycleOnStartFunc(),this._transitionStart(t),i=this._transitionLayout()),i},h.prototype.destroy=function(){this._resolveBusyState();for(var e=this._elem,t=this._getTileChildren(),i=0;i<t.length;i++){var n=t[i].style;this._rtl?n.right="":n.left="",n.top=""}e.removeChild(this._sizeDivWrapper),this._sizeDivWrapper=null,this._sizeDiv=null,this._hideTilesFunc=null,this._resolveBusyStateFunc=null,this._arMovedInfolets=null,this._arInfoletsToResize=null,this._arInfoletsToShow=null,this._arInfoletsToHide=null,this._arFireHideOnEnd=null,this._elem=null,this._addStyleClassNameFunc=null,this._removeStyleClassNameFunc=null,this._getSizeStyleClassNameFunc=null,this._getTileSpanFunc=null,this._showTileOnEndFunc=null,this._hideTileOnEndFunc=null,this._startAnimationFunc=null,this._layoutOnEndFunc=null,this._layoutCycleOnStartFunc=null,this._layoutCycleOnEndFunc=null,this._sortTilesOriginalOrderFunc=null,this._subtreeAttachedFunc=null,this._subtreeDetachedFunc=null,this._addBusyStateFunc=null},h.prototype.resizeTile=function(e,t){var i=this._elem.querySelector(e);this._arInfoletsToResize||(this._arInfoletsToResize=[]);var n=this._arInfoletsToResize;n.push(i),n.push(t),this._resizingInfolet=!0,this._queueRelayout()},h.prototype.insertTileDomElem=function(e,t){var i=this._getTileChildren();this._sortTilesOriginalOrderFunc(i);var n=null;t>=0&&t<i.length&&(n=i[t]),this._elem.insertBefore(e,n),this._queueRelayout()},h.prototype.showTile=function(e){var t=this._elem.querySelector(e);if(t){this._arInfoletsToShow||(this._arInfoletsToShow=[]),this._arInfoletsToShow.push(t),this._showingInfolets=!0;var i=h;this._layoutPhase!==i._PHASE_HIDE&&this._layoutPhase!==i._PHASE_LAYOUT?this._queueRelayout():this._showingInfolets=!1}},h.prototype.hideTile=function(e){var t=this._elem.querySelector(e);t&&(this._arInfoletsToHide||(this._arInfoletsToHide=[]),this._arInfoletsToHide.push(t),this._hidingInfolets=!0,this._queueRelayout())},h.prototype.resizeNotify=function(){this._resizingInfolet||this._hidingInfolets||this._showingInfolets||(this._busyStateResolveFunc=this._addBusyStateFunc("performing layout (resizeNotify)"),this._layoutCycleOnStartFunc(),this._transitionStart(!1),this._transitionLayout())},h.prototype.getCellSize=function(){return this._cellSize},h.prototype.isAnimationEnabled=function(){if(this._temporarilyDisableAnimation)return!1;if(!this._cachedAnimationEnabled){if(this._automationEnabled)this._animationEnabled=!1;else{var e=h,t=e._agentTypeAndVersion[0],i=e._agentTypeAndVersion[1];this._animationEnabled=e._isMinimumAgentMet(t,i,["gecko",16,"trident",6,"webkit",533.1])}this._cachedAnimationEnabled=!0}return this._animationEnabled},h.prototype.isInLayoutCycle=function(){return null!=this._layoutPhase||null!=this._arMovedInfolets&&this._arMovedInfolets.length>0},h.prototype.finishLayoutCycle=function(){this._temporarilyDisableAnimation=!0,this._removeStyleClassFromTiles(this._transitionShowFromStyleClass);for(var e=h,t=this._getTileChildren(),i=0;i<t.length;i++){var n=t[i];n._afrCellSize&&delete n._afrCellSize}this._hideTilesAnimationStarted?(this._hideTilesAnimationStarted=!1,this._handleHideTransitionEnd(null)):this._showTilesTimeout?(clearTimeout(this._showTilesTimeout),this._showTilesTimeout=null,this._showTiles()):this._layoutPhase===e._PHASE_LAYOUT||null!=this._arMovedInfolets&&this._arMovedInfolets.length>0?this._handleTransitionEnd(null):this._layoutPhase===e._PHASE_SHOW&&this._handleShowTransitionEnd(null),this._temporarilyDisableAnimation=!1},h._getElemSize=function(e){var t=h,i=t._getComputedStyle(e),n=t._getCSSLengthAsInt(i.marginLeft)+t._getCSSLengthAsInt(i.marginRight),s=t._getCSSLengthAsInt(i.marginTop)+t._getCSSLengthAsInt(i.marginBottom);return{w:e.offsetWidth+n,h:e.offsetHeight+s}},h._getElemInsets=function(e){var t=h,i=t._getComputedStyle(e);return{paddingLeft:t._getCSSLengthAsInt(i.paddingLeft),paddingRight:t._getCSSLengthAsInt(i.paddingRight),paddingTop:t._getCSSLengthAsInt(i.paddingTop),paddingBottom:t._getCSSLengthAsInt(i.paddingBottom),borderLeftWidth:t._getCSSLengthAsInt(i.borderLeftWidth),borderRightWidth:t._getCSSLengthAsInt(i.borderRightWidth),borderTopWidth:t._getCSSLengthAsInt(i.borderTopWidth),borderBottomWidth:t._getCSSLengthAsInt(i.borderBottomWidth)}},h._getComputedStyle=function(e){var t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e,null):e.currentStyle},h._getCSSLengthAsInt=function(e){if(e.length>0&&"auto"!==e){var t=parseInt(e,10);return isNaN(t)&&(t=0),t}return 0},h._arrayIndexOf=function(e,t){if(e)for(var i=0;i<e.length;i++)if(e[i]===t)return i;return-1},h._isMinimumAgentMet=function(e,t,i){var n=i.length;if(n%2==0)for(var s=0;s<=n-2;s+=2){if(e===i[s])return t>=i[1+s]}return!1},h._getAgentTypeAndVersion=function(e){var t=h._parseFloatVersion,i=null,n=-1,s=e.toLowerCase();if(-1!==s.indexOf("msie")||-1!==s.indexOf("trident")){i="trident";var r=t(s,/trident\/(\d+[.]\d+)/);-1!==r?n=r:(-1===(r=t(s,/msie (\d+\.\d+);/))&&(r=t(s,/msie (\d+\.\d+)b;/)),n=r-4),null!=document.documentMode&&(n=Math.min(n,document.documentMode-4))}else-1!==s.indexOf("applewebkit")?(i="webkit",n=t(s,/applewebkit\/(\d+([.]\d+)*)/)):-1!==s.indexOf("gecko/")&&(i="gecko",n=t(s,/rv:(\d+[.]\d+)/));return[i,n]},h._parseFloatVersion=function(e,t){var i=e.match(t);if(i){var n=i[1];if(n)return parseFloat(n)}return-1},h._compareTilePositions=function(e,t){return e.startRow>t.startRow?1:e.startRow<t.startRow?-1:e.startCol>t.startCol?1:-1},h.prototype._queueRelayout=function(){this._hideTilesTimeout||(this._layoutPhase?this._queuedRelayout||(this._queuedRelayout=!0):(this._busyStateResolveFunc=this._addBusyStateFunc("performing layout"),this._hideTilesTimeout=setTimeout(this._hideTilesFunc,0)))},h.prototype._getTileChildren=function(){for(var e=this._elem.querySelectorAll(this._tilesSelector),t=[],i=0;i<e.length;i++){var n=e[i],s=n.style;n.offsetWidth>0&&n.offsetHeight>0&&"hidden"!==s.visibility&&t.push(n)}return t},h.prototype._transitionLayout=function(){var e=this._arMovedInfolets,t=this._layout();if(this._arInfoletsToResize){var i=this._arInfoletsToResize;t||(t=[]);for(var n=h,s=0;s<i.length;s+=2){var r=i[s];n._arrayIndexOf(t,r)<0&&t.push(r)}}var a=!1;!t||t.length<1?(!e||e.length<1)&&(this._arMovedInfolets=null,this._handleTransitionEnd(null),a=!0):this._arMovedInfolets=t;var o=null!=t&&t.length>0;return this.isAnimationEnabled()||a||this._handleTransitionEnd(null),o},h.prototype._layout=function(){var e=this._elem,t=this._getTileChildren();this._sortTilesOriginalOrderFunc(t),this._cellSize=null;var i=null;this._cols=0,this._rows=1,this._occupancyMap=null;var n,s,r,a,o,l=[],d=[],u=[],_=[],c=this._rtl,f=h,g=f._getElemInsets(e),m=0,p=[];for(this._arTilePositions=p,n=0;n<t.length;n++){(s=t[n])._afrCellSize&&(this._cellSize=s._afrCellSize,delete s._afrCellSize);var v=this._getTileSpanFunc(s);if(this._cellSize||(this._cellSize=this._calcCellSize(s,v)),i=this._cellSize,!this._occupancyMap){var y=e.offsetWidth-g.paddingLeft-g.paddingRight-g.borderLeftWidth-g.borderRightWidth;this._cols=Math.max(Math.floor(y/i.w),1),this._initOccupancyMap(this._cols,this._rows),m=this._cols}v.colSpan>m&&(m=v.colSpan),v.colSpan>this._cols&&(v.colSpan=this._cols);for(var T=!1,S=0;S<this._rows;S++){for(var O=0;O<this._cols;O++)if(this._fits(O,S,v)){o={top:(r=s.style).top},c?o.right=r.right:o.left=r.left,d.push(o),a=this._calcPosition(s,O,S,v,i,g),u.push(a),c&&_.push(O),T=!0,p.push({startCol:O,startRow:S,tile:s});break}if(T)break;S===this._rows-1&&this._addRow()}}if(i){var C=this._sizeDiv.style;if(C){var b=m*i.w,E=this._rows*i.h,F=C.width?h._getCSSLengthAsInt(C.width.toString()):0,D=C.height?h._getCSSLengthAsInt(C.height.toString()):0;(F>b||D>E)&&(this._afrSizeDivDims={},this._afrSizeDivDims.width=b+"px",this._afrSizeDivDims.height=E+"px"),C.width=(F>b?F:b)+"px",C.height=(D>E?D:E)+"px"}}for(n=0;n<t.length;n++)r=(s=t[n]).style,a=u[n],""!==(o=d[n]).top&&(c&&parseInt(a.right,10)!==parseInt(o.right,10)||!c&&parseInt(a.left,10)!==parseInt(o.left,10)||parseInt(a.top,10)!==parseInt(o.top,10))&&(l.push(s),this._layoutTransition&&f._arrayIndexOf(this._arInfoletsToResize,s)<0&&this._animateLayout(s,this._reorderTransitionStarted?"reorder":"move")),r.top=a.top,this._rtl?r.right=a.right:r.left=a.left;return l.length<1&&(l=null),l},h.prototype._updateSizeDivOnEnd=function(){if(this._afrSizeDivDims){var e=this._sizeDiv.style;e.width=this._afrSizeDivDims.width,e.height=this._afrSizeDivDims.height,delete this._afrSizeDivDims}},h.prototype._reorderTilesForLayout=function(){var e=this._arTilePositions;this._arTilePositions=null;var t=h;e=e.sort(t._compareTilePositions);for(var i=this._getTileChildren(),n=0;n<i.length;n++){var s=i[n],r=e[n].tile;if(s!==r){this._subtreeDetachedFunc(r),s.parentNode.insertBefore(r,s),this._subtreeAttachedFunc(r);var a=t._arrayIndexOf(i,r);a>n&&(i.splice(a,1),i.splice(n,0,r))}}},h.prototype._initOccupancyMap=function(e,t){this._occupancyMap=[];for(var i=this._occupancyMap,n=0;n<t;n++){var s=[];i.push(s);for(var r=0;r<e;r++)s[r]=!1}},h.prototype._addRow=function(){this._rows+=1;var e=[];this._occupancyMap.push(e);for(var t=0;t<this._cols;t++)e[t]=!1},h.prototype._fits=function(e,t,i){for(var n=i.colSpan,s=i.rowSpan,r=t;r<t+s;r++){r>=this._rows&&this._addRow();for(var a=e;a<e+n;a++){if(a>=this._cols)return!1;if(this._occupancyMap[r][a])return!1}}return!0},h.prototype._calcPosition=function(e,t,i,n,s,r){for(var a=n.colSpan,o=n.rowSpan,l=this._occupancyMap,h=i;h<i+o;h++)for(var d=t;d<t+a;d++)l[h][d]=!0;var u={},_=r.paddingTop+i*s.h;if(u.top=_+"px",this._rtl){var c=r.paddingRight+t*s.w;u.right=c+"px"}else{var f=r.paddingLeft+t*s.w;u.left=f+"px"}return u},h.prototype._removeStyleClassFromTiles=function(e){for(var t=this._getTileChildren(),i=0;i<t.length;i++)this._removeStyleClassNameFunc(t[i],e)},h.prototype._animateLayout=function(e,t){if(this.isAnimationEnabled()){var i=this;i._startAnimationFunc(e,t).then(function(){i._layoutTransition&&i._handleTransitionEnd(e)})}},h.prototype._transitionStart=function(e){this._layoutTransition||(this._reorderTransitionStarted=e,this._layoutTransition=!0)},h.prototype._handleTransitionEnd=function(e){var t=!0;if(this._arMovedInfolets){var i=this._arMovedInfolets;if(e){for(var n=0;n<i.length;n++)if(e===i[n]){this._arMovedInfolets=[],i=this._arMovedInfolets;break}}else this.isAnimationEnabled()||(this._arMovedInfolets=[],i=this._arMovedInfolets);i.length>0&&(t=!1)}if(t){this._arInfoletsToResize&&(this._arInfoletsToResize=null),this._reorderTransitionStarted&&(this._reorderTransitionStarted=!1);var s=h;if(this._layoutTransition=!1,this._resizingInfolet=!1,this._hidingInfolets=!1,this._showingInfolets=!1,this._reorderTilesForLayout(),this._layoutOnEndFunc(),this._updateSizeDivOnEnd(),this._layoutPhase===s._PHASE_LAYOUT)if(this.isAnimationEnabled()){var r=this;this._showTilesTimeout=setTimeout(function(){r._showTiles()},0)}else this._showTiles();else this._layoutPhase||this._layoutCycleOnEndFunc(this._resolveBusyStateFunc)}},h.prototype._calcCellSize=function(e,t){var i=h._getElemSize(e);return{w:i.w/t.colSpan,h:i.h/t.rowSpan}},h.prototype._hideTiles=function(){this._hideTilesTimeout&&(clearTimeout(this._hideTilesTimeout),this._hideTilesTimeout=null),this._layoutCycleOnStartFunc();var e=h;if(this._layoutPhase=e._PHASE_HIDE,this._arInfoletsToHide&&this.isAnimationEnabled()){var t=this._arInfoletsToHide,i=this;this._hideTilesAnimationStarted=!0;for(var n=0;n<t.length;n++){var s=t[n],r=function(e){i._handleHideTransitionEnd(e)}.bind(null,s);this._startAnimationFunc(s,"remove").then(r)}}else this._handleHideTransitionEnd(null)},h.prototype._handleHideTransitionEnd=function(e){this._hideTilesAnimationStarted&&(this._hideTilesAnimationStarted=!1);var t,i,n,s,r=h,a=this._arInfoletsToHide;if(e){if(t=e,a){for(n=0;n<a.length;n++)if((i=a[n])===t){a.splice(n,1),this._arFireHideOnEnd||(this._arFireHideOnEnd=[]),(s=this._arFireHideOnEnd).push(t);break}a.length<1&&(this._arInfoletsToHide=null)}}else if(!this.isAnimationEnabled()&&a){for(n=0;n<a.length;n++)i=a[n],this._arFireHideOnEnd||(this._arFireHideOnEnd=[]),(s=this._arFireHideOnEnd).push(i);this._arInfoletsToHide=null}if(!this._arInfoletsToHide){if(this._arFireHideOnEnd){for(s=this._arFireHideOnEnd,n=0;n<s.length;n++){var o=(t=s[n]).style;this._rtl?o.right="":o.left="",o.top="",this._hideTileOnEndFunc(t)}this._arFireHideOnEnd=null}if(this._layoutPhase=r._PHASE_LAYOUT,this._transitionStart(!1),this._arInfoletsToResize){var l=this._arInfoletsToResize;for(n=0;n<l.length;n+=2){t=l[n];var d=l[n+1],u=this._getSizeStyleClassNameFunc(t);this.isAnimationEnabled()&&(t._afrCellSize=this._cellSize,this._animateLayout(t,"resize")),this._removeStyleClassNameFunc(t,u),this._addStyleClassNameFunc(t,d)}}this._transitionLayout()}},h.prototype._showTiles=function(){this._showTilesTimeout&&(clearTimeout(this._showTilesTimeout),this._showTilesTimeout=null);var e,t,i=h;this._layoutPhase=i._PHASE_SHOW;var n=this._arInfoletsToShow;if(n&&this.isAnimationEnabled()){var s=this;for(e=0;e<n.length;e++){t=n[e],this._removeStyleClassNameFunc(t,this._transitionShowFromStyleClass);var r=function(e){s._handleShowTransitionEnd(e)}.bind(null,t);this._startAnimationFunc(t,"insert").then(r)}}else{if(n)for(e=0;e<n.length;e++)t=n[e],this._removeStyleClassNameFunc(t,this._transitionShowFromStyleClass);this._handleShowTransitionEnd(null)}},h.prototype._handleShowTransitionEnd=function(e){var t,i,n=this._arInfoletsToShow;if(e){var s=e;if(n){for(t=0;t<n.length;t++)if((i=n[t])===s){n.splice(t,1),this._showTileOnEndFunc(s);break}n.length<1&&(this._arInfoletsToShow=null)}}else if(!this.isAnimationEnabled()&&n){for(t=0;t<n.length;t++)i=n[t],this._showTileOnEndFunc(i);this._arInfoletsToShow=null}this._arInfoletsToShow||(this._layoutPhase=null,this._layoutCycleOnEndFunc(this._resolveBusyStateFunc),this._queuedRelayout&&(this._queuedRelayout=!1,this._queueRelayout()))},h.prototype._resolveBusyState=function(){this._busyStateResolveFunc&&(this._busyStateResolveFunc(),this._busyStateResolveFunc=null)},h._PHASE_HIDE=1,h._PHASE_LAYOUT=2,h._PHASE_SHOW=3,function(){var l="hidden",d="none",u="oj-masonrylayout-tile",_=/oj-masonrylayout-tile-[0-9]+x[0-9]+/,c="."+u,f={cut:"ojmasonrylayoutcut","paste-before":"ojmasonrylayoutpastebefore","paste-after":"ojmasonrylayoutpasteafter"},g={cut:"labelCut","paste-before":"labelPasteBefore","paste-after":"labelPasteAfter"};function m(e){return t(e).offset()}function p(e,i){t(e).addClass(i)}function v(e,i){t(e).removeClass(i)}function y(e){var i=null,n=t(e).attr("class").match(_);return n&&(i=n[0]),i}function T(e){var i=t(e).attr("class").match(_)[0].substring(u.length+1),n=i.indexOf("x"),s=i.substring(0,n),r=i.substring(n+1);return{colSpan:h._getCSSLengthAsInt(s),rowSpan:h._getCSSLengthAsInt(r)}}function S(e){return e&&e.sort(O),e}function O(e,t){return t._jetDataMasonryOriginalOrder<e._jetDataMasonryOriginalOrder?1:e._jetDataMasonryOriginalOrder<t._jetDataMasonryOriginalOrder?-1:0}function C(e,t){for(var i=e;i;){var n=i.style;if(n&&(n.visibility===l||n.display===d))break;var s=i.parentNode;if(s===t)return i;i=s}return null}function b(e){for(var t=e;t;){var i=t.nextSibling,n=!0;if(i){var s=i.style;!s||s.visibility!==l&&s.display!==d||(n=!1)}if(i&&1===i.nodeType&&n)return i;t=i}return null}e.__registerWidget("oj.ojMasonryLayout",t.oj.baseComponent,{defaultElement:"<div>",widgetEventPrefix:"oj",options:{reorderHandle:null,animateStart:null,animateEnd:null,beforeInsert:null,insert:null,beforeRemove:null,remove:null,beforeResize:null,resize:null,beforeReorder:null,reorder:null},_ComponentCreate:function(){this._super(),this.element.addClass("oj-masonrylayout oj-component"),this.options.disabled&&o.warn("JET MasonryLayout: 'disabled' property not supported"),this.reorderHandleEventNamespace=this.eventNamespace+"ReorderHandle",this._menu={},this._menu.usermenu=!1,this._menu.$container=!1,this._menu.$elemCut=!1,this._menu.$elemPasteBefore=!1,this._menu.$elemPasteAfter=!1,this._initMenu(),this._applyMenu(),this._setup(!0)},refresh:function(){this._super();var e="rtl"===this._GetReadingDirection()!==this._bRTL;e&&this._destroyMLCommon(),this._setup(e)},_NotifyShown:function(){(this._super(),this._needsSetup)?this._setup(this._needsSetup[0]):this._mlCommon.setup(!0)},_NotifyAttached:function(){(this._super(),this._needsSetup)?this._setup(this._needsSetup[0]):this._mlCommon.setup(!0)},_NotifyContextMenuGesture:function(e,i,n){this._prepareContextMenuBeforeOpen(i);var s=this._menu.$container.children().not(".oj-helper-hidden");s&&s.length>0&&this._OpenContextMenu(i,n,{launcher:t(i.target).closest(":tabbable")})},_setup:function(t){var i=this;if(!this._canCalculateSizes()){var s=!1;return this._needsSetup&&(s=this._needsSetup[0]),void(this._needsSetup=[t||s])}this._needsSetup=null,this._bRTL="rtl"===this._GetReadingDirection(),this._bTouchSupported=e.DomUtils.isTouchSupported();var a=this.element,o=this.options;if(t){if(this._showTileOnEndFunc=function(e){i._showTileOnEnd(e)},this._hideTileOnEndFunc=function(e){i._hideTileOnEnd(e)},this._startAnimationFunc=function(e,t){return i._startAnimation(e,t)},this._layoutOnEndFunc=function(){i._layoutOnEnd()},this._layoutCycleOnStartFunc=function(){i._layoutCycleOnStart()},this._layoutCycleOnEndFunc=function(e){i._layoutCycleOnEnd(e)},!this._mlCommon){var l={};l.tiles=c;var d={transitionShowFromStyleClass:"oj-masonrylayout-tile-transition-show-from"},u={};u.addStyleClassName=p,u.removeStyleClassName=v,u.getSizeStyleClassName=y,u.getTileSpan=T,u.showTileOnEndFunc=this._showTileOnEndFunc,u.hideTileOnEndFunc=this._hideTileOnEndFunc,u.startAnimationFunc=this._startAnimationFunc,u.layoutOnEndFunc=this._layoutOnEndFunc,u.layoutCycleOnStartFunc=this._layoutCycleOnStartFunc,u.layoutCycleOnEndFunc=this._layoutCycleOnEndFunc,u.sortTilesOriginalOrderFunc=S,u.subtreeAttached=r.subtreeAttached,u.subtreeDetached=r.subtreeDetached,u.addBusyState=function(e){return i._addBusyState(e)},this._applyTileStyleClass(),this._saveTilesOriginalOrder(),this._mlCommon=new h(a[0],this._bRTL,"enabled"===n.getAutomationMode(),l,d,u)}this._handleDragStartFunc=function(e){i._handleDragStart(e)},this._handleDragEnterFunc=function(e){i._handleDragEnter(e)},this._handleDragOverFunc=function(e){i._handleDragOver(e)},this._handleDragLeaveFunc=function(e){i._handleDragLeave(e)},this._handleDragEndFunc=function(e){i._handleDragEnd(e)},this._handleDropFunc=function(e){i._handleDrop(e)},o.reorderHandle&&this._setupReorderHandles()}else{this._applyTileStyleClass();var _=a.children();this._tearDownReorderHandlesForElem(_),this._setupReorderHandlesForElem(_),this._checkTilesOriginalOrder()}this._mlCommon.setup(t),t&&(this._handleResizeFunc=function(e,t){i._handleResize()},e.DomUtils.addResizeListener(a[0],this._handleResizeFunc,25))},_destroy:function(){this._clearMenu();var t=this.element;e.DomUtils.removeResizeListener(t[0],this._handleResizeFunc),this._handleResizeFunc=null,this._restoreTilesOriginalOrder();for(var i=this._getTileElements(),n=i.length,s=0;s<n;s++){delete i[s]._jetDataMasonryOriginalOrder}this._destroyMLCommon(),t.removeClass("oj-masonrylayout oj-component"),this.options.reorderHandle&&this._tearDownReorderHandles(),t.children("."+u).removeClass(u),this._handleDragStartFunc=null,this._handleDragEnterFunc=null,this._handleDragOverFunc=null,this._handleDragLeaveFunc=null,this._handleDragEndFunc=null,this._handleDropFunc=null,this._showTileOnEndFunc=null,this._hideTileOnEndFunc=null,this._startAnimationFunc=null,this._layoutOnEndFunc=null,this._layoutCycleOnStartFunc=null,this._layoutCycleOnEndFunc=null,this._arTilesToInsert=null,this._super()},_setOption:function(t,i,n){var s=!1,r=!1;switch(t){case"reorderHandle":this._tearDownReorderHandles(),s=!0;break;case"disabled":o.warn("JET MasonryLayout: 'disabled' property not supported");break;case"contextMenu":e.DomUtils.isTouchSupported()||(this._clearMenu(),i&&this._initMenu(i));break;case"translations":e.Object.compareValues(i,this.options[t])||(r=!0)}this._super(t,i,n),r&&this._refreshMenu(),s&&i&&this._setupReorderHandles()},resizeTile:function(e,i){var n=this._mlCommon;n.isInLayoutCycle()&&n.finishLayoutCycle();var s=t(e),r=s[0];if(!r)throw new Error("JET MasonryLayout: Unable to resize tile because no tile found for selector: "+e);var a=y(r);if(i===a)throw new Error("JET MasonryLayout: Unable to resize child "+e+" to style class "+i+" because "+i+" is already applied.");var o={tile:s,previousSizeStyleClass:a,sizeStyleClass:i};!1!==this._trigger("beforeResize",null,o)&&(this._arResizingTiles||(this._arResizingTiles=[]),this._arResizingTiles.push(r,a,i),n.resizeTile(e,i))},insertTile:function(e,i){var n=this._mlCommon;n.isInLayoutCycle()&&n.finishLayoutCycle(),isNaN(i)&&(i=-1);var s=t(e),a=s[0];if(!a)throw new Error("JET MasonryLayout: Unable to insert tile because no tile found for selector: "+e);s.addClass(u);var o={tile:s,index:i};if(!1!==this._trigger("beforeInsert",null,o)){a._jetDataTileInsertIndex=i,n.isAnimationEnabled()&&s.addClass("oj-masonrylayout-tile-transition-show-from");var l=a.style;l.top="-1px",this._bRTL?l.right="-1px":l.left="-1px",this._insertTileOriginalOrder(a,i),n.insertTileDomElem(a,i),r.subtreeAttached(a),this._arTilesToInsert||(this._arTilesToInsert=[]),this._arTilesToInsert.push(e)}},removeTile:function(i){var n=this._mlCommon;n.isInLayoutCycle()&&n.finishLayoutCycle();var s=t(i),r=s[0];if(!r)throw new Error("JET MasonryLayout: Unable to remove tile because no tile found for selector: "+i);if(e.FocusUtils.containsFocus(r)){var a=this._getTileElements(!0),o=a.indexOf(r);o>0&&(this._deletingTileWithFocusPrev=a[o-1])}var l={tile:s};!1!==this._trigger("beforeRemove",null,l)&&n.hideTile(i)},_handleResize:function(){this._bDragging||this._inLayoutCycle||this._mlCommon.resizeNotify()},_showTileOnEnd:function(e){var i=t(e),n=e._jetDataTileInsertIndex;delete e._jetDataTileInsertIndex,this.options.reorderHandle&&this._setupReorderHandlesForElem(i);var s={tile:i,index:n};this._eventsToFire.push("insert",s)},_hideTileOnEnd:function(e){var i=t(e);this.options.reorderHandle&&this._tearDownReorderHandlesForElem(i),i.removeClass(u),r.subtreeDetached(e),e.parentNode.removeChild(e),this._removeTileOriginalOrder(e);var n={tile:i};this._eventsToFire.push("remove",n)},_startAnimation:function(e,t){var i=(s.parseJSONFromFontFamily("oj-masonrylayout-option-defaults")||{}).animation,n=i?i[t]:null;return a.startAnimation(e,t,n,this)},_layoutOnEnd:function(){var e;if(this._arTilesToInsert){var i=this._mlCommon,n=this._arTilesToInsert;for(e=0;e<n.length;e++){var s=n[e];i.showTile(s)}this._arTilesToInsert=null}if(this._arResizingTiles){var r=this._arResizingTiles;for(e=0;e<r.length;e+=3){var a=r[e],o=r[e+1],l=r[e+2],h={tile:t(a),previousSizeStyleClass:o,sizeStyleClass:l};this._eventsToFire.push("resize",h)}this._arResizingTiles=null}this._bDragging&&(this._bDragMoveTransition?this._handleDragMoveTransitionEnd():this._bDragEndTransition&&this._handleDragEndTransitionEnd())},_layoutCycleOnStart:function(){this._inLayoutCycle=!0,this._layoutStartActiveDomElem=null,this._eventsToFire||(this._eventsToFire=[]);var t=document.activeElement;t&&e.DomUtils.isAncestor(this.element[0],t)&&(this._layoutStartActiveDomElem=t)},_layoutCycleOnEnd:function(t){this._inLayoutCycle=!1;var i=this.element[0];if(this._layoutStartActiveDomElem){var n=this._layoutStartActiveDomElem;if(this._layoutStartActiveDomElem=null,this._deletingTileWithFocusPrev){var s=this._deletingTileWithFocusPrev;if(this._deletingTileWithFocusPrev=null,s&&e.DomUtils.isAncestor(i,s)){var r=this._getTileElements(i,!0),a=r.indexOf(s);a>=0&&a<r.length-1?e.FocusUtils.focusFirstTabStop(r[a+1]):e.FocusUtils.focusFirstTabStop(s)}}else e.DomUtils.isAncestor(i,n)?e.FocusUtils.focusElement(n):e.FocusUtils.focusFirstTabStop(i)}if(t&&t(),this._eventsToFire){var o=this._eventsToFire;this._eventsToFire=[];for(var l=0;l<o.length;l+=2){var h=o[l],d=o[l+1];this._trigger(h,null,d)}}},_destroyMLCommon:function(){var e=this._mlCommon;e&&e.destroy(),this._mlCommon=null},_canCalculateSizes:function(){var e=document.createElement("div"),t=e.style;t.width="10px",t.height="10px";var i=this.element[0];i.appendChild(e);var n=!1;try{n=e.offsetWidth>0&&e.offsetHeight>0}catch(e){}return i.removeChild(e),n},_getTileElements:function(e){for(var t=this.element.children(c),i=t.length,n=[],s=0;s<i;s++){var r=t[s];if(!e||e&&r!==this._dropSite){var a=r.style;a.visibility!==l&&a.display!==d&&n.push(r)}}return n},_saveTilesOriginalOrder:function(){var e=this._getTileElements();if(e)for(var t=0;t<e.length;t++){var i=e[t];i._jetDataMasonryOriginalOrder||(i._jetDataMasonryOriginalOrder=t+1)}},_checkTilesOriginalOrder:function(){var e=this._getTileElements();if(e)for(var t=0;t<e.length;t++){var i=e[t];i._jetDataMasonryOriginalOrder||this._insertTileOriginalOrder(i,t)}},_restoreTilesOriginalOrder:function(){var e=this._getTileElements(),t=this._getTileElements();S(t);for(var i=0;i<e.length;i++){var n=e[i],s=t[i];if(n!==s){r.subtreeDetached(s),n.parentNode.insertBefore(s,n),r.subtreeAttached(s);var a=e.indexOf(s);a>i&&(e.splice(a,1),e.splice(i,0,s))}}},_insertTileOriginalOrder:function(e,t){var i=this._getTileElements();if(t<0&&(t=i.length),i)for(var n=0;n<i.length;n++){var s=i[n];s._jetDataMasonryOriginalOrder&&s._jetDataMasonryOriginalOrder>=t+1&&(s._jetDataMasonryOriginalOrder+=1)}e._jetDataMasonryOriginalOrder=t+1},_removeTileOriginalOrder:function(e){if(e._jetDataMasonryOriginalOrder){var t=this._getTileElements();if(t)for(var i=0;i<t.length;i++){var n=t[i];n._jetDataMasonryOriginalOrder&&n._jetDataMasonryOriginalOrder>e._jetDataMasonryOriginalOrder&&(n._jetDataMasonryOriginalOrder-=1)}delete e._jetDataMasonryOriginalOrder}},_applyTileStyleClass:function(){var e=this.element.children();(e=(e=e.not("."+u)).filter(function(e,t){return t.className.match(_)})).addClass(u)},_initMenu:function(e){var i=this._GetContextMenu();if(e||i||this._IsCustomElement()||(i=this.element.attr("contextmenu"))&&(this.options.contextMenu="#"+i),e||i){if(i=e||i,"function"===t.type(i)){try{i=i()}catch(e){i=null}t.type(i)}if(i){var n=t(i);if(n.length>0){n.css("display",d);var s=this._menu;if(!s)return;s.$container=n,s.usermenu=!0}this._menu.usermenu&&e&&this._applyMenu()}}},_applyMenu:function(){if(this._menu&&this._menu.usermenu&&this.options.reorderHandle){var e=this._menu.$container,i=this;"OJ-MENU"===e[0].tagName?e[0].addEventListener("ojAction",this._handleContextMenuSelect.bind(this)):e.on("ojselect",this._handleContextMenuSelect.bind(this));var n=e.find("[data-oj-command]"),s=!1;n.each(function(){var n=t(this).attr("data-oj-command");n.indexOf("oj-masonrylayout-")>=0&&(n=n.slice("oj-masonrylayout-".length));var r="OJ-MENU"===e[0].tagName?this.tagName:"li",a=i._buildContextMenuItem(n,r);t(this).attr("id",a.attr("id")),"OJ-OPTION"===this.tagName?(this.innerHTML=a.get(0).innerHTML,t(this).attr("data-oj-command",a.attr("data-oj-command"))):(a.get(0).className=t(this).get(0).className,t(this).replaceWith(a)),s=!0}),s&&("OJ-MENU"===e[0].tagName?e[0].refresh():e.ojMenu("refresh")),this._menu.$elemCut=e.find("#ojmasonrylayoutcut"),this._menu.$elemPasteBefore=e.find("#ojmasonrylayoutpastebefore"),this._menu.$elemPasteAfter=e.find("#ojmasonrylayoutpasteafter")}},_clearMenu:function(){var e=this._menu;e&&e.usermenu&&(e.usermenu=!1,"OJ-MENU"===e.$container[0].tagName?e.$container[0].removeEventListener("ojAction",this._handleContextMenuSelect):e.$container.off("ojselect"),e.$container=null)},_refreshMenu:function(){this._clearMenu(),this._initMenu(),this._applyMenu()},_prepareContextMenuBeforeOpen:function(e){var i=this.element,n=e.originalEvent.target,s=this.options.reorderHandle,r=!1;if(s){var a=t(n).closest(s);a&&a.length>0&&(r=!0)}var o,l=C(n,i[0]);if(this._menu.tile=l,this._menu.usermenu){var h=this._menu.cutTile,d=!1,u=this._menu.$elemCut;if(u){var _=u.hasClass("oj-helper-hidden");r||_?r&&_&&(u.removeClass("oj-helper-hidden"),d=!0):(u.addClass("oj-helper-hidden"),d=!0);var c=u.hasClass("oj-disabled");o=!1,h&&l===h&&(o=!0),o&&!c?(u.addClass("oj-disabled"),d=!0):!o&&c&&(u.removeClass("oj-disabled"),d=!0)}var f=this._menu.$elemPasteBefore;if(f){var g=f.hasClass("oj-helper-hidden");r||g?r&&g&&(f.removeClass("oj-helper-hidden"),d=!0):(f.addClass("oj-helper-hidden"),d=!0);var m=f.hasClass("oj-disabled");o=!1,h&&l!==h&&l!==b(h)||(o=!0),o&&!m?(f.addClass("oj-disabled"),d=!0):!o&&m&&(f.removeClass("oj-disabled"),d=!0)}var p=this._menu.$elemPasteAfter;if(p){var v=p.hasClass("oj-helper-hidden");r||v?r&&v&&(p.removeClass("oj-helper-hidden"),d=!0):(p.addClass("oj-helper-hidden"),d=!0);var y=p.hasClass("oj-disabled");o=!1,h&&h!==l&&h!==b(l)||(o=!0),o&&!y?(p.addClass("oj-disabled"),d=!0):!o&&y&&(p.removeClass("oj-disabled"),d=!0)}if(d){var T=this._menu.$container;"OJ-MENU"===T[0].tagName?T[0].refresh():T.ojMenu("refresh")}}},_buildContextMenuItem:function(e,i){var n=f[e],s=t(document.createElement(i));return s.attr("id",n),s.attr("data-oj-command",e),s.append(this._buildContextMenuLabel(e,"OJ-OPTION"===i)),s},_buildContextMenuLabel:function(e,i){var n=g[e],s=document.createTextNode(this.getTranslatedString(n));return i?s:t('<a href="#"></a>').append(s)},_menuCut:function(e){e&&(this._menu.cutTile=e)},_menuPaste:function(e,t){if(e&&this._menu.cutTile){var i=this._menu.cutTile;this._menu.cutTile=!1,this._doPaste(i,e,t)}},_doPaste:function(e,i,n){var s=e._jetDataMasonryOriginalOrder-1,r=t(e),a={tile:r,fromIndex:s};if(!1!==this._trigger("beforeReorder",null,a)){this._removeTileOriginalOrder(e);var o=i._jetDataMasonryOriginalOrder-1;n||(o+=1);var l=this.element[0];if(n)this._insertTileOriginalOrder(e,o),l.insertBefore(e,i);else{var h=b(i);this._insertTileOriginalOrder(e,o),l.insertBefore(e,h)}this._mlCommon.setup(!0);var d={tile:r,fromIndex:s,toIndex:o};this._trigger("reorder",null,d)}},_handleContextMenuSelect:function(e,i){var n=(i?i.item:t(e.target)).attr("id");"ojmasonrylayoutcut"===n?this._menuCut(this._menu.tile):"ojmasonrylayoutpastebefore"===n?this._menuPaste(this._menu.tile,!0):"ojmasonrylayoutpasteafter"===n&&this._menuPaste(this._menu.tile,!1)},_getTileIndex:function(e){var t=this._getTileElements(!0);S(t);for(var i=t.length,n=0;n<i;n++)if(t[n]===e)return n;return-1},_setupReorderHandles:function(){var e=this.element,t=e.children();this._setupReorderHandlesForElem(t),e.on("dragstart"+this.reorderHandleEventNamespace,this._handleDragStartFunc).on("dragenter"+this.reorderHandleEventNamespace,this._handleDragEnterFunc).on("dragover"+this.reorderHandleEventNamespace,this._handleDragOverFunc).on("dragleave"+this.reorderHandleEventNamespace,this._handleDragLeaveFunc).on("dragend"+this.reorderHandleEventNamespace,this._handleDragEndFunc).on("drop"+this.reorderHandleEventNamespace,this._handleDropFunc)},_setupReorderHandlesForElem:function(e){var t=this.options;e.filter(t.reorderHandle).attr("draggable","true").addClass("oj-draggable"),e.find(t.reorderHandle).attr("draggable","true").addClass("oj-draggable")},_tearDownReorderHandles:function(){var e=this.element,t=e.children();this._tearDownReorderHandlesForElem(t),e.off(this.reorderHandleEventNamespace)},_tearDownReorderHandlesForElem:function(e){var t=this.options;e.filter(t.reorderHandle).removeAttr("draggable").removeClass("oj-draggable"),e.find(t.reorderHandle).removeAttr("draggable").removeClass("oj-draggable")},_handleDragStart:function(e){var i,n=this.options;i=e.originalEvent.target;var s=t(i).closest(n.reorderHandle);if(s&&!(s.length<1)&&!this._bDragging){var r=C(i=e.target,this.element[0]);if(r){var a=this._getTileIndex(r);r._jetDataMasonryDragSourceIndex=a;var o={tile:t(r),fromIndex:a};if(!1!==this._trigger("beforeReorder",null,o)){var l=e.originalEvent;this._dragStart(r,l.pageX,l.pageY,l.dataTransfer)}}}},_handleDragEnter:function(i){if(this._bDragging){var n=i.originalEvent,s=n.relatedTarget,r=this.element[0],a=!1;if(s)a=r!==s&&!e.DomUtils.isAncestor(r,s);else if(this._dragLeftMasonryLayout){var o=document.elementFromPoint(n.clientX,n.clientY);a=o&&(o===r||e.DomUtils.isAncestor(r,o))}if(a)if(this._dragLeftMasonryLayout=!1,this._draggedTile){if(this._dropSite){t(this._dropSite).css("display",""),this._mlCommon.setup(!1,!0)}}else n.dataTransfer.dropEffect="none"}},_handleDragOver:function(e){if(!this._bDragging)return!1;var t=e.originalEvent;return t.dataTransfer.dropEffect="move",this._dragMove(t.pageX,t.clientX,t.clientY),e.preventDefault(),!1},_handleDragLeave:function(i){if(this._bDragging){var n=i.originalEvent,s=n.relatedTarget,r=this.element[0],a=!1;if(s)a=r!==s&&!e.DomUtils.isAncestor(r,s);else{var o=document.elementFromPoint(n.clientX,n.clientY);a=o&&o!==r&&!e.DomUtils.isAncestor(r,o)}if(a)if(this._dragLeftMasonryLayout=!0,this._dropSite)t(this._dropSite).css("display",d),this._mlCommon.setup(!1,!0)}},_clearDragStartHideTileTimeout:function(){if(this._dragStartHideTileTimeout){clearTimeout(this._dragStartHideTileTimeout),this._dragStartHideTileTimeout=null,this._busyStateResolveFunc(),this._busyStateResolveFunc=null;var e=this._draggedTile;e&&t(e).removeClass("oj-drag")}},_handleDragEnd:function(i){if(this._clearDragStartHideTileTimeout(),this._bDragging&&!this._bDropping){var n=this._draggedTile;if(n&&this._dropSite){var s=this._dropSite,r=this.element[0];if(e.DomUtils.isAncestor(r,n))t(s).css("display",""),this._removeTileOriginalOrder(s),s.parentNode.removeChild(s),t(n).css("display",""),this._insertTileOriginalOrder(n,n._jetDataMasonryOriginalOrder-1),this._mlCommon.setup(!1,!0);delete n._jetDataMasonryDragSourceIndex}this._draggedTile=null,this._dropSite=null,this._prevTileUnderPoint=null,this._prevCellUnderPoint=null,this._bDragMoveTransition=!1,this._bMouseMoved=!1,this._dragOffset=null,this._bDragEndTransition=!1,this._bDragging=!1}},_handleDrop:function(e){if(!this._bDragging)return!1;var t=this._mlCommon;t.isInLayoutCycle()&&t.finishLayoutCycle(),this._clearDragStartHideTileTimeout();var i=e.originalEvent;return this._drop(this._draggedTile,i.pageX,i.pageY),e.stopPropagation(),!1},_dragStart:function(e,i,n,s){this._bDragging=!0,this._bDropping=!1,this._bMouseMoved=!1,this._bDragStartTileHidden=!1,this._draggedTile=e;var a=this.element[0],o=y(e);this._dropSite=document.createElement("div");var l=this._dropSite;l._jetDataMasonryOriginalOrder=e._jetDataMasonryOriginalOrder,l.className=o+" oj-drop "+u;var h=l.style,_=e.style;h.top=_.top,this._bRTL?h.right=_.right:h.left=_.left;var c=m(e);a.insertBefore(l,e);var f={left:i-c.left,top:n-c.top};this._dragOffset=f,t(e).addClass("oj-drag"),s.effectAllowed="move",s.setData("text/html",e.outerHTML),s.setDragImage(e,f.left,f.top);var g=this;this._busyStateResolveFunc=this._addBusyState("Wait for dragStartHideTile timeout"),this._dragStartHideTileTimeout=setTimeout(function(){g._bDragStartTileHidden=!0,_.display=d,t(e).removeClass("oj-drag"),g._dragStartHideTileTimeout=null,g._busyStateResolveFunc(),g._busyStateResolveFunc=null,r.subtreeHidden(e)},0)},_dragMove:function(e,i,n){if(this._bMouseMoved=!0,this._bDragStartTileHidden&&!this._bDragMoveTransition){var s=this.element[0],r=C(document.elementFromPoint(i,n),s),a=!1;if(r){var o=t(r),l=this.options.reorderHandle;if(o.is(l))a=!0;else{var h=o.find(l);a=h&&h.length>0}}var d=!1;if(null==r||r===this._dropSite||r===this._draggedTile)this._prevTileUnderPoint=null,this._prevCellUnderPoint=null;else if(this._prevTileUnderPoint&&this._prevCellUnderPoint&&this._prevTileUnderPoint!==r){var u=this._getCellPosition(i,n);u&&u.row===this._prevCellUnderPoint.row&&u.col===this._prevCellUnderPoint.col&&(d=!0)}if(r&&!d&&r!==this._dropSite&&r!==this._draggedTile&&a){var _=e-m(s).left,c=b(this._dropSite),f=_>=r.offsetLeft+.5*r.offsetWidth;if(this._removeTileOriginalOrder(this._dropSite),f&&!this._bRTL||!f&&this._bRTL){var g=b(r);g?(this._insertTileOriginalOrder(this._dropSite,g._jetDataMasonryOriginalOrder-1),s.insertBefore(this._dropSite,g)):(this._insertTileOriginalOrder(this._dropSite,r._jetDataMasonryOriginalOrder),s.appendChild(this._dropSite))}else this._insertTileOriginalOrder(this._dropSite,r._jetDataMasonryOriginalOrder-1),s.insertBefore(this._dropSite,r);if(c!==b(this._dropSite)){var p=this._mlCommon,v=r,y=this._getCellPosition(i,n);this._bDragMoveTransition=p.setup(!1,!0),this._bDragMoveTransition&&(this._prevTileUnderPoint=v,this._prevCellUnderPoint=y)}}}},_handleDragMoveTransitionEnd:function(){this._bDragMoveTransition=!1},_drop:function(e,i,n){this._bDropping=!0;var s=this.element[0],a=this._dropSite;this._dropSite=null,this._prevTileUnderPoint=null,this._prevCellUnderPoint=null,r.subtreeDetached(e),s.insertBefore(e,a),s.removeChild(a),r.subtreeAttached(e),e._jetDataMasonryOriginalOrder=a._jetDataMasonryOriginalOrder;var o=e.style;o.display="",r.subtreeShown(e);var l=m(s),h=this._dragOffset;o.top=n-h.top-l.top+"px";var d=i-h.left-l.left;if(this._bRTL?(o.right=s.offsetWidth-(d+t(e).outerWidth(!0))+"px",o.left=""):o.left=d+"px",this._dragOffset=null,this._bMouseMoved){var u=this._mlCommon;this._bDragEndTransition=u.setup(!1,!0)}else this._handleDragEndTransitionEnd()},_handleDragEndTransitionEnd:function(){this._bDragEndTransition=!1,this._bDragging=!1,this._bDropping=!1,this._bMouseMoved=!1,this._bDragStartTileHidden=!1;var e=this._draggedTile;this._draggedTile=null;var i=e._jetDataMasonryDragSourceIndex;delete e._jetDataMasonryDragSourceIndex;var n=this._getTileIndex(e),s={tile:t(e),fromIndex:i,toIndex:n};this._trigger("reorder",null,s)},_getCellPosition:function(e,t){var i=this._mlCommon.getCellSize(),n=null;return i&&(n={col:parseInt(e/i.w,10),row:parseInt(t/i.h,10)}),n},_addBusyState:function(e){var t=this.element,n=i.getContext(t[0]).getBusyContext(),s="MasonryLayout";s+=" (id='"+t.attr("id")+"')";var r={description:s+=": "+e};return n.addBusyState(r)},getNodeBySubId:function(e){return this._super(e)},getSubIdByNode:function(e){return this._super(e)}})}(),l.extension._WIDGET_NAME="ojMasonryLayout",e.CustomElementBridge.register("oj-masonry-layout",{metadata:l})});