/** * gridstack.js 0.6.4 * https://gridstackjs.com/ * (c) 2014-2020 Alain Dumesny, Dylan Weiss, Pavel Reznikov * gridstack.js may be freely distributed under the MIT license. * @preserve */ !function(t){if("function"==typeof define&&define.amd)define(["jquery","exports"],t);else if("undefined"!=typeof exports){var e;try{e=require("jquery")}catch(t){}t(e||window.jQuery,exports)}else t(window.jQuery,window)}(function(m,t){function n(t,e,i,o){void 0!==t[e]&&(t[i]=t[e],console.warn("gridstack.js: Option `"+e+"` is deprecated in "+o+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))}function d(t,e,i,o){var a=t.attr(e);void 0!==a&&(t.attr(i,a),console.warn("gridstack.js: attribute `"+e+"`="+a+" is deprecated on this object in "+o+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))}var f={isIntercepted:function(t,e){return!(t.x+t.width<=e.x||e.x+e.width<=t.x||t.y+t.height<=e.y||e.y+e.height<=t.y)},sort:function(t,e,i){if(!i){var o=t.map(function(t){return t.x+t.width});i=Math.max.apply(Math,o)}return-1===e?f.sortBy(t,function(t){return-(t.x+t.y*i)}):f.sortBy(t,function(t){return t.x+t.y*i})},createStylesheet:function(t,e){var i=document.createElement("style");return i.setAttribute("type","text/css"),i.setAttribute("data-gs-style-id",t),i.styleSheet?i.styleSheet.cssText="":i.appendChild(document.createTextNode("")),(e=e||document.getElementsByTagName("head")[0]).insertBefore(i,e.firstChild),i.sheet},removeStylesheet:function(t){m("STYLE[data-gs-style-id="+t+"]").remove()},insertCSSRule:function(t,e,i,o){"function"==typeof t.insertRule?t.insertRule(e+"{"+i+"}",o):"function"==typeof t.addRule&&t.addRule(e,i,o)},toBool:function(t){return"boolean"==typeof t?t:"string"==typeof t?!(""===(t=t.toLowerCase())||"no"===t||"false"===t||"0"===t):Boolean(t)},_collisionNodeCheck:function(t){return t!==this.node&&f.isIntercepted(t,this.nn)},_didCollide:function(t){return f.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},t)},_isAddNodeIntercepted:function(t){return f.isIntercepted({x:this.x,y:this.y,width:this.node.width,height:this.node.height},t)},parseHeight:function(t){var e=t,i="px";if(e&&"string"==typeof e){var o=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!o)throw new Error("Invalid height");i=o[2]||"px",e=parseFloat(o[1])}return{height:e,unit:i}},without:function(t,e){var i=t.indexOf(e);return-1!==i&&(t=t.slice(0)).splice(i,1),t},sortBy:function(t,a){return t.slice(0).sort(function(t,e){var i=a(t),o=a(e);return o===i?0:ot.clientHeight?t:f.getScrollParent(t.parentNode)},updateScrollPosition:function(t,e,i){var o=t.getBoundingClientRect(),a=window.innerHeight||document.documentElement.clientHeight;if(o.top<0||o.bottom>a){var s=o.bottom-a,r=o.top,n=f.getScrollParent(t);if(null!==n){var d=n.scrollTop;o.top<0&&i<0?t.offsetHeight>a?n.scrollTop+=i:n.scrollTop+=Math.abs(r)>Math.abs(i)?i:r:0a?n.scrollTop+=i:n.scrollTop+=i=t._packY;){this.nodes.slice(0,e).find(f._didCollide,{n:t,newY:i})||(t._dirty=!0,t.y=i),--i}},this):this.nodes.forEach(function(t,e){if(!t.locked)for(;0this.column?t.width=this.column:t.width<1&&(t.width=1),t.height<1&&(t.height=1),t.x<0&&(t.x=0),t.x+t.width>this.column&&(e?t.width=this.column-t.x:t.x=this.column-t.width),t.y<0&&(t.y=0),t},l.prototype._notify=function(){if(!this._batchMode){var t=Array.prototype.slice.call(arguments,0);t[0]=void 0===t[0]?[]:Array.isArray(t[0])?t[0]:[t[0]],t[1]=void 0===t[1]||t[1];var e=t[0].concat(this.getDirtyNodes());this.onchange(e,t[1])}},l.prototype.cleanNodes=function(){this._batchMode||this.nodes.forEach(function(t){delete t._dirty})},l.prototype.getDirtyNodes=function(t){if(t){var e=[];return this.nodes.forEach(function(t){t._dirty&&(t.y===t._origY&&t.x===t._origX&&t.width===t._origW&&t.height===t._origH?delete t._dirty:e.push(t))}),e}return this.nodes.filter(function(t){return t._dirty})},l.prototype.addNode=function(t,e){if(void 0!==(t=this._prepareNode(t)).maxWidth&&(t.width=Math.min(t.width,t.maxWidth)),void 0!==t.maxHeight&&(t.height=Math.min(t.height,t.maxHeight)),void 0!==t.minWidth&&(t.width=Math.max(t.width,t.minWidth)),void 0!==t.minHeight&&(t.height=Math.max(t.height,t.minHeight)),t._id=t._id||++s,t.autoPosition){this._sortNodes();for(var i=0;;++i){var o=i%this.column,a=Math.floor(i/this.column);if(!(o+t.width>this.column)&&!this.nodes.find(f._isAddNodeIntercepted,{x:o,y:a,node:t})){t.x=o,t.y=a,delete t.autoPosition;break}}}return this.nodes.push(t),e&&this._addedNodes.push(t),this._fixCollisions(t),this._packNodes(),this._notify(),t},l.prototype.removeNode=function(t,e){e=void 0===e||e,this._removedNodes.push(t),t._id=null,this.nodes=f.without(this.nodes,t),this._packNodes(),this._notify(t,e)},l.prototype.removeAll=function(t){delete this._layouts,0!==this.nodes.length&&(t=void 0===t||t,this.nodes.forEach(function(t){t._id=null}),this._removedNodes=this.nodes,this.nodes=[],this._notify(this._removedNodes,t))},l.prototype.canMoveNode=function(e,t,i,o,a){if(!this.isNodeChangedPosition(e,t,i,o,a))return!1;var s,r=Boolean(this.nodes.find(function(t){return t.locked}));if(!this.maxRow&&!r)return!0;var n=new l(this.column,null,this.float,0,this.nodes.map(function(t){return t===e?s=m.extend({},t):m.extend({},t)}));if(!s)return!0;n.moveNode(s,t,i,o,a);var d=!0;return r&&(d&=!Boolean(n.nodes.find(function(t){return t!==s&&Boolean(t.locked)&&Boolean(t._dirty)}))),this.maxRow&&(d&=n.getGridHeight()<=this.maxRow),d},l.prototype.canBePlacedWithRespectToHeight=function(t){if(!this.maxRow)return!0;var e=new l(this.column,null,this.float,0,this.nodes.map(function(t){return m.extend({},t)}));return e.addNode(t),e.getGridHeight()<=this.maxRow},l.prototype.isNodeChangedPosition=function(t,e,i,o,a){return"number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof o&&(o=t.width),"number"!=typeof a&&(a=t.height),void 0!==t.maxWidth&&(o=Math.min(o,t.maxWidth)),void 0!==t.maxHeight&&(a=Math.min(a,t.maxHeight)),void 0!==t.minWidth&&(o=Math.max(o,t.minWidth)),void 0!==t.minHeight&&(a=Math.max(a,t.minHeight)),t.x!==e||t.y!==i||t.width!==o||t.height!==a},l.prototype.moveNode=function(t,e,i,o,a,s){if("number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof o&&(o=t.width),"number"!=typeof a&&(a=t.height),void 0!==t.maxWidth&&(o=Math.min(o,t.maxWidth)),void 0!==t.maxHeight&&(a=Math.min(a,t.maxHeight)),void 0!==t.minWidth&&(o=Math.max(o,t.minWidth)),void 0!==t.minHeight&&(a=Math.max(a,t.minHeight)),t.x===e&&t.y===i&&t.width===o&&t.height===a)return t;var r=t.width!==o;return t._dirty=!0,t.x=e,t.y=i,t.width=o,t.height=a,t.lastTriedX=e,t.lastTriedY=i,t.lastTriedWidth=o,t.lastTriedHeight=a,t=this._prepareNode(t,r),this._fixCollisions(t),s||(this._packNodes(),this._notify()),t},l.prototype.getGridHeight=function(){return this.nodes.reduce(function(t,e){return Math.max(t,e.y+e.height)},0)},l.prototype.beginUpdate=function(t){t._updating||(t._updating=!0,this.nodes.forEach(function(t){t._packY=t.y}))},l.prototype.endUpdate=function(){var t=this.nodes.find(function(t){return t._updating});t&&(t._updating=!1,this.nodes.forEach(function(t){delete t._packY}))};function i(t,e){var i,c=this;e=e||{},this.container=m(t),n(e,"width","column","v0.5.3"),n(e,"height","maxRow","v0.5.3"),function(t,e,i,o){void 0!==t[e]&&console.warn("gridstack.js: Option `"+e+"` is deprecated in "+i+o)}(e,"oneColumnModeClass","v0.6.3",". Use class `.grid-stack-1` instead"),d(this.container,"data-gs-width","data-gs-column","v0.5.3"),d(this.container,"data-gs-height","data-gs-max-row","v0.5.3"),e.itemClass=e.itemClass||"grid-stack-item";var o=0
'+this.opts.placeholderText+"
").hide(),this._updateContainerHeight(),this._updateHeightsOnResize=f.throttle(function(){c.cellHeight(c.cellWidth(),!1)},100),this.onResizeHandler=function(){if(i&&c._updateHeightsOnResize(),!c.opts.staticGrid)if(!c.opts.disableOneColumnMode&&(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=c.opts.minWidth){if(c.oneColumnMode)return;c.oneColumnMode=!0,c.setColumn(1)}else{if(!c.oneColumnMode)return;c.oneColumnMode=!1,c.setColumn(c._prevColumn)}},m(window).resize(this.onResizeHandler),this.onResizeHandler(),!c.opts.staticGrid&&"string"==typeof c.opts.removable){var r=m(c.opts.removable);this.dd.isDroppable(r)||this.dd.droppable(r,c.opts.removableOptions),this.dd.on(r,"dropover",function(t,e){var i=m(e.draggable),o=i.data("_gridstack_node");o&&o._grid===c&&(i.data("inTrashZone",!0),c._setupRemovingTimeout(i))}).on(r,"dropout",function(t,e){var i=m(e.draggable),o=i.data("_gridstack_node");o&&o._grid===c&&(i.data("inTrashZone",!1),c._clearRemovingTimeout(i))})}if(!c.opts.staticGrid&&c.opts.acceptWidgets){function p(t,e){var i=u,o=i.data("_gridstack_node"),a=c.getCellFromPixel({left:t.pageX,top:t.pageY},!0),s=Math.max(0,a.x),r=Math.max(0,a.y);o._added||(o._added=!0,o.el=i,o.autoPosition=!0,o.x=s,o.y=r,c.grid.cleanNodes(),c.grid.beginUpdate(o),c.grid.addNode(o),c.container.append(c.placeholder),c.placeholder.attr("data-gs-x",o.x).attr("data-gs-y",o.y).attr("data-gs-width",o.width).attr("data-gs-height",o.height).show(),o.el=c.placeholder,o._beforeDragX=o.x,o._beforeDragY=o.y,c._updateContainerHeight()),c.grid.canMoveNode(o,s,r)&&(c.grid.moveNode(o,s,r),c._updateContainerHeight())}var u=null;this.dd.droppable(c.container,{accept:function(t){var e=(t=m(t)).data("_gridstack_node");return(!e||e._grid!==c)&&t.is(!0===c.opts.acceptWidgets?".grid-stack-item":c.opts.acceptWidgets)}}).on(c.container,"dropover",function(t,e){var i,o,a=m(e.draggable),s=a.data("_gridstack_node");if(!s||!s.width||!s.height){var r=parseInt(a.attr("data-gs-width"));0this._styles._max)){for(var a=this._styles._max;a=p.grid.column||s<0||!p.grid.float&&s>p.grid.getGridHeight()){if(l._temporaryRemoved)return;!0===p.opts.removable&&p._setupRemovingTimeout(h),a=l._beforeDragX,s=l._beforeDragY,p.placeholder.detach(),p.placeholder.hide(),p.grid.removeNode(l),p._updateContainerHeight(),l._temporaryRemoved=!0}else p._clearRemovingTimeout(h),l._temporaryRemoved&&(p.grid.addNode(l),p.placeholder.attr("data-gs-x",a).attr("data-gs-y",s).attr("data-gs-width",i).attr("data-gs-height",o).show(),p.container.append(p.placeholder),l.el=p.placeholder,l._temporaryRemoved=!1)}else if("resize"===t.type&&a<0)return;var n=void 0!==i?i:l.lastTriedWidth,d=void 0!==o?o:l.lastTriedHeight;!p.grid.canMoveNode(l,a,s,i,o)||l.lastTriedX===a&&l.lastTriedY===s&&l.lastTriedWidth===n&&l.lastTriedHeight===d||(l.lastTriedX=a,l.lastTriedY=s,l.lastTriedWidth=i,l.lastTriedHeight=o,p.grid.moveNode(l,a,s,i,o),p._updateContainerHeight(),"resize"===t.type&&m(t.target).trigger("gsresize",l))}function e(t,e){p.container.append(p.placeholder);var i=m(this);p.grid.cleanNodes(),p.grid.beginUpdate(l),g=p.cellWidth();var o=p.cellHeight();c=p.container.height()/parseInt(p.container.attr("data-gs-current-height")),p.placeholder.attr("data-gs-x",i.attr("data-gs-x")).attr("data-gs-y",i.attr("data-gs-y")).attr("data-gs-width",i.attr("data-gs-width")).attr("data-gs-height",i.attr("data-gs-height")).show(),l.el=p.placeholder,l._beforeDragX=l.x,l._beforeDragY=l.y,l._prevYPix=e.position.top;var a=l.minHeight||1,s=p.opts.verticalMargin;p.dd.resizable(h,"option","minWidth",g*(l.minWidth||1)),p.dd.resizable(h,"option","minHeight",o*a+(a-1)*s),"resizestart"===t.type&&i.find(".grid-stack-item").trigger("resizestart")}function i(t,e){var i=m(this);if(i.data("_gridstack_node")){if(p.placeholder.detach(),l.el=i,p.placeholder.hide(),l._isAboutToRemove)h.data("_gridstack_node")._grid._triggerRemoveEvent(),h.removeData("_gridstack_node"),h.remove();else p._clearRemovingTimeout(h),l._temporaryRemoved?(f.removePositioningStyles(i),i.attr("data-gs-x",l._beforeDragX).attr("data-gs-y",l._beforeDragY).attr("data-gs-width",l.width).attr("data-gs-height",l.height),l.x=l._beforeDragX,l.y=l._beforeDragY,l._temporaryRemoved=!1,p.grid.addNode(l)):(f.removePositioningStyles(i),i.attr("data-gs-x",l.x).attr("data-gs-y",l.y).attr("data-gs-width",l.width).attr("data-gs-height",l.height));p._updateContainerHeight(),p._triggerChangeEvent(),p.grid.endUpdate();var o=i.find(".grid-stack");o.length&&"resizestop"===t.type&&(o.each(function(t,e){m(e).data("gridstack").onResizeHandler()}),i.find(".grid-stack-item").trigger("resizestop"),i.find(".grid-stack-item").trigger("gsresizestop")),"resizestop"===t.type&&p.container.trigger("gsresizestop",i)}}var g,c,p=this;this.dd.draggable(h,{start:e,stop:i,drag:t}).resizable(h,{start:e,stop:i,resize:t}),(l.noMove||this.opts.disableDrag||this.opts.staticGrid)&&this.dd.draggable(h,"disable"),(l.noResize||this.opts.disableResize||this.opts.staticGrid)&&this.dd.resizable(h,"disable"),this._writeAttr(h,l)},i.prototype._prepareElement=function(t,e){e=void 0!==e&&e;(t=m(t)).addClass(this.opts.itemClass);var i=this._readAttr(t,{el:t,_grid:this});i=this.grid.addNode(i,e),t.data("_gridstack_node",i),this._prepareElementsByNode(t,i)},i.prototype._writeAttr=function(t,e){t=m(t),void 0!==(e=e||{}).x&&t.attr("data-gs-x",e.x),void 0!==e.y&&t.attr("data-gs-y",e.y),void 0!==e.width&&t.attr("data-gs-width",e.width),void 0!==e.height&&t.attr("data-gs-height",e.height),void 0!==e.autoPosition&&t.attr("data-gs-auto-position",!!e.autoPosition||null),void 0!==e.minWidth&&t.attr("data-gs-min-width",e.minWidth),void 0!==e.maxWidth&&t.attr("data-gs-max-width",e.maxWidth),void 0!==e.minHeight&&t.attr("data-gs-min-height",e.minHeight),void 0!==e.maxHeight&&t.attr("data-gs-max-height",e.maxHeight),void 0!==e.noResize&&t.attr("data-gs-no-resize",!!e.noResize||null),void 0!==e.noMove&&t.attr("data-gs-no-move",!!e.noMove||null),void 0!==e.locked&&t.attr("data-gs-locked",!!e.locked||null),void 0!==e.resizeHandles&&t.attr("data-gs-resize-handles",e.resizeHandles),void 0!==e.id&&t.attr("data-gs-id",e.id)},i.prototype._readAttr=function(t,e){return t=m(t),(e=e||{}).x=t.attr("data-gs-x"),e.y=t.attr("data-gs-y"),e.width=t.attr("data-gs-width"),e.height=t.attr("data-gs-height"),e.autoPosition=f.toBool(t.attr("data-gs-auto-position")),e.maxWidth=t.attr("data-gs-max-width"),e.minWidth=t.attr("data-gs-min-width"),e.maxHeight=t.attr("data-gs-max-height"),e.minHeight=t.attr("data-gs-min-height"),e.noResize=f.toBool(t.attr("data-gs-no-resize")),e.noMove=f.toBool(t.attr("data-gs-no-move")),e.locked=f.toBool(t.attr("data-gs-locked")),e.resizeHandles=t.attr("data-gs-resize-handles"),e.id=t.attr("data-gs-id"),e},i.prototype.setAnimation=function(t){t?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},i.prototype.addWidget=function(t,e,i,o,a,s,r,n,d,h,l){return void 0!==e&&"object"!=typeof e?this.addWidget(t,{x:e,y:i,width:o,height:a,autoPosition:s,minWidth:r,maxWidth:n,minHeight:d,maxHeight:h,id:l}):(e=e||{},t=m(t),this._writeAttr(t,e),this.container.append(t),this.makeWidget(t))},i.prototype.makeWidget=function(t){return t=m(t),this._prepareElement(t,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(!0),t},i.prototype.willItFit=function(t,e,i,o,a){var s={x:t,y:e,width:i,height:o,autoPosition:a};return this.grid.canBePlacedWithRespectToHeight(s)},i.prototype.removeWidget=function(t,e){e=void 0===e||e;var i=(t=m(t)).data("_gridstack_node");i=i||this.grid.getNodeDataByDOMEl(t),t.removeData("_gridstack_node"),this.grid.removeNode(i,e),this._triggerRemoveEvent(),this._triggerChangeEvent(!0)},i.prototype.removeAll=function(t){!1!==t&&this.grid.nodes.forEach(function(t){t.el.removeData("_gridstack_node")}),this.grid.removeAll(t),this._triggerRemoveEvent()},i.prototype.destroy=function(t){m(window).off("resize",this.onResizeHandler),this.disable(),void 0===t||t?this.container.remove():(this.removeAll(!1),this.container.removeData("gridstack")),f.removeStylesheet(this._stylesId),this.grid&&(this.grid=null)},i.prototype.resizable=function(t,o){var a=this;return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(i.noResize=!o,i.noResize?a.dd.resizable(e,"disable"):a.dd.resizable(e,"enable"))}),this},i.prototype.movable=function(t,o){var a=this;return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(i.noMove=!o,i.noMove?(a.dd.draggable(e,"disable"),e.removeClass("ui-draggable-handle")):(a.dd.draggable(e,"enable"),e.addClass("ui-draggable-handle")))}),this},i.prototype.enableMove=function(t,e){this.movable(this.container.children("."+this.opts.itemClass),t),e&&(this.opts.disableDrag=!t)},i.prototype.enableResize=function(t,e){this.resizable(this.container.children("."+this.opts.itemClass),t),e&&(this.opts.disableResize=!t)},i.prototype.disable=function(){this.movable(this.container.children("."+this.opts.itemClass),!1),this.resizable(this.container.children("."+this.opts.itemClass),!1),this.container.trigger("disable")},i.prototype.enable=function(){this.movable(this.container.children("."+this.opts.itemClass),!0),this.resizable(this.container.children("."+this.opts.itemClass),!0),this.container.trigger("enable")},i.prototype.locked=function(t,o){return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(i.locked=o||!1,e.attr("data-gs-locked",i.locked?"yes":null))}),this},i.prototype.maxHeight=function(t,o){return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(isNaN(o)||(i.maxHeight=o||!1,e.attr("data-gs-max-height",o)))}),this},i.prototype.minHeight=function(t,o){return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(isNaN(o)||(i.minHeight=o||!1,e.attr("data-gs-min-height",o)))}),this},i.prototype.maxWidth=function(t,o){return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(isNaN(o)||(i.maxWidth=o||!1,e.attr("data-gs-max-width",o)))}),this},i.prototype.minWidth=function(t,o){return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(isNaN(o)||(i.minWidth=o||!1,e.attr("data-gs-min-width",o)))}),this},i.prototype._updateElement=function(t,e){var i=(t=m(t).first()).data("_gridstack_node");if(i){var o=this;o.grid.cleanNodes(),o.grid.beginUpdate(i),e.call(this,t,i),o._updateContainerHeight(),o._triggerChangeEvent(),o.grid.endUpdate()}},i.prototype.resize=function(t,i,o){this._updateElement(t,function(t,e){i=null!=i?i:e.width,o=null!=o?o:e.height,this.grid.moveNode(e,e.x,e.y,i,o)})},i.prototype.move=function(t,i,o){this._updateElement(t,function(t,e){i=null!=i?i:e.x,o=null!=o?o:e.y,this.grid.moveNode(e,i,o,e.width,e.height)})},i.prototype.update=function(t,i,o,a,s){this._updateElement(t,function(t,e){i=null!=i?i:e.x,o=null!=o?o:e.y,a=null!=a?a:e.width,s=null!=s?s:e.height,this.grid.moveNode(e,i,o,a,s)})},i.prototype.compact=function(){if(0!==this.grid.nodes.length){this.batchUpdate(),this.grid._sortNodes();var t=this.grid.nodes;this.grid.nodes=[],t.forEach(function(t){t.noMove||t.locked||(t.autoPosition=!0),this.grid.addNode(t,!1),t._dirty=!0},this),this.commit()}},i.prototype.verticalMargin=function(t,e){if(void 0===t)return this.opts.verticalMargin;var i=f.parseHeight(t);this.opts.verticalMarginUnit===i.unit&&this.opts.maxRow===i.height||(this.opts.verticalMarginUnit=i.unit,this.opts.verticalMargin=i.height,e||this._updateStyles())},i.prototype.cellHeight=function(t,e){if(void 0===t){if(this.opts.cellHeight&&"auto"!==this.opts.cellHeight)return this.opts.cellHeight;var i=this.container.children("."+this.opts.itemClass).first(),o=i.attr("data-gs-height"),a=this.opts.verticalMargin;return Math.round((i.outerHeight()-(o-1)*a)/o)}var s=f.parseHeight(t);this.opts.cellHeightUnit===s.unit&&this.opts.cellHeight===s.height||(this.opts.cellHeightUnit=s.unit,this.opts.cellHeight=s.height,e||this._updateStyles())},i.prototype.cellWidth=function(){return Math.round(this.container.outerWidth()/this.opts.column)},i.prototype.getCellFromPixel=function(t,e){var i=void 0!==e&&e?this.container.offset():this.container.position(),o=t.left-i.left,a=t.top-i.top,s=Math.floor(this.container.width()/this.opts.column),r=Math.floor(this.container.height()/parseInt(this.container.attr("data-gs-current-height")));return{x:Math.floor(o/s),y:Math.floor(a/r)}},i.prototype.batchUpdate=function(){this.grid.batchUpdate()},i.prototype.commit=function(){this.grid.commit(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()},i.prototype.isAreaEmpty=function(t,e,i,o){return this.grid.isAreaEmpty(t,e,i,o)},i.prototype.setStatic=function(t){this.opts.staticGrid=!0===t,this.enableMove(!t),this.enableResize(!t),this._setStaticClass()},i.prototype._setStaticClass=function(){var t="grid-stack-static";!0===this.opts.staticGrid?this.container.addClass(t):this.container.removeClass(t)},l.prototype._layoutsNodesChange=function(t){this._layouts&&!this._ignoreLayoutsNodeChange&&this._layouts.forEach(function(o,a){o&&a!==this.column&&(a