function A_xf(a,b){if(!a.ma&&!a.pe&&a.Na!=AdfDhtmlPivotTablePeer.Ea){var c=A_Te(a);if(void 0!=c&&null!=c&&""!=c&&!a.On){var c=A_Xe(a,b)[1],d;if(!(d=null!=c||null==b))a:{d=b;for(var e=a.getDomElement();d&&1==d.nodeType;){if(d==e){d=!0;break a}d=d.parentNode}d=!1}d&&c!=a.T&&(a.On=!0,a.Ej=!1,a.Jw||(a.Jw=a.createCallback(a.Mm)),AdfAgent.AGENT.getDomWindow().setTimeout(a.Jw,300),a.xg=!0)}}}
AdfDhtmlPivotTablePeer.prototype.Mm=function(a){this.Na==AdfDhtmlPivotTablePeer.Ea?this.xg&&(this.xg=null):(0==this.Ej?(void 0==a&&(a=A_Se(this)),a&&(this.Nd=this.T,A_af(this,null,this.T,this.gk),this.T=null),A_vf(this,null,a),this.Gd=this.Zj=null):this.xg=null,this.cf=this.On=!1)};
function A_tf(a,b,c){var d=A_4f(a,b),e=AdfAgent.AGENT.getIntAttribute(d,"_startRow")<a.b.u[1]?0:1,f=AdfAgent.AGENT.getIntAttribute(d,"_startCol")<a.b.u[0]?0:1;b=b.parentNode.rowIndex;a:{for(var f=a.b.V[e][f],g=f.length,h=0;h<g;h++)for(var l=f[h],m=l.length,n=0;n<m;n++)if(l[n]==d){d=h;break a}d=-1}f=a.b.Pa[e][d].childNodes[0].rows[b].cells[0];f.parentNode.Hc=f.offsetHeight+c;A_jf(a,!1,e,d,f,b,c,!0)}function A_Te(a){return a.getComponent().getProperty(AdfRichPivotTable.gd)}
function A_vf(a,b,c){var d=a.getComponent(),e=d.getProperty(AdfRichPivotTable.gd);d.setProperty(AdfRichPivotTable.gd,b,!1,AdfUIComponent.PROPAGATE_ALWAYS);d.setProperty("activeCellKey",b,!1,AdfUIComponent.PROPAGATE_ALWAYS);void 0!=c&&c?a.pk():A_Uf(a,b,e,a.Gd,a.fk)?a.tn=e:(d.setProperty(AdfRichPivotTable.gd,e,!1,AdfUIComponent.PROPAGATE_ALWAYS),d.setProperty("activeCellKey",e,!1,AdfUIComponent.PROPAGATE_ALWAYS),A_ig(a,e),A_jg(a),A_Xg(a),a.xg=null)}
function A_ah(a,b){if(A_Se(a)){null==a.te&&(a.te=[]);if(null!=a.Nd&&null!=b&&-1==a.te.indexOf(b)){var c=A_nf(a,a.Nd);if(0<c.length){var d=c[0].yb,c=c[0].value;null!=d&&d!=c&&a.te.push(b)}}return a.te}return[]}function A_Uf(a,b,c,d,e){var f=a.getComponent();d=new A_bh(f,b,c,d,e);c=A_ah(a,c);d.Jx=c;d.setPartial(!0);f.queueEvent(d);f=d.isCanceled();f||(A_hf(a,AdfDhtmlPivotTablePeer.Ea),a.Qd=null,null!=b?(a.lr=!1,a.ky=b):a.ky=null);return f?null:d}
AdfDhtmlPivotTablePeer.prototype.pk=function(a){var b=this.T;if(b){A_Pe(this)||A_Xg(this);var c=A_nf(this,b);if("TD"==b.tagName){var d=A_8e(this,b);A_ch(this,d,b,c)}if(0<c.length){var e;this.Rr?(e=c[c.length-1],this.Rr=!1):e=c[0];A_df(e);b=AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM;if("INPUT"==e.tagName&&"text"==e.type||"TEXTAREA"==e.tagName)b&&e.focus(),this.enableUserSelect(),b&&a?setTimeout(function(){e.select()},0):e.select()}else A_df(this.getDomElement())}else A_df(this.getDomElement())};
function A_1e(a,b){null!=b&&b.cancel();a.Ej=!1;a.Mm()}function A_Mf(a){if(a.Na!=AdfDhtmlPivotTablePeer.Ea&&!a.ma&&!a.pe){var b=a.F;if(null!=b&&A_yf(b)==AdfPivotTableUtils.O){var c=A_g(b),c=A_Va(a,c);if(0<c.length&&(c=c[0],null!=c&&(c.id||A_Se(a))&&a.T!=c)){a.T=c;a.Gd=c.parentNode.offsetHeight;var d=void 0;if(A_Se(a)&&(d=A_sf(a,c,c))){if(!A_Pe(a)){var e=a.Gd;a.Gd=c.parentNode.offsetHeight;var f=a.Gd-e;0!=f&&A_tf(a,c,f)}A_af(a,c,c,e)}e=A_4f(a,c);f=null;e&&(f=A_7g(c,e),A_Vf(a,b),A_vf(a,f,d))}}}}
function A_af(a,b,c,d){if(null!=a.Nd&&null!=a.Nd.parentNode){var e=A_rf(a,a.Nd),f=e.ia;null!=f&&f instanceof AdfRichInputText&&(null!=e.element.getAttribute("_afrCellDirty")?A_dh(f,!0):f.setProperty("readOnly",!0,!1,AdfUIComponent.vp),e=-1,null!=b&&(e=A_uf(a,b).row),e!=a.Zj&&(A_Pe(a)||(b=a.gk-a.Nd.parentNode.offsetHeight,0!=b&&A_tf(a,a.Nd,b)),a.gk=d,-1!=e&&(a.Zj=e)),a.Nd=c)}}function A_Xg(a){if(a.ur){var b=a.T.parentNode.offsetHeight-a.ur;b&&(A_tf(a,a.T,b),a.ur=null)}}
function A_Cf(a,b,c){if(c==b)return null;var d=b.getAttribute("id");return null!=d&&(d=AdfPage.PAGE.findComponent(d),null!=d&&d instanceof AdfRichInputText)?d:A_Cf(a,b.parentNode,c)}
function A_rf(a,b){var c=AdfAgent.AGENT.getDomDocument();if(c.evaluate)for(var c=c.evaluate(".//span[@id]",b,null,XPathResult.ANY_TYPE,null),d=c.iterateNext();d;){if(!d.disabled&&A_5g(a,d,b)){var e=AdfPage.PAGE.findComponent(d.id);if(null!=e&&e instanceof AdfRichInputText)return{ia:e,element:d}}d=c.iterateNext()}else for(var c=b.getElementsByTagName("*"),f=c.length,g=0;g<f;g++)if(d=c[g],"SPAN"==d.tagName&&d.id&&!d.disabled&&A_5g(a,d,b)&&(e=AdfPage.PAGE.findComponent(d.id),null!=e&&e instanceof AdfRichInputText))return{ia:e,
element:d};return{ia:null,element:null}}function A_sf(a,b,c){b=A_Cf(a,b,c);null==b&&(b=A_rf(a,c).ia);if(null!=b){c=c.getAttribute("_ros");if(null==c||-1==c.indexOf(b.getClientId())){a.xy=!0;try{A_dh(b,!1),b.setProperty("readOnly",!1,!1,AdfUIComponent.vp)}finally{a.xy=!1}void 0==a.bs&&(a.bs=a.BH.bind(a));b.removeEventListener(AdfValueChangeEvent.VALUE_CHANGE_TYPE,a.bs);b.addEventListener(AdfValueChangeEvent.VALUE_CHANGE_TYPE,a.bs)}return!0}return!1}
AdfDhtmlPivotTablePeer.prototype.BH=function(a){var b=a.getSource(),c=AdfRichUIPeer.getDomElementForComponent(b);if(null!=a.getOldValue()||c.getAttribute("_afrOldValue")!=a.getNewValue())void 0===this.te&&(this.te=[]),a=A_Xe(this,c),null!=a&&-1==this.te.indexOf(a[0])&&this.te.push(a[0]),b.setProperty("readOnly",!1,!1,AdfUIComponent.vp),c.setAttribute("_afrCellDirty",!0),A_dh(b,!0)};
AdfDhtmlPivotTablePeer.Ws=function(a,b){if("readOnly"==a.getPropertyName()){var c=AdfPage.PAGE.findComponent(b).getPeer();if(!c.xy){var d=a.getSource(),e=AdfRichUIPeer.getDomElementForComponent(d),c=A_Xe(c,e);if(null!=c)if(c=c[1],e=c.getAttribute("_ros"),d=d.getClientId(),"true"==a.getNewValue())null==e?c.setAttribute("_ros",d):c.setAttribute("_ros",e+" "+d);else if("false"==a.getNewValue()&&null!=e){var f=e.indexOf(d);if(0==f&&-1==e.trim().indexOf(" "))c.removeAttribute("_ros");else{var g="";0<f&&
(g+=e.substring(0,f));f+d.length+1<g.length&&(g+=substring(f+d.length+1));c.setAttribute("_ros",g)}}}}};A_a("AdfDhtmlPivotTablePeer.handlePropertyChange",AdfDhtmlPivotTablePeer.Ws);
function A_dh(a,b){var c=AdfRichUIPeer.getDomElementForComponent(a);if(b)AdfDomUtils.ta(c,"p_AFClickToEdit")&&AdfDomUtils.X(c,"p_AFClickToEdit"),AdfDomUtils.ya(c,"p_AFReadOnly"),c.firstChild&&"INPUT"==c.firstChild.tagName&&(c.firstChild.setAttribute("readOnly","true"),c.firstChild.style.minHeight="inherit");else{AdfDomUtils.ta(c,"p_AFReadOnly")&&AdfDomUtils.X(c,"p_AFReadOnly");AdfDomUtils.ya(c,"p_AFClickToEdit");c.firstChild&&"INPUT"==c.firstChild.tagName&&c.firstChild.removeAttribute("readOnly");
var d=c.textContent;c.getAttribute("_afrOldValue")!=d&&c.setAttribute("_afrOldValue",d)}}AdfDhtmlPivotTablePeer.sC=function(a,b,c){a=AdfPage.PAGE.findComponent(a).getPeer();b=A_f(b,c);A_tg(a.b);A_0(a,b);A_Vf(a,b);A_Mf(a)};A_a("AdfDhtmlPivotTablePeer.HandleInvalidCells",AdfDhtmlPivotTablePeer.sC);
AdfDhtmlPivotTablePeer.prototype.pH=function(a){null==this.Qd&&null!=this.T&&(a.isBusy()?(this.ug=!0,a=A_rf(this,this.T).ia,A_dh(a,!0),A_We(this,!0,{dataCells:[]})):(this.ug=!1,A_zf(this,this.F)!=this.T?A_Mf(this):(A_sf(this,this.T,this.T),this.pk(!0))))};