function AdfPivotTableUtils(a,b,c){0<arguments.length&&this.Init(a,b,c)}AdfObject.createSubclass(AdfPivotTableUtils);
AdfPivotTableUtils.InitClass=function(){this.DATABODY=-1;this.COLUMN_EDGE=0;this.ROW_EDGE=1;this.ROW_PIVOT_HANDLES=this.PAGE_EDGE=2;this.COL_PIVOT_HANDLES=3;this.SEPARATOR="::";this.MAYBE=-1;this.COLUMN_EDGE_DUMMY_ROW_COUNT=this.COLUMN_EDGE_DUMMY_COLUMN_COUNT=1;this.COLUMN_EDGE_DUMMY_ROWCOL_COUNT=[this.COLUMN_EDGE_DUMMY_COLUMN_COUNT,this.COLUMN_EDGE_DUMMY_ROW_COUNT];this.ROW_EDGE_DUMMY_ROW_COUNT=this.ROW_EDGE_DUMMY_COLUMN_COUNT=1;this.ROW_EDGE_DUMMY_ROWCOL_COUNT=[this.ROW_EDGE_DUMMY_COLUMN_COUNT,
this.ROW_EDGE_DUMMY_ROW_COUNT];this.DATABODY_DUMMY_ROW_COUNT=this.DATABODY_DUMMY_COLUMN_COUNT=0;this.DATABODY_DUMMY_ROWCOL_COUNT=[this.DATABODY_DUMMY_COLUMN_COUNT,this.DATABODY_DUMMY_ROW_COUNT];this.DUMMY_ROWCOL_COUNT=[this.COLUMN_EDGE_DUMMY_ROWCOL_COUNT,this.ROW_EDGE_DUMMY_ROWCOL_COUNT];this.DUMMY_ROWCOL_COUNT["-1"]=this.DATABODY_DUMMY_ROWCOL_COUNT;this.CELL_EXTRA_HEIGHT=3;AdfPivotTableUtils.initSizeConstants();this.SCROLLBAR_SPACER_EXTRA_LENGTH=[0,0];this.SCROLLBAR_SPACER_EXTRA_BREADTH=[1,1];this.VIEWPORT_CUSHION_FACTOR_HORIZ=
this.VIEWPORT_CUSHION_FACTOR_VERT=this.PLACEHOLDER_ROW_HEIGHT=1;this.SCROLLTYPE_LONG_SCROLL=0;this.SCROLLTYPE_SHORT_SCROLL=1;this.SCROLLTYPE_NO_FETCH=2;this.PAGE_PREV=[[],[]];this.PAGE_FIRST=[[],[]];this.PAGE_NEXT=[[],[]];this.PAGE_LAST=[[],[]];this.PAGE_PREV[0][0]=0;this.PAGE_PREV[0][1]=1;this.PAGE_PREV[1][0]=2;this.PAGE_PREV[1][1]=3;this.PAGE_FIRST[0][0]=4;this.PAGE_FIRST[0][1]=5;this.PAGE_FIRST[1][0]=6;this.PAGE_FIRST[1][1]=7;this.PAGE_NEXT[0][0]=8;this.PAGE_NEXT[0][1]=9;this.PAGE_NEXT[1][0]=10;
this.PAGE_NEXT[1][1]=11;this.PAGE_LAST[0][0]=12;this.PAGE_LAST[0][1]=13;this.PAGE_LAST[1][0]=14;this.PAGE_LAST[1][1]=15;this.DELAY_FILL_VIEWPORT=this.DELAY_INITIAL=0;this.DELAY_SHORT_SCROLL=20;this.DELAY_LONG_SCROLL=200;this.END_SCROLLING_MIN_PIXELS=10;this.assertsOff=!AdfAssert.DEBUG;this.domAssertsOff=!0;this.DATABODY_CELL_STYLE="_st_dbc";this.DATABODY_CELL_SELECTED_STYLE="_st_dbc_s";this.DATABODY_CELL_FOCUSED_STYLE="_st_dbc_f";this.ROW_HEADER_CELL_STYLE="_st_rhc";this.ROW_HEADER_CELL_SELECTED_STYLE=
"_st_rhc_s";this.ROW_HEADER_CELL_FOCUSED_STYLE="_st_rhc_f";this.COLUMN_HEADER_CELL_STYLE="_st_chc";this.COLUMN_HEADER_CELL_SELECTED_STYLE="_st_chc_s";this.COLUMN_HEADER_CELL_FOCUSED_STYLE="_st_chc_f";this.ROW_PIVOT_IMAGE_CELL_LEFT_STYLE="_st_rp_icl";this.ROW_PIVOT_SWAP_DROP_TARGET="_st_rpsdt";this.COLUMN_PIVOT_SWAP_DROP_TARGET="_st_cpsdt";this.ROW_PIVOT_IMAGE_CELL_RIGHT_STYLE="_st_rp_icr";this.ROW_PIVOT_IMAGE_CELL_CENTER_STYLE="_st_rp_icc";this.ROW_PIVOT_LABEL_CELL_STYLE="_st_rp_lc";this.ROW_PIVOT_INDICATOR_HEADER_CELL_STYLE=
"_st_rp_ihc";this.ROW_PIVOT_INDICATOR_PIVOT_HANDLE_STYLE="_st_rp_iph";this.COL_PIVOT_IMAGE_CELL_TOP_STYLE="_st_cp_ict";this.COL_PIVOT_LABEL_CELL_STYLE="_st_cp_lc";this.COL_PIVOT_IMAGE_CELL_CENTER_STYLE="_st_cp_icc";this.COL_PIVOT_IMAGE_CELL_BOTTOM_STYLE="_st_cp_icb";this.COLUMN_PIVOT_INDICATOR_HEADER_CELL_STYLE="_st_cp_ihc";this.COLUMN_PIVOT_INDICATOR_PIVOT_HANDLE_STYLE="_st_cp_iph";this.SELECTED_STATE_CLASS="st_sel";this.COLUMN_HEADER_SIZING_CELL_CLASS="af_dvt-pivotTable_column-sizing-cell"};
AdfPivotTableUtils.initSizeConstants=function(){AdfPivotTableUtils.CONTAINER_EXTRA_SIZE=[2,2];AdfPivotTableUtils.DATABODY_EXTRA_SIZE=[1,1];AdfPivotTableUtils.HEADER_EXTRA_PIXEL_EXTENT=[1,1];AdfPivotTableUtils.HEADER_EXTRA_PIXEL_DEPTH=[0,0];AdfPivotTableUtils.HEADER_OUTER_PIXEL_DEPTH_NO_DATA=[33,67]};
AdfPivotTableUtils.prototype.Init=function(a,b,c){AdfPivotTableUtils.superclass.Init.call(this);this._id=c.id;this._pivotTable=a;this._pivotTablePeer=b;this._container=c;a=this._container.id+"::";this._innerContainer=AdfDhtmlPivotTablePeer._getChildById(c,a+"Inner");c=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"RowHeader0");var d=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"RowHeader1"),e=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"ColHeader0"),f=
AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"ColHeader1"),g=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"Databody00"),h=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"Databody01"),l=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"Databody10"),m=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"Databody11");if(AdfPivotTableUtils.isMobileTouchDevice())var n=g.childNodes[0],p=h.childNodes[0],q=l.childNodes[0],r=m.childNodes[0];var v=
AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"DatabodyScroller01"),u=v.childNodes[0],w=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"DatabodyScroller10"),y=w.childNodes[0],t=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"DatabodyScroller11"),A=t.childNodes[0],D=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"ColHeaderScrollbarSpacer0"),C=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"ColHeaderScrollbarSpacer1"),z=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,
a+"RowHeaderScrollbarSpacer0"),x=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"RowHeaderScrollbarSpacer1");this._corner=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"Corner");this._rowHeaders=[c,d];this._colHeaders=[e,f];this._headers=[this._colHeaders,this._rowHeaders];this._databodies=[[g,h],[l,m]];this._databodyScrollers=[[null,v],[w,t]];this._databodyScrollerCanvases=[[null,u],[y,A]];AdfPivotTableUtils.isMobileTouchDevice()&&(this._databodyCanvases=[[n,p],[q,r]]);
this._databodiesByEdgeAndPane=[[l,m],[h,m]];this._databodyScrollersByEdgeAndPane=[[w,t],[v,t]];this._statusBar=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"StatusBar");this._hasStatusBar=null!=this._statusBar;this._scrollbarSpacers=[[z,x],[D,C]];this._cornerScrollbarSpacer=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"CornerScrollbarSpacer");b._isPaging&&(this._pagingControl=[[],[]],this._pagingControl[0][0]=AdfDhtmlPivotTablePeer._getChildById(this._container,a+"hPc").childNodes[1],
this._pagingControl[0][1]=AdfDhtmlPivotTablePeer._getChildById(this._container,a+"hPc").childNodes[0],this._pagingControl[1][0]=AdfDhtmlPivotTablePeer._getChildById(this._container,a+"vPc1").childNodes[0],this._pagingControl[1][1]=AdfDhtmlPivotTablePeer._getChildById(this._container,a+"vPc").childNodes[0],this._pagingControlInputId=[[],[]],this._pagingControlInputId[0][0]=":hPIc1",this._pagingControlInputId[0][1]=":hPIc",this._pagingControlInputId[1][0]=":vPIc1",this._pagingControlInputId[1][1]=":vPIc");
this._resizeIndicator=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"ri");this._fetchStatus=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"FetchStatus");this._pivotDropTarget=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"pdt");this._scrollbarTester=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"ScrollbarTesterParent");this._summaryDiv=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,a+"Summary");this._pivotStatus=AdfDhtmlPivotTablePeer._getChildById(this._innerContainer,
a+"PivotStatus");this._rightToLeft=AdfPage.PAGE.getLocaleContext().isRightToLeft();this._lastScrollPos=[[0,0],[0,0]];this._maxScrollPos=[[0,0],[0,0]];AdfPivotTableUtils.isMobileTouchDevice()&&!b._isPaging&&(this._scrollWaitForFetch=!1);this._splitPercentage=[0.5,0.5];this.offsetSizeAttr=["offsetWidth","offsetHeight"];this.sizeAttr=["width","height"];this._sizeAttr=["_width","_height"];this._usableSizeAttr=["_usableWidth","_usableHeight"];this._posAttr=["_horizPos","_top"];this._canvasPosAttr=["_canvasHorizPos",
"_canvasTop"];this.scrollPosAttr=["scrollLeft","scrollTop"];this.sliceAttr=["column","row"];this.initBuffer()};
AdfPivotTableUtils.prototype.initInfo=function(a,b){var c=AdfAgent.AGENT.getIntAttribute(a,"_startRow"),d=AdfAgent.AGENT.getIntAttribute(a,"_startCol"),e=AdfAgent.AGENT.getIntAttribute(a,"_startRowPixel"),f=AdfAgent.AGENT.getIntAttribute(a,"_startColPixel"),g=AdfAgent.AGENT.getIntAttribute(a,"_rowHeaderStartLayer"),h=AdfAgent.AGENT.getIntAttribute(a,"_colHeaderStartLayer"),l=AdfAgent.AGENT.getIntAttribute(a,"_rowHeaderStartPixel"),m=AdfAgent.AGENT.getIntAttribute(a,"_colHeaderStartPixel");b.setProperty(AdfRichPivotTable.__START_ROW_KEY,
c);b.setProperty(AdfRichPivotTable.__START_COLUMN_KEY,d);b.setProperty(AdfRichPivotTable.__START_ROW_PIXEL_KEY,e);b.setProperty(AdfRichPivotTable.__START_COLUMN_PIXEL_KEY,f);b.setProperty(AdfRichPivotTable.__ROW_HEADER_START_LAYER_KEY,g);b.setProperty(AdfRichPivotTable.__COLUMN_HEADER_START_LAYER_KEY,h);b.setProperty(AdfRichPivotTable.__ROW_HEADER_START_PIXEL_KEY,l);b.setProperty(AdfRichPivotTable.__COLUMN_HEADER_START_PIXEL_KEY,m);e=AdfAgent.AGENT.getIntAttribute(a,"_splitCol");d=AdfAgent.AGENT.getIntAttribute(a,
"_splitRow");c=this._splitSlice=[e,d];b.setProperty(AdfRichPivotTable.__SPLIT_COLUMN_KEY,e);b.setProperty(AdfRichPivotTable.__SPLIT_ROW_KEY,d);-1==e&&-1==d&&(this._splitPercentage[0]=0.5,this._splitPercentage[1]=0.5);-1!=e&&(e=AdfAgent.AGENT.getIntAttribute(a,"_secondStartCol"),f=AdfAgent.AGENT.getIntAttribute(a,"_secondStartColPixel"),b.setProperty(AdfRichPivotTable.__SECOND_START_COLUMN_KEY,e),b.setProperty(AdfRichPivotTable.__SECOND_START_COLUMN_PIXEL_KEY,f));-1!=d&&(d=AdfAgent.AGENT.getIntAttribute(a,
"_secondStartRow"),e=AdfAgent.AGENT.getIntAttribute(a,"_secondStartRowPixel"),b.setProperty(AdfRichPivotTable.__SECOND_START_ROW_KEY,d),b.setProperty(AdfRichPivotTable.__SECOND_START_ROW_PIXEL_KEY,e));d=AdfAgent.AGENT.getIntAttribute(a,"_cExtent");e=AdfAgent.AGENT.getIntAttribute(a,"_rExtent");f=this._edgeExtent=[d,e];g=AdfAgent.AGENT.getIntAttribute(a,"_cLayerCount");h=AdfAgent.AGENT.getIntAttribute(a,"_rLayerCount");this._layerCount=[g,h];l=AdfAgent.AGENT.getIntAttribute(a,"_cBlockSize");m=AdfAgent.AGENT.getIntAttribute(a,
"_rBlockSize");this._blockSize=[l,m];this._startPane=[];this._canvasStartSlice=[[],[]];this._canvasEndSlice=[[],[]];this._paneExtent=[[],[]];for(var n=this._startPane,p=this._canvasStartSlice,q=this._canvasEndSlice,r=this._paneExtent,v=0;2>v;++v){-1==c[v]?n[v]=1:(n[v]=0,p[v][1]=c[v],q[v][0]=c[v]);p[v][n[v]]=0;q[v][1]=f[v];for(var u=n[v];2>u;++u)r[v][u]=q[v][u]-p[v][u]}this._headerSizeAllocation=[Number(AdfAgent.AGENT.getAttribute(a,"_sizeAlloc0")),Number(AdfAgent.AGENT.getAttribute(a,"_sizeAlloc1"))];
this._headerSizeAllocUnit=[AdfAgent.AGENT.getAttribute(a,"_sizeUnit0"),AdfAgent.AGENT.getAttribute(a,"_sizeUnit1")];this._colExtent=d;this._rowExtent=e;this._colLayerCount=g;this._rowLayerCount=h;this._colBlockSize=l;this._rowBlockSize=m};
AdfPivotTableUtils.prototype.setVisibilityOfPanes=function(){for(var a=this._splitSlice,b=this._headers,c=this._databodies,d=this._databodyScrollers,e=0;2>e;++e){var f=-1==a[e]?"none":"block";b[e][0].style.display=f;(e?c[0][1]:c[1][0]).style.display=f;AdfPivotTableUtils.isMobileTouchDevice()||((e?d[0][1]:d[1][0]).style.display=f)}c[0][0].style.display=-1!=a[0]&&-1!=a[1]?"block":"none"};
AdfPivotTableUtils.isMobileSafari=function(){var a=navigator.userAgent.toLowerCase();return-1!=a.indexOf("mobile")&&-1!=a.indexOf("safari")};AdfPivotTableUtils.isMobileTouchDevice=function(){return AdfAgent.guessOS()==AdfAgent.ANDROID_OS||AdfPivotTableUtils.isMobileSafari()};
AdfPivotTableUtils.handlePagingValueChange=function(a){var b=a.getSource(),c=b.getParent().getPeer(),d=b.getClientId().indexOf("vPIc");if(-1!=d)var e=AdfPivotTableUtils.ROW_EDGE,d=d==b.getClientId().length-4?1:0;else e=AdfPivotTableUtils.COLUMN_EDGE,d=b.getClientId().indexOf("hPIc")==b.getClientId().length-4?1:0;if(!c._keepPagingValueChange[e][d]&&!c._updatedPagingInputValue){var f=a.getNewValue();a=a.getOldValue();a!=f&&(c._keepPagingValueChange[e][d]=!0,b.setValue(a))}else if(c._updatedPagingInputValue){c._updatedPagingInputValue=
!1;var g=!0,f=a.getNewValue();a=a.getOldValue();var h=c._ptUtils._splitSlice[e];if(f>(1==d&&-1!=h?h:0)&&f<=c._ptUtils._edgeExtent[e]&&!(f>a&&c._ptUtils.getScrollPos(e,d)==c._ptUtils._maxScrollPos[e][d]))c.setPageStartSlice(e,f-1),g=!1;g&&(c._keepPagingValueChange[e][d]=!0,b.setValue(a))}else c._keepPagingValueChange[e][d]&&(c._keepPagingValueChange[e][d]=!1)};AdfPivotTableUtils.prototype.getScroller=function(a,b){return AdfPivotTableUtils.isMobileTouchDevice()?this._databodies[a][b]:this._databodyScrollers[a][b]};
AdfPivotTableUtils.prototype.getScrollerByEdgeAndPane=function(a,b){return AdfPivotTableUtils.isMobileTouchDevice()?this._databodiesByEdgeAndPane[a][b]:this._databodyScrollersByEdgeAndPane[a][b]};AdfPivotTableUtils.prototype.getScrollerCanvas=function(a,b){return AdfPivotTableUtils.isMobileTouchDevice()?this._databodyCanvases[a][b]:this._databodyScrollerCanvases[a][b]};
AdfPivotTableUtils.prototype.removeExistingBlocksFromDOM=function(){for(var a=AdfPivotTableUtils.isMobileTouchDevice()?this._databodyCanvases:this._databodies,b=0;2>b;++b)for(var c=0;2>c;++c)this.removeChildren(this._headers[b][c]),this.removeChildren(a[b][c])};AdfPivotTableUtils.prototype.removeChildren=function(a,b){b||(b=a.childNodes);for(var c=b.length-1;0<=c;--c){var d=b[c];d instanceof Array?this.removeChildren(a,d):d.parentNode==a&&(this._unregisterNode(d),a.removeChild(d))}};
AdfPivotTableUtils.prototype._unregisterNode=function(a){AdfPage.PAGE.removeComponentsInSubtree(a);AdfAgent.AGENT.elementsRemoved(a)};
AdfPivotTableUtils.prototype.positionInitialBlocks=function(a){for(var b=[[],[]],c=this._startPane,d=1;0<=d;--d)for(var e=c[d];2>e;++e){var f=this._buffers2[d][e][0],g=1==d?0<this._splitSlice[0]?[this._databodyBuffers[e][0][0][0],this._databodyBuffers[e][1][0][0]]:[this._databodyBuffers[e][1][0][0]]:0<this._splitSlice[1]?[this._databodyBuffers[0][e][0][0],this._databodyBuffers[1][e][0][0]]:[this._databodyBuffers[1][e][0][0]],h=this.getIntAttribute(f,"_startSlice"),l=this._canvasStartSlice[d][e],m=
this._canvasEndSlice[d][e],n=this._pivotTablePeer.getViewportStartSliceProperty(d,e,!1);b[d][e]=this._positionInitialBlocks(d,e,l,m,f,g,h,this._defaultSliceSize[d],this._maxScrollPos[d][e],d?a.heightBeforeViewport[e]:a.widthBeforeViewport[e],n)}if(this._pivotTablePeer.__logEnabled)for(d=0;2>d;++d)for(e=c[d];2>e;++e)this._pivotTablePeer.putInTestLog("positionInitialBlocks calling setScrollPos("+d+", "+e+", "+b[d][e]+")");a=[[],[]];for(d=0;2>d;++d)for(e=c[d];2>e;++e)a[d][e]=this.setScrollPos(d,e,b[d][e]);
if(!AdfPivotTableUtils.assertsOff){f=!1;d=0;a:for(;2>d;++d)for(e=c[d];2>e;++e)if(b[d][e]!=a[d][e]){f=!0;break a}if(f){f="positionInitialBlocks: scrollPoses out of bounds.  ";for(d=0;2>d;++d)for(e=c[d];2>e;++e)f+="edge "+d+", pane "+e+", scrollPos "+b[d][e]+", scrollPos2 "+a[d][e];AdfAssert.assert(!1,f)}}};
AdfPivotTableUtils.prototype._positionInitialBlocks=function(a,b,c,d,e,f,g,h,l,m,n){var p=!0;c=(g-c)*h;n>=d?(AdfAssert.assert(AdfPivotTableUtils.assertsOff||e.getAttribute("_lastBlock"),"In scrollToEnd case, the block must be the last block."),d=l,l=c-d):(d=-m,l=Math.max(d,c-l),l==d&&(p=!1),d=c-l);m=AdfPivotTableUtils.isMobileTouchDevice()?c:l;for(n=0;n<f.length;++n)this.setPos(a,m,f[n]);this.setPos(a,l,e);for(n=0;n<f.length;++n)this.setCanvasPos(a,c,f[n]);this.setCanvasPos(a,c,e);p&&this.setViewportStartSliceFromPosition(a,
b);return d};
AdfPivotTableUtils.prototype.setViewportStartSliceFromPosition=function(a,b){if(void 0===a)for(a=0;2>a;++a)for(b=this._startPane[a];2>b;++b)this.setViewportStartSliceFromPosition(a,b);else viewportStartSliceObj=this.firstSliceInShiftedViewport(a,b,0),viewportStartSlice=viewportStartSliceObj.slice,-1!=viewportStartSlice&&(viewportStartPixel=viewportStartSliceObj.pixel,this._pivotTablePeer.setViewportStartSliceProperty(a,b,!1,viewportStartSlice),this._pivotTablePeer.setViewportStartSliceProperty(a,b,
!0,viewportStartPixel))};AdfPivotTableUtils.prototype.setViewportStartLayerFromPosition=function(a){if(void 0===a)this.setViewportStartLayerFromPosition(AdfPivotTableUtils.COLUMN_EDGE),this.setViewportStartLayerFromPosition(AdfPivotTableUtils.ROW_EDGE);else{var b=this.firstLayerInViewport(a);this._pivotTablePeer.setHeaderStartLayerProperty(a,!1,b.layer);this._pivotTablePeer.setHeaderStartLayerProperty(a,!0,b.pixel)}};
AdfPivotTableUtils.prototype.getOldScrollPos=function(a,b){var c=this._buffers2[a][b][0];return c[this._canvasPosAttr[a]]-c[this._posAttr[a]]};AdfPivotTableUtils.prototype.getNewBlockPos=function(a,b,c){return b[this._canvasPosAttr[a]]-c};
AdfPivotTableUtils.prototype.scrollHTMLBlocks=function(a){for(var b=this._databodyBuffers,c=1;0<=c;--c)for(var d=1-c,e=this._buffers2[c],f=this._buffers2[d],g=this._startPane[c];2>g;++g){var h=this.getScrollPos(c,g);if(a||0!=h-this.getOldScrollPos(c,g)||0==c&&this._rightToLeft){for(var l=e[g],m=0;m<l.length;m++){var n=l[m];if(!n._placeholder){var p=this.getNewBlockPos(c,n,h);this.setPos(c,p,n)}for(n=this._startPane[d];2>n;++n)for(var q=f[n].length,r=1==c?b[g][n]:b[n][g],v=0;v<q;v++){var u=1==c?r[m][v]:
r[v][m];u&&(p=AdfPivotTableUtils.isMobileTouchDevice()?u[this._canvasPosAttr[c]]:this.getNewBlockPos(c,u,h),this.setPos(c,p,u))}}this.setViewportStartSliceFromPosition(c,g)}}};
AdfPivotTableUtils.prototype.positionNewHTMLBlocks=function(a){var b,c,d,e=[[],[]];for(b=1;0<=b;--b){var f=this._buffers2[b],g=this._canvasPosAttr[b],h=this._sizeAttr[b],l=this._posAttr[b];for(c=this._startPane[b];2>c;++c){var m=f[c],n=m.length,p=null,q=m[0];q._new||(p=q);d=this.getIntAttribute(q,"_startSlice")-this._canvasStartSlice[b][c];this.setCanvasPos(b,this._defaultSliceSize[b]*d,q);for(d=1;d<n;d++){var r=q,q=m[d];null==p&&!q._new&&(p=q);this.setCanvasPos(b,r[g]+r[h],q);q.style[b?"left":"top"]=
"0px"}e[b][c]=p[g]-(p[l]-a[b][c])}}b=this._rowHeaderBuffers;c=this._colHeaderBuffers;f=this._databodyBuffers;for(g=this._startPane[1];2>g;++g){h=b[g];l=f[g];for(m=this._startPane[0];2>m;++m){p=c[m];q=l[m];n=q.length;for(d=0;d<n;d++){var r=h[d],v=q[d],u=v.length;for(a=0;a<u;a++){var w=p[a],y=v[a];this.setCanvasPos(1,r._canvasTop,y);this.setCanvasPos(0,w._canvasHorizPos,y)}}}}for(b=1;0<=b;--b)for(c=this._startPane[b];2>c;++c)this._pivotTablePeer.__logEnabled&&this._pivotTablePeer.putInTestLog("positionNewHTMLBlocks calling setScrollPos("+
b+", "+c+", "+e[b][c]+")"),this.setScrollPos(b,c,e[b][c])};
AdfPivotTableUtils.prototype.moveExistingBlocksTop=function(a,b,c){var d=this._rowHeaderBuffers[a],e=d.length;for(i=b;i<e;i++){var f=d[i];!f._placeholder&&!f._new&&(this.setCanvasPos(1,f._canvasTop+c,f),this.setPos(1,f._top+c,f))}for(d=this._startPane[0];2>d;++d){var g=this._databodyBuffers[a][d],e=g.length;for(i=b;i<e;i++){var h=g[i],l=h.length;for(j=0;j<l;j++)if((f=h[j])&&!f._new)this.setCanvasPos(1,f._canvasTop+c,f),this.setPos(1,f._top+c,f)}}};
AdfPivotTableUtils.prototype.initBuffer=function(){this._databodyBuffers=[[[],[]],[[],[]]];this._colHeaderBuffers=[[],[]];this._rowHeaderBuffers=[[],[]];this._buffers2=[this._colHeaderBuffers,this._rowHeaderBuffers];this._buffers2[AdfPivotTableUtils.DATABODY]=this._databodyBuffers};
AdfPivotTableUtils.prototype.trimBuffer=function(a){var b=[[],[]],c=!1,d=!1,e=0;a:for(;2>e;++e)for(var f=this._startPane[e];2>f;++f){var g=this._buffers2[e][f].length;if(0==g){c=!0;break a}var h=this.rangeOfBlocksOverlappingShiftedViewport(e,f,a?a[e][f]:0);if(!this.doesBufferOverlapShiftedViewport(e,f,h)){d=!0;break a}h.start=Math.max(h.start,0);h.end=Math.min(h.end,g-1);b[e][f]=h}if(c)AdfLogger.LOGGER.severe("trimBuffer found that the buffer was already empty.  This is unexpected."),this.removeAllBlocks();
else if(d)AdfLogger.LOGGER.severe("trimBuffer is removing all blocks due to no overlap.  This is unexpected."),this.removeAllBlocks();else{for(e=1;0<=e;--e)for(f=this._startPane[e];2>f;++f)h=b[e][f],a=h.end+1,g=this._buffers2[e][f].length,g-=a,this._trimBuffer(e,f,a,g),a=0,g=h.start,this._trimBuffer(e,f,a,g);for(e=1;0<=e;--e)for(f=this._startPane[e];2>f;++f)b=this._buffers2[e][f],h=b.length-1,b[h]._placeholder&&(a=h,g=1,this._trimBuffer(e,f,a,g));for(e=1;0<=e;--e)for(f=this._startPane[e];2>f;++f)if(b=
this._buffers2[e][f],(b=b[0])&&b._placeholder)a=0,g=1,this._trimBuffer(e,f,a,g);for(e=0;2>e;++e)for(f=this._startPane[e];2>f;++f)0==this._buffers2[e][f].length&&(AdfLogger.LOGGER.severe("trimBuffer found overlap betweeen the buffer and the viewport, but that overlap was exclusively placeholder rows/columns, so it removed all blocks.  This is unexpected."),this.removeAllBlocks())}};
AdfPivotTableUtils.prototype._trimBuffer=function(a,b,c,d){this._trimBuffer2(this._buffers2[a][b],this._headers[a][b],c,d);for(var e=AdfPivotTableUtils.isMobileTouchDevice()?this._databodyCanvases:this._databodies,f=this._startPane[1-a];2>f;++f){if(a)var g=b,h=f;else g=f,h=b;var l=this._databodyBuffers[g][h],g=e[g][h];if(a)this._trimBuffer2(l,g,c,d);else for(h=0;h<l.length;++h)this._trimBuffer2(l[h],g,c,d)}};
AdfPivotTableUtils.prototype._trimBuffer2=function(a,b,c,d){a=a.splice(c,d);this.removeChildren(b,a)};AdfPivotTableUtils.prototype.removeAllBlocks=function(){this.initBuffer();this.removeExistingBlocksFromDOM()};AdfPivotTableUtils.prototype.addBlocksToBuffer=function(){this.addRowHeaderBlocksToBuffer();this.addColHeaderBlocksToBuffer();this.addDatabodyBlocksToBuffer();var a=AdfDhtmlPivotTablePeer._getChildBySubId(this._container,"PPRTarget");this.removeChildren(a)};
AdfPivotTableUtils.prototype.addRowHeaderBlocksToBuffer=function(){for(var a=this._rowHeaderBuffers,b=this._databodyBuffers,c=0<this._splitSlice[0]?[this._colHeaderBuffers[0].length,this._colHeaderBuffers[1].length]:[this._colHeaderBuffers[1].length],d=this._splitSlice[1],e=AdfDhtmlPivotTablePeer._getChildBySubId(this._container,"PPRTarget"),e=this.getArrivingBlocks(e,this._id,AdfPivotTableUtils.ROW_EDGE),f=e.length,g=0;g<f;++g){var h=e[g],l=this.getIntAttribute(h,"_startSlice"),m=this.getIntAttribute(h,
"_numSlices"),n=l<d?0:1,p=a[n],q=0<this._splitSlice[0]?b[n]:[b[n][1]];this.addBlockToDOM(this._rowHeaders[n],h);n=p.length;if(0==n){p[0]=h;for(var r=0;r<q.length;++r)q[r][0]=Array(c[r])}else if(r=this.getIntAttribute(p[0],"_startSlice"),l<r)if(m=l+m,m==r){p.unshift(h);for(r=0;r<q.length;++r)q[r].unshift(Array(c[r]))}else{l=r-m;n={_startSlice:m,_numSlices:l,_placeholder:!0};p.unshift(h,n);for(r=0;r<q.length;++r)q[r].unshift(Array(c[r]),Array(c[r]))}else{var v=p[n-1],r=this.getIntAttribute(v,"_startSlice"),
v=this.getIntAttribute(v,"_numSlices");if(l>r)if(m=r+v,m==l){p.push(h);for(r=0;r<q.length;++r)q[r].push(Array(c[r]))}else{l-=m;n={_startSlice:m,_numSlices:l,_placeholder:!0};p.push(n,h);for(r=0;r<q.length;++r)q[r].push(Array(c[r]),Array(c[r]))}else for(r=0;r<n;++r){var v=p[r],u=this.getIntAttribute(v,"_startSlice"),w=this.getIntAttribute(v,"_numSlices"),v=u+w;if(l==u){p[r]=h;if(m<w){n={_startSlice:l+m,_numSlices:w-m,_placeholder:!0};p.splice(r+1,0,n);for(h=0;h<q.length;++h)q[h].splice(r+1,0,Array(c[h]))}break}if(l<
v){p[r]=h;n={_startSlice:u,_numSlices:l-u,_placeholder:!0};p.splice(r,0,n);for(h=0;h<q.length;++h)q[h].splice(r,0,Array(c[h]));h=l+m;if(h<v){n={_startSlice:h,_numSlices:v-h,_placeholder:!0};p.splice(r+2,0,n);for(h=0;h<q.length;++h)q[h].splice(r+2,0,Array(c[h]))}break}}}}for(n=0;2>n;++n){r=0;for(b=a[n].length;r<b;++r)if(a[n][r]._placeholder)throw Error("Attempting to add one or more placeholder rows!");}};
AdfPivotTableUtils.prototype.addColHeaderBlocksToBuffer=function(){for(var a=this._colHeaderBuffers,b=this._splitSlice[0],c=AdfDhtmlPivotTablePeer._getChildBySubId(this._container,"PPRTarget"),d=this.getArrivingBlocks(c,this._id,AdfPivotTableUtils.COLUMN_EDGE),e=d.length,f=0;f<e;++f){var g=d[f],h=this.getIntAttribute(g,"_startSlice"),l=this.getIntAttribute(g,"_numSlices"),c=h<b?0:1,m=a[c];this.addBlockToDOM(this._colHeaders[c],g);var n=m.length;if(0==n)m[0]=g,this.insertColumnIntoDatabodyBuffer(c,
0);else{var p=this.getIntAttribute(m[0],"_startSlice");if(h<p){l=h+l;if(l==p)m.unshift(g);else{var h=p-l,q={_startSlice:l,_numSlices:h,_placeholder:!0};m.unshift(g,q);this.insertColumnIntoDatabodyBuffer(c,0)}this.insertColumnIntoDatabodyBuffer(c,0)}else{var r=m[n-1],p=this.getIntAttribute(r,"_startSlice"),r=this.getIntAttribute(r,"_numSlices");if(h>p)l=p+r,l==h?m.push(g):(h-=l,q={_startSlice:l,_numSlices:h,_placeholder:!0},m.push(q,g),this.insertColumnIntoDatabodyBuffer(c,n)),this.insertColumnIntoDatabodyBuffer(c,
n);else for(p=0;p<n;++p){var r=m[p],q=this.getIntAttribute(r,"_startSlice"),v=this.getIntAttribute(r,"_numSlices"),r=q+v;if(h==q){m[p]=g;l<v&&(q={_startSlice:h+l,_numSlices:v-l,_placeholder:!0},m.splice(p+1,0,q),this.insertColumnIntoDatabodyBuffer(c,p+1));break}if(h<r){m[p]=g;q={_startSlice:q,_numSlices:h-q,_placeholder:!0};m.splice(p,0,q);this.insertColumnIntoDatabodyBuffer(c,p);g=h+l;g<r&&(q={_startSlice:g,_numSlices:r-g,_placeholder:!0},m.splice(p+2,0,q),this.insertColumnIntoDatabodyBuffer(c,p+
2));break}}}}}for(c=0;2>c;++c){p=0;for(b=a[c].length;p<b;++p)if(a[c][p]._placeholder)throw Error("Attempting to add one or more placeholder cols!");}};
AdfPivotTableUtils.prototype.addDatabodyBlocksToBuffer=function(){for(var a=AdfDhtmlPivotTablePeer._getChildBySubId(this._container,"PPRTarget"),a=this.getArrivingBlocks(a,this._id,AdfPivotTableUtils.DATABODY),b=a.length,c=0;c<b;++c){var d=a[c],e=this.getIntAttribute(d,"_startRow"),f=this.getIntAttribute(d,"_startCol"),g=e<this._splitSlice[1]?0:1,h=f<this._splitSlice[0]?0:1,l=this._rowHeaderBuffers[g],m=this._colHeaderBuffers[h],n=this._databodyBuffers[g][h],p=l.length,q=m.length;AdfPivotTableUtils.isMobileTouchDevice()?
this.addBlockToDOM(this._databodyCanvases[g][h],d):this.addBlockToDOM(this._databodies[g][h],d);for(var h=g=0,r;g<p&&!(r=this.getIntAttribute(l[g],"_startSlice"),e==r);++g);for(;h<q&&!(r=this.getIntAttribute(m[h],"_startSlice"),f==r);++h);AdfAssert.assert(AdfPivotTableUtils.assertsOff||!n[g][h],"adding databody block to non-empty buffer slot.");n[g][h]=d}};
AdfPivotTableUtils.prototype.addPivotHandlesAndLayerLabelBlock=function(a){for(var b=this.getArrivingElements(a,this._id+"::ph"),c=b.length,d=0;d<c;d++)this._corner.appendChild(b[d]);(this._layerLabelBlock=AdfDhtmlPivotTablePeer._getChildById(a,this._id+"::LayerLabelBlock"))&&this.addBlockToDOM(this._corner,this._layerLabelBlock)};
AdfPivotTableUtils.prototype.removePivotHandlesAndLayerLabelBlock=function(){for(var a=this.getArrivingElements(this._corner,this._id+"::ph"),b=a.length,c=0;c<b;c++)this._corner.removeChild(a[c]);this._layerLabelBlock&&this._corner.removeChild(this._layerLabelBlock)};
AdfPivotTableUtils.prototype.addBlockToDOM=function(a,b){a.appendChild(b);b._new=!0;b.style.top=a==this._colHeaders[0]||a==this._colHeaders[1]||a==this._corner?"0px":this._pivotTablePeer._maxHeight+1E3+"px";a==this._rowHeaders[0]||a==this._rowHeaders[1]||a==this._corner?this._rightToLeft?b.style.right="0px":b.style.left="0px":b.style.left=this._pivotTablePeer._maxWidth+1E3+"px"};
AdfPivotTableUtils.prototype.markBlocksNotNew=function(){for(var a,b,c,d=this._startPane,e=0;2>e;++e){a=this._buffers2[e];for(var f=d[e];2>f;++f){b=a[f];for(var g=0;g<b.length;++g)c=b[g],c._new=!1}}a=this._databodyBuffers;for(e=d[1];2>e;++e)for(var f=a[e],h=d[0];2>h;++h){b=f[h];for(g=0;g<b.length;++g)for(var l=b[g],m=0;m<l.length;++m)c=l[m],c._new=!1}this._layerLabelBlock&&(this._layerLabelBlock._new=!1)};
AdfPivotTableUtils.prototype.insertColumnIntoDatabodyBuffer=function(a,b){for(var c=this._startPane[1];2>c;++c)for(var d=this._databodyBuffers[c][a],e=d.length,f=0;f<e;++f)d[f].splice(b,0,null)};
AdfPivotTableUtils.prototype.fetchNearbyBlocks=function(a,b,c){if(void 0==c){c=[[],[]];for(var d=1;0<=d;--d)for(var e=this._startPane[d];2>e;++e)c[d][e]=this.rangeOfBlocksOverlappingShiftedViewport(d,e,b?b[d][e]:0)}b=[];for(var d={},e={},f=this._startPane[1];2>f;++f)for(var g=c[1][f],h=this._startPane[0];2>h;++h){var l=c[0][h];this.findBlocksInRangeNeedingFetch(b,d,e,h,l.start,l.end,f,g.start,g.end)}if(0<b.length){c=[];for(var m in e)e.hasOwnProperty(m)&&c.push(e[m]);for(m in d)d.hasOwnProperty(m)&&
c.push(d[m]);m=this.getRowHeaderWidths();d=this.getColumnHeaderHeights();a?(a=AdfPivotTableDataFetchEvent.FETCH_TYPE_INITIAL_FILL_VIEWPORT,e=AdfPivotTableUtils.DELAY_FILL_VIEWPORT):(a=AdfPivotTableDataFetchEvent.FETCH_TYPE_SHORT_SCROLL,e=AdfPivotTableUtils.DELAY_SHORT_SCROLL);this._pivotTablePeer.fetchBlocks(a,e,b,null,c,m,d);return!0}return!1};AdfPivotTableUtils.prototype.isShiftedViewportSatisfied=function(a,b,c){return-1!=c.start&&c.end!=this._buffers2[a][b].length};
AdfPivotTableUtils.prototype.doesBufferOverlapShiftedViewport=function(a,b,c){var d=c.start;return!(d==c.end&&(-1==d||d==this._buffers2[a][b].length))};
AdfPivotTableUtils.prototype.identifyScrollType=function(a){for(var b=0;2>b;++b)for(var c=this._startPane[b];2>c;++c)if(!this.doesBufferOverlapShiftedViewport(b,c,a[b][c]))return AdfPivotTableUtils.SCROLLTYPE_LONG_SCROLL;for(b=0;2>b;++b)for(c=this._startPane[b];2>c;++c)if(!this.isShiftedViewportSatisfied(b,c,a[b][c]))return AdfPivotTableUtils.SCROLLTYPE_SHORT_SCROLL;return AdfPivotTableUtils.SCROLLTYPE_NO_FETCH};
AdfPivotTableUtils.prototype.rangeOfBlocksOverlappingShiftedViewport=function(a,b,c){void 0==c&&(c=0);var d=this._posAttr[a],e=this._sizeAttr[a],f=this._buffers2[a][b],g=this._canvasEndSlice[a][b],h=c;a=c+this._databodiesByEdgeAndPane[a][b][e];b=f.length;c=-2;var l=b,m=f[0][d];if(m>h)c=-1;else for(var n=0;n<b;++n){var p=f[n],q=p[d],p=p[e],p=q+p;if(h<p){c=n;break}}if(-2==c)return{start:b,end:b};if(-1==c){if(a<=m)return{start:-1,end:-1};h=0;p=f[0];startSlice=this.getIntAttribute(p,"_startSlice");0==
startSlice&&(c=0)}else h=c;for(n=h;n<b;++n)if(p=f[n],q=p[d],p=p[e],p=q+p,a<=p){l=n;break}l==b&&(p=f[b-1],startSlice=this.getIntAttribute(p,"_startSlice"),numSlices=this.getIntAttribute(p,"_numSlices"),startSlice+numSlices>=g&&--l);return{start:c,end:l}};
AdfPivotTableUtils.prototype.firstSliceInShiftedViewport=function(a,b,c,d){void 0==d&&(d=this.rangeOfBlocksOverlappingShiftedViewport(a,b,c));b=this._buffers2[a][b];d=d.start;if(-1==d||d==b.length)return{slice:-1,pixel:-1,pixelsInsideViewport:-1};d=b[d];b=d.firstChild.rows;c=d[this._posAttr[a]]-c;b=a?b:b[0].cells;a=this.offsetSizeAttr[a];for(var e=1;e<b.length;++e){var f=b[e][a];c+=f;if(0<c)return{slice:this.getIntAttribute(d,"_startSlice")+e-1,pixel:f-c,pixelsInsideViewport:c}}AdfAssert.assert(AdfPivotTableUtils.assertsOff||
!1,"firstSliceInShiftedViewport completed without finding a first slice, which shouldn't happen")};
AdfPivotTableUtils.prototype.lastSliceInShiftedViewport=function(a,b,c,d){void 0==d&&(d=this.rangeOfBlocksOverlappingShiftedViewport(a,b,c));var e=this._buffers2[a][b];d=d.end;if(-1==d||d==e.length)return{slice:-1,pixelsInsideViewport:-1,pixelsOutsideViewport:-1};e=e[d];d=e.firstChild.rows;b=this._databodyScrollersByEdgeAndPane[a][b];c=(a?b._usableHeight:b._usableWidth)-(e[this._posAttr[a]]-c+e[this._sizeAttr[a]]);b=a?d:d[0].cells;a=this.offsetSizeAttr[a];for(d=b.length-1;1<=d;--d){var f=b[d][a];
c+=f;if(0<c)return{slice:this.getIntAttribute(e,"_startSlice")+d-1,pixelsInsideViewport:c,pixelsOutsideViewport:f-c}}AdfAssert.assert(AdfPivotTableUtils.assertsOff||!1,"lastSliceInShiftedViewport completed without finding a last slice, which shouldn't happen")};
AdfPivotTableUtils.prototype.scrollDistanceToSlice=function(a,b,c){var d=this._pivotTablePeer.getBlockNumOfSlice(a,c,b);if(-1!=d){var e=this._buffers2[a][b][d],d=e.firstChild.rows;b=e[this._posAttr[a]];d=a?d:d[0].cells;a=this.offsetSizeAttr[a];for(var e=this.getIntAttribute(e,"_startSlice"),f=1;f<d.length;f++){if(e+f-1==c)return b;b+=d[f][a]}}};
AdfPivotTableUtils.prototype.firstLayerInViewport=function(a){var b=-this._headers[a][1][this.scrollPosAttr[1-a]];if(0==b)return{layer:0,pixel:0};var c=this._buffers2[a][1][0].firstChild.rows,c=a==AdfPivotTableUtils.ROW_EDGE?c[0].cells:c;a=this.offsetSizeAttr[1-a];for(var d=1;d<c.length;++d){var e=c[d][a],b=b+e;if(0<b)return{layer:d-1,pixel:e-b}}AdfAssert.assert(AdfPivotTableUtils.assertsOff||!1,"firstLayerInViewport completed without finding a first layer, which shouldn't happen")};
AdfPivotTableUtils.prototype.findBlocksInRangeNeedingFetch=function(a,b,c,d,e,f,g,h,l){var m,n,p,q,r,v;if(0==this._rowExtent||0==this._colExtent)return!1;var u=this._rowHeaderBuffers[g],w=this._colHeaderBuffers[d],y=this._databodyBuffers[g][d],t=u.length,A=w.length,D={},C={},z=!1,x=!1,E=!1,F=!1;-1==e&&(e=0,z=!0);-1==h&&(h=0,E=!0);f==A&&(f-=1,x=!0);l==t&&(l-=1,F=!0);t=Array(A);for(A=e;A<=f;++A){var G=w[A],H={};H.needColHeaderBlock=G._placeholder?!0:!1;H.startCol=this.getIntAttribute(G,"_startSlice");
H.numCols=this.getIntAttribute(G,"_numSlices");t[A]=H}z&&(q=!0,r=Math.min(this._colBlockSize,t[0].startCol-this._canvasStartSlice[0][d]),v=t[0].startCol-r);x&&(m=!0,n=(t[f].startCol?t[f].startCol:0)+(t[f].numCols?t[f].numCols:0),p=Math.min(this._colBlockSize,this._canvasEndSlice[0][d]-n));for(G=h;G<=l;++G){H=u[G];d=H._placeholder?!0:!1;var s=this.getIntAttribute(H,"_startSlice");h=this.getIntAttribute(H,"_numSlices");for(var B=y[G],A=e;A<=f;++A)if(null==B[A]){var I=t[A],J=AdfPivotTableDataFetchEvent.createBlockParameters(I.startCol,
s,I.needColHeaderBlock,d,I.numCols,h);a.push(J);d||(D[s]=H);I.needColHeaderBlock||(C[I.startCol]=w[A])}z&&(J=AdfPivotTableDataFetchEvent.createBlockParameters(v,s,q,d,r,h),a.push(J),d||(D[s]=H));x&&(J=AdfPivotTableDataFetchEvent.createBlockParameters(n,s,m,d,p,h),a.push(J),d||(D[s]=H))}if(E){d=!0;s=this.getIntAttribute(u[0],"_startSlice");h=Math.min(this._rowBlockSize,s-this._canvasStartSlice[1][g]);s-=h;for(A=e;A<=f;++A)I=t[A],J=AdfPivotTableDataFetchEvent.createBlockParameters(I.startCol,s,I.needColHeaderBlock,
d,I.numCols,h),a.push(J),I.needColHeaderBlock||(C[I.startCol]=w[A]);z&&(J=AdfPivotTableDataFetchEvent.createBlockParameters(v,s,!1,!1,r,h),a.push(J));x&&(J=AdfPivotTableDataFetchEvent.createBlockParameters(n,s,!1,!1,p,h),a.push(J))}if(F){d=!0;l=u[l];s=this.getIntAttribute(l,"_startSlice");l=this.getIntAttribute(l,"_numSlices");s+=l;h=Math.min(this._rowBlockSize,this._canvasEndSlice[1][g]-s);for(A=e;A<=f;++A)I=t[A],J=AdfPivotTableDataFetchEvent.createBlockParameters(I.startCol,s,I.needColHeaderBlock,
d,I.numCols,h),a.push(J),I.needColHeaderBlock||(C[I.startCol]=w[A]);z&&(J=AdfPivotTableDataFetchEvent.createBlockParameters(v,s,!1,!1,r,h),a.push(J));x&&(J=AdfPivotTableDataFetchEvent.createBlockParameters(n,s,!1,!1,p,h),a.push(J))}for(s in D)D.hasOwnProperty(s)&&(a=this.getSizeString(!1,D[s]),a=AdfPivotTableDataFetchEvent.createSizingParameter(!0,!1,s,a),c[s]=a);for(s in C)C.hasOwnProperty(s)&&(a=this.getSizeString(!0,C[s]),a=AdfPivotTableDataFetchEvent.createSizingParameter(!1,!0,s,a),b[s]=a)};
AdfPivotTableUtils.prototype.getArrivingBlocks=function(a,b,c){switch(c){case AdfPivotTableUtils.DATABODY:b+="::DatabodyBlock";break;case AdfPivotTableUtils.COLUMN_EDGE:b+="::ColHeaderBlock";break;case AdfPivotTableUtils.ROW_EDGE:b+="::RowHeaderBlock";break;default:throw Error("bad edge passed to AdfPivotTableUtils.getArrivingBlocks");}return this.getArrivingElements(a,b)};
AdfPivotTableUtils.prototype.getArrivingElements=function(a,b){for(var c=[],d=a.childNodes,e=0;e<d.length;e++){var f=d[e],g=f.id;g&&0==g.indexOf(b)&&c.push(f)}return c};AdfPivotTableUtils.prototype.setPos=function(a,b,c,d){a==AdfPivotTableUtils.COLUMN_EDGE?d?(c._left=b,c.style.left=b+"px"):this.setHorizPos(b,c):(c._top=b,c.style.top=b+"px")};
AdfPivotTableUtils.prototype.setHorizPos=function(a,b){var c;if(this._rightToLeft){c=b.parentNode;var d=c._width;c==this._colHeaders[1]&&(d-=this.getColHeaderScrollbarWidth());c=d-b._width-a}else c=a;b._horizPos=a;b._left=c;b.style.left=c+"px"};AdfPivotTableUtils.prototype.setCanvasPos=function(a,b,c){a==AdfPivotTableUtils.COLUMN_EDGE?this.setCanvasHorizPos(b,c):c._canvasTop=b};AdfPivotTableUtils.prototype.setCanvasHorizPos=function(a,b){b._canvasHorizPos=a};
AdfPivotTableUtils.prototype.getScrollPos=function(a,b){return a==AdfPivotTableUtils.COLUMN_EDGE?this.getScrollHorizPos(b):this.getScrollerByEdgeAndPane(a,b).scrollTop};
AdfPivotTableUtils.prototype.getScrollHorizPos=function(a){var b=AdfPivotTableUtils.COLUMN_EDGE,c=this.getScrollerByEdgeAndPane(b,a).scrollLeft;if(this._rightToLeft&&AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&!(8<=AdfAgent.AGENT.getVersion())){var d=this._maxScrollPos[b][a];if(!AdfPivotTableUtils.assertsOff){var e=this.getCanvasSizeByEdgeAndPane(b,a);a=this._databodiesByEdgeAndPane[b][a]._width+1;AdfAssert.assert(AdfPivotTableUtils.assertsOff||d-c==(e<a?0:e-a-c))}return d-c}return c};
AdfPivotTableUtils.prototype.setScrollPos=function(a,b,c,d){if(!this.scrollbarExists(a,b))return 0;var e=this._maxScrollPos[a][b];c=Math.min(c,e);c=Math.max(c,0);this._rightToLeft&&a==AdfPivotTableUtils.COLUMN_EDGE&&AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&!(8<=AdfAgent.AGENT.getVersion())?(e-=c,AdfAssert.assert(AdfPivotTableUtils.assertsOff||e==Math.max(0,this.getCanvasSizeByEdgeAndPane(a,b)-(this._databodiesByEdgeAndPane[a][b]._width+1)-c),"expected Math.max(0, canvasWidth - (databodyWidth+1) - newPosition) \x3d\x3d (maxScrollPos - newPosition), but not equal")):
e=c;var f=this.getScrollerByEdgeAndPane(a,b),g=this.scrollPosAttr[a];if(d)f[g]=e;else{this._ignoreScrollPosChange=!0;try{this._lastScrollPos[a][b]=c,f[g]=e}finally{this._ignoreScrollPosChange=!1}}AdfAssert.assert(AdfPivotTableUtils.domAssertsOff||f[g]==e,"setScrollPos() tried to set an out-of-bounds scrollPos, which shouldn't be possible due to the preceding bounds checks.  Perhaps maxScrollPos is set too high.");AdfAssert.assert(AdfPivotTableUtils.domAssertsOff||this.getScrollPos(a,b)==c,"setScrollPos() tried to set the scroll pos, but the resulting scrollPos !\x3d newPosition");
return c};AdfPivotTableUtils.prototype.scrollbarExists=function(a,b){return 0<this._maxScrollPos[a][b]};AdfPivotTableUtils.prototype.cloneArray=function(a){var b;if(Array.isArray(a)){b=a.slice(0);for(a=0;a<b.length;a++)b[a]=this.cloneArray(b[a]);return b}return a};