function ve(a,b,d,e){this.Init(a,b,d,e)}v("AdfAutoSuggestBehaviorImpl",ve);
ve.da=function(){this.Ic="_afrAutoSuggest";this.ii="p_AFSelected";this.qF="data-afr-value";this.t6="data-afr-label";this.xM="_afrautosuggestpopup";this.NOa="su";this.qOa="sm";this.$Ma="_afrautosuggestcontainer";this.dM="_afrautosuggestmorelink";this.d5="_afrautosuggestbusydiv";this.aNa="AFAutoSuggestItemsContainer";this.MOa="AFAutoSuggestItem";this.ULa="AFAutoSuggestMoreLink";this.pma="AFAutoSuggestBusyStyle";v("AdfAutoSuggestBehaviorImpl.SUGGEST_BUSY_STYLE",ve.pma)};
v("AdfAutoSuggestBehaviorImpl.InitClass",ve.da);z.l(ve,Ma);ve.prototype.Init=function(a,b,d,e){ve.f.Init.call(this);this.gYa=a;this.Bxa=b;this.qY=d;this.VX=e};z.a("AdfAutoSuggestBehaviorImpl.prototype.Init",{Init:ve.prototype.Init});ve.prototype.za=function(a){F.c.oa(this,this.nx,a,0)};z.a("AdfAutoSuggestBehaviorImpl.prototype.initialize",{za:ve.prototype.za});
ve.prototype.nx=function(a){a.addEventListener(I.qd,this.NUa,this);a.addEventListener(I.ec,this.MUa,this);a.addEventListener(I.jb,this.KUa,this);a.addEventListener(I.Xc,this.OUa,this);a.addEventListener(I.Dd,this.JUa,this);a.addEventListener(I.tc,this.LUa,this);this.eta=p;this.OP=0;this.bY={};this.pN=p;var b=a.e();a=U.W(a);a.setAttribute("role","combobox");a.setAttribute("aria-autocomplete","list");a.setAttribute("aria-owns",M.Na(b,ve.xM));a.setAttribute("aria-expanded","false")};
ve.Qa=function(a,b){return b.Qa(a,ve.Ic)};v("AdfAutoSuggestBehaviorImpl.isPopupVisible",ve.Qa);ve.yEa=function(a,b,d,e,f,g,h){var m=F.c.j(a);if(m)if(e&&e==l)m.CZ=d;else if(h==m.OP&&(e=m.YQ(Ma)))e.bY[b]=d,e.Jl(m,b,a,d,p,f,g)};v("AdfAutoSuggestBehaviorImpl.showAutoSuggestPopup",ve.yEa);v("AdfAutoSuggestBehaviorImpl.showAutoSuggestPopup",ve.yEa);ve.prototype.vR=function(a){var b=U.W(a).value;if(0!=b.trim().length){var d=[];a=we(a.CZ,b);ve.Tta(a,d);ve.Tta(this.bY[b],d);return d}};
z.a("AdfAutoSuggestBehaviorImpl.prototype.getSuggestedItems",{vR:ve.prototype.vR});ve.vsa=function(a,b,d,e){var f=a.createElement("div");d=M.Na(d,ve.d5);f.setAttribute("id",d);e=e.getStyleClass(ve.pma);H.n(f,e);liElement=a.createElement("li");liElement.appendChild(f);w.b.wa(f);b.appendChild(liElement)};
ve.Gsa=function(a,b,d,e,f,g,h){if(!e&&f&&0<=f){ve.Hsa(a,b);e=a.createElement("a");e.setAttribute("href","#");var m=F.c.R();f=w.b;m.gj&&f instanceof ee?e.setAttribute("onclick","void(0); return false;"):e.setAttribute("onClick","return false");d=M.Na(d,ve.dM);e.setAttribute("id",d);e.setAttribute(ve.qF,g);e.setAttribute("role","option");g=a.createTextNode(h.V("AFAutoSuggestMoreLinkLabel"));e.appendChild(g);H.n(e,ve.ULa);liElement=a.createElement("li");liElement.appendChild(e);f.wa(e);b.appendChild(liElement)}};
ve.Jsa=function(a,b,d,e,f,g){var h=F.c.R(),m=w.b,h=h.gj&&m instanceof ee;g=g.getStyleClass(ve.MOa);var q=0;d=M.Na(d,f?ve.qOa:ve.NOa);for(var s in e){f=a.createElement("li");f.setAttribute("role","option");f.setAttribute("id",d+q++);f.setAttribute(ve.qF,e[s]);h&&f.setAttribute("onclick","void(0)");var y=s;f.setAttribute(ve.t6,y);f.appendChild(a.createTextNode(y));H.n(f,g);b.appendChild(f);m.wa(f)}};ve.Hsa=function(a,b){var d=a.createElement("li"),e=a.createElement("hr");d.appendChild(e);b.appendChild(d)};
ve.sRa=function(a){var b=w.b.getComputedStyle(a),b=parseInt(b.maxHeight,10),d=a.scrollHeight,e=F.c.Ma().Oa();a=H.Tc(a);for(var f=0;f<a.length;f++){var g=a[f];d>b?e?g.style.paddingLeft="20px":g.style.paddingRight="20px":e?g.style.paddingLeft="":g.style.paddingRight=""}};ve.Tta=function(a,b){for(var d in a)if(a.hasOwnProperty(d)){var e=new gb(a[d],d);b.push(e)}};
ve.Xta=function(a,b,d,e){var f=M.Na(b,ve.xM);b=M.Na(b,ve.$Ma);a=U.W(a);var g=e.getElementById(b),h=F.c.u().getStyleClass(ve.aNa);g?g.innerHTML="":(g=d.createElement("div"),g.setAttribute("id",b),g.style.display="none");d=d.createElement("ul");d.setAttribute("id",f);d.setAttribute("role","listbox");H.n(d,h);g.appendChild(d);a.parentNode.appendChild(g);e.wa(g);return d};ve.dba=function(a){return"option"==a.getAttribute("role")};ve.GAa=function(a,b){var d=H.n;b||(d=H.F);d(a,ve.ii)};u=ve.prototype;
u.LUa=function(a){a=a.getSource();if(!this.eta){if(a&&a instanceof AdfUIEditableValue){var b=a.k();b.bind(a);b.E_&&b.E_(a)}this.eta=l}this.gYa&&!a.CZ&&Cb.v(a,"_autoSuggest",{y$a:l},l,l)};
u.OUa=function(a){var b=a.getSource(),d=b.k();d.bind(b);if(b&&b instanceof AdfUIEditableValue){var e=a.Q(),f=e.getAttribute&&e.getAttribute(ve.qF),g=U.W(b),h=b.e(),m=M.Na(h,ve.dM);if(e.id==m)d.hv(),this.pN=l;else if(f&&0<f.length)(e=e.getAttribute(ve.t6))&&0<e.length&&b.setProperty("_afrAutoSuggestLabel",e,p,J.rd),g.value=f,e=b.getValue(),e==n&&(e=xe.ly(g)),d.Yf(b,a.Q()),f==e&&ic.v(b,e,b.getValue(),b.getAutoSubmit()),this.pN=l;else{a=M.Na(h,ve.xM);for(b=M.Na(h,ve.d5);e;){if(e.id==a){this.pN=l;w.b.G()==
w.aa&&d.hv();break}else if(e==g||e.id==b)break;e=e.parentNode}}}};u.JUa=function(a){var b=this.Id;b&&(F.c.ac(b),delete this.Id);a=a.getSource();a.k().bind(a);F.c.oa(this,this.KSa,n,100);ye(this);F.c.yf().Ok()==oe.yT&&(a.OP=this.OP++)};
u.KUa=function(a){var b=a.getSource();if(b&&b instanceof AdfUIEditableValue){var d=b.k();d.bind(b);a=a.Q();if(ve.Qa(b,d)){var e=a.getAttribute(ve.qF),f=b.e(),f=M.Na(f,ve.dM);a.id==f?(e&&0<e.length&&this.VX&&Ib.v(b,l),b.focus()):e&&0<e.length&&(ye(this),d.ob(b,ve.Ic),b.focus())}}};
u.NUa=function(a){var b=w.b,d=b.ia(a.L());if(!(d==E.Kb||d==E.Lb)){var e=this.DZ!==k;ye(this);var f=a.getSource();if(f&&f instanceof AdfUIEditableValue){var g=f.k();g.bind(f);var h=U.W(f);if(h){var m=h.value;if(0<m.replace(/\s*/,"").length){if(d==E.FS||this.cu!=k&&m.length!=this.cu||this.tba&&this.tba!=m)m=F.c,this.Id?m.XR(this.Id,500):this.Id=m.oa(this,this.fSa,f,500,{isSynchronized:l})}else 0==m.length&&ve.Qa(f,g)&&g.ob(f,ve.Ic);delete this.cu;delete this.tba;m=f.e();switch(d){case E.$a:if(ve.Qa(f,
g)){var q=M.Na(m,ve.dM),s=ze(h);if(s&&s==q)this.VX&&Ib.v(f,l);else{var y;s&&(y=b.getElementById(s));y&&(b=y.getAttribute(ve.t6))&&0<b.length&&f.setProperty("_afrAutoSuggestLabel",b,p,J.rd);b=f.getValue();b==n&&(b=xe.ly(h));g.Yf(f,a.Q());y&&y.getAttribute(ve.qF)==b&&ic.v(f,b,f.getValue(),f.getAutoSubmit())}g.ob(f,ve.Ic);a.cancel();a.dc()}break;case E.Ja:case E.Ya:if(ve.Qa(f,g)){a=M.Na(m,ve.xM);a=b.getElementById(a);if(e&&(f=M.Na(m,ve.d5),f=b.getElementById(f)))g=f.parentElement,y=H.nc(g),a.removeChild(g),
b.gc(f),a.removeChild(y);b=d==E.Ja;(d=ze(h))?(q=w.b.getElementById(d),s=b?H.l0(q,a,l,ve.dba):H.vga(q,a,ve.dba)):b&&(s=H.Lu(a,l,ve.dba));if(s&&(q&&ve.GAa(q,p),ve.GAa(s,l),h.setAttribute("aria-activedescendant",s.id),s.scrollIntoView(),b=s.getAttribute(ve.qF)))h.value=b}}}}}};
u.MUa=function(a){var b=a.getSource();if(b&&b instanceof AdfUIEditableValue){var d=b.k();d.bind(b);var e=U.W(b);w.b.ia(a.L())==E.$a&&ve.Qa(b,d)&&(b=b.e(),a=ze(e),b=M.Na(b,ve.dM),a&&a==b&&d.hv());this.cu=e.value.length;this.tba=e.value}};u.PUa=function(a){a=U.W(a);a.setAttribute("aria-expanded","false");a.removeAttribute("aria-activedescendant")};u.QUa=function(a){U.W(a).setAttribute("aria-expanded","true")};function ze(a){return a.getAttribute("aria-activedescendant")}
u.fSa=function(a){this.Id=n;var b=a.k();b.bind(a);ve.Qa(a,b)&&b.ob(a,ve.Ic);var b=U.W(a),d=b.value,e=this.bY[d];if(e)this.Jl(a,d,a.e(),e,p,this.qY,this.VX);else if(d){e=p;if(a.CZ){var f=we(a.CZ,d);(e=!ya.Bc(f))&&this.Jl(a,d,a.e(),f,l,this.qY,this.VX)}d.length<this.Bxa||(e?this.DZ=F.c.oa(this,this.Kya,[a,d,b,this.qY],2E3,{isSynchronized:l}):this.Kya([a,d,b,this.qY]))}};function ye(a){var b=a.DZ;b&&(F.c.ac(b),delete a.DZ)}
u.Kya=function(a){delete this.DZ;var b=F.c.u();if(a[1]){var d=a[0],e=d.k();e.bind(d);if(!ve.Qa(d,e)){var f=d.e(),g=U.W(d).ownerDocument,h=ve.Xta(d,f,g,w.b);ve.vsa(g,h,f,b);this.NH(d,e,f,h)}e=this.OP++;d.OP=e;Cb.v(a[0],"_autoSuggest",{submittedValue:a[1],emptyText:b.V("AFAutoSuggestEmptyText"),maxSuggestedItems:a[3],requestId:e},l,l)}};function we(a,b){var d={},e;for(e in a)0==e.indexOf(b)&&(d[e]=a[e]);return d}
u.Jl=function(a,b,d,e,f,g,h){var m=a.k();m.bind(a);var q=M.Na(d,ve.xM),s=U.W(a),y=s.ownerDocument,A=w.b,C=F.c.u(),G=!e.hasOwnProperty(C.V("AFAutoSuggestEmptyText"));if(ve.Qa(a,m)){q=A.getElementById(q);if(a=a=q.lastChild)A.gc(a),q.removeChild(a);ve.Jsa(y,q,d,e,f,C);G&&h&&ve.Gsa(y,q,d,f,g,b,C)}else q=ve.Xta(a,d,y,A),ve.Jsa(y,q,d,e,f,C),f==l&&s.value.length>=this.Bxa&&(ve.Hsa(y,q),ve.vsa(y,q,d,C)),G&&h&&ve.Gsa(y,q,d,f,g,b,C),this.NH(a,m,d,q);ve.sRa(q)};
u.NH=function(a,b,d,e){z.kb(AdfRichPopup);var f={type:"menu",autodismiss:"autodismissMenu",focus:p,closeOnEscape:l};f.closeHandler=this.o(this.PUa);f.closeHandlerParam=a;f.openedHandler=this.o(this.QUa);f.openedHandlerParam=a;f[AdfRichPopup.fd]=AdfRichPopup.of;f[AdfRichPopup.Cf]=d;f[AdfRichPopup.pf]=M.Na(d,"content");b.fe(a,e,f,ve.Ic)};u.KSa=function(){this.pN||(this.bY={});this.pN=p};