AdfDhtmlPivotTablePeer.prototype.clearSizeOverrides=function(a){a.setProperty(AdfRichPivotTable.__SIZE_OVERRIDES_KEY,void 0)};AdfDhtmlPivotTablePeer.prototype.updateSizeOverrides=function(a,b,c){var d=a.getProperty(AdfRichPivotTable.__SIZE_OVERRIDES_KEY),d=void 0==d?{}:this.shallowCopy(d);d[b]=c;a.setProperty(AdfRichPivotTable.__SIZE_OVERRIDES_KEY,d,!1,AdfUIComponent.PROPAGATE_ALWAYS)};
AdfDhtmlPivotTablePeer.prototype.stringifySizeOverrides=function(a){var b="",c;for(c in a)a.hasOwnProperty(c)&&(b+=c+":"+a[c]+",");return b};
AdfDhtmlPivotTablePeer.prototype._getHeaderResizeMouseAction=function(a,b){var c={};if(b.headerContext){var d=b.headerContext;if(d.cell){var e=b.component==AdfPivotTableUtils.ROW_EDGE&&0==this._ptUtils._rowLayerCount;if(!e){var f=!1,g=null,e=Math.min(AdfDhtmlPivotTablePeer.COLUMN_RESIZE_MARGIN,Math.ceil(d.cellWidth/2));if(d.cellWidth-d.cellMouseX<=e)f=!0,g="endCol";else if(d.cellMouseX<=e){var h=!1;if(1==this.getAbsoluteColumnIndex(a,d.cell))if(b.component==AdfPivotTableUtils.ROW_EDGE)h=!0;else if(e=
this.getParentBlock(d.cell),e==this._ptUtils._colHeaderBuffers[1][0]||0<this._ptUtils._splitSlice[0]&&e==this._ptUtils._colHeaderBuffers[0][0])h=!0;h||(f=!0,g="startCol")}}e=b.component==AdfPivotTableUtils.COLUMN_EDGE&&0==this._ptUtils._colLayerCount;if(!f&&!e)if(d.cellMouseY<=AdfDhtmlPivotTablePeer.ROW_RESIZE_MARGIN){h=!1;if(1==this.getAbsoluteRowIndex(a,d.cell))if(b.component==AdfPivotTableUtils.COLUMN_EDGE)h=!0;else if(e=this.getParentBlock(d.cell),e==this._ptUtils._rowHeaderBuffers[1][0]||0<this._ptUtils._splitSlice[1]&&
e==this._ptUtils._rowHeaderBuffers[0][0])h=!0;h||(f=!0,g="startRow")}else d.cellHeight-d.cellMouseY<=AdfDhtmlPivotTablePeer.ROW_RESIZE_MARGIN?(f=!0,g="endRow"):b.component==AdfPivotTableUtils.COLUMN_EDGE&&d.cellHeight-d.cellMouseY<=AdfDhtmlPivotTablePeer.ROW_RESIZE_MARGIN+1?(h=this.getAbsoluteRowIndex(a,d.cell)+d.cell.rowSpan-1,h==this._ptUtils._colLayerCount&&(f=!0,g="endRow")):b.component==AdfPivotTableUtils.ROW_EDGE&&d.cellHeight-d.cellMouseY<=AdfDhtmlPivotTablePeer.ROW_RESIZE_MARGIN+1&&(h=this.getAbsoluteRowIndex(a,
d.cell)+d.cell.rowSpan-1,e=this.getParentBlock(d.cell),h==AdfAgent.AGENT.getAttribute(e,"_numSlices")&&"t"==AdfAgent.AGENT.getAttribute(e,"_lastBlock")&&(f=!0,g="endRow"));c.cell=d.cell;f&&(c.type="resize",c.isRowHeader=b.component==AdfPivotTableUtils.ROW_EDGE,c.data=g)}}return c};
AdfDhtmlPivotTablePeer.prototype.showColumnResizeIndicator=function(a){var b=a.cell,c=this.getParentBlock(b.parentNode),d=AdfAgent.AGENT.getIntAttribute(c,"_startSlice"),e=a.isRowHeader?1:0,f=d<this._ptUtils._splitSlice[e]?0:1,g=this._ptUtils._buffers2[e][f],h=this.getHeaderBlockIndex(g,c),d=AdfAgent.AGENT,l=this.getAbsoluteColumnIndex(d,b);"startCol"==a.data?(l--,0==l&&(AdfAssert.assert(AdfPivotTableUtils.assertsOff||!a.isRowHeader&&0<h),h--,c=g[h],l=c.childNodes[0].rows[0].cells.length-1)):l+=b.colSpan-
1;this._resizedCell=b=c.childNodes[0].rows[0].cells[l];this._resizedIndex=l;this._resizedBlockIndex=h;this._resizedIsHeader=a.isRowHeader;this._resizedPane=f;a=this._ptUtils._resizeIndicator;a.className=d.getAttribute(a,"_colClass");h=a.style;h.display="block";h.zIndex=20;h.top="0px";h.width="0px";h.height=this._ptUtils._colHeaders[1]._height+this._ptUtils._databodies[1][1]._height+(0<this._ptUtils._splitSlice[1]?this._ptUtils._databodies[0][1]._height:0)+"px";this._resizeIndicatorStartPos=c=this.getColumnResizeIndicatorLeft(c,
b,e,f,l);h.left=c+"px";AdfDhtmlPivotTablePeer._setCursor(a,d.getCursor("col-resize"))};AdfDhtmlPivotTablePeer.prototype.getColumnResizeIndicatorLeft=function(a,b,c,d,e){var f,g;f=this._ptUtils._headers[c][d];d=f._left;a=c?-f.scrollLeft:a._left;f=b.offsetLeft;b=this._ptUtils._rightToLeft?0:b.offsetWidth;g=c||this._ptUtils._rightToLeft?-1:0;c&&e==this._ptUtils._rowLayerCount&&(g=this._ptUtils._rightToLeft?-2:0);return d+a+f+b+g};
AdfDhtmlPivotTablePeer.prototype.showRowResizeIndicator=function(a){var b=a.cell,c=this.getParentBlock(b.parentNode),d=AdfAgent.AGENT.getIntAttribute(c,"_startSlice"),e=a.isRowHeader?1:0,d=d<this._ptUtils._splitSlice[e]?0:1,f=this._ptUtils._buffers2[e][d],g=this.getHeaderBlockIndex(f,c),h=AdfAgent.AGENT,l=this.getAbsoluteRowIndex(h,b);"startRow"==a.data?(l--,0==l&&(AdfAssert.assert(AdfPivotTableUtils.assertsOff||a.isRowHeader&&0<g),g--,c=f[g],l=c.childNodes[0].rows.length-1)):l+=b.rowSpan-1;this._resizedCell=
b=c.childNodes[0].rows[l].cells[0];this._resizedIndex=l;this._resizedBlockIndex=g;this._resizedIsHeader=!a.isRowHeader;this._resizedPane=d;g=this._ptUtils._resizeIndicator;g.className=h.getAttribute(g,"_rowClass");l=g.style;l.display="block";l.zIndex=20;l.left="0px";l.height="0px";l.width=this._ptUtils._rowHeaders[1]._width+this._ptUtils._databodies[1][1]._width+(0<this._ptUtils._splitSlice[0]?this._ptUtils._databodies[1][0]._width:0)+"px";b=b.offsetTop+b.offsetHeight;this._resizeIndicatorStartPos=
b=a.isRowHeader?b+(this._ptUtils._headers[e][d]._top+c._top):b-this._ptUtils._colHeaders[1].scrollTop;l.top=b+"px";AdfDhtmlPivotTablePeer._setCursor(g,h.getCursor("row-resize"))};AdfDhtmlPivotTablePeer.prototype._isColumnHeaderTextWrap=function(){void 0==this._columnHeaderTextWrap&&(this._columnHeaderTextWrap=this._isHeaderTextWrap(!1));return this._columnHeaderTextWrap};
AdfDhtmlPivotTablePeer.prototype._isRowHeaderTextWrap=function(){void 0==this._rowHeaderTextWrap&&(this._rowHeaderTextWrap=this._isHeaderTextWrap(!0));return this._rowHeaderTextWrap};AdfDhtmlPivotTablePeer.prototype._isHeaderTextWrap=function(a){for(var b=this._ptUtils._startPane[a?1:0];2>b;++b)for(var c=a?this._ptUtils._rowHeaderBuffers[b]:this._ptUtils._colHeaderBuffers[b],d=c.length,e=0;e<d;e++){var f=c[e];if(!f._placeholder&&this._isHeaderTextWrapInBlock(f))return!0}return!1};
AdfDhtmlPivotTablePeer.prototype._isHeaderTextWrapInBlock=function(a){a=a.childNodes[0].rows;for(var b=1;b<a.length;b++)for(var c=a[b].cells,d=1;d<c.length;d++)if(this._isTextWrappingEnabled(c[d]))return!0;return!1};AdfDhtmlPivotTablePeer.prototype._isColumnHeaderOutOfSync=function(){return this._isHeaderOutOfSync(!1)};AdfDhtmlPivotTablePeer.prototype._isRowHeaderOutOfSync=function(){return this._isHeaderOutOfSync(!0)};
AdfDhtmlPivotTablePeer.prototype._isHeaderOutOfSync=function(a){for(var b=AdfAgent.AGENT,c=b.getPlatform(),b=c==AdfAgent.IE_PLATFORM&&8<=b.getVersion(),c=c==AdfAgent.WEBKIT_PLATFORM,d=this._ptUtils._startPane[a?1:0];2>d;++d)for(var e=a?this._ptUtils._rowHeaderBuffers[d]:this._ptUtils._colHeaderBuffers[d],f=e.length,g=0;g<f;g++){var h=e[g];if(!h._placeholder)for(var h=h.childNodes[0].rows,l=1;l<h.length;l++){var m=h[l].cells,n=c||b?m[0]:h[l],m=parseInt(n.style.height),n=n.offsetHeight;if(!isNaN(m)&&
!isNaN(n)&&m!=n)return!0}}return!1};
AdfDhtmlPivotTablePeer.prototype._updateColumnHeaderSizeOverrides=function(){for(var a=AdfAgent.AGENT,b=a.getPlatform(),a=b==AdfAgent.IE_PLATFORM&&8<=a.getVersion(),b=b==AdfAgent.WEBKIT_PLATFORM,c=this._ptUtils._startPane[0];2>c;++c)for(var d=this._ptUtils._colHeaderBuffers[c],e=d.length;0<e;){c=d[0];if(!c._placeholder){c=c.childNodes[0].rows;for(d=1;d<c.length;d++)e=c[d].cells,e=parseInt((b||a?e[0]:c[d]).style.height),isNaN(e)||this.updateSizeOverrides(this.getComponent(),"ch"+(d-1),e)}return}};
AdfDhtmlPivotTablePeer.prototype._resizeColumn=function(a,b,c,d,e,f){var g=d.offsetWidth+f;if(a){a=this._ptUtils._rowHeaderBuffers[b][c]._width;for(b=this._ptUtils._startPane[1];2>b;++b){c=this._ptUtils._rowHeaderBuffers[b];for(var h=c.length,l=0;l<h;l++)if(d=c[l],!d._placeholder){var m=d.childNodes[0].rows[0].cells[e];m.style.width=g+"px";this._changeBlockWidth(d,a,f)}}if(d=this._ptUtils._layerLabelBlock)b=d.childNodes[0].rows[0].cells,e==this._ptUtils._rowLayerCount||0==this._ptUtils._rowLayerCount?
(c=Math.ceil(this._ptUtils._innerRhLayerLabelPercentage*g),b[e].style.width=c+"px",b[e+1].style.width=g-c+"px"):b[e].style.width=g+"px",this._changeBlockWidth(d,a,f);this.updateSizeOverrides(this.getComponent(),"rh"+(e-1),g);0>f&&(this._isRowHeaderTextWrap()&&this._isRowHeaderOutOfSync())&&(this._ptUtils.coordinateRowBlockSizes(),this._ptUtils._isRowHeaderWidthOverrideSmaller=!0)}else{d.style.width=g+"px";d=this._ptUtils._colHeaderBuffers[b][c];a=d._width;this._changeBlockWidth(d,a,f);h=-1;for(l=
this._ptUtils._startPane[1];2>l;++l)for(var n=this._ptUtils._databodyBuffers[l][b],p=n.length,q=0;q<p;q++){d=n[q][c];-1==h&&(h=AdfAgent.AGENT.getIntAttribute(d,"_startCol"));table=d.childNodes[0];var m=table.rows[0].cells[e],r=parseInt(m.style.width)+f;m.style.width=r+"px";this._changeBlockWidth(d,a,f)}e=h+e-1;this.updateSizeOverrides(this.getComponent(),"cc"+e,g);this.moveBlocksHoriz(b,c+1,f);0>f&&(this._isColumnHeaderTextWrap()&&this._isColumnHeaderOutOfSync())&&(this._ptUtils.coordinateColumnBlockSizes(),
this._updateColumnHeaderSizeOverrides())}this._ptUtils.sizePivotTable(this._maxWidth,this._maxHeight);this._ptUtils.scrollHTMLBlocks();this._ptUtils.fetchNearbyBlocks(!0);this._isPaging&&this.updatePagingControls();return g};
AdfDhtmlPivotTablePeer.prototype._resizeRow=function(a,b,c,d,e,f,g){var h=d.offsetHeight,l=h+f,m=AdfAgent.AGENT.getPlatform(),n=m==AdfAgent.IE_PLATFORM,p=n&&8<=AdfAgent.AGENT.getVersion(),m=m==AdfAgent.WEBKIT_PLATFORM;if(a){d=this._ptUtils._colHeaderBuffers[b][c]._height;for(b=this._ptUtils._startPane[0];2>b;++b){c=this._ptUtils._colHeaderBuffers[b];for(var q=c.length,r=0;r<q;r++){a=c[r];var v=a.childNodes[0];a._placeholder||(v=v.rows[e],v._minRH>l&&(l=v._minRH))}}f=l-h;for(b=this._ptUtils._startPane[0];2>
b;++b){c=this._ptUtils._colHeaderBuffers[b];q=c.length;for(r=0;r<q;r++)a=c[r],a._placeholder||this._resizeRowOfColumnHeaderBlock(a,e,l,d,f,m,n,p)}(a=this._ptUtils._layerLabelBlock)&&this._resizeRowOfColumnHeaderBlock(a,e,l,d,f,m,n,p);!1==g&&this.updateSizeOverrides(this.getComponent(),"ch"+(e-1),l);0>f&&(this._isColumnHeaderTextWrap()&&this._isColumnHeaderOutOfSync())&&this._ptUtils.coordinateColumnBlockSizes()}else{q=d.parentNode;q._minRH>l&&(l=q._minRH);f=-1;for(r=this._ptUtils._startPane[0];2>
r;++r){a=this._ptUtils._databodyBuffers[b][r];for(var u=a[c],w=u.length,y=0;y<w;y++)a=u[y],-1==f&&(f=AdfAgent.AGENT.getIntAttribute(a,"_startRow")),v=a.childNodes[0],v=v.rows[e],v._minRH>l&&(l=v._minRH)}f=f+e-1;!1==g&&this.updateSizeOverrides(this.getComponent(),"rr"+f,l);f=l-h;h=g=0;n&&!p&&(g=AdfPivotTableUtils.CELL_EXTRA_HEIGHT,h=g+1);(m||p?d:q).style.height=l-h+"px";h=this._ptUtils._rowHeaderBuffers[b][c];d=h._height;n&&!p?this._changeBlockHeight(h,d,f,1):this._changeBlockHeight(h,d,f,0);for(r=
this._ptUtils._startPane[0];2>r;++r){a=this._ptUtils._databodyBuffers[b][r];u=a[c];w=u.length;for(y=0;y<w;y++)a=u[y],v=a.childNodes[0],v=v.rows[e],h=m||p?v.cells[0]:v,h.style.height=l-g+"px",this._changeBlockHeight(a,d,f,0)}this._ptUtils.moveExistingBlocksTop(b,c+1,f);n&&this._ptUtils.updateTextAreaCellHeights(v,l-g);0>f&&(this._isRowHeaderTextWrap()&&this._isRowHeaderOutOfSync())&&this._ptUtils.coordinateRowBlockSizes()}this._ptUtils.sizePivotTable(this._maxWidth,this._maxHeight);this._ptUtils.scrollHTMLBlocks();
this._ptUtils.fetchNearbyBlocks(!0);this._isPaging&&this.updatePagingControls();return l};AdfDhtmlPivotTablePeer.prototype._resizeRowOfColumnHeaderBlock=function(a,b,c,d,e,f,g,h){b=a.childNodes[0].rows[b];f=f||h?b.cells[0]:b;g&&!h?(f.style.height=c-AdfPivotTableUtils.CELL_EXTRA_HEIGHT+"px",this._changeBlockHeight(a,d,e,1)):(f.style.height=c+"px",this._changeBlockHeight(a,d,e,0))};
AdfDhtmlPivotTablePeer.prototype._handleColResizeDrag=function(a,b,c){c=AdfAgent.AGENT;c.getPlatform()==AdfAgent.IE_PLATFORM&&8<=c.getVersion()||(a=this._getMouseContext(a),a.headerContext&&(a.headerContext.cell&&a.headerContext.edge===AdfPivotTableUtils.COLUMN_EDGE)&&AdfDhtmlPivotTablePeer._setCursor(a.headerContext.cell,c.getCursor("col-resize")));a=this._ptUtils._resizeIndicator.style;c=this._resizedCell.offsetWidth;var d=this._resizedIsHeader?AdfDhtmlPivotTablePeer.MIN_ROW_HEADER_WIDTH:AdfDhtmlPivotTablePeer.MIN_COLUMN_WIDTH,
d=Math.min(d,c);b=parseInt(b,10);this._resizeDeltaRaw=this._ptUtils._rightToLeft?this._resizeDeltaRaw-b:this._resizeDeltaRaw+b;c+this._resizeDeltaRaw>d&&(this._resizeDelta=this._resizeDeltaRaw,a.left=this._resizeIndicatorStartPos+(this._ptUtils._rightToLeft?-this._resizeDelta:this._resizeDelta)+"px")};
AdfDhtmlPivotTablePeer.prototype._handleColResizeDrop=function(a,b,c){this._ptUtils._resizeIndicator.style.display="none";this.hidePivotHandle();this._resizeColumn(this._resizedIsHeader,this._resizedPane,this._resizedBlockIndex,this._resizedCell,this._resizedIndex,this._resizeDelta);this._resizeDragState=!1;AdfDhtmlPivotTablePeer._setCursor(this._resizedCell,AdfAgent.AGENT.getCursor("auto"));this._resizedPane=this._resizedIsHeader=this._resizedBlock=this._resizedIndex=this._resizedCell=null;this._resizeDropMousePos=
AdfAgent.AGENT.getMousePosition(a)};
AdfDhtmlPivotTablePeer.prototype._handleRowResizeDrag=function(a,b,c){b=AdfAgent.AGENT;b.getPlatform()==AdfAgent.IE_PLATFORM&&8<=b.getVersion()||(a=this._getMouseContext(a),a.headerContext&&(a.headerContext.cell&&a.headerContext.edge===AdfPivotTableUtils.ROW_EDGE)&&AdfDhtmlPivotTablePeer._setCursor(a.headerContext.cell,b.getCursor("row-resize")));a=this._ptUtils._resizeIndicator.style;b=this._resizedCell.offsetHeight;var d=this._resizedIsHeader?AdfDhtmlPivotTablePeer.MIN_COL_HEADER_HEIGHT:AdfDhtmlPivotTablePeer.MIN_ROW_HEIGHT,
d=Math.min(d,b);c=parseInt(c,10);this._resizeDeltaRaw+=c;b+this._resizeDeltaRaw>d&&(this._resizeDelta=this._resizeDeltaRaw,a.top=this._resizeIndicatorStartPos+this._resizeDelta+"px")};
AdfDhtmlPivotTablePeer.prototype._handleRowResizeDrop=function(a,b,c){try{this._ptUtils._resizeIndicator.style.display="none",this.hidePivotHandle(),this._resizeRow(this._resizedIsHeader,this._resizedPane,this._resizedBlockIndex,this._resizedCell,this._resizedIndex,this._resizeDelta,!1),this._resizeDragState=!1,AdfDhtmlPivotTablePeer._setCursor(this._resizedCell,AdfAgent.AGENT.getCursor("auto")),this._resizedPane=this._resizedIsHeader=this._resizedBlock=this._resizedIndex=this._resizedCell=null,this._resizeDropMousePos=
AdfAgent.AGENT.getMousePosition(a)}catch(d){AdfLogger.LOGGER.severe(d.message)}};AdfDhtmlPivotTablePeer.prototype.showResizeDialog=function(a){this._ptState=AdfDhtmlPivotTablePeer.STATE_DIALOG;this._resizeDialogIsForHeight=a;a=this.getComponent().getClientId();AdfPage.PAGE.findComponent(a+AdfDhtmlPivotTablePeer._NAMING_SEP+AdfDhtmlPivotTablePeer.RESIZE_DIALOG_POPUP_ID).show()};
AdfDhtmlPivotTablePeer.prototype.resizeDialogOpening=function(){var a=this.getSelectedEdge(),b=this.getCurrentRange().startIndex,c=b.layer,d=b.slice,b=this._resizeDialogIsForHeight,e=a==AdfPivotTableUtils.ROW_EDGE!=b,f=e?c:d,g;e?(d=this._ptUtils._startPane[a],c=0,g=this._ptUtils._buffers2[a][d][c],a=f+1):(d=f<this._ptUtils._splitSlice[a]?0:1,c=this.getBlockNumOfSlice(a,f,d),g=this._ptUtils._buffers2[a][d][c],a=AdfAgent.AGENT.getIntAttribute(g,"_startSlice"),a=f-a+1);b?(f=g.childNodes[0].rows[a].cells[0],
g=f.offsetHeight):(f=g.childNodes[0].rows[0].cells[a],g=f.offsetWidth);var h=this.getComponent().getClientId(),l=AdfPage.PAGE.findComponent(h+AdfDhtmlPivotTablePeer._NAMING_SEP+AdfDhtmlPivotTablePeer.RESIZE_DIALOG_SPINNER_ID);l.setValue(g);var m=b?this._heightText:this._widthText;AdfPage.PAGE.findComponent(h+AdfDhtmlPivotTablePeer._NAMING_SEP+AdfDhtmlPivotTablePeer.RESIZE_DIALOG_ID).setTitle(m);h=h+AdfDhtmlPivotTablePeer._NAMING_SEP+AdfDhtmlPivotTablePeer.RESIZE_DIALOG_PLM_ID;AdfPage.PAGE.findComponent(h).setLabel(m);
m=AdfAgent.getAgent().getElementById(h).childNodes[0];h=m.cloneNode(!0);h.style.visibility="hidden";this.getDomElement().appendChild(h);m.style.width=h.offsetWidth+"px";this.getDomElement().removeChild(h);this._resizeDialogInfo||(this._resizeDialogInfo={});m=this._resizeDialogInfo;m.spinner=l;m.oldSize=g;m.isLayer=e;m.isHeight=b;m.pane=d;m.blockIndex=c;m.localIndex=a;m.cell=f};
AdfDhtmlPivotTablePeer.prototype.handleResizeDialog=function(a){var b=this._resizeDialogInfo,c=b.oldSize,d=b.isHeight;a=b.isLayer;var e=b.pane,f=b.blockIndex,g=b.localIndex,h=b.cell,b=b.spinner.getValue(),d=Math.min(d?16:11,c),b=Math.max(b,d),c=b-c;0!=c&&(this._resizeDialogIsForHeight?this._resizeRow(a,e,f,h,g,c,!1):this._resizeColumn(a,e,f,h,g,c))};AdfDhtmlPivotTablePeer.prototype._isTextWrappingEnabled=function(a){a=a.lastChild;return null!=a&&null!=a.style&&"normal"==a.style.whiteSpace};