/**
 * Copyright (c) 2014, 2016, Oracle and/or its affiliates.
 * The Universal Permissive License (UPL), Version 1.0
 */
"use strict";
/*
 Copyright 2012 Igor Vaynberg

 This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
 General Public License version 2 (the "GPL License"). You may choose either license to govern your
 use of this software only upon the condition that you accept all of the terms of either the Apache
 License or the GPL License.

 You may obtain a copy of the Apache License and the GPL License at:

 http://www.apache.org/licenses/LICENSE-2.0
 http://www.gnu.org/licenses/gpl-2.0.html

 Unless required by applicable law or agreed to in writing, software distributed under the
 Apache License or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
 the specific language governing permissions and limitations under the Apache License and the GPL License.
 Copyright 2012 Igor Vaynberg

 This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
 General Public License version 2 (the "GPL License"). You may choose either license to govern your
 use of this software only upon the condition that you accept all of the terms of either the Apache
 License or the GPL License.

 You may obtain a copy of the Apache License and the GPL License at:

 http://www.apache.org/licenses/LICENSE-2.0
 http://www.gnu.org/licenses/gpl-2.0.html

 Unless required by applicable law or agreed to in writing, software distributed under the
 Apache License or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
 the specific language governing permissions and limitations under the Apache License and the GPL License.
 Copyright 2012 Igor Vaynberg

 This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
 General Public License version 2 (the "GPL License"). You may choose either license to govern your
 use of this software only upon the condition that you accept all of the terms of either the Apache
 License or the GPL License.

 You may obtain a copy of the Apache License and the GPL License at:

 http://www.apache.org/licenses/LICENSE-2.0
 http://www.gnu.org/licenses/gpl-2.0.html

 Unless required by applicable law or agreed to in writing, software distributed under the
 Apache License or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
 the specific language governing permissions and limitations under the Apache License and the GPL License.
 Copyright 2012 Igor Vaynberg

 This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
 General Public License version 2 (the "GPL License"). You may choose either license to govern your
 use of this software only upon the condition that you accept all of the terms of either the Apache
 License or the GPL License.

 You may obtain a copy of the Apache License and the GPL License at:

 http://www.apache.org/licenses/LICENSE-2.0
 http://www.gnu.org/licenses/gpl-2.0.html

 Unless required by applicable law or agreed to in writing, software distributed under the
 Apache License or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
 the specific language governing permissions and limitations under the Apache License and the GPL License.
 Copyright 2012 Igor Vaynberg

 This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
 General Public License version 2 (the "GPL License"). You may choose either license to govern your
 use of this software only upon the condition that you accept all of the terms of either the Apache
 License or the GPL License.

 You may obtain a copy of the Apache License and the GPL License at:

 http://www.apache.org/licenses/LICENSE-2.0
 http://www.gnu.org/licenses/gpl-2.0.html

 Unless required by applicable law or agreed to in writing, software distributed under the
 Apache License or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
 the specific language governing permissions and limitations under the Apache License and the GPL License.
 Copyright 2012 Igor Vaynberg

 This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
 General Public License version 2 (the "GPL License"). You may choose either license to govern your
 use of this software only upon the condition that you accept all of the terms of either the Apache
 License or the GPL License.

 You may obtain a copy of the Apache License and the GPL License at:

 http://www.apache.org/licenses/LICENSE-2.0
 http://www.gnu.org/licenses/gpl-2.0.html

 Unless required by applicable law or agreed to in writing, software distributed under the
 Apache License or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
 the specific language governing permissions and limitations under the Apache License and the GPL License.
 Copyright 2012 Igor Vaynberg

 This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
 General Public License version 2 (the "GPL License"). You may choose either license to govern your
 use of this software only upon the condition that you accept all of the terms of either the Apache
 License or the GPL License.

 You may obtain a copy of the Apache License and the GPL License at:

 http://www.apache.org/licenses/LICENSE-2.0
 http://www.gnu.org/licenses/gpl-2.0.html

 Unless required by applicable law or agreed to in writing, software distributed under the
 Apache License or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
 the specific language governing permissions and limitations under the Apache License and the GPL License.
*/
define(["ojs/ojcore","jquery","ojs/ojeditablevalue"],function(a,f){var b={iv:"oj-select-options-generated",Ga:{TAB:9,ENTER:13,kF:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,vQ:16,x6:17,s6:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,fF:8,IP:46,hO:function(a){switch(a.which){case b.Ga.vQ:case b.Ga.x6:case b.Ga.s6:return!0}return a.metaKey||a.ctrlKey?!0:!1},kO:function(b){b=b.which?b.which:b;return 112<=b&&123>=b}},A6:70,js:{MP:"enter_pressed",i7:"option_selected",DP:"blur",n7:"search_icon_clicked"},pO:{x:0,
y:0},Su:function(){var b=1;return function(){return b++}}(),u5:null,um:function(b,a){for(var d=f.isFunction(b[0])?f(b[0]()):f(b[0]),c=-1,e=b.length;++c<e&&(d.context=d[0]=f.isFunction(b[0])?b[c]():b[c])&&!1!==a.call(d[0],c,d););return b},Vpa:function(){var b=f("\x3cdiv class\x3d'oj-listbox-measure-scrollbar'\x3e\x3c/div\x3e");b.appendTo("body");var a={width:b.width()-b[0].clientWidth,height:b.height()-b[0].clientHeight};b.remove();return a},Um:function(b,a){var d,c,e;if(null===b||1>b.length)return[];
d=b.split(a);c=0;for(e=d.length;c<e;c+=1)d[c]=f.trim(d[c]);return d},B3:function(b){return b.outerWidth(!1)-b.width()},Dpa:function(a){a.on("keydown",function(){void 0===f.data(a,"keyup-change-value")&&f.data(a,"keyup-change-value",a.val())});a.on("keyup",function(d){d.which===b.Ga.ENTER?d.stopPropagation():(d=f.data(a,"keyup-change-value"),void 0!==d&&a.val()!==d&&(f.removeData(a,"keyup-change-value"),a.trigger("keyup-change")))})},Cpa:function(a){a.on("mousemove",function(a){var d=b.pO;if(void 0===
d||d.x!==a.pageX||d.y!==a.pageY)f(a.target).trigger("mousemove-filtered",a),b.pO.x=a.pageX,b.pO.y=a.pageY})},$qa:function(b){var a=!1,d;return function(){!1===a&&(d=b(),a=!0);return d}},ng:function(b){b[0]!==document.activeElement&&window.setTimeout(function(){var a=b[0],d=b.val().length;b.focus();b.is(":visible")&&a===document.activeElement&&(a.setSelectionRange?a.setSelectionRange(d,d):a.createTextRange&&(a=a.createTextRange(),a.collapse(!1),a.select()))},40)},Foa:function(b){b=f(b)[0];var a=0,
d=0;"selectionStart"in b?(a=b.selectionStart,d=b.selectionEnd-a):"selection"in document&&(b.focus(),a=document.selection.createRange(),d=document.selection.createRange().text.length,a.moveStart("character",-b.value.length),a=a.text.length-d);return{offset:a,length:d}},Cd:function(b){b.preventDefault();b.stopPropagation()},Npa:function(b){b.preventDefault();b.stopImmediatePropagation()},Asa:function(b){var a={"\\":"\x26#92;","\x26":"\x26amp;","\x3c":"\x26lt;","\x3e":"\x26gt;",'"':"\x26quot;","'":"\x26#39;"};
return String(b).replace(/[&<>"'\\]/g,function(b){return a[b]})},Qpa:function(a,d){function c(b){return""+b.label}var e=a,g,h;f.isArray(e)&&(h=e,e={jb:h});!1===f.isFunction(e)&&(h=e,e=function(){return h});var k=e();k&&k.text&&(c=k.text,f.isFunction(c)||(g=k.text,c=function(b){return b[g]}));return function(a){var g={jb:[]};""!==a.kp||d?(e()&&b.um(f(e().jb),function(e,f){b.eL(a,f,g.jb,d,!0,c)}),a.Db(g)):a.Db(e())}},oN:function(a,d,c,e){var g=f("\x3coption\x3e");g.addClass("oj-listbox-result oj-listbox-result-selectable oj-listbox-results-depth-"+
a);g.attr("role","option");g.attr("id","oj-listbox-result-label-"+b.Su());g.text(e(c));g.attr("value",d);return g},u2:function(b,a,d){var c=f("\x3coptgroup\x3e");c.addClass("oj-listbox-results-sub");c.attr("label",d(a));b.addClass("oj-listbox-result-with-children");return c},Ppa:function(a,d,c){function e(a,d,g){var h,k,p,m;d.each(function(){k=f(this);k.is("li")&&(0<k.children("ul").length?(p=k.contents().filter(function(){return 1!==this.nodeType||"ul"!==this.tagName.toLowerCase()}).text(),h=b.u2(a,
p,c),m=k.children("ul"),e(h,m.children(),g+1)):h=b.oN(g,k.attr("oj-data-value"),k.text(),c),h.appendTo(a))})}e(a,d,0)},sO:function(b,a,d){d=a[d]||d;return b[d]},U1:function(a,d,c,e){function g(a,d,e,f){for(var h,q,k,p=0,m=d.length;p<m;p++)h=d[p],k=b.sO(h,f,"children"),q=b.sO(h,f,"label"),k&&0<k.length?(q=b.u2(a,q,c),g(q,k,e+1,f.childKeys||{})):(k=b.sO(h,f,"value"),q=b.oN(e,k,q,c)),q.appendTo(a)}g(a,d,0,e||{})},h2:function(b){b.children().remove();b.removeClass("oj-listbox-result-with-children")},
pqa:function(a,d){return function(c){var e={component:this.V};c.value?e.value=c.value:e.term=c.kp||"";a(e).then(function(a){var e={jb:[]};a&&b.um(f(a),function(a,g){b.eL(c,g,e.jb,d,!1)});c.Db(e)})}},eL:function(a,d,c,e,g,h){var k,m;d=d[0];!d.label&&e&&e.label&&(d.label=d[e.label]);!d.value&&e&&e.value&&(d.value=d[e.value]);!d.children&&e&&e.children&&(d.children=d[e.children],delete d[e.children]);if(d.children){k={};for(m in d)d.hasOwnProperty(m)&&(k[m]=d[m]);k.children=[];b.um(f(d.children),function(d,
c){b.eL(a,c,k.children,e&&e.childKeys?e.childKeys:null,g,h)});(!g||k.children.length||a.Zo(a.kp,h(k),d))&&c.push(k)}else g&&!a.Zo(a.kp,h(d),d)||c.push(d)},Dna:function(b,a,d){if(f.isFunction(a))return!0;if(!a)return!1;throw Error(d+" must be a function or a false value");},Ko:function(b,d){function c(){}a.b.ga(c,b,"");c.prototype=f.extend(c.prototype,d);return c},fQ:"last-query-result",p3:function(a){return f.data(a.ra,a.za+"-"+b.fQ)},Bqa:function(a,d){f.data(a.ra,a.za+"-"+b.fQ,d)}},d=b.Ko(Object,
{Vc:function(b){var a=this;return function(){b.apply(a,arguments)}},_init:function(a){var d,c=this.za,e=this.Wc;this.V=a.V;this.U=a=this.qo(a);this.id=a.id;this.V3=!1;void 0!==a.element.data(e)&&null!==a.element.data(e)&&a.element.data(e)._destroy();this.ra=this.rw();var g=this.U.rootAttributes;this.qm=g&&g.id?g.id:"ojChoiceId_"+(a.element.attr("id")||"autogen"+b.Su());this.qm.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1");this.ra.attr("id",this.qm);this.body=b.$qa(function(){return a.element.closest("body")});
this.ra.attr("style",a.element.attr("style"));this.tN=this.U.element.attr("tabindex");this.U.element.data(e,this).attr("tabindex","-1").before(this.ra);this.ra.data(e,this);this.vc=this.ra.find(".oj-listbox-drop");this.vc.data("ojlistbox",this);this.vc.attr("data-oj-containerid",this.qm);this.jb=this.ra.find(".oj-listbox-results");this.jb.on("click",b.Cd);a.list&&f("#"+a.list).is("ul")&&(e=f("#"+a.list),this.F2=e.parent(),e.addClass("oj-listbox-results").attr("role","listbox"),this.jb.replaceWith(e),
this.jb=this.ra.find(".oj-listbox-results"),this.jb.css("display",""));this.search=d="oj-select"==c?this.ra.find("input.oj-listbox-input"):this.ra.find("input."+c+"-input");this.$O=this.j5=0;this.context=null;this.qC();this.ra.on("click",b.Cd);b.Cpa(this.jb);this.vc.on("mousemove-filtered touchstart touchmove touchend",".oj-listbox-results",this.Vc(this.WX));f(this.ra).on("change","."+c+"-input",function(b){b.stopPropagation()});f(this.vc).on("change","."+c+"-input",function(b){b.stopPropagation()});
var h=this;b.Dpa(d);d.on("keyup-change input paste",this.Vc(this.qu));d.on("focus",function(){d.addClass(c+"-focused");"oj-select"!==c&&h.ra.addClass("oj-focus")});d.on("blur",function(){d.removeClass(c+"-focused");"oj-select"!==c&&h.ra.removeClass("oj-focus")});this.vc.on("mouseup",".oj-listbox-results",this.Vc(function(b){0<f(b.target).closest(".oj-listbox-result-selectable").length&&(this.WX(b),this.IL(null,b))}));this.vc.on("click mouseup mousedown",function(b){b.stopPropagation()});f.isFunction(this.U.So)&&
this.Dq();e=a.element.prop("disabled");void 0===e&&(e=!1);this.mj(!e);e=a.element.prop("readonly");void 0===e&&(e=!1);this.Kx(e);b.u5=b.u5||b.Vpa();this.autofocus=a.element.prop("autofocus");a.element.prop("autofocus",!1);this.autofocus&&this.ng()},PH:function(b){var a=this.vc;!f(b.target).closest(a).length&&!f(b.target).closest("#"+a.attr("data-oj-containerid")).length&&0<a.length&&(a=a.data("ojlistbox"),a.close(b))},Xq:function(){this.vc&&this.vc.remove()},_destroy:function(){var b=this.Kn;isNaN(b)||
(delete this.Kn,window.clearTimeout(b));var b=this.U.element,a=b.data(this.Wc);this.close();this.i5&&(delete this.i5,this.i5=null);this.U.list&&this.jb&&(this.LH(this.jb),this.F2&&this.F2.append(this.jb));void 0!==a&&(a.ra.remove(),a.vc.remove(),b.removeAttr("aria-hidden").removeData(this.Wc).off("."+this.za).prop("autofocus",this.autofocus||!1),this.tN?b.attr({cta:this.tN}):b.removeAttr("tabindex"),b.show())},LH:function(b){if(b&&b.is("ul")){b.removeClass("oj-listbox-results oj-listbox-result-sub");
b.removeAttr("role");for(var a=b.children().length-1;0<=a;a--)this.LH(f(b.children()[a]))}else b.is("li")&&((b.hasClass("oj-listbox-placeholder")||b.hasClass("oj-listbox-no-results"))&&b.remove(),b.attr("class")&&b.attr("class",b.attr("class").replace(/\oj-listbox-\S+/g,"")),(a=b.children(".oj-listbox-result-label"))&&a.contents().unwrap(),"none"==b.css("display")&&b.css("display",""),this.LH(b.children("ul")))},Kq:function(b){if(b.is("option"))return{value:b.prop("value"),label:b.text(),element:b.get(),
css:b.attr("class"),disabled:b.prop("disabled"),locked:"locked"===b.attr("locked")||!0===b.data("locked")};if(b.is("optgroup"))return{label:b.attr("label"),children:[],element:b.get(),css:b.attr("class")};if(b.is("li")){var a,d=null;(a=b.children())&&0<a.length&&a.is("ul")?(a=b.attr("oj-data-label")?b.attr("oj-data-label"):b.clone().children().remove().end().text().trim(),d=[]):a=b.attr("oj-data-label")?b.attr("oj-data-label"):b.text().trim();return{value:b.attr("oj-data-value"),label:a,element:b.get(),
css:b.attr("class"),children:d}}},qo:function(a){var d,e,g=this;a.options&&Array.isArray(a.options)&&a.optionsKeys&&(a.options=f.extend(!0,[],a.options));d=a.element;var h=d.get(0).tagName.toLowerCase();"input"===h&&d.attr("list")?this.Uk=e=f("#"+d.attr("list")):"select"===h&&0<d.children().length?this.Uk=e=d:a.list&&(this.Uk=e=f("#"+a.list));a=f.extend({},{gqa:function(d,c,e,h){var k,m=this.U.id,l=this.U.optionRenderer;"function"!==typeof l&&(l=null);k=function(d,c,h,t,n){function r(b,c){if(l){var g=
{index:x,depth:t,leaf:!c.children,parent:d,data:c,component:a.V,parentElement:b.get(0)},g=l.call(a.V,g);null!==g&&(null===g.parentNode||g.parentNode instanceof DocumentFragment)&&b.appendChild(g)}else N=a.O2(c),void 0!==N&&b.text(N);!0!==e.qE&&(g=b.find(".oj-listbox-highlighter-section"),g.length||(g=b),v(g,e.kp))}function v(b,a){function d(b,a){var c=0;if(3===b.nodeType){var e=b.data.toUpperCase().indexOf(a);if(0<=e){c=document.createElement("span");c.className="oj-listbox-highlighter";e=b.splitText(e);
e.splitText(a.length);var g=e.cloneNode(!0);c.appendChild(g);e.parentNode.replaceChild(c,e);c=1}}else if(1===b.nodeType&&b.childNodes&&!/(script|style)/i.test(b.tagName))for(e=0;e<b.childNodes.length;++e)e+=d(b.childNodes[e],a);return c}b.length&&a&&a.length&&b.each(function(){d(this,a.toUpperCase())})}function s(b,a){if(a.children&&0<a.children.length){var d=a.element&&f(a.element[0]).is("li")&&f(a.element[0]).children("ul"),c=d?f(a.element[0]).children("ul"):f("\x3cul\x3e\x3c/ul\x3e");c.hasClass("oj-listbox-result-sub")||
c.addClass("oj-listbox-result-sub");k(a,a.children,c,t+1,!1);d||b.append(c)}}var x,w,K,I,D,N;w=g.$n();n&&null!==w&&!e.kp&&0>=h.find(".oj-listbox-placeholder").length&&(w={value:"",label:w},D=f("\x3cli\x3e\x3c/li\x3e"),D.addClass("oj-listbox-placeholder oj-listbox-results-depth-0 oj-listbox-result oj-listbox-result-selectable"),D.attr("role","presentation"),K=f(document.createElement("div")),K.addClass("oj-listbox-result-label"),K.attr("id","oj-listbox-result-label-"+b.Su()),K.attr("role","option"),
N=a.O2(w),void 0!==N&&K.text(N),D.append(K),D.data(g.Wc,w),h.prepend(D));x=0;for(n=c.length;x<n;x+=1){w=c[x];I=!0===w.disabled;K=!I&&void 0!==m(w);var O=w.element&&f(w.element[0]).is("li");D=O?f(w.element[0]):f("\x3cli\x3e\x3c/li\x3e");D.hasClass("oj-listbox-result")?(w.children&&0<w.children.length&&s(D,w),f(w.element[0]).css("display","")):(D.addClass("oj-listbox-results-depth-"+t),D.addClass("oj-listbox-result"),D.addClass(K?"oj-listbox-result-selectable":"oj-listbox-result-unselectable"),I&&D.addClass("oj-disabled"),
w.children&&D.addClass("oj-listbox-result-with-children"),D.attr("role","presentation"),K=f(document.createElement("div")),K.addClass("oj-listbox-result-label"),K.attr("id","oj-listbox-result-label-"+b.Su()),K.attr("role","option"),I&&K.attr("aria-disabled","true"),O||(r(K,w),D.append(K)),w.children&&0<w.children.length&&s(D,w),D.data(g.Wc,w),O?(f(w.element[0]).contents().filter(function(){return"UL"!==this.tagName}).wrapAll(K),f(w.element[0]).css("display","")):h.append(D))}};k(null,c,d,0,h)}},c,
a);a.id=function(b){return b.value};a.O2=function(b){return isNaN(b.label)?b.label:this.V.iq(b.label)};a.FN=function(b){return b&&b.label?isNaN(b.label)?b.label:this.V.iq(b.label):void 0};"select"!==h&&null!==a.manageNewEntry&&(a.manageNewEntry=function(b){var a={};a.value=a.label=f.trim(b);return a});e?a.Dr=this.Vc(function(a){var d={jb:[],Osa:!1},c=a.kp,f,h;h=function(d,e){var f,k=d.children()&&0<d.children().length&&d.children().is("ul");if(d.is("option")||d.is("li")&&!k)a.Zo(c,d.text(),d)&&e.push(g.Kq(d));
else if(d.is("optgroup")||d.is("li")&&k)f=g.Kq(d),b.um(d.is("optgroup")?d.children():d.children("ul").children(),function(b,a){h(a,f.children)}),0<f.children.length&&e.push(f)};f=e.children();void 0!==this.$n()&&0<f.length&&""==f.first().attr("value")&&(f=f.slice(1));b.um(f,function(b,a){h(a,d.jb)});a.Db(d)}):"options"in a&&(a.Dr=f.isFunction(a.options)?b.pqa(a.options,a.optionsKeys?a.optionsKeys:null):b.Qpa(a.options,a.optionsKeys?a.optionsKeys:null));return a},Eba:function(){var b=this.U.element.find(".oj-listbox-header");
if(b.length){this.header=f("\x3cli\x3e",{"class":"oj-listbox-result-header oj-listbox-result-unselectable",role:"presentation"});this.header.append(b.children());this.hha();b=f("\x3cul\x3e",{"class":"oj-listbox-results-with-header",role:"listbox"});b.append(this.header);b.appendTo(this.jb.parent());var a=f("\x3cli\x3e",{role:"presentation"});b.append(a);this.jb.attr("role","presentation");this.jb.appendTo(a)}this.V3=!0},hha:function(){this.Sh=this.header.find("li[role\x3d'option'], li:not([role])");
this.Sh.uniqueId();this.header.find("ul").attr("role","presentation");this.header.find("li:not([role])").attr("role","option");this.header.find("a, input, select, textarea, button, object, .oj-component-initnode").each(function(){f(this).attr("tabIndex",-1)})},wY:function(b){var a=!1;this.Sh.each(function(){if(f(this).attr("id")===b)return a=!0,!1});return a},Aea:function(b){if(!this.Sh)return null;if(!b)return this.Sh.first();var a=!1,d=null;this.Sh.each(function(){if(a)return d=f(this),!1;a=f(this).attr("id")===
b});return d},Oea:function(b){if(!this.Sh)return null;var a=null;this.Sh.each(function(){if(f(this).attr("id")===b)return!1;a=f(this)});return a},nla:function(b){var a=b.find(".oj-component .oj-enabled").first();0===a.length&&(a=b.find("a, input, select, textarea, button, object, .oj-component-initnode").first(),0===a.length&&(a=b.children().first()));a&&a.addClass("oj-focus")},nka:function(){this.Sh&&this.Sh.find(".oj-focus").removeClass("oj-focus")},y1:function(b){b=f.Event(this.Wc+"-selecting",
{val:this.id(b),object:b});this.U.element.trigger(b);return!b.isDefaultPrevented()},Ck:function(){return!0===this.G2},et:function(){var b=this.ft&&!this.Kx;if(b===this.G2)return!1;this.ra.toggleClass("oj-disabled",!b);this.close();this.G2=b;return!0},mj:function(b){void 0===b&&(b=!0);this.ft!==b&&(this.ft=b,this.U.element.prop("disabled",!b),this.ra.toggleClass("oj-enabled",b),this.et())},oI:function(){this.mj(!1)},Kx:function(b){void 0===b&&(b=!1);if(this.Kx===b)return!1;this.Kx=b;this.U.element.prop("readonly",
b);this.et();return!0},nd:function(){return this.ra.hasClass("oj-listbox-dropdown-open")},Wda:function(){return this.ra.children().first()},qy:function(b,d){if(a.oc.fO(d))this.Kn=window.setTimeout(f.proxy(this.close,this),1);else{var c=this.ra,e=d.element.element;e.css(b);"bottom"===d.vertical?(c.addClass("oj-listbox-drop-above"),e.addClass("oj-listbox-drop-above")):(c.removeClass("oj-listbox-drop-above"),e.removeClass("oj-listbox-drop-above"))}},kW:function(){var b={my:"start top",at:"start bottom",
of:this.Wda(),collision:"flip",using:f.proxy(this.qy,this)},d="rtl"===a.v.zm();return a.oc.Hg(b,d)},cL:function(){var b=this.vc,a=this.kW();b.css("width",this.ra.outerWidth());b.position(a)},Vla:function(b){return this.nd()||!1===this.ft||!0===this.Kx?!1:this.V._trigger("beforeExpand",b,{component:this.U.element})},aU:function(){this.ra.removeClass("oj-listbox-drop-above");this.vc.removeClass("oj-listbox-drop-above")},open:function(b,a){if(!this.Vla(b))return!1;this.Jq(b,a);return!0},Jq:function(){this.V3||
this.Eba();this.ra.addClass("oj-listbox-dropdown-open")},hD:function(){if(this.nd()&&"true"!==this.Ql().attr("aria-expanded")){this.aU();this.vc[0]!==this.body().children().last()[0]&&this.vc.detach().appendTo(this.body());this.vc.appendTo(this.body());this.header&&(this.vc.find(".oj-listbox-results-with-header").prepend(this.header),this.header.show());var b={};b[a.N.Bc.bs]=f.proxy(this.close,this);b[a.N.Bc.ds]=f.proxy(this.Xq,this);b[a.N.Bc.as]=f.proxy(this.PH,this);b[a.N.Bc.jn]=f.proxy(this.cL,
this);var d={};d[a.N.Ra.lf]=this.vc;d[a.N.Ra.mv]=this.U.element;d[a.N.Ra.qp]=b;d[a.N.Ra.qv]=this.kW();d[a.N.Ra.gn]="oj-listbox-drop-layer";a.N.re().open(d);f("#oj-listbox-drop").removeAttr("id");this.vc.attr("id","oj-listbox-drop");this.vc.attr("data-oj-containerid",this.qm);this.cL();this.Ql().attr("aria-expanded",!0)}},close:function(){if(this.nd()){this.ra.removeClass("oj-listbox-dropdown-open");var b=this.Ql().attr("aria-expanded");if(b&&"false"!==b){var b=this.qm,d="scroll."+b,c="resize."+b,
e="orientationchange."+b;this.ra.parents().add(window).each(function(){f(this).off(d).off(c).off(e)});this.aU();b={};b[a.N.Ra.lf]=this.vc;a.N.re().close(b);this.header&&(this.header.hide(),this.header.appendTo(this.ra));this.vc.removeAttr("data-oj-containerid");this.vc.removeAttr("id");this.U.list?this.Sx():(this.vc.detach(),this.jb.empty());this.Ql().attr("aria-expanded",!1)}}},Jn:function(){},$ca:function(){var b=this.jb,a,d,c,e;d=this.Cq();0>d||(0==d?b.scrollTop(0):(a=this.jt().find(".oj-listbox-result-label"),
c=f(a[d]),e=c.offset().top+c.outerHeight(!0),d===a.length-1&&(a=b.find("li.oj-listbox-more-results"),0<a.length&&(e=a.offset().top+a.outerHeight(!0))),a=b.offset().top+b.outerHeight(!0),e>a&&b.scrollTop(b.scrollTop()+(e-a)),e=c.offset().top-b.offset().top,0>e&&"none"!=c.css("display")&&b.scrollTop(b.scrollTop()+e)))},jt:function(){return this.jb.find(".oj-listbox-result-selectable:not(.oj-disabled, .oj-selected)").filter(function(){return"none"!=f(this).css("display")})},mZ:function(b){var a=this.jt(),
d=this.Cq();if(this.header&&(0>=d||d===a.length-1)){var c=this.Ql().attr("aria-activedescendant"),e=this.wY(c);e||(c=null);var g=null;0<b&&(0>d||d===a.length-1)?g=this.Aea(c):0>b&&(e&&0>d||0===d)&&(g=this.Oea(c));if(g){this.Sx();this.nla(g);this.Ql().attr("aria-activedescendant",g.attr("id"));return}e&&0>b&&(d=0)}for(;-1<=d&&d<a.length;)if(d+=b,d==a.length?d=0:-1==d&&(d=a.length-1),c=f(a[d]),c.hasClass("oj-listbox-result-selectable")&&!c.hasClass("oj-disabled")&&!c.hasClass("oj-selected")){this.Cq(d);
break}},Cq:function(b){var a=this.jt();if(0===arguments.length){var d=a.filter(".oj-hover");d.length||(d=a.children(".oj-hover").closest(".oj-listbox-result"));return a.get().indexOf(d[0])}b>=a.length&&(b=a.length-1);0>b&&(b=0);this.Sx();a=f(a[b]);a.hasClass("oj-listbox-result-with-children")?a.children(".oj-listbox-result-label").addClass("oj-hover"):a.addClass("oj-hover");this.Ql().attr("aria-activedescendant",a.find(".oj-listbox-result-label").attr("id"));this.$ca()},Sx:function(){this.jb.find(".oj-hover").removeClass("oj-hover");
this.nka()},WX:function(b){b=f(b.target).closest(".oj-listbox-result-selectable");if(0<b.length&&!b.is(".oj-hover")){var a=this.jt();this.Cq(a.index(b))}else 0==b.length&&this.Sx()},qu:function(a){var d=this,c=this.search.val(),e=f.data(this.ra,this.za+"-last-term");if(!0===a||!e||c!==e)if(e||c||!a||"input"!==a.type)f.data(this.ra,this.za+"-last-term",c),c.length>=(this.U.minLength||0)?(clearTimeout(this.jqa),a&&!0!==a?this.jqa=setTimeout(function(){d.VZ(a)},b.A6):this.VZ(a)):this.close()},VZ:function(a){function d(){h.cL();
if(h.header&&h.Sh.length){var b=h.jt(),a=h.Sh.length+b.length;h.Sh.attr("aria-setsize",a);b.length&&(b=b.children("[role\x3d'option']"),b.attr("aria-setsize",a),b.first().attr("aria-posinset",h.Sh.length+1))}}var c=this.search,e=this.jb,g=this.U,h=this,k;k=c.val();var m;(g.minLength||0)>k.length?this.close():(this.open(null,!0),m=++this.j5,this.Sx(),k=this.search.val(),k=void 0!==k&&null!==k&&(!0!==a||g.Wb||0<g.minLength)?k:"",this.$O=1,g.Dr({element:g.element,kp:k,page:this.$O,context:null,Zo:g.Zo,
Db:this.Vc(function(k){m===this.j5&&this.nd()&&(this.context=k&&void 0!==k.context?k.context:null,k&&0!==k.jb.length||!b.Dna(h.V,g.N2,"formatNoMatches")?(b.Bqa(this,k.jb),this.hD(),this.IZ(e),h.U.gqa.call(this,e,k.jb,{kp:c.val(),page:this.$O,context:null,qE:a},this.L0()),this.Dx(k,a),d()):"oj-select"===this.za&&!0!==this.U.multiple||this.header?(k=f("\x3cli\x3e"),k.addClass("oj-listbox-no-results"),k.text(g.N2(h.V,c.val())),this.hD(),this.IZ(e),e.append(k),d()):this.close())})}))},IZ:function(b){this.U.list?
(b=b.children(),this.TX(b)):b.empty()},TX:function(b){for(var a=0;a<b.length;a++){f(b[a]).is("LI")&&((f(b[a]).hasClass("oj-listbox-no-results")||f(b[a]).hasClass("oj-listbox-placeholder"))&&f(b[a]).remove(),f(b[a]).css("display","none"),f(b[a]).hasClass("oj-selected")&&f(b[a]).removeClass("oj-selected"));var d=f(b[a]).children("ul");d&&d.children()&&this.TX(d.children())}},EH:function(b){this.close(b)},lt:function(){b.ng(this.search)},IL:function(a,d){if(this.header){var c=this.Ql().attr("aria-activedescendant");
if(this.wY(c)){var c=f("#"+c),e=c.find("a, input, select, textarea, button, object").first();0===e.length&&(e=c.children());e.length&&e[0].click();this.close(d);return}}c=this.Cq();(e=this.jb.find(".oj-hover").closest(".oj-listbox-result").data(this.Wc))?(this.Cq(c),a=a||{},a.trigger=b.js.i7,this.zx(e,a,d)):a&&a.$pa&&this.close(d)},$n:function(){return this.U.element.attr("placeholder")||this.U.element.attr("data-placeholder")||this.U.element.data("placeholder")||this.U.placeholder},Mk:function(){var b=
this.$n();b&&(this.search.attr("placeholder",b),this.ra.removeClass(this.za+"-allowclear"))},$X:function(){var b;a:{var a,d,c;b=this.U.element.attr("style");if(void 0!==b)for(b=b.split(";"),d=0,c=b.length;d<c;d+=1)if(a=b[d].replace(/\s/g,""),a=a.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==a&&1<=a.length){b=a[1];break a}b=void 0}null!==b&&this.ra.css("width",b)},Nb:function(){return this.V.option("value")},hp:function(b,a,d){var c={jr:!1};d&&(c._context=d);"string"===
typeof b?this.V.gc([b],a,c):this.V.gc(b,a,c);this.U.element.val(b)},L0:function(){return!1},Ql:function(){return this.search},Bt:function(){return void 0!==this.U.minimumResultsForSearch&&void 0!==this.ra.Bt},qj:function(b,a){for(var d=0;d<b.length;d++)if(f(b[d]).data(this.Wc).value===a)return b[d];return null}}),c={jN:!0,Usa:!0,N2:function(b){return b.A("noMatchesFound")},id:function(b){return b.id},Zo:function(b,a){return 0<=(""+a).toUpperCase().indexOf((""+b).toUpperCase())},separator:","},e=b.Ko(d,
{et:function(){e.r.et.apply(this,arguments)&&this.search.prop("disabled",!this.Ck())},ng:function(){this.nd()&&this.close()},_destroy:function(){f("label[for\x3d'"+this.search.attr("id")+"']").attr("for",this.U.element.attr("id"));e.r._destroy.apply(this,arguments)},MH:function(b){this.selection.data(this.Wc)&&(b||a.q.warn("Event should not be null when user modified the value in UI"),"oj-select"===this.za&&this.V.sn()||this.hp([],b),this.search.val(""),this.selection.removeData(this.Wc));this.Mk()},
Dq:function(){this.U.So.call(null,this.Uk?this.Uk:this.U.element,this.Vc(this.E1))},Ts:function(a){if(this.Ck())if(a.which===b.Ga.PAGE_UP||a.which===b.Ga.PAGE_DOWN)b.Cd(a);else{switch(a.which){case b.Ga.UP:case b.Ga.DOWN:this.nd()?this.mZ(a.which===b.Ga.UP?-1:1):this.open(a);b.Cd(a);return;case b.Ga.ENTER:this.IL(null,a);b.Cd(a);this.nd()||(this.br=!1);return;case b.Ga.TAB:this.close(a);this.br=!1;return;case b.Ga.kF:this.nd()&&(this.EH(a),b.Cd(a));this.br=!1;return}this.br=!0}},pba:function(b){this.Ck()&&
!this.nd()&&this.open(b)},qC:function(){var a;a=this.ra;var d,c=this.U.rootAttributes,c=c&&c.id?c.id:this.U.element.attr("id")||b.Su();this.selection=a=a.find("."+this.za+"-choice");a.attr("id",this.za+"-choice-"+c);d=f("label[for\x3d'"+this.U.element.attr("id")+"']");d.attr("id")||d.attr("id",this.za+"-label-"+c);a.find("."+this.za+"-input").attr("id",this.za+"-input-"+c);this.jb.attr("id")||this.jb.attr("id","oj-listbox-results-"+c);this.search.attr("aria-owns",this.jb.attr("id"));this.search.attr("aria-labelledby",
d.attr("id"));this.U.element.attr("aria-labelledby",d.attr("id"));this.search.attr("id")&&d.attr("for",this.search.attr("id"));this.U.element.attr("aria-label")&&this.search.attr("aria-label",this.U.element.attr("aria-label"));this.U.element.attr("aria-controls")&&this.search.attr("aria-controls",this.U.element.attr("aria-controls"));a.on("keydown",this.Vc(this.Ts));a.on("mousedown","abbr",this.Vc(function(a){this.Ck()&&(this.MH(a),b.Npa(a),this.close(a),this.selection.focus())}));a.on("mousedown",
this.Vc(function(a){this.U.element.prop("disabled")&&b.Cd(a);this.nd()?this.close(a):this.Ck()&&this.open(a);(a=this.search.parent().attr("aria-hidden"))&&"true"==a?this.selection.focus():this.search.focus();this.ra.addClass("oj-active")}));a.on("mouseup",this.Vc(function(){this.ra.removeClass("oj-active")}));a.on("focus",this.Vc(function(a){b.Cd(a)}));this.search.on("input",this.Vc(function(b){this.V.Dn(this.search.val(),b)}));this.search.on("blur keyup",this.Vc(function(a){if("keyup"!==a.type||
10===a.keyCode||13===a.keyCode){if(void 0!==this.search.val()&&0>=this.jb.find(".oj-hover").length)if(this.U.manageNewEntry){var d=this.selection.data(this.Wc);if(!d&&""!==this.search.val()||d&&(d.label!==this.search.val()||!this.V.isValid()))d=this.U.manageNewEntry(this.search.val()),this.zx(d,{trigger:"blur"===a.type?b.js.DP:b.js.MP},a)}else null==this.U.manageNewEntry&&((d=this.selection.data(this.Wc),""==this.search.val())?this.MH(a):d||""===this.search.val()?"oj-select"!==this.za&&(a=this.U.FN(d),
void 0!==a&&this.search.val(a)):this.Jn());this.search.removeClass(this.za+"-focused");this.ra.removeClass("oj-focus")}}));this.$X();this.U.element.hide().attr("aria-hidden",!0);this.Mk()},qo:function(){var a=e.r.qo.apply(this,arguments),d=this,c=a.element.get(0).tagName.toLowerCase();if("input"===c&&a.element.attr("list")||"select"===c&&0<a.element.children().length||a.list){var g=a.list?"li":"option";a.So=function(b,a){var c,e=d.Nb();Array.isArray(e)&&(e=e[0]);c=void 0!==e&&null!==e?d.Kq(b.find(g).filter(function(){if("li"==
g)return this.getAttribute("oj-data-value")===e;if("option"==g)return this.value===e})):d.Kq(b.find(g).filter(function(){if("li"==g)return!0===this.getAttribute("oj-data-selected");if("option"==g)return this.selected}));a(c)};a.validate=function(b,a){var c;void 0!==a&&null!==a&&(c=d.Kq(b.find(g).filter(function(){if("li"==g)return this.getAttribute("oj-data-value")===a;if("option"==g)return this.value===a})));return!!c}}else if("options"in a||this.Nb()&&0<this.Nb().length)f.isFunction(a.options)?
a.So=function(c,e){function g(b,d){for(var c=0,e=b.length;c<e;c++){var f=b[c];if(d===a.id(f)||f.children&&(f=g(f.children,d)))return f}return null}var h="";d.Nb()&&d.Nb().length&&(h=d.Nb()[0]);var k=null;if(h){var q=b.p3(d);q&&(k=g(q,h));k||(q=d.currentItem)&&q.length&&h===a.id(q[0])&&(k=q[0]);k||d.yP?e(k):a.Dr({value:[h],Db:f.isFunction(e)?function(b){b&&b.jb&&(k=g(b.jb,h));e(k)}:f.noop})}else e(k)}:(a.So=function(b,e){var g="";d.Nb()&&d.Nb().length&&(g=d.Nb()[0]);var h="select"==c&&d.V.Hp()&&!d.V.sn()?
d.$n():null,k=null;a.Dr({Zo:function(b,d,c){(b=g===a.id(c))&&(k=c);null==h&&(h=c);return b},Db:f.isFunction(e)?function(){k||"select"!==c||(k=h);e(k)}:f.noop})},a.validate=function(b,d){var c=null;a.Dr({Zo:function(b,e,g){(b=d===a.id(g))&&(c=g);return b},Db:f.noop});return!!c});return a},Dx:function(a,d,c){var e=-1,g=this;a=this.jt();b.um(a,function(b,a){if(g.Nb()&&g.Nb()[0]===g.id(a.data(g.Wc)))return e=b,!1});!1!==c&&!0===d&&0<=e&&this.Cq(e)},zx:function(b,a,d){if(this.y1(b)){var c;a&&a.trigger&&
(c={Br:{trigger:a.trigger}});this.close(d);this.hp(0===this.id(b).length?[]:this.id(b),d,c);"blur"!==d.type&&this.lt()}},Jn:function(){this.search.val("")}}),g=b.Ko(e,{Wc:"ojcombobox",za:"oj-combobox",rw:function(){return f(document.createElement("div")).attr({"class":"oj-combobox oj-component"}).html("\x3cdiv class\x3d'oj-combobox-choice' tabindex\x3d'-1' role\x3d'presentation'\x3e   \x3cinput type\x3d'text' autocomplete\x3d'off' autocorrect\x3d'off' autocapitalize\x3d'off'       spellcheck\x3d'false' class\x3d'oj-combobox-input' role\x3d'combobox' aria-expanded\x3d'false' aria-autocomplete\x3d'list' /\x3e   \x3cabbr class\x3d'oj-combobox-clear-entry' role\x3d'presentation'\x3e\x3c/abbr\x3e   \x3ca class\x3d'oj-combobox-arrow oj-combobox-icon oj-component-icon oj-clickable-icon-nocontext oj-combobox-open-icon'       role\x3d'button' aria-label\x3d'expand'\x3e\x3c/a\x3e\x3c/div\x3e\x3cdiv class\x3d'oj-listbox-drop' style\x3d'display:none' role\x3d'presentation'\x3e   \x3cul class\x3d'oj-listbox-results' role\x3d'listbox'\x3e   \x3c/ul\x3e\x3c/div\x3e")},
mj:function(b){g.r.mj.apply(this,arguments);this.ft?this.ra.find(".oj-combobox-arrow").removeClass("oj-disabled"):this.ra.find(".oj-combobox-arrow").addClass("oj-disabled")},close:function(b){this.nd()&&g.r.close.apply(this,arguments)},Jq:function(b,a){g.r.Jq.apply(this,arguments);a||this.qu(!0)},Ts:function(a){b.Ga.hO(a)||b.Ga.kO(a)||g.r.Ts.apply(this,arguments)},Do:function(b){var a,d=[];this.selection.data(this.Wc,b);null!==b&&0!=b.length?(a=this.U.FN(b),void 0!==a&&this.search.val()!==a&&this.search.val(a),
this.search.removeClass(this.za+"-default"),d.push(b)):(this.search.val(""),this.Mk());this.currentItem=d;this.U.nna&&this.ra.addClass(this.za+"-allowclear")},E1:function(b){if(void 0===b||null===b)b=(b=this.Nb())?Array.isArray(b)?Array.isArray(b)&&b.length?{label:b[0]}:null:{label:b}:null;this.Do(b)}}),h=b.Ko(e,{Wc:"ojselect",za:"oj-select",br:!1,rw:function(){return f(document.createElement("div")).attr({"class":"oj-select oj-component"}).html("\x3cdiv class\x3d'oj-select-choice' tabindex\x3d'0' role\x3d'combobox'      aria-autocomplete\x3d'none' aria-expanded\x3d'false' aria-ready\x3d'true'\x3e  \x3cspan class\x3d'oj-select-chosen'\x3e\x3c/span\x3e  \x3cabbr class\x3d'oj-select-search-choice-close' role\x3d'presentation'\x3e\x3c/abbr\x3e  \x3ca class\x3d'oj-select-arrow oj-component-icon oj-clickable-icon-nocontext oj-select-open-icon' role\x3d'presentation'\x3e\x3c/a\x3e\x3c/div\x3e\x3cdiv class\x3d'oj-listbox-drop' style\x3d'display:none' role\x3d'presentation'\x3e  \x3cdiv class\x3d'oj-listbox-search-wrapper'\x3e  \x3cdiv class\x3d'oj-listbox-search'\x3e    \x3cinput type\x3d'text' autocomplete\x3d'off' autocorrect\x3d'off' autocapitalize\x3d'off'           spellcheck\x3d'false' class\x3d'oj-listbox-input' title\x3d'Search field'            role\x3d'combobox' aria-expanded\x3d'false' aria-autocomplete\x3d'list' /\x3e    \x3cspan class\x3d'oj-listbox-spyglass-box'\x3e      \x3cspan class\x3d'oj-component-icon oj-clickable-icon-nocontext oj-listbox-search-icon' role\x3d'presentation'\x3e       \x3cb role\x3d'presentation'\x3e\x3c/b\x3e\x3c/span\x3e    \x3c/span\x3e  \x3c/div\x3e  \x3c/div\x3e   \x3cul class\x3d'oj-listbox-results' role\x3d'listbox'\x3e   \x3c/ul\x3e\x3c/div\x3e")},
mj:function(b){h.r.mj.apply(this,arguments);this.ft?(this.ra.find(".oj-select-choice").attr("tabindex","0"),this.ra.find(".oj-select-arrow").removeClass("oj-disabled")):(this.ra.find(".oj-select-choice").attr("tabindex","-1"),this.ra.find(".oj-select-arrow").addClass("oj-disabled"))},close:function(a){this.nd()&&(h.r.close.apply(this,arguments),this.ra.find(".oj-select-choice").attr("aria-expanded",!1),this.kM(a)||this.Jn(),a instanceof MouseEvent&&a.target!=this.selection&&a.target!=this.search||
b.ng(this.selection),this.ra.find(".oj-listbox-spyglass-box").off("mouseup click"))},Jq:function(a,d){h.r.Jq.apply(this,arguments);var c;a&&"keydown"==a.type&&a.which!=b.Ga.UP&&a.which!=b.Ga.DOWN&&a.which!=b.Ga.LEFT&&a.which!=b.Ga.RIGHT&&(c=String.fromCharCode(a.which),b.Cd(a));this.M0(c);d||(c?this.qu():this.qu(!0))},hD:function(){if(this.nd()){h.r.hD.apply(this,arguments);this.ra.find(".oj-select-choice").attr("aria-expanded",!0);var b,a;this.Bt()&&(b=this.search.get(0),b.createTextRange?(b=b.createTextRange(),
b.collapse(!1),b.select()):b.setSelectionRange&&(a=this.search.val().length,b.setSelectionRange(a,a)))}},qC:function(){var b=this.qm+"_selected";this.text=this.ra.find(".oj-select-chosen").attr("id",b);h.r.qC.apply(this,arguments);this.ra.find(".oj-select-choice").attr({"aria-owns":this.search.attr("aria-owns"),"aria-labelledby":this.search.attr("aria-labelledby"),"aria-describedby":b});(b=this.U.element.attr("aria-label"))&&this.selection.attr("aria-label",b);this.search.on("keydown",this.Vc(this.Ts));
this.search.on("keyup-change input",this.Vc(this.pba));this.search.attr("title",this.V.A("seachField"));var a=this;this.selection.on("blur",function(b){a.kM(b)})},Dq:function(){this.GY()?(this.Do(null),this.close(),this.Mk()):h.r.Dq.apply(this,arguments)},E1:function(b){if(void 0!==b&&null!==b){var a,d=this.Nb(),d=Array.isArray(d)?d[0]:d;a=this.U.id(b);d!==a&&(void 0===d||null===d?this.V.options.value=Array.isArray(a)?a:[a]:this.hp(Array.isArray(a)?a:[a]));this.Do(b);this.close()}},Do:function(b){this.selection.data(this.Wc,
b);null!==b&&this.text.text(b.label);b&&""!=b.id&&this.text.removeClass(this.za+"-default");this.U.nna&&this.ra.addClass(this.za+"-allowclear")},Ql:function(){return this.search.attr("aria-expanded")&&this.Bt()?this.search:this.selection},GY:function(){if(null===this.$n())return!1;var b=this.Nb(),b=Array.isArray(b)?b[0]:b;return""===b||void 0===b||null===b},$n:function(){return this.U.placeholder},L0:function(){return!0},Mk:function(){var b=this.$n();this.GY()&&void 0!==b&&(void 0===b&&(b=""),this.text.text(b).addClass(this.za+
"-default"),this.ra.removeClass(this.za+"-allowclear"))},hp:function(b,a,d){h.r.hp.call(this,b,a,d);this.selection.data("selectVal",b)},Ts:function(a){if(!(b.Ga.hO(a)&&a.which!=b.Ga.vQ||b.Ga.kO(a))){switch(a.which){case b.Ga.TAB:this.close(a);this.selection.focus();this.kM(a);return;case b.Ga.ENTER:if(a.target===this.selection[0]&&!this.nd()){this.open(a);b.Cd(a);return}}var d=this.Bt();h.r.Ts.apply(this,arguments);this.br&&!this.nd()&&this.open(a);if(!d&&this.br){var c;a.which!=b.Ga.LEFT&&a.which!=
b.Ga.RIGHT&&(c=String.fromCharCode(a.which));this.M0(c);this.qu();b.Cd(a)}}},kM:function(b){return""==this.text.text()?(this.MH(b),!0):!1},M0:function(a){var d=!1,c=this.vc.find(".oj-listbox-search");c&&(this.Bt()?(this.vc.find(".oj-listbox-search-wrapper").removeClass("oj-helper-hidden-accessible"),f(c).removeAttr("aria-hidden"),this.search.val(a),d=!0):(this.vc.find(".oj-listbox-search-wrapper").addClass("oj-helper-hidden-accessible"),f(c).attr("aria-hidden","true")));b.ng(d?this.search:this.selection);
if(d){var e=this;c.find(".oj-listbox-spyglass-box").on("mouseup click",function(b){e.search.focus();b.stopPropagation()})}},Bt:function(){var b=this.U.minimumResultsForSearch;return(this.U.list?f("#"+this.U.list).find("li").length:this.Uk?this.Uk[0].length:this.U.options?this.U.options.length:0)>b||this.br}}),k=b.Ko(d,{qo:function(){var a=k.r.qo.apply(this,arguments),d=this,c=a.element.get(0).tagName.toLowerCase();if("input"===c&&a.element.attr("list")||"select"===c&&0<a.element.children().length||
a.list){var e=a.list?"li":"option";a.So=function(a,g){var f=[];if(d.Nb())for(var h,k=d.Nb(),m=0;m<k.length;m++){var l=k[m];(h=a.find(e).filter(function(){if("option"===e)return this.value===l;if("li"===e)return this.getAttribute("oj-data-value")===l}))&&h.length?f.push(d.Kq(h)):f.push({value:l,label:l})}else"select"!==c&&(h=a.find(e).filter(function(){if("option"===e)return this.selected;if("li"===e)return!0===this.getAttribute("oj-data-selected")}),b.um(h,function(b,a){f.push(d.Kq(a))}));g(f)}}else"options"in
a&&(a.So=f.isFunction(a.options)?function(c,e){function g(){for(var b=[],c=0;c<k.length;c++){for(var f=k[c],h=!1,m=0;m<q.length;m++){var l=q[m];if(f===a.id(l)){b.push(l);q.splice(m,1);h=!0;break}}if(!h){if((m=d.currentItem)&&m.length)for(l=0;l<m.length;l++)if(f===a.id(m[l])){b.push(m[l]);h=!0;break}h||b.push({value:f,label:f})}}e(b)}function h(b,d){for(var c=[],e=0,g=b.length;e<g;e++){var k=b[e];0<=d.indexOf(a.id(k))&&c.push(k);k.children&&(k=h(k.children,d))&&k.length&&f.merge(c,k)}return c}var k=
d.Nb(),q=[],m=b.p3(d);m&&(q=h(m,k));d.yP?g():a.Dr({value:k,Db:function(b){b&&b.jb&&(b=h(b.jb,k))&&b.length&&f.merge(q,b);g()}})}:a.So||function(b,c){var e=d.Nb(),g=[];a.Dr({Zo:function(b,d,c){(b=f.grep(e,function(b){return b===a.id(c)}).length)&&g.push(c);return b},Db:f.isFunction(c)?function(){for(var b=[],d=0;d<e.length;d++){for(var f=e[d],h=!1,k=0;k<g.length;k++){var q=g[k];if(f===a.id(q)){b.push(q);g.splice(k,1);h=!0;break}}h||b.push({value:f,label:f})}c(b)}:f.noop})});return a},cu:function(b){var a=
this.ra.find("."+this.za+"-selected-choice.oj-focus");a.length&&b&&b[0]==a[0]||(a.length&&this.U.element.trigger("choice-deselected",a),a.removeClass("oj-focus"),b&&b.length&&(this.close(),b.addClass("oj-focus"),this.ra.find("."+this.za+"-description").text(b.attr("valueText")+". Press back space to delete.").attr("aria-live","assertive"),this.U.element.trigger("choice-selected",b)))},_destroy:function(){f("label[for\x3d'"+this.search.attr("id")+"']").attr("for",this.U.element.attr("id"));k.r._destroy.apply(this,
arguments)},qC:function(){var a="."+this.za+"-choices",d,c=b.Su(),e;this.bP=this.ra.find("."+this.za+"-search-field");this.selection=d=this.ra.find(a);var g=this;this.selection.on("click","."+this.za+"-selected-choice:not(."+this.za+"-locked)",function(){g.search[0].focus();g.cu(f(this))});e=f("label[for\x3d'"+this.U.element.attr("id")+"']");e.attr("id")||e.attr("id",this.za+"-label-"+c);d.find("."+this.za+"-input").attr("id",this.za+"-input-"+c);this.jb.attr("id")||this.jb.attr("id","oj-listbox-results-"+
c);this.search.attr("aria-owns",this.jb.attr("id"));this.search.attr("aria-labelledby",e.attr("id"));this.U.element.attr("aria-labelledby",e.attr("id"));this.search.attr("id")&&e.attr("for",this.search.attr("id"));this.U.element.attr("aria-label")&&this.search.attr("aria-label",this.U.element.attr("aria-label"));this.U.element.attr("aria-controls")&&this.search.attr("aria-controls",this.U.element.attr("aria-controls"));this.search.attr("tabindex",this.tN);this.nO=0;this.search.on("keydown",this.Vc(function(a){if(this.Ck()){++this.nO;
var c=d.find("."+this.za+"-selected-choice.oj-focus"),e=c.prev("."+this.za+"-selected-choice:not(."+this.za+"-locked)"),g=c.next("."+this.za+"-selected-choice:not(."+this.za+"-locked)"),f=b.Foa(this.search);if(!c.length||a.which!=b.Ga.LEFT&&a.which!=b.Ga.RIGHT&&a.which!=b.Ga.fF&&a.which!=b.Ga.IP&&a.which!=b.Ga.ENTER)if((a.which!==b.Ga.fF||1!=this.nO)&&a.which!=b.Ga.LEFT||0!=f.offset||f.length){this.cu(null);if(this.nd())switch(a.which){case b.Ga.UP:case b.Ga.DOWN:this.mZ(a.which===b.Ga.UP?-1:1);b.Cd(a);
return;case b.Ga.ENTER:this.IL(null,a);b.Cd(a);return;case b.Ga.TAB:this.close(a);return;case b.Ga.kF:this.EH(a);b.Cd(a);return}if(!(a.which===b.Ga.TAB||b.Ga.hO(a)||b.Ga.kO(a)||a.which===b.Ga.kF||a.which===b.Ga.ENTER&&this.search.val()&&"ojcombobox"===this.Wc))switch(a.which){case b.Ga.UP:case b.Ga.DOWN:this.open();b.Cd(a);break;case b.Ga.PAGE_UP:case b.Ga.PAGE_DOWN:b.Cd(a);break;case b.Ga.ENTER:b.Cd(a)}}else this.cu(d.find("."+this.za+"-selected-choice:not(."+this.za+"-locked)").last()),b.Cd(a);
else f=c,a.which==b.Ga.LEFT&&e.length?f=e:a.which==b.Ga.RIGHT?f=g.length?g:null:a.which===b.Ga.fF?(this.KM(c.first(),a),this.search.width(10),f=e.length?e:g):a.which==b.Ga.IP?(this.KM(c.first(),a),this.search.width(10),f=g.length?g:null):a.which==b.Ga.ENTER&&(f=null),this.cu(f),b.Cd(a),f&&f.length||this.open()}}));this.search.on("keyup",this.Vc(function(){this.nO=0}));this.search.on("input",this.Vc(function(b){this.V.Dn(this.search.val(),b)}));this.search.on("blur keyup",this.Vc(function(a){if("keyup"!==
a.type||10===a.keyCode||13===a.keyCode){if(this.U.manageNewEntry&&this.search.val()&&0>=this.jb.find(".oj-hover").length){var d=this.U.manageNewEntry(this.search.val());this.zx(d,{trigger:"blur"===a.type?b.js.DP:b.js.MP},a)}this.search.removeClass(this.za+"-focused");this.ra.removeClass("oj-focus");this.cu(null);this.nd()||this.Jn();a.stopImmediatePropagation()}}));this.ra.on("click touchstart",a,this.Vc(function(b){!this.Ck()||0<f(b.target).closest("."+this.za+"-selected-choice").length||(this.cu(null),
this.nd()?this.close(b):(this.open(),this.lt()),b.preventDefault())}));this.ra.on("focus",a,this.Vc(function(){}));this.$X();this.U.element.hide().attr("aria-hidden",!0);this.Jn()},et:function(){k.r.et.apply(this,arguments)&&this.search.prop("disabled",!this.Ck())},Dq:function(){null!==this.Nb()&&0!==this.Nb().length||"oj-select"!==this.za&&""!==this.U.element.text()||(this.Do([]),this.close(),this.Jn());if(this.Uk||null!==this.Nb()&&this.Nb().length){var b=this;this.U.So.call(null,this.Uk?this.Uk:
this.U.element,function(a){void 0!==a&&null!==a&&0!==a.length&&(b.Do(a),b.close(),b.Jn())})}},Jn:function(){var b=this.$n(),a=this.wea();void 0===b||this.Nb()&&0!==this.Nb().length?(this.search.attr("placeholder",""),this.search.val("").width(10),this.bP.width("auto")):(this.search.attr("placeholder",b),this.search.val("").width(0<a?a:this.ra.css("width")),this.bP.width("100%"))},Jq:function(b,a){this.Kka();k.r.Jq.apply(this,arguments);this.lt();a||this.qu(!0);this.search.focus()},close:function(b){this.nd()&&
k.r.close.apply(this,arguments)},ng:function(){this.close();this.search.focus()},Do:function(b){var a=[],d=[],c=this;f(b).each(function(){0>a.indexOf(c.id(this))&&(a.push(c.id(this)),d.push(this))});b=d;this.selection.find("."+this.za+"-selected-choice").remove();f(b).each(function(){c.M$(this)});this.currentItem=b;this.U.element.val(0===a.length?"":a.join(this.U.separator));c.Dx()},zx:function(a,d,c){if(this.y1(a)){var e;d&&d.trigger&&(e={Br:{trigger:d.trigger}});var g=this.id(a),h=this.Nb()?this.Nb().slice(0):
[];this.V.isValid()||(h=b.Um(this.U.element.val(),this.U.separator));f(a).each(function(){0>h.indexOf(g)&&h.push(g)});this.hp(h,c,e);!this.select&&this.U.jN||this.Dx(a,!1,!0===this.U.jN);this.U.jN&&(this.close(c),this.search.width(10));d&&d.$pa||this.lt()}},EH:function(b){this.close(b);this.lt()},M$:function(a){var d=!a.locked,c=f("\x3cli class\x3d'"+this.za+"-selected-choice'\x3e    \x3cdiv\x3e\x3c/div\x3e    \x3ca href\x3d'#' onclick\x3d'return false;' role\x3d'button' aria-label\x3d'remove' class\x3d'"+
this.za+"-clear-entry       oj-component-icon oj-clickable-icon-nocontext "+this.za+"-clear-entry-icon' tabindex\x3d'-1'\x3e    \x3c/a\x3e\x3c/li\x3e"),e=f("\x3cli class\x3d'"+this.za+"-selected-choice "+this.za+"-locked'\x3e\x3cdiv\x3e\x3c/div\x3e\x3c/li\x3e"),c=d?c:e;this.id(a);e=this.U.FN(a);void 0!==e&&(c.find("div").addClass(this.za+"-selected-choice-label").text(e),c.find("."+this.za+"-clear-entry").attr("aria-label",e+" remove"),c.attr("valueText",e));if(d)c.find("."+this.za+"-clear-entry").on("mousedown",
b.Cd).on("click dblclick",this.Vc(function(a){this.Ck()&&(f(a.target).closest("."+this.za+"-selected-choice").fadeOut("fast",this.Vc(function(){this.KM(f(a.target),a);this.selection.find("."+this.za+"-selected-choice.oj-focus").removeClass("oj-focus");this.close(a);this.lt()})).dequeue(),b.Cd(a))}));c.data(this.Wc,a);c.insertBefore(this.bP)},KM:function(a,d){var c=this.Nb()?this.Nb().slice(0):[],e,g;a=a.closest("."+this.za+"-selected-choice");if(0===a.length)throw"Invalid argument: "+a+". Must be ."+
this.za+"-selected-choice";if(e=a.data(this.Wc)){for(this.V.isValid()||(c=b.Um(this.U.element.val(),this.U.separator));0<=(g=c.indexOf(this.id(e)));)c.splice(g,1),this.hp(c,d),this.select&&this.Dx();a.remove()}},Dx:function(){var a=this.Nb()&&(this.U.element.val()||this.V.isValid())?this.Nb():[],d=this.jb.find(".oj-listbox-result"),c=this.jb.find(".oj-listbox-result-with-children"),e=this;b.um(d,function(b,d){var c=e.id(d.data(e.Wc));a&&0<=a.indexOf(c)&&(d.addClass("oj-selected"),d.find(".oj-listbox-result-selectable").addClass("oj-selected"))});
b.um(c,function(b,a){a.is(".oj-listbox-result-selectable")||0!==a.find(".oj-listbox-result-selectable:not(.oj-selected)").length||a.addClass("oj-selected")});0< !d.filter(".oj-listbox-result:not(.oj-selected)").length&&this.close()},wea:function(){return this.selection.width()-b.B3(this.search)},rma:function(b){var a=document.createElement("span");b=document.createTextNode(b);a.style.display="none";a.appendChild(b);f("body").append(a);a=f("body").find("span:last").width();f("body").find("span:last").remove();
return a},Kka:function(){var a,d,c,e,g=b.B3(this.search);a=this.rma(this.search.val())+10;d=this.search.offset().left;c=this.selection.width();e=this.selection.offset().left;d=c-(d-e)-g;d<a&&(d=c-g);40>d&&(d=c-g);0>=d&&(d=a);this.search.width(Math.floor(d))},hp:function(a,d,c){var e;e=[];"string"===typeof a&&(a=b.Um(a,this.U.separator));for(var g=0;g<a.length;g++)0>e.indexOf(a[g])&&e.push(a[g]);a={jr:!1};c&&(a._context=c);this.V.gc(e,d,a);(this.V.isValid()||0===e.length)&&this.U.element.val(0===e.length?
"":e.join(this.U.separator));this.search.attr("aria-activedescendant",this.U.element.attr("id"))}}),l=b.Ko(k,{Wc:"ojcombobox",za:"oj-combobox",rw:function(){return f(document.createElement("div")).attr({"class":"oj-combobox oj-combobox-multi oj-component"}).html("\x3cul class\x3d'oj-combobox-choices'\x3e  \x3cli class\x3d'oj-combobox-search-field'\x3e    \x3cinput type\x3d'text' role\x3d'combobox' aria-expanded\x3d'false' aria-autocomplete\x3d'list' autocomplete\x3d'off' autocorrect\x3d'off' autocapitalize\x3d'off' spellcheck\x3d'false' class\x3d'oj-combobox-input'\x3e  \x3c/li\x3e\x3c/ul\x3e\x3cdiv class\x3d'oj-combobox-description oj-helper-hidden-accessible'/\x3e\x3cdiv class\x3d'oj-listbox-drop oj-listbox-drop-multi' style\x3d'display:none'\x3e   \x3cul class\x3d'oj-listbox-results' role\x3d'listbox'\x3e   \x3c/ul\x3e\x3c/div\x3e")}}),
m=b.Ko(k,{Wc:"ojselect",za:"oj-select",rw:function(){return f(document.createElement("div")).attr({"class":"oj-select oj-select-multi oj-component"}).html("\x3cul class\x3d'oj-select-choices'\x3e  \x3cli class\x3d'oj-select-search-field'\x3e    \x3cinput type\x3d'text' role\x3d'combobox' aria-expanded\x3d'false' aria-autocomplete\x3d'list' autocomplete\x3d'off' autocorrect\x3d'off' autocapitalize\x3d'off' spellcheck\x3d'false' class\x3d'oj-listbox-input'\x3e  \x3c/li\x3e\x3c/ul\x3e\x3cdiv class\x3d'oj-select-description oj-helper-hidden-accessible'/\x3e\x3cdiv class\x3d'oj-listbox-drop oj-listbox-drop-multi' style\x3d'display:none'\x3e   \x3cul class\x3d'oj-listbox-results' role\x3d'listbox'\x3e   \x3c/ul\x3e\x3c/div\x3e")}});
a.ya("oj.ojCombobox",f.oj.editableValue,{defaultElement:"\x3cinput\x3e",widgetEventPrefix:"oj",options:{converter:void 0,placeholder:"",list:void 0,multiple:!1,options:null,optionsKeys:null,optionRenderer:null,minLength:0,beforeExpand:null,rawValue:void 0},widget:function(){return this.tc.ra},_ComponentCreate:function(){this._super();this.Ba()},ae:function(d,c){this._super(d,c);a.ze.al([{W:"disabled",xc:!0},{W:"placeholder"},{W:"required",ef:!0,xc:!0},{W:"title"}],c,this);if(void 0===this.options.value)this.options.value=
void 0!==this.element.attr("value")?b.Um(this.element.val(),","):null;else{var e=this.options.value;Array.isArray(e)?e=e.slice(0):"string"===typeof e&&(e=!0===this.options.multiple?b.Um(e,","):[e]);this.options.value=e}},Ba:function(){var b={},a=this.options.multiple;b.element=this.element;b.V=this;b=f.extend(this.options,b);this.tc=a?new l:new g;this.tc._init(b)},_destroy:function(){this.tc._destroy();this._super()},refresh:function(){this._super();this.tc._destroy();this.Ba();this.pA();this.Xg("required",
this.options.required)},_setOption:function(a,d,c){"value"===a&&(Array.isArray(d)?d=d.slice(0):"string"===typeof d&&(d=!0===this.options.multiple?b.Um(d,","):[d]),this.tc.yP=c&&c._context&&c._context.Br?c._context.Br.trigger:null);this._super(a,d,c);"options"===a&&(this.tc.U.options=d,this.tc.U=this.tc.qo(this.tc.U));"disabled"===a&&(d?this.tc.oI():this.tc.mj())},oi:function(){this.tc.close()},zl:function(){this.tc.close()},qi:function(){this.tc.Dq()},Cn:function(b){this.tc&&(this.tc.U.placeholder=
b,this.tc.Mk&&this.tc.Mk())},validate:function(){var b=this.tc.search.val(),a=null;!0!==this.options.multiple?a=void 0===b||null===b||""===b?[]:[b]:(a=this.tc.Nb(),a=void 0===b||null===b||""===b?a:a.push(b));return this.gc(a,null,this.tA)},MC:function(a){var d=[];"string"===typeof a&&(a=!0===this.options.multiple?b.Um(a,","):[a]);if(Array.isArray(a))for(var c=0;c<a.length;c++){var e=this._super(a[c]);d.push(e.toString())}return d},_GetMessagingLauncherElement:function(){return this.tc.search},$d:function(){return this.tc.search},
_GetDefaultStyleClass:function(){return"oj-combobox"},Kw:function(){if(this.tc&&this.tc.nd())for(var b=f(".oj-listbox-drop"),a=0;a<b.length;a++)if("oj-listbox-drop"==f(b[a]).attr("id")&&f(b[a]).attr("data-oj-containerid")==this.tc.qm)return f(b[a]);return null},qj:function(b,a){for(var d=0;d<b.length;d++)if(f(b[d]).data("ojcombobox").value===a)return b[d];return null},getNodeBySubId:function(b){var a=null,d;if(null==b)return this.tc.ra?this.tc.ra[0]:null;a=this._super(b);if(!a){d=b.subId;"oj-combobox-drop"===
d&&(d="oj-listbox-drop");"oj-combobox-results"===d&&(d="oj-listbox-results");"oj-combobox-selection"===d&&(d="oj-combobox-selected-choice");var c=this.Kw();switch(d){case "oj-combobox-input":case "oj-combobox-arrow":a=this.widget().find("."+d)[0];break;case "oj-listitem":c&&(a=c.find(".oj-listbox-result"),a=this.qj(a,b.value));break;case "oj-combobox-remove":a=this.widget().find(".oj-combobox-selected-choice");a=(b=this.qj(a,b.value))?f(b).find(".oj-combobox-clear-entry-icon")[0]:null;break;case "oj-listbox-drop":c&&
(a=c[0]);break;case "oj-listbox-results":c&&(a=c.find("."+d)[0]);break;case "oj-combobox-selected-choice":a=this.widget().find("."+d).toArray()}}return a||null},getSubIdByNode:function(b){var a=null;null!=b&&(b=f(b),b.hasClass("oj-combobox-input")?a={subId:"oj-combobox-input"}:b.hasClass("oj-combobox-arrow")?a={subId:"oj-combobox-arrow"}:b.hasClass("oj-listbox-result")?a={subId:"oj-listitem",value:b.data("ojcombobox").value}:b.hasClass("oj-combobox-clear-entry-icon")&&(a={subId:"oj-combobox-remove",
value:b.closest(".oj-combobox-selected-choice").data("ojcombobox").value}));return a}});var n=b.Ko(g,{Wc:"ojinputsearch",za:"oj-inputsearch",rw:function(){var b=f(document.createElement("div")).attr({"class":"oj-inputsearch oj-component"}).html("\x3cdiv class\x3d'oj-inputsearch-choice' tabindex\x3d'-1' role\x3d'presentation'\x3e   \x3cinput type\x3d'text' autocomplete\x3d'off' autocorrect\x3d'off' autocapitalize\x3d'off'       spellcheck\x3d'false' class\x3d'oj-inputsearch-input' role\x3d'combobox' aria-expanded\x3d'false' aria-autocomplete\x3d'list' /\x3e   \x3ca class\x3d'oj-inputsearch-search-button oj-inputsearch-search-icon oj-component-icon oj-clickable-icon-nocontext'       role\x3d'button' aria-label\x3d'search'\x3e\x3c/a\x3e\x3c/div\x3e\x3cdiv class\x3d'oj-listbox-drop' style\x3d'display:none' role\x3d'presentation'\x3e   \x3cul class\x3d'oj-listbox-results' role\x3d'listbox'\x3e   \x3c/ul\x3e\x3c/div\x3e"),
a=b.find(".oj-inputsearch-search-button");this.iaa(a);return b},iaa:function(a){var d=this;a.on("click",function(a){if(d.Ck()){if(d.U.manageNewEntry){var c=d.U.manageNewEntry(d.search.val());d.zx(c,{trigger:b.js.n7},a)}return!1}}).on("mousedown",function(b){b.stopPropagation();return!1})},mj:function(b){n.r.mj.apply(this,arguments);this.ft?this.ra.find(".oj-inputsearch-search-button").removeClass("oj-disabled"):this.ra.find(".oj-inputsearch-search-button").addClass("oj-disabled")}});a.ya("oj.ojInputSearch",
f.oj.editableValue,{defaultElement:"\x3cinput\x3e",widgetEventPrefix:"oj",options:{placeholder:void 0,options:null,optionsKeys:null,optionRenderer:null,minLength:0,beforeExpand:null,rawValue:void 0,optionChange:null},widget:function(){return this.Wb.ra},_ComponentCreate:function(){this._super();this.Ba()},ae:function(d,c){this._super(d,c);a.ze.al([{W:"disabled",$D:null,xc:!0},{W:"placeholder",$D:""},{W:"required",$D:!1,ef:!0,xc:!0},{W:"title",$D:""}],c,this);if(void 0===this.options.value)this.options.value=
void 0!==this.element.attr("value")?b.Um(this.element.val(),","):null;else{var e=this.options.value;Array.isArray(e)?e=e.slice(0):"string"===typeof e&&(e=[e]);this.options.value=e}},Ba:function(){var b={};b.element=this.element;b.V=this;b.Wb=!0;b=f.extend(this.options,b);this.Wb=new n;this.Wb._init(b)},_destroy:function(){this.Wb._destroy();this._super()},refresh:function(){this._super();this.Wb._destroy();this.Ba();this.pA();this.Xg("required",this.options.required)},_setOption:function(b,a,d){"value"===
b&&(Array.isArray(a)?a=a.slice(0):"string"===typeof a&&(a=[a]),this.Wb.yP=d&&d._context&&d._context.Br?d._context.Br.trigger:null);this._super(b,a,d);"options"===b&&(this.Wb.U.options=a,this.Wb.U=this.Wb.qo(this.Wb.U));"disabled"===b&&(a?this.Wb.oI():this.Wb.mj())},oi:function(){this.Wb.close()},zl:function(){this.Wb.close()},qi:function(){this.Wb.Dq()},Cn:function(b){this.Wb&&(this.Wb.U.placeholder=b,this.Wb.Mk&&this.Wb.Mk())},validate:function(){var b=this.Wb.search.val(),a=null,a=this.Wb.Nb(),
a=void 0===b||null===b||""===b?a:a.push(b);return this.gc(a,null,this.tA)},MC:function(b){var a=[];"string"===typeof b&&(b=[b]);if(Array.isArray(b))for(var d=0;d<b.length;d++){var c=this._super(b[d]);a.push(c.toString())}return a},_GetMessagingLauncherElement:function(){return this.Wb.search},$d:function(){return this.Wb.search},_GetDefaultStyleClass:function(){return"oj-inputsearch"},Kw:function(){if(this.Wb&&this.Wb.nd())for(var b=f(".oj-listbox-drop"),a=0;a<b.length;a++)if("oj-listbox-drop"==f(b[a]).attr("id")&&
f(b[a]).attr("data-oj-containerid")==this.Wb.qm)return f(b[a]);return null},expand:function(){this.Wb.open()},collapse:function(){this.Wb.close()},getNodeBySubId:function(b){var a=null,d;if(null===b)return this.Wb.ra?this.Wb.ra[0]:null;a=this._super(b);if(!a)switch(d=b.subId,"oj-inputsearch-search"===d&&(d="oj-inputsearch-search-button"),d){case "oj-inputsearch-input":case "oj-inputsearch-search-button":a=this.widget().find("."+d)[0];break;case "oj-listitem":if(d=this.Kw())a=d.find(".oj-listbox-result"),
a=this.Wb.qj(a,b.value)}return a||null},getSubIdByNode:function(b){var a=null;null!=b&&(b=f(b),b.hasClass("oj-inputsearch-input")?a={subId:"oj-inputsearch-input"}:b.hasClass("oj-inputsearch-search-button")?a={subId:"oj-inputsearch-search"}:b.hasClass("oj-listbox-result")&&(a={subId:"oj-listitem",value:b.data("ojinputsearch").value}));return a}});a.ya("oj.ojSelect",f.oj.editableValue,{defaultElement:"\x3cselect\x3e",widgetEventPrefix:"oj",options:{minimumResultsForSearch:10,placeholder:null,list:void 0,
multiple:!1,options:null,optionsKeys:null,beforeExpand:null,renderMode:"jet"},widget:function(){return this.select?this.select.ra:this.element.parent()},_ComponentCreate:function(){this._super();this.Ba()},oZ:function(b){b?(this.element.attr("disabled",""),this.element.parent().addClass("oj-disabled").removeClass("oj-enabled")):(this.element.removeAttr("disabled"),this.element.parent().removeClass("oj-disabled").addClass("oj-enabled"))},Cia:function(b){var a=[],d=!this.sn()&&this.Hp();f(b.target).find("option").each(function(){this.selected&&
(this.value||d&&""===this.value)&&a.push(this.value)});this.gc(a,b,{jr:!1})},Eia:function(){var a=this.element;a.wrap("\x3cdiv\x3e").parent().addClass("oj-select-native oj-component oj-select oj-form-control");a.addClass("oj-select-select oj-component-initnode");this.options.multiple?(a.attr("multiple",""),a.parent().prepend("\x3ca class\x3d'oj-select-arrow oj-component-icon oj-clickable-icon-nocontext oj-select-multiple-open-icon' role\x3d'presentation'\x3e\x3c/a\x3e")):a.parent().prepend("\x3ca class\x3d'oj-select-arrow oj-component-icon oj-clickable-icon-nocontext oj-select-open-icon' role\x3d'presentation'\x3e\x3c/a\x3e");
this.oZ(this.options.disabled);this.options.list?(b.Ppa(a,f("#"+this.options.list).children(),this.iq.bind(this)),a.addClass(b.iv)):this.options.options&&(b.U1(a,this.options.options,this.iq.bind(this),this.options.optionsKeys),a.addClass(b.iv));a.change(this.Cia.bind(this))},Qha:function(){var b={},a=this.options.multiple;b.element=this.element;b.V=this;b=f.extend(this.options,b);this.select=a?new m:new h;this.select._init(b);this.select.ra.addClass("oj-select-jet oj-form-control")},Ba:function(){this.Kt()?
this.Eia():this.Qha()},refresh:function(){this._super();this.ok();this.Ba();this.pA();this.Xg("required",this.options.required)},_destroy:function(){this.ok();this._super()},oi:function(){this.select&&this.select.close()},zl:function(){this.select&&this.select.close()},Cn:function(a){if(this.Kt()&&null!=a){var d=f(this.element.children("option:first-child"));d&&""===d.attr("value")?(d.text(this.options.placeholder),d.attr("value","")):(d=b.oN(0,"",a,this.iq.bind(this)),d.addClass("oj-listbox-placeholder"),
d.prependTo(this.element))}},Hp:function(){return"string"===typeof this.options.placeholder},$Q:function(){this.tS(null);this.Cn(null)},ae:function(d,c){this._super(d,c);a.ze.al([{W:"disabled",xc:!0},{W:"placeholder"},{W:"required",ef:!0,xc:!0},{W:"title"}],c,this);if(void 0===this.options.value)this.options.value=void 0!==this.element.attr("value")?b.Um(this.element.val(),","):null;else{var e=this.options.value;Array.isArray(e)&&(e=e.slice(0));this.options.value=e}},validate:function(){return this.select?
this.gc(this.select.Nb(),null,this.tA):!0},qi:function(b){this.select?this.select.Dq():null==b?this.Hp()?(this.element[0].selectedIndex=0,this.element.addClass("oj-select-default")):(b=this.element.children(),0<b.length&&(this.options.value=[b.first().attr("value")])):this.element.val(b)},nZ:function(){var b=this.element.children("option:not(:disabled)");return 0<b.length?[f(b[0]).attr("value")]:null},Dia:function(a){var d=this.options.value,c=this.element;if(c.hasClass(b.iv))b.h2(c);else{var e=c.children();
0<e.length&&e.remove()}b.U1(c,a,this.iq.bind(this),this.options.optionsKeys);c.addClass(b.iv);a=null;this.Hp()&&(this.options.required&&(a=this.nZ()),this.Cn());null===a&&(a=this.nZ());this.options.value=a;this._setOption("value",d)},tka:function(b){for(var a,d=[],c=0;c<b.length;c++)a=b[c],null!=a&&(0<a.length?(1==d.length&&""===d[0]&&d.pop(),d.push(a)):0==d.length&&d.push(a));return d},_setOption:function(b,a,d){if("value"===b)if(this.Hp()&&a&&0==a.length)this._super(b,a,d);else{var c;this.select&&
(c=this.select.Uk,c||(c=this.select.U.element));Array.isArray(a)||(a=[a]);this.Kt()&&(a=this.tka(a),1==a.length&&""==a[0]?this.element.addClass("oj-select-default"):this.element.removeClass("oj-select-default"));for(var e=[],g=0;g<a.length;g++)this.select?(this.options.multiple||this.select.U.validate(c,a[g]))&&e.push(a[g]):0<this.element.find("option[value\x3d'"+a[g]+"']").length&&e.push(a[g]);(0<e.length||this.options.multiple)&&this._super(b,e,d)}else"placeholder"===b?this.select?(this.select.U.placeholder=
a,this.select.Mk()):(c=this.options.value,c&&0!==c.length&&c[0]||(this.element[0].selectedIndex=0)):"minimumResultsForSearch"===b?this.select&&(this.select.U.minimumResultsForSearch=a):"renderMode"===b&&(this.ok(),this.options.renderMode=a,this.refresh()),this._super(b,a,d),"disabled"===b?this.select?a?this.select.oI():this.select.mj():this.oZ(a):"options"===b&&(this.select?(this.select.U.options=a,this.select.U=this.select.qo(this.select.U),this._super("value",this.select.Nb())):this.Dia(a))},Kw:function(){if(this.select&&
this.select.nd()){var b=this.select.vc;if(b&&b.attr("data-oj-containerid")===this.select.qm)return b}return null},Kt:function(){return"native"===this.options.renderMode},ok:function(){var a=this.Kt();a&&this.element.parent().hasClass("oj-select-native")?(this.element.off("change"),this.element.hasClass(b.iv)&&b.h2(this.element),this.element.parent().hasClass("oj-select-native")&&(this.element.parent().children(".oj-select-arrow").remove(),this.element.unwrap()),this.element.removeClass("oj-select-select oj-component-initnode"),
this.element.attr({"aria-labelledby":""})):!a&&this.select&&(this.select._destroy(),this.select=void 0)},getNodeBySubId:function(b){var a=null,d;if(null==b)return(b=this.widget())?b[0]:null;if(this.Kt())return null;a=this._super(b);if(!a){var c=this.Kw();d=b.subId;switch(d){case "oj-select-drop":c&&(a=c[0]);break;case "oj-select-results":c&&(a=c.find(".oj-listbox-results")[0]);break;case "oj-select-search":c&&(a=c.find(".oj-listbox-search")[0]);break;case "oj-select-input":case "oj-listbox-input":!0===
this.options.multiple?a=this.widget().find(".oj-listbox-input")[0]:c&&(a=c.find(".oj-listbox-input")[0]);break;case "oj-select-choice":case "oj-select-chosen":case "oj-select-arrow":a=this.widget().find("."+d)[0];break;case "oj-listitem":c&&(a=c.find(".oj-listbox-result"),a=this.select.qj(a,b.value));break;case "oj-select-remove":a=this.widget().find(".oj-select-selected-choice");a=(b=this.select.qj(a,b.value))?f(b).find(".oj-select-clear-entry-icon")[0]:null;break;case "oj-listbox-result-label":c&&
(c=f("#"+this.select.jb.attr("id")).children(),b=b.index,c.length&&b<c.length&&(a=c.eq(b).find("."+d)[0]))}}return a||null},getSubIdByNode:function(b){if(this.Kt())return this._super(b);var a=null;null!=b&&(b=f(b),b.hasClass("oj-listbox-input")?a={subId:"oj-select-input"}:b.hasClass("oj-select-arrow")?a={subId:"oj-select-arrow"}:b.hasClass("oj-listbox-result")?a={subId:"oj-listitem",value:b.data("ojselect").value}:b.hasClass("oj-select-clear-entry-icon")&&(a={subId:"oj-select-remove",value:b.closest(".oj-select-selected-choice").data("ojselect").value}));
return a},_GetDefaultStyleClass:function(){return"oj-select"},_GetMessagingLauncherElement:function(){return this.select?this.select.selection:this.element},$d:function(){return this.select?this.select.selection:this.element}});a.Components.Tm({ojSelect:{displayOptions:{converterHint:["none"]},renderMode:a.Components.nh(function(){return a.Ee.Yk("select").renderMode})}})});