function Ye(a,b,d,e){this.Init(a,b,d,e)}m("AdfAutoSuggestBehaviorImpl",Ye);
Ye.ga=function(){this.$c="_afrAutoSuggest";this.MK="data-afr-value";this.dfa="data-afr-label";this.rT="_afrautosuggestpopup";this.u6a="su";this.K5a="sm";this.e4a="_afrautosuggestcontainer";this.US="_afrautosuggestmorelink";this.Mda="_afrautosuggestbusydiv";this.f4a="AFAutoSuggestItemsContainer";this.j6a="AFAutoSuggestItem";this.G2a="AFAutoSuggestMoreLink";this.lza="AFAutoSuggestBusyStyle";m("AdfAutoSuggestBehaviorImpl.SUGGEST_BUSY_STYLE",Ye.lza)};m("AdfAutoSuggestBehaviorImpl.InitClass",Ye.ga);
r.v(Ye,Ja);Ye.prototype.Init=function(a,b,d,e){Ye.h.Init.call(this);this.pib=a;this.bNa=b;this.g6=d;this.J5=e};r.a("AdfAutoSuggestBehaviorImpl.prototype.Init",{Init:Ye.prototype.Init});Ye.prototype.Qa=function(a){A.c.ta(this,this.mB,a,0)};r.a("AdfAutoSuggestBehaviorImpl.prototype.initialize",{Qa:Ye.prototype.Qa});
Ye.prototype.mB=function(a){if(!A.c.Zg()){a.addEventListener(D.Ad,this.zdb,this);a.addEventListener(D.Bc,this.ydb,this);a.addEventListener(D.wb,this.wdb,this);a.addEventListener(D.Bd,this.Adb,this);a.addEventListener(D.Nd,this.vdb,this);a.addEventListener(D.Oc,this.xdb,this);this.mHa=!1;this.jX=0;this.N5={};this.mU=!1;var b=a.g();a=O.da(a);a.setAttribute("role","combobox");a.setAttribute("aria-autocomplete","list");a.setAttribute("aria-owns",I.la(b,Ye.rT));a.setAttribute("aria-expanded","false")}};
Ye.Za=function(a,b){return b.Za(a,Ye.$c)};m("AdfAutoSuggestBehaviorImpl.isPopupVisible",Ye.Za);Ye.pVa=function(a,b,d,e,f,g,h){var l=A.c.m(a);l&&(e&&1==e?l.t7=d:h==l.jX&&(e=l.GY(Ja))&&(e.N5[b]=d,e.Wn(l,b,a,d,!1,f,g)))};m("AdfAutoSuggestBehaviorImpl.showAutoSuggestPopup",Ye.pVa);m("AdfAutoSuggestBehaviorImpl.showAutoSuggestPopup",Ye.pVa);Ye.prototype.gZ=function(a){var b=O.da(a).value;if(0!=b.trim().length){var d=[];a=Ze(a.t7,b);Ye.qIa(a,d);Ye.qIa(this.N5[b],d);return d}};
r.a("AdfAutoSuggestBehaviorImpl.prototype.getSuggestedItems",{gZ:Ye.prototype.gZ});Ye.AGa=function(a,b,d,e){var f=a.createElement("div");d=I.la(d,Ye.Mda);f.setAttribute("id",d);e=e.getStyleClass(Ye.lza);C.w(f,e);liElement=a.createElement("li");liElement.appendChild(f);q.b.Ia(f);b.appendChild(liElement)};
Ye.LGa=function(a,b,d,e,f,g,h){if(!e&&f&&0<=f){Ye.NGa(a,b);e=a.createElement("a");e.setAttribute("href","#");var l=A.c.Y();f=q.b;l.zj&&f instanceof Ee?e.setAttribute("onclick","void(0); return false;"):e.setAttribute("onClick","return false");d=I.la(d,Ye.US);e.setAttribute("id",d);e.setAttribute(Ye.MK,g);e.setAttribute("role","option");g=a.createTextNode(h.Z("AFAutoSuggestMoreLinkLabel"));e.appendChild(g);C.w(e,Ye.G2a);liElement=a.createElement("li");liElement.appendChild(e);f.Ia(e);b.appendChild(liElement)}};
Ye.PGa=function(a,b,d,e,f,g){var h=A.c.Y(),l=q.b,h=h.zj&&l instanceof Ee;g=g.getStyleClass(Ye.j6a);var n=0;d=I.la(d,f?Ye.K5a:Ye.u6a);for(var t in e){f=a.createElement("li");f.setAttribute("role","option");f.setAttribute("id",d+n++);f.setAttribute(Ye.MK,e[t]);h&&f.setAttribute("onclick","void(0)");var y=t;f.setAttribute(Ye.dfa,y);f.appendChild(a.createTextNode(y));C.w(f,g);b.appendChild(f);l.Ia(f)}};Ye.NGa=function(a,b){var d=a.createElement("li");d.appendChild(a.createElement("hr"));b.appendChild(d)};
Ye.v9a=function(a){var b=q.b.getComputedStyle(a),b=parseInt(b.maxHeight,10),d=a.scrollHeight,e=A.c.Ka().La();a=C.Dc(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=""}};Ye.qIa=function(a,b){for(var d in a)if(a.hasOwnProperty(d)){var e=new kb(a[d],d);b.push(e)}};
Ye.vIa=function(a,b,d,e){var f=I.la(b,Ye.rT);b=I.la(b,Ye.e4a);a=O.da(a);var g=e.getElementById(b),h=A.c.H().getStyleClass(Ye.f4a);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");C.w(d,h);g.appendChild(d);a.parentNode.appendChild(g);e.Ia(g);return d};Ye.dma=function(a){return"option"==a.getAttribute("role")};Ye.JQa=function(a,b){var d=C.w;b||(d=C.O);d(a,I.Rq)};k=Ye.prototype;
k.xdb=function(a){a=a.getSource();if(!this.mHa){if(a&&a instanceof AdfUIEditableValue){var b=a.o();b.bind(a);b.E8&&b.E8(a)}this.mHa=!0}this.pib&&!a.t7&&Ib.F(a,"_autoSuggest",{Jwb:!0},!0,!0)};
k.Adb=function(a){var b=a.getSource(),d=b.o();d.bind(b);if(b&&b instanceof AdfUIEditableValue){var e=a.X(),f=e.getAttribute&&e.getAttribute(Ye.MK),g=O.da(b),h=b.g(),l=I.la(h,Ye.US);if(e.id==l)d.hv(),this.mU=!0;else if(f&&0<f.length)(e=e.getAttribute(Ye.dfa))&&0<e.length&&b.setProperty("_afrAutoSuggestLabel",e,!1,G.ld),g.value=f,e=b.getValue(),null==e&&(e=$e.ks(g)),d.nd(b,a.X()),f==e&&lc.F(b,e,b.getValue(),b.getAutoSubmit()),this.mU=!0;else for(a=I.la(h,Ye.rT),b=I.la(h,Ye.Mda);e;){if(e.id==a){this.mU=
!0;q.b.S()==q.ia&&d.hv();break}else if(e==g||e.id==b)break;e=e.parentNode}}};k.vdb=function(a){var b=this.qe;b&&(A.c.ic(b),delete this.qe);a=a.getSource();a.o().bind(a);A.c.ta(this,this.Mab,null,100);af(this);A.c.Yf().vm()==Qe.G0&&(a.jX=this.jX++)};
k.wdb=function(a){var b=a.getSource();if(b&&b instanceof AdfUIEditableValue){var d=b.o();d.bind(b);a=a.X();if(Ye.Za(b,d)){var e=a.getAttribute(Ye.MK),f=b.g(),f=I.la(f,Ye.US);a.id==f?(e&&0<e.length&&this.J5&&Pb.F(b,!0),b.focus()):e&&0<e.length&&(af(this),d.Jb(b,Ye.$c),b.focus())}}};
k.zdb=function(a){var b=q.b,d=b.na(a.U());if(d!=w.ub&&d!=w.vb){var e=void 0!==this.u7;af(this);var f=a.getSource();if(f&&f instanceof AdfUIEditableValue){var g=f.o();g.bind(f);var h=O.da(f);if(h){var l=h.value;if(0<l.replace(/\s*/,"").length){if(d==w.uz||void 0!=this.Dx&&l.length!=this.Dx||this.Fi&&this.Fi!=l)l=A.c,this.qe?l.Cs(this.qe,500):this.qe=l.ta(this,this.u$a,f,500,{isSynchronized:!0})}else 0==l.length&&Ye.Za(f,g)&&g.Jb(f,Ye.$c);delete this.Dx;delete this.Fi;l=f.g();switch(d){case w.jb:if(Ye.Za(f,
g)){d=I.la(l,Ye.US);if((e=bf(h))&&e==d)this.J5&&Pb.F(f,!0);else{var n;e&&(n=b.getElementById(e));n&&(b=n.getAttribute(Ye.dfa))&&0<b.length&&f.setProperty("_afrAutoSuggestLabel",b,!1,G.ld);b=f.getValue();null==b&&(b=$e.ks(h));g.nd(f,a.X());n&&n.getAttribute(Ye.MK)==b&&lc.F(f,b,f.getValue(),f.getAutoSubmit())}g.Jb(f,Ye.$c);a.cancel();a.wc()}break;case w.Ra:case w.ab:Ye.Za(f,g)&&(a=I.la(l,Ye.rT),a=b.getElementById(a),e&&(f=I.la(l,Ye.Mda),f=b.getElementById(f))&&(g=f.parentElement,n=C.lc(g),a.removeChild(g),
b.yc(f),a.removeChild(n)),this.e7(h,a,d==w.Ra))}}}}};k.ydb=function(a){var b=a.getSource();if(b&&b instanceof AdfUIEditableValue){var d=b.o();d.bind(b);var e=O.da(b);q.b.na(a.U())==w.jb&&Ye.Za(b,d)&&(b=b.g(),a=bf(e),b=I.la(b,Ye.US),a&&a==b&&d.hv());this.Dx=e.value.length;this.Fi=e.value}};k.Bdb=function(a){a=O.da(a);a.setAttribute("aria-expanded","false");a.removeAttribute("aria-activedescendant")};k.Cdb=function(a){O.da(a).setAttribute("aria-expanded","true")};
function bf(a){return a.getAttribute("aria-activedescendant")}k.u$a=function(a){this.qe=null;var b=a.o();b.bind(a);Ye.Za(a,b)&&b.Jb(a,Ye.$c);var b=O.da(a),d=b.value,e=this.N5[d];if(e)this.Wn(a,d,a.g(),e,!1,this.g6,this.J5);else if(d){e=!1;if(a.t7){var f=Ze(a.t7,d);(e=!E.zc(f))&&this.Wn(a,d,a.g(),f,!0,this.g6,this.J5)}d.length<this.bNa||(e?this.u7=A.c.ta(this,this.qOa,[a,d,b,this.g6],2E3,{isSynchronized:!0}):this.qOa([a,d,b,this.g6]))}};function af(a){var b=a.u7;b&&(A.c.ic(b),delete a.u7)}
k.qOa=function(a){delete this.u7;var b=A.c.H();if(a[1]){var d=a[0],e=d.o();e.bind(d);if(!Ye.Za(d,e)){var f=d.g(),g=O.da(d).ownerDocument,h=Ye.vIa(d,f,g,q.b);Ye.AGa(g,h,f,b);this.JN(d,e,f,h)}e=this.jX++;d.jX=e;Ib.F(a[0],"_autoSuggest",{submittedValue:a[1],emptyText:b.Z("AFAutoSuggestEmptyText"),maxSuggestedItems:a[3],requestId:e},!0,!0)}};function Ze(a,b){var d={},e;for(e in a)0==e.indexOf(b)&&(d[e]=a[e]);return d}
k.e7=function(a,b,d){var e,f,g=bf(a);g?(e=q.b.getElementById(g),f=d?C.x9(e,b,!0,Ye.dma):C.psa(e,b,Ye.dma)):d&&(f=C.Ou(b,!0,Ye.dma));f&&(e&&Ye.JQa(e,!1),Ye.JQa(f,!0),a.setAttribute("aria-activedescendant",f.id),f.scrollIntoView(),b=f.getAttribute(Ye.MK))&&(a.value=b)};
k.Wn=function(a,b,d,e,f,g,h){var l=a.o();l.bind(a);var n=I.la(d,Ye.rT),t=O.da(a),y=t.ownerDocument,z=q.b,B=A.c.H(),F=!e.hasOwnProperty(B.Z("AFAutoSuggestEmptyText"));if(Ye.Za(a,l)){n=z.getElementById(n);if(a=a=n.lastChild)z.yc(a),n.removeChild(a);Ye.PGa(y,n,d,e,f,B);F&&h&&Ye.LGa(y,n,d,f,g,b,B)}else n=Ye.vIa(a,d,y,z),Ye.PGa(y,n,d,e,f,B),1==f&&t.value.length>=this.bNa&&(Ye.NGa(y,n),Ye.AGa(y,n,d,B)),F&&h&&Ye.LGa(y,n,d,f,g,b,B),this.JN(a,l,d,n);Ye.v9a(n)};
k.JN=function(a,b,d,e){r.bb(AdfRichPopup);var f={type:"menu",autodismiss:"autodismissMenu",focus:!1,closeOnEscape:!0};f.closeHandler=this.D(this.Bdb);f.closeHandlerParam=a;f.openedHandler=this.D(this.Cdb);f.openedHandlerParam=a;f[AdfRichPopup.Ed]=AdfRichPopup.qf;f[AdfRichPopup.cg]=d;f[AdfRichPopup.Jf]=I.la(d,"content");b.He(a,e,f,Ye.$c)};k.Mab=function(){this.mU||(this.N5={});this.mU=!1};