function dj(){this.Init()}m("AdfDhtmlPositionManager",dj);m("AdfDhtmlPositionManager",dj);r.v(dj);dj.ga=function(){this.Zz=0;m("AdfDhtmlPositionManager.TOP",dj.Zz);this.Qz=1;m("AdfDhtmlPositionManager.MIDDLE",dj.Qz);this.Ss=2;m("AdfDhtmlPositionManager.BOTTOM",dj.Ss);this.Pz=3;m("AdfDhtmlPositionManager.LEFT",dj.Pz);this.wz=4;m("AdfDhtmlPositionManager.CENTER",dj.wz);this.qt=5;m("AdfDhtmlPositionManager.RIGHT",dj.qt);this.OWa=32;m("AdfDhtmlPositionManager.MIN_WIDTH",dj.OWa)};
m("AdfDhtmlPositionManager.InitClass",dj.ga);dj.prototype.Init=function(){dj.h.Init.call(this);var a=v.l;a.getLevel(v.FINEST)&&(this.UM=a);this.gj=[];this.yb=A.c.Ka().La()};r.a("AdfDhtmlPositionManager.prototype.Init",{Init:dj.prototype.Init});dj.prototype.qj=function(){var a=0,b=this.gj,d;for(d in b)d&&a++;return a};r.a("AdfDhtmlPositionManager.prototype.getElementCount",{qj:dj.prototype.qj});dj.prototype.ac=function(){this.gj=null};r.a("AdfDhtmlPositionManager.prototype.dispose",{ac:dj.prototype.ac});
dj.prototype.Wpa=function(a,b){a.jC()||u.u(a.Op());return tj(this,a,b)};r.a("AdfDhtmlPositionManager.prototype.addFloatingElement",{Wpa:dj.prototype.Wpa});dj.prototype.c8=function(a,b){a.ov(b);return tj(this,a,AdfRichPopup.qf)};r.a("AdfDhtmlPositionManager.prototype.addFloatingElementByPosition",{c8:dj.prototype.c8});dj.prototype.k8=function(a,b,d,e,f){var g=uj(this,d);d=g.TH;g=g.FI;a={top:0,right:b,bottom:a,left:0,width:b,height:a};e=vj(e,f);f=wj(this,d,a,e);d=wj(this,g,a,e);return xj(f,d,a,e)};
r.a("AdfDhtmlPositionManager.prototype.calculatePlacementPosition",{k8:dj.prototype.k8});function tj(a,b,d){u.u(b.Ha());if(1>a.qj()){var e=q.b,f=e.Y(),g=e.R(),h=a.ROa;h||(h=a.ROa=a.D(a.Glb));var l=e.S()==q.ia;e.LP()&&(e.ba(g,"mousewheel",h),e.ba(f,"scroll",h),l||e.ba(g,"DOMMouseScroll",h));e.ba(f,"resize",h)}f=uj(a,d);d=f.FI;e=f.TH;f=f.bta;g=(g=b.Op())?a.Fta(g):!1;a.gj.push({element:b,Dsb:d,Aqb:e,gvb:g,bta:f});return a.gj.length-1}
function uj(a,b){var d=dj.Ss,e=dj.Zz,f=dj.Qz,g=yj(a,"start"),h=yj(a,"end"),l=dj.wz,n=!1,t,y;switch(b){case AdfRichPopup.qf:y=[d,e];t=[g,g];break;case AdfRichPopup.HI:y=[d,e];t=[h,h];break;case AdfRichPopup.Waa:y=[d,e,d,e];t=[g,g,l,l];break;case AdfRichPopup.dD:y=[e,d];t=[g,g];break;case AdfRichPopup.v_:y=[e,d];t=[h,h];break;case AdfRichPopup.Xaa:y=[e,d,e,d];t=[g,g,l,l];break;case AdfRichPopup.w_:y=[d,d];t=[h,g];break;case AdfRichPopup.tz:y=[e,e];t=[h,g];break;case AdfRichPopup.Yaa:y=[e,e,f,f];t=[h,
g,h,g];break;case AdfRichPopup.z_:y=[d,d];t=[g,h];break;case AdfRichPopup.A_:y=[e,e];t=[g,h];break;case AdfRichPopup.Zaa:y=[e,e,f,f];t=[g,h,g,h];break;case AdfRichPopup.DQ:y=[e,e];t=[g,g];break;case AdfRichPopup.x_:n=!0;y=[e,e];t=[h,h];break;case AdfRichPopup.y_:n=!0;y=[e,e];t=[g,g];break;case AdfRichPopup.u_:y=[e,d,e,d];t=[h,h,h,g];break;default:u.assert(!1,"Invalid alignmentHint provided")}return{TH:Aj(a,t),FI:Aj(a,y),bta:n}}
function Bj(a){switch(a){case dj.Zz:return dj.Ss;case dj.Ss:return dj.Zz;case dj.Qz:return dj.Qz;case dj.Pz:return dj.qt;case dj.qt:return dj.Pz;case dj.wz:return dj.wz}}function Cj(a){switch(a){case dj.Zz:return"Top";case dj.Ss:return"Bottom";case dj.Qz:return"Middle";case dj.Pz:return"Left";case dj.qt:return"Right";case dj.wz:return"Center"}}
function Aj(a,b){for(var d=[],e=0;e<b.length;e+=2)d.splice(0,0,{dqa:b[e],jy:b[e+1],pRa:a["_prefer"+Cj(Bj(b[e]))+Cj(Bj(b[e+1]))+"Condition"]},{dqa:Bj(b[e]),jy:Bj(b[e+1]),pRa:a["_prefer"+Cj(b[e])+Cj(b[e+1])+"Condition"]});return d}
function vj(a,b,d){var e=q.b,f,g;a?(e=e.jc(a),a instanceof SVGElement?(d=e.y,b=e.x,a=a.getBoundingClientRect(),e=a.width,g=a.height):d?(d=e.y+a.clientTop,b=e.x+a.clientLeft,e=a.clientWidth,g=a.clientHeight):(d=e.y,b=e.x,e=a.offsetWidth,g=a.offsetHeight),a=d+g,f=b+e):(g=e=0,null==b?f=b=a=d=0:(a=d=b.y,f=b=b.x));return{top:d,bottom:a,left:b,right:f,width:e,height:g}}
dj.prototype.jOa=function(a,b,d){var e=q.b,f=e.getWindowHeight(),g=e.zf(),h=Ki.so(),e=b.top+a.height<=f+g,f=b.bottom+h<=f+g;b=b.bottom-(a.height-h)>=g&&f;a=d?e:b;(f=this.UM)&&f.hq(v.FINEST,(d?"_preferBottomBottomCondition":"_preferTopTopCondition")+" fitsBelow\x3d"+e+" fitsAbove\x3d"+b+" return\x3d"+a+" usedBy\x3d"+(d?"end_before, start_before, overlap":"end_after, start_after"));return a};dj.prototype._preferTopTopCondition=dj.prototype.jOa;
dj.prototype.Tkb=function(a,b){var d=q.b,e=d.getWindowHeight(),d=d.zf(),f=Ki.so(),g=a.height-f,e=b.top+b.height/2+g/2+f<=e+d,g=b.bottom-b.height/2-g/2>=d,d=e&&g;(f=this.UM)&&f.hq(v.FINEST,"_preferMiddleMiddleCondition fitsBelow\x3d"+e+" fitsAbove\x3d"+g+" return\x3d"+d+" usedBy\x3dend_center, start_center");return d};dj.prototype._preferMiddleMiddleCondition=dj.prototype.Tkb;
dj.prototype.Rkb=function(a,b){var d=q.b,e=d.getWindowWidth(),d=d.Oe(),f=Ki.so(),g=a.width-f;this.yb?(e=b.left+b.width/2+g/2<=e+d,f=b.right-b.width/2-g/2-f>=d):(e=b.left+b.width/2+g/2+f<=e+d,f=b.right-b.width/2-g/2>=d);d=e&&f;(g=this.UM)&&g.hq(v.FINEST,"_preferCenterCenterCondition fitsToRight\x3d"+e+" fitsToLeft\x3d"+f+" return\x3d"+d+" usedBy\x3dafter_center, before_center");return d};dj.prototype._preferCenterCenterCondition=dj.prototype.Rkb;dj.prototype.Qkb=function(a,b){return this.jOa(a,b,!0)};
dj.prototype._preferBottomBottomCondition=dj.prototype.Qkb;dj.prototype.gOa=function(a,b,d){var e=q.b,f=e.getWindowHeight(),g=e.zf(),e=Ki.so(),h=b.top+e<=f+g,e=b.top-(a.height-e)>=g&&h;b=b.bottom+a.height<=f+g;a=d?b:e;(f=this.UM)&&f.hq(v.FINEST,(d?"_preferTopBottomCondition":"_preferBottomTopCondition")+" fitsAbove\x3d"+e+" fitsBelow\x3d"+b+" return\x3d"+a+" usedBy\x3d"+(d?"after_start, after_end":"before_start, before_end, before_after"));return a};dj.prototype._preferBottomTopCondition=dj.prototype.gOa;
dj.prototype.Vkb=function(a,b){return this.gOa(a,b,!0)};dj.prototype._preferTopBottomCondition=dj.prototype.Vkb;
dj.prototype.hOa=function(a,b,d){var e=q.b,f=e.getWindowWidth(),e=e.Oe(),g=Ki.so(),h=a.width+a.wQ-g,l;this.yb?(l=b.right-(a.width+a.wQ)>=e,a=b.left-g>=e,a=b.left+h<=f+e&&a):(a=b.left+a.width+a.wQ<=f+e,f=b.right+g<=f+e,l=b.right-h>=e&&f);b=d?a:l;(f=this.UM)&&f.hq(v.FINEST,(d?"_preferRightRightCondition":"_preferLeftLeftCondition")+" fitsToRight\x3d"+a+" fitsToLeft\x3d"+l+" return\x3d"+b+" usedBy\x3d"+(d?"after_start, before_start, overlap":"after_end, before_end, before_after"));return b};
dj.prototype._preferLeftLeftCondition=dj.prototype.hOa;dj.prototype.Ukb=function(a,b){return this.hOa(a,b,!0)};dj.prototype._preferRightRightCondition=dj.prototype.Ukb;
dj.prototype.iOa=function(a,b,d){var e=q.b,f=e.getWindowWidth(),e=e.Oe(),g=Ki.so(),h=a.width+a.wQ-g;this.yb?(g=b.right-g>=e,f=b.right+h<f+e&&g,h=b.left-(a.width+a.wQ)>=e):(g=b.left+g<f+e,h=b.left-h>=e&&g,f=b.right+(a.width+a.wQ)<f+e);a=d?f:h;(b=this.UM)&&b.hq(v.FINEST,(d?"_preferLeftRightCondition":"_preferRightLeftCondition")+" fitsToLeft\x3d"+h+" fitsToRight\x3d"+f+" return\x3d"+a+" usedBy\x3d"+(d?"end_before, before_after":"start_after, start_before"));return a};
dj.prototype._preferRightLeftCondition=dj.prototype.iOa;dj.prototype.Skb=function(a,b){return this.iOa(a,b,!0)};dj.prototype._preferLeftRightCondition=dj.prototype.Skb;function yj(a,b){return"start"==b&&a.yb||"end"==b&&!a.yb?dj.qt:dj.Pz}dj.prototype.Si=function(a){delete this.gj[a];if(1>this.qj()){a=q.b;var b=a.Y(),d=a.R(),e=this.ROa;e&&(a.xa(d,"mousewheel",e),a.xa(b,"scroll",e),a.xa(d,"DOMMouseScroll",e),a.xa(b,"resize",e))}};r.a("AdfDhtmlPositionManager.prototype.removeElement",{Si:dj.prototype.Si});
dj.prototype.Fta=function(a){return A.c.Gg().sH(a)};r.a("AdfDhtmlPositionManager.prototype.managesElement",{Fta:dj.prototype.Fta});
dj.prototype.zQ=function(a){var b=A.c.Dg();if(!b||!b.rl())if(b=this.gj[a],null!=b){a=b.element;var d=a.Op(),e=a.jC(),f=b.bta,g=q.b,h=a.Ha(),l=h.offsetWidth,n=h.offsetHeight,t=g.jc(h),g=t.y,t=t.x;0==l&&(h=h.firstChild)&&(l=h.offsetWidth,n=h.offsetHeight);var h=Ki.so(),n=n+h,l=l+h,y=h=0;a.hZ&&a.hZ()&&(y=a.hZ(),h=y.offsetWidth,y=y.offsetHeight);l={top:g,right:t+l,bottom:g+n,left:t,width:l,height:n,wQ:h,Twb:y};l.inversePosition=a.oQ();d=vj(d,e,f);e=wj(this,b.Dsb,l,d);f=wj(this,b.Aqb,l,d);b.g4={};b.g4.FI=
e;b.g4.TH=f;b=b.g4;b=xj(b.TH,b.FI,l,d);a.setPosition(b.y,b.x)}};r.a("AdfDhtmlPositionManager.prototype.validatePosition",{zQ:dj.prototype.zQ});function wj(a,b,d,e){if(!d.inversePosition)return b[0];for(var f,g=0;!f&&g<b.length;g++)b[g].pRa.call(a,d,e)&&(f=b[g]);f||(f=b[0]);return f}dj.prototype.IY=function(a){a=this.gj[a];if(null!=a)return a.g4};r.a("AdfDhtmlPositionManager.prototype.getComputedBehavior",{IY:dj.prototype.IY});
function xj(a,b,d,e){var f,g,h=Ki.so(),l=d.height-h,h=d.width-h;switch(b.dqa){case dj.Zz:f=e.top;break;case dj.Ss:f=e.bottom;break;case dj.Qz:f=e.top+e.height/2;break;default:u.assert(!1,"Invalid alignElementAnchor for verticalBehavior provided")}switch(a.dqa){case dj.Pz:g=e.left;break;case dj.qt:g=e.right;break;case dj.wz:g=e.left+e.width/2;break;default:u.assert(!1,"Invalid alignElementAnchor for horizontalBehavior provided")}var n,t;switch(b.jy){case dj.Zz:n=f;break;case dj.Ss:n=f-l;break;case dj.Qz:n=
f-l/2;break;default:u.assert(!1,"Invalid floatingElementAnchor for verticalBehavior provided")}switch(a.jy){case dj.Pz:t=g;break;case dj.qt:t=g-h;break;case dj.wz:t=g-h/2;break;default:u.assert(!1,"Invalid floatingElementAnchor for horizontalBehavior provided")}A.c.Oy()&&(f=q.b,b=f.zf(),a=f.Oe(),e=f.getWindowWidth(),f=f.getWindowHeight(),n=Math.max(0,n),f=f+b-(n+d.height),0>f&&(n=Math.max(b,n+f)),t=Math.max(0,t),d=e+a-(t+d.width),0>d&&(t=Math.max(a,t+d)));return{x:t,y:n}}
dj.prototype.Glb=function(){var a=q.b.Y();null==this.QOa&&(this.QOa=this.D(this.Hlb));this.Yna&&a.clearTimeout(this.Yna);this.Yna=a.setTimeout(this.QOa,200)};
dj.prototype.Hlb=function(){delete this.Yna;for(var a=this.gj,b=a.length-1;-1<b;b--)if(null!=a[b]){var d=a[b].element,e=d.Op();if(!d.rs())if(e){for(var f=e,e=q.b,g=e.rd(f),h=e.getWindowWidth(),l=e.Oe(),n=e.getWindowHeight(),t=e.zf(),h=dj.uMa(g,{top:t,bottom:n+t,left:l,right:l+h}),f=f.parentNode;h&&f&&!dj.oib(f);)1==f.nodeType&&(h=e.rd(f),h=dj.uMa(g,h)),f=f.parentNode;!h&&d.Dk()?d.cancel():this.zQ(b)}else{if(e=d.jC())g=d,e=q.b,d=g.getWidth(),g=g.getHeight(),f=e.getWindowWidth(),e=e.getWindowHeight(),
e=!(d>f||g>e);e&&this.zQ(b)}}};dj.oib=function(a){var b=q.b.Na(a);if("FORM"==b||"BODY"==b)return!0;if(a=a.getAttribute("id"))if(a=a.split(":"),b=a.length,0<b)return bj.iJ==a[b-1];return!1};dj.uMa=function(a,b){return-2>a.top-b.top||-2>b.bottom-a.bottom||-2>a.left-b.left||2<a.right-b.right?!1:!0};dj.prototype.mua=function(a){var b=this.Uqa(a);if(b&&!(b instanceof Ge)){var d=b.Ha();if(C.Nb(d,a))return b.Hp(),!0}return!1};r.a("AdfDhtmlPositionManager.prototype.resizeFloatingElement",{mua:dj.prototype.mua});
dj.prototype.Uqa=function(a){for(var b=this.gj,d=0;d<b.length;d++)if(d in b){var e=b[d];if(e&&(e=e.element)){var f=e.Ha();if(C.Nb(f,a))return e}}return null};r.a("AdfDhtmlPositionManager.prototype.findFloatingElement",{Uqa:dj.prototype.Uqa});