var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.checkStringArgs=function(a,b,c){if(null==a)throw new TypeError("The 'this' value for String.prototype."+c+" must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype."+c+" must not be a regular expression");return a+""};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;
$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};
$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,b){var c=$jscomp.propertyToPolyfillSymbol[b];if(null==c)return a[b];c=a[c];return void 0!==c?c:a[b]};$jscomp.polyfill=function(a,b,c,d){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,b,c,d):$jscomp.polyfillUnisolated(a,b,c,d))};
$jscomp.polyfillUnisolated=function(a,b,c,d){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))return;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})};
$jscomp.polyfillIsolated=function(a,b,c,d){var e=a.split(".");a=1===e.length;d=e[0];d=!a&&d in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var f=0;f<e.length-1;f++){var g=e[f];if(!(g in d))return;d=d[g]}e=e[e.length-1];c=$jscomp.IS_SYMBOL_NATIVE&&"es6"===c?d[e]:null;b=b(c);null!=b&&(a?$jscomp.defineProperty($jscomp.polyfills,e,{configurable:!0,writable:!0,value:b}):b!==c&&(void 0===$jscomp.propertyToPolyfillSymbol[e]&&(c=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[e]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(e):$jscomp.POLYFILL_PREFIX+c+"$"+e),$jscomp.defineProperty(d,$jscomp.propertyToPolyfillSymbol[e],{configurable:!0,writable:!0,value:b})))};$jscomp.polyfill("String.prototype.endsWith",function(a){return a?a:function(b,c){var d=$jscomp.checkStringArgs(this,b,"endsWith");b+="";void 0===c&&(c=d.length);c=Math.max(0,Math.min(c|0,d.length));for(var e=b.length;0<e&&0<c;)if(d[--c]!=b[--e])return!1;return 0>=e}},"es6","es3");
zul.inp.ComboWidget=zk.$extends(zul.inp.InputWidget,{_buttonVisible:!0,_iconSclass:null,$define:{buttonVisible:function(a){zul.inp.RoundUtl.buttonVisible(this,a)},autodrop:null,popupWidth:function(a){if(this._open){a=this.getPopupNode_();var b=this.getPopupNode_(!0);if(a){var c=this._getPopupSize(a,b);this._fixsz(c);this._checkPopupSpaceAndPosition(a,this.$n());this._fixFfWhileBothScrollbar(a,b)}}},type:11>zk.ie?function(){this.rerender()}:function(a){var b=this.getInputNode();b&&(b.type=a)},iconSclass:function(a){var b=
this.$n("icon");this.desktop&&b&&(b.className=this.$s("icon")+" "+a)}},setWidth:function(){this.$supers("setWidth",arguments);if(this.desktop)this.onSize()},setRepos:function(a){!this._repos&&a&&(this.desktop&&(this._shallFixPopupDimension=!0),this._repos=!1)},onSize:function(){if(this._open){var a=this.getPopupNode_();a&&this._checkPopupSpaceAndPosition(a,this.$n())}},onFloatUp:function(a){if((this._inplace||this.isOpen())&&!jq(this.getPopupNode_()).is(":animated")&&!zUtl.isAncestor(this,a.origin)&&
(this.isOpen()&&this.close({sendOnOpen:!0}),this._inplace)){a=this.$n();var b=this.getInplaceCSS();jq(a).hasClass(b)||(a.style.width=jq.px0(zk(a).revisedWidth(a.offsetWidth)),jq(this.getInputNode()).addClass(b),jq(a).addClass(b),this.onSize(),a.style.width=this.getWidth()||"")}},onResponse:function(a,b){if((this._shallFixPopupDimension||b.rtags.onOpen||b.rtags.onChanging)&&this.isOpen())if(jq(this.getPopupNode_()).is(":animated")){var c=this;setTimeout(function(){if(c.desktop)c.onResponse(a,b)},50)}else{this._shallFixPopupDimension=
!1;var d=this.getPopupNode_(),e=this.getPopupSize_(d);try{var f=d.scrollLeft;var g=d.scrollTop;d.style.height="auto";zk.ie9&&(d.style.width=e[0]);this._fixsz(e)}finally{d.scrollTop=g||0,d.scrollLeft=f||0}}},onScroll:function(a){this.isOpen()&&a&&((a=this.getInputNode())&&zul.inp.InputWidget._isInView(this)?zk(this.getPopupNode_()).position(a,"after_start"):this.close({sendOnOpen:!0}))},setOpen:function(a,b){this.isRealVisible()&&(a?this.open(b):this.close(b))},isOpen:function(){return this._open},
open:function(a){if(!this._open){this._inplace&&(this._inplaceIgnore=!0);this._open=!0;a&&a.focus&&this.focus();var b=this.getPopupNode_(),c=this.getInputNode(),d=this.getPopupNode_(!0);if(b){this.setFloating_(!0,{node:b});zWatch.fire("onFloatUp",this);var e=this.setTopmost(),f=this.getSclass();b.className=this.$s("popup")+(f?" "+f:"");b.style.zIndex=0<e?e:1;b.style.position="absolute";b.style.display="block";e=this._getPopupSize(b,d);(f=zk.ie10_||zk.ie11_)&&this._fixsz(e);b.style.visibility="hidden";
b.style.left="-10000px";zk(b).makeVParent();zWatch.fireDown("onVParent",this);f&&(b.style.height=b.style.width="auto");this._fixsz(e);b.style.left="";var g=this.$n();e=jq(g);f=jq(b);this._checkPopupSpaceAndPosition(b,g);this._shallSyncPopupPosition=!1;g=f.offset().top;b.style.display="none";b.style.visibility="";e.offset().top>g?this.slideDown_(b,"b"):this.slideDown_(b);this._fixFfWhileBothScrollbar(b,d);this._shadow||(this._shadow=new zk.eff.Shadow(b,{left:-4,right:4,top:-2,bottom:3}));a&&a.sendOnOpen&&
this.fire("onOpen",{open:!0,value:c.value},{rtags:{onOpen:1}});a=this.$s("open");e.addClass(a);f.addClass(a)}}},_getPopupSize:function(a,b){var c=this.getPopupSize_(a);a.style.width=c[0];a.style.height="auto";b&&(b.style.width=b.style.height="auto");this.presize_()&&(c=this.getPopupSize_(a));return c},_checkPopupSpaceAndPosition:function(a,b){a=zk(a);var c=a.dimension().height,d=a.dimension().width,e=(b.nodeType?zk(b):b).dimension(!0),f=e.top,g=e.left,p=e.height,h=this.$n("btn");e=e.width-(h?h.offsetWidth:
0);h=jq.innerX();var n=jq.innerY(),q=jq.innerHeight(),r=jq.innerWidth(),k="start",l="after",m;h+r-g-e>d?k="start":g-h>d?k="end":m={overflow:!0};n+q-f-p>c?l="after":f-n>c?l="before":m={overflow:!0};a.position(b,l+"_"+k,m)},_fixFfWhileBothScrollbar:function(a,b){if(zk.gecko&&(b=b?b.rows:null)&&10<a.offsetHeight-a.clientHeight&&150>a.offsetHeight){for(var c=0,d=b.length;d--;)c+=b[d].offsetHeight;a.style.height=jq.px0(c+20)}},_checkPopupPosition:function(){var a=this.getPopupNode_(),b=zk(a),c=this.getInputNode();
a=b.dimension(!0);c=zk(c).dimension(!0);var d=a.top+a.height,e=a.left+a.width;b=d-b.scrollOffset()[1];var f=c.top+c.height,g=c.left+c.width;return b>=jq.innerHeight()||a.top<c.top&&d<c.top||a.left<g&&e>c.left&&d>c.top&&a.top<f?this._shallSyncPopupPosition=!0:!1},presize_:zk.$void,slideDown_:function(a,b){zk(a).slideDown(this,{afterAnima:this._afterSlideDown,duration:100,anchor:b})},slideUp_:function(a){a.style.display="none"},zsync:function(){this.$supers("zsync",arguments);!zk.css3&&this.isOpen()&&
this._shadow&&this._shadow.sync()},_afterSlideDown:function(a){this.desktop||(zk(a).undoVParent(),jq(a).remove());this._shadow&&this._shadow.sync()},getPopupNode_:function(a){return a?this.$n("cave"):this.$n("pp")},close:function(a){if(this._open){this._inplace&&(this._inplaceIgnore=!1);var b=this;if(jq(this.getPopupNode_()).is(":animated"))setTimeout(function(){b.desktop&&b.close(a)},50);else{this._open=!1;a&&a.focus&&this.focus();var c=this.getPopupNode_();if(c){this.setFloating_(!1);zWatch.fireDown("onHide",
this);this.slideUp_(c);zk.afterAnimate(function(){zk(c).undoVParent();zWatch.fireDown("onVParent",b)},-1);this._shadow&&(this._shadow.destroy(),this._shadow=null);a&&a.sendOnOpen&&this.fire("onOpen",{open:!1,value:this.getInputNode().value},{rtags:{onOpen:1}});var d=this.$s("open");jq(this.$n()).removeClass(d);jq(c).removeClass(d)}}}},_fixsz:function(a){var b=this.getPopupNode_();if(b){var c=this.getPopupNode_(!0);"auto"==a[1]&&350<b.offsetHeight?b.style.height="350px":10>b.offsetHeight&&this._shadow&&
this._shadow.sync();var d=this.$n(),e;(e=this.getPopupWidth())?e.endsWith("%")?b.style.width=jq.px0(d.offsetWidth*parseFloat(e)/100):b.style.width=e:"auto"==a[0]&&(b.offsetWidth<=d.offsetWidth?(b.style.width=jq.px0(zk(b).revisedWidth(d.offsetWidth)),c&&(c.style.width="100%")):(a=jq.innerWidth()-20,a<d.offsetWidth&&(a=d.offsetWidth),b.offsetWidth>a&&(b.style.width=jq.px0(a))))}},dnPressed_:zk.$void,upPressed_:zk.$void,otherPressed_:zk.$void,enterPressed_:function(a){this.close({sendOnOpen:!0});this.updateChange_();
a.stop()},escPressed_:function(a){this.close({sendOnOpen:!0});a.stop()},getPopupSize_:function(a){return["auto","auto"]},redrawpp_:function(a){},afterKeyDown_:function(a,b){!b&&this._inplace&&jq(this.$n()).toggleClass(this.getInplaceCSS(),13==a.keyCode?null:!1);return this.$supers("afterKeyDown_",arguments)},_dnInputOpen:function(){this._autodrop&&!this._open&&this.open({sendOnOpen:!0})},bind_:function(){this.$supers(zul.inp.ComboWidget,"bind_",arguments);var a;if(a=this.$n("btn"))this.domListen_(a,
zk.android?"onTouchstart":"onClick","_doBtnClick"),this._inplace&&this.domListen_(a,"onMouseDown","_doBtnMouseDown");this.domListen_(this.$n("real"),"onInput","_dnInputOpen");zWatch.listen({onSize:this,onFloatUp:this,onResponse:this,onScroll:this});if(!zk.css3)jq.onzsync(this)},unbind_:function(){this.close();var a=this.$n("btn");a&&(this.domUnlisten_(a,zk.android?"onTouchstart":"onClick","_doBtnClick"),this._inplace&&this.domUnlisten_(a,"onMouseDown","_doBtnMouseDown"));zWatch.unlisten({onSize:this,
onFloatUp:this,onResponse:this,onScroll:this});zk.css3||jq.unzsync(this);this.domUnlisten_(this.$n("real"),"onInput","_dnInputOpen");this.$supers(zul.inp.ComboWidget,"unbind_",arguments)},inRoundedMold:function(){return!0},_doBtnClick:function(a){this._inplaceIgnore=!1;this._buttonVisible&&(this._disabled||jq(this.getPopupNode_()).is(":animated")||(this._open?this.close({focus:zul.inp.InputCtrl.isPreservedFocus(this),sendOnOpen:!0}):this.open({focus:zul.inp.InputCtrl.isPreservedFocus(this),sendOnOpen:!0})),
zk.ios&&(this._windowX=window.pageXOffset,this._windowY=window.pageYOffset),a.stop(this._open?{propagation:1}:null))},_doBtnMouseDown:function(a){this._inplaceIgnore=!0},doKeyDown_:function(a){this._disabled||(this._doKeyDown(a),a.stopped||this.$supers("doKeyDown_",arguments))},doKeyUp_:function(){this._updateValue();this.$supers("doKeyUp_",arguments)},doClick_:function(a){this._disabled||(a.domTarget==this.getPopupNode_()?this.close({focus:zul.inp.InputCtrl.isPreservedFocus(this),sendOnOpen:!0}):
this._readonly&&!this.isOpen()&&this._buttonVisible&&this.open({focus:zul.inp.InputCtrl.isPreservedFocus(this),sendOnOpen:!0}),this.$supers("doClick_",arguments))},_doKeyDown:function(a){var b=a.keyCode,c=this._open;a.target==this&&9==b?c&&this.close({sendOnOpen:!0}):!a.altKey||38!=b&&40!=b?!c||13!=b&&27!=b?38==b?this.upPressed_(a):40==b?this.dnPressed_(a):this.otherPressed_(a):13==b?this.enterPressed_(a):this.escPressed_(a):(c?this.close({sendOnOpen:!0}):this.open({sendOnOpen:!0}),b={propagation:!0},
11>zk.ie&&(b.dom=!0),a.stop(b))},redraw_:_zkf=function(a){var b=this.uuid,c=this._buttonVisible;a.push("<span",this.domAttrs_({text:!0,tabindex:!0}),' role="combobox" aria-expanded="false" aria-owns="',b,'-pp" aria-haspopup="dialog"><input id="',b,'-real" class="',this.$s("input"));c||a.push(" ",this.$s("input-full"));a.push('" autocomplete="off" aria-autocomplete="none" aria-controls="',b,'-pp"',this.textAttrs_(),'/><a id="',b,'-btn" tabindex="-1" role="button" aria-label="',msgzul.PANEL_EXPAND,
'" class="',this.$s("button"));c||a.push(" ",this.$s("disabled"));a.push('" aria-hidden="true"><i id="',b,'-icon" class="',this.$s("icon")," ",this.getIconSclass(),'"></i></a>');this.redrawpp_(a);a.push("</span>")}},{$redraw:_zkf});
