var ju=I.ea(I,"AdfDhtmlPanelGridLayoutPeer",!1);m("AdfDhtmlPanelGridLayoutPeer",ju);ju.C=function(){I.sb(this,AdfRichPanelGridLayout.INLINE_STYLE)};m("AdfDhtmlPanelGridLayoutPeer.InitSubclass",ju.C);
ju.prototype.mD=function(a,b,d,e){var f=b.style,g=f.display,h=f.position,l=f.left,n=f.right,t=f.top,y=f.bottom,z=f.width,B=f.minWidth,F=f.maxWidth,K=f.height,P=f.minHeight,Q=f.maxHeight,da=[];if("n"==q.b.getAttribute(b,"_afrm")){var ba=f.swb,f=f.twb;ju.h.mD.call(this,a,b,d,e);null!=ba&&""!=ba&&da.push("-ms-grid-columns:"+ba);null!=f&&""!=f&&da.push("-ms-grid-rows:"+f)}else ju.h.mD.call(this,a,b,d,e),null!=this.bka&&C.jm(b,this.bka,!0);null!=g&&""!=g&&da.push("display:"+g);null!=h&&""!=h&&da.push("position:"+
h);null!=l&&""!=l&&da.push("left:"+l);null!=n&&""!=n&&da.push("right:"+n);null!=t&&""!=t&&da.push("top:"+t);null!=y&&""!=y&&da.push("bottom:"+y);null!=z&&""!=z&&da.push("width:"+z);null!=B&&""!=B&&da.push("min-width:"+B);null!=F&&""!=F&&da.push("max-width:"+F);null!=K&&""!=K&&da.push("height:"+K);null!=P&&""!=P&&da.push("min-height:"+P);null!=Q&&""!=Q&&da.push("max-height:"+Q);0<da.length&&C.jm(b,da.join(";"),!0)};r.a("AdfDhtmlPanelGridLayoutPeer.prototype.ComponentInlineStyleChanged",{mD:ju.prototype.mD});
ju.prototype.ya=function(){return!0};r.a("AdfDhtmlPanelGridLayoutPeer.prototype.needsResizeNotify",{ya:ju.prototype.ya});ju.prototype.ue=function(){return!0};r.a("AdfDhtmlPanelGridLayoutPeer.prototype.needsChildVisibilityChanges",{ue:ju.prototype.ue});ju.prototype.ka=function(a){this.Una&&A.c.bp(a)};r.a("AdfDhtmlPanelGridLayoutPeer.prototype.ComponentRemoved",{ka:ju.prototype.ka});
ju.prototype.Sa=function(a,b,d,e){a=this.f();if(null!=this.bka){b=-1!=ku(this,a).indexOf("%");var f=-1!=lu(this,a).indexOf("%"),g=-1!=ku(this,a).indexOf("auto"),h=-1!=lu(this,a).indexOf("auto");if(!(b||f||g||h))return}b=this.i();null!=C.pa(b)&&(d=this.wp(d,e),this.Una&&!d?(A.c.bp(a),this.Una=!1):d&&(A.c.pr(a),this.Una=!0),"hidden"==b.style.visibility&&(b.style.visibility="visible"))};r.a("AdfDhtmlPanelGridLayoutPeer.prototype.ResizeNotify",{Sa:ju.prototype.Sa});
ju.prototype.le=function(a,b,d){return this.C5(b)?(C.setVisible(b.parentNode,d),this.wp(),C.setVisible(b,d),A.c.Xg(this.f()),!0):!1};r.a("AdfDhtmlPanelGridLayoutPeer.prototype.ChildVisibilityChanged",{le:ju.prototype.le});ju.prototype.C5=function(a){return a.parentNode.parentNode==this.i()};function ku(a,b){null==a.oU&&(a.oU=b.K("_privateColumns"));return a.oU}function lu(a,b){null==a.Ag&&(a.Ag=b.K("_privateRows"));return a.Ag}
ju.prototype.wp=function(a,b){var d=this.i(),e=q.b;if("n"==e.getAttribute(d,"_afrm"))return!1;for(var f=this.f(),g=ku(this,f).split(" "),h=lu(this,f).split(" "),l=0,n=0,t=C.Dc(d),y=[],z=v.l,B=null,F=-1!=ku(this,f).indexOf("%"),K=-1!=lu(this,f).indexOf("%"),P,Q,da,ba,ta=t.length-1,Ha=0;Ha<=ta;Ha++){var Eb=t[Ha];if(null!=e.getAttribute(Eb,"_afrc")||null!=e.getAttribute(Eb,"_afrr")){var fb=C.pa(Eb);null==fb&&(fb=C.Kra(Eb,3));if(null==fb)Ha==ta&&null!=e.getAttribute(Eb,"_afrr")?B=Eb:z.finest("The grid layout ("+
f.g()+") has an empty grid cell under wrapper index \x3d "+Ha+", wrapper.innerHTML \x3d "+Eb.innerHTML+")");else if(3==fb.nodeType||C.kb(fb)){var Ya=this.P4(e,Eb,"_afrc","1 1 1 1 stretch stretch").split(" ");P=parseInt(Ya[0],10);Q=parseInt(Ya[1],10);da=parseInt(Ya[2],10);ba=parseInt(Ya[3],10);var Lb=Ya[4],Ya=Ya[5];0<P&&0<da&&(data={wrapper:Eb,child:fb,col:P,cspan:Q,row:da,rspan:ba,halign:Lb,valign:Ya},l=Math.max(l,P+Q-1),n=Math.max(n,da+ba-1),y.push(data))}else z.ee(v.FINE)&&z.fine("The grid layout ("+
f.g()+") has an invisible child (wrapper index \x3d "+Ha+", child.id \x3d "+fb.id+", wrapper.innerHTML \x3d "+Eb.innerHTML+")")}}if(0==y.length)return z.ee(v.FINE)&&z.fine("The grid layout ("+f.g()+") has no child data to process (wrappers.length \x3d "+t.length+")."),!1;ta=A.c.Ka().La();t=!1;P=mu(g,l,d,y,"col","cspan","clientWidth",a);ba=mu(h,n,d,y,"row","rspan","clientHeight",b);Q=P[0];da=ba[0];t||(t=P[1]||ba[1]);null==B&&(B=d.ownerDocument.createElement("div"),e.setAttribute(B,"_afrr","y"),d.appendChild(B));
C.jm(B,"width:"+Q+"px;height:"+da+"px",!0);P="";F||(P+="max-width:"+Q+"px;min-width:"+Q+"px;");K||(P+="max-height:"+da+"px;min-height:"+da+"px;");""!=P&&(C.jm(d,P,!0),this.bka=P);z.ee(v.FINE)&&(z.fine("Grid layout details for "+f.g()+" (childData.length \x3d "+y.length+")"),z.fine("Columns: "+g),z.fine("Rows: "+h),z.fine("Grid (permanent) dimensions: "+Q+"px and "+da+"px."));F=y.length;for(Ha=0;Ha<F;Ha++)data=y[Ha],"center"==data.halign&&(data.sw=data.wrapper.scrollWidth),"middle"==data.valign&&(data.sh=
data.wrapper.scrollHeight);for(Ha=0;Ha<F;Ha++)data=y[Ha],Eb=data.wrapper,P=data.col,Q=data.cspan,da=data.row,ba=data.rspan,Lb=data.halign,Ya=data.valign,K=[],"center"==Lb?(t=!0,e=nu(g,P),e=e+Math.ceil(Math.max(0,nu(g,P+Q)-e)/2-data.sw/2)+"px",ta?K.push("right:"+e):K.push("left:"+e)):"stretch"==Lb?(e=nu(g,P),B=nu(g,P+Q),ta?K.push("right:"+e+"px"):K.push("left:"+e+"px"),K.push("width:"+(B-e)+"px")):ta?("end"!=Lb&&K.push("right:"+nu(g,P)+"px"),"start"!=Lb&&K.push("left:"+ou(g,P+Q-1)+"px")):("end"!=Lb&&
K.push("left:"+nu(g,P)+"px"),"start"!=Lb&&K.push("right:"+ou(g,P+Q-1)+"px")),"middle"==Ya?(t=!0,e=nu(h,da),K.push("top:"+(e+Math.ceil(Math.max(0,nu(h,da+ba)-e)/2-data.sh/2))+"px")):"stretch"==Ya?(e=nu(h,da),B=nu(h,da+ba),K.push("top:"+e+"px"),K.push("height:"+(B-e)+"px")):("bottom"!=Ya&&K.push("top:"+nu(h,da)+"px"),"top"!=Ya&&K.push("bottom:"+ou(h,da+ba-1)+"px")),0<K.length&&C.jm(Eb,K.join(";"),!0),z.ee(v.FINE)&&z.fine("child "+Ha+": c\x3d"+P+" (span\x3d"+Q+") halign\x3d"+Lb+" -- r\x3d"+da+" (span\x3d"+
ba+") valign\x3d"+Ya);if(a!=d.clientWidth||b!=d.clientHeight)a:{g=v.l;if(null==this.iX)this.iX=1,this.U6=A.c.ta(this,this.inb,{},1E3);else{if(10<++this.iX&&(null==a||a>d.clientWidth||null==b||b>d.clientHeight)){g.ee(v.FINE)&&g.fine("Unsable structure encountered, stopping repositioning attempts (case a).");pu(this);break a}if(15<++this.iX){g.ee(v.FINE)&&g.fine("Unsable structure encountered, stopping repositioning attempts (case b).");pu(this);break a}}g.ee(v.FINE)&&g.fine("Grid layout size change, notifying ancestors: panelGridLayout\x3d"+
d.id+" oldW\x3d"+a+", newW\x3d"+d.clientWidth+", oldH\x3d"+b+", newH\x3d"+d.clientHeight);A.c.EA(f);A.c.zA()}else pu(this);return t};ju.prototype.inb=function(){this.U6=this.iX=null};function pu(a){null!=a.U6&&A.c.ic(a.U6);a.iX=null;a.U6=null}function nu(a,b){for(var d=0,e=0;e<b-1;e++)d+=a[e];return d}function ou(a,b){for(var d=0,e=a.length-1;e>=b;e--)d+=a[e];return d}ju.prototype.P4=function(a,b,d,e){a=a.getAttribute(b,d);return null==a?e:a};
function mu(a,b,d,e,f,g,h,l){var n=0,t,y,z,B,F=a.length;for(t=b-F;0<t;t--)a.push("auto");b=!1;var K=0,F=a.length;for(t=0;t<F;t++)y=a[t],"auto"==y?(b=!0,y=["auto"]):-1!=y.indexOf("%")?K+=parseFloat(y):(y=C.CSa(d,y),n+=y),a[t]=y;if(b){y=q.b;var P=[],Q,da,ba,ta=e.length;for(t=0;t<ta;t++)if(z=e[t],Q=z[f]-1,da=Q+z[g]-1,Q!=da)v.l.ee(v.FINE)&&v.l.fine("Skipped auto resolution for a multi-span child because firstLineIndex \x3d "+Q+" and lastLineIndex \x3d "+da);else{ba=-1;for(B=Q;B<=da;B++)if("object"==typeof a[B]){ba=
B;break}-1!=ba&&(B=z.wrapper,C.jm(B,"top:auto;top:auto;bottom:auto;left:auto;right:auto;width:auto;height:auto;max-width:none;max-height:none",!0),P.push([B,Q,da,ba]))}e=P.length;for(t=0;t<e;t++)for(ba=P[t],B=ba[0],Q=ba[1],da=ba[2],ba=ba[3],f=0,"clientWidth"==h?(f=B.scrollWidth,y.S()==q.ed&&1.8<y.Ib()&&++f):f=B.scrollHeight,B=Q;B<=da;B++){if(ba==B){a[B].push(f);break}Q=a[B];if("number"==typeof Q&&(f=Math.max(0,f-Q),0==f))break}for(B=0;B<F;B++)if(y=a[B],P=0,"object"==typeof y){da=y.length;for(t=1;t<
da;t++)P=Math.max(P,y[t]);a[B]=P;n+=P}}t=0;if(0<K){t=Math.max(0,null==l?d[h]:l);F=a.length;for(B=0;B<F&&0<t;B++)y=a[B],"number"==typeof y&&(t=Math.max(0,t-y));for(B=0;B<F;B++)y=a[B],"string"==typeof y&&(a[B]=Math.floor(t*parseFloat(y)/K))}return[n,b]};