1((n,l,o)=>{namespace("NewDesign.Widgets")("Select",t);var a=o.classNameBuilder("select"),h=o.selectorBuilder("select");function t(t,e,i){var s;this.settings=i||{openUpwards:!1,includeSwatch:!1},this.id=e,this.eventNamespace=".select-"+this.id,this.$root=t,this.$native=this.$root.find(h("native")),this.$nativeOptions=this.$native.find("option"),this.$value=this.$root.find(h("value")),this.$anchor=this.$root.find(h("anchor")),this.$list=this.$root.find(h("list")),this.$options=this.$list.find(h("option")),this.$shade=this.$root.find(h("shade")),i=this.$nativeOptions.filter(":selected"),this.selected={value:i.val(),label:i.attr("orig-text")||i.text(),swatchUrl:i.attr("data-swatch-url")||""},this.maxHeight=this.getListMaxHeight(),this.isScrollable=this.$list.get(0).scrollHeight>this.maxHeight,this.isActive=!1,this.isDirty=!1,this.isErred=!1,this.isHovered=!1,this.isOnBottom=!1,this.disabledOptions=this.$nativeOptions.toArray().filter(function(t){return""!==t.value&&t.disabled}).map(function(t){return t.value}),this.didChange=!1,this.scrollPositionOnOpen=0,this.render(),s=this,l(document).on("click"+this.eventNamespace,function(t){o.isClickOutside(t,s.getRootNode())&&s.close()}),l(document).on("scroll"+this.eventNamespace,function(){var t=Math.abs(l(document).scrollTop()-s.scrollPositionOnOpen)<150;!s.isActive||s.isHovered||t||s.close()}),this.$anchor.on("click",function(){l(this).parent().click()}),this.$value.on("click",function(){var t=s.getListMaxHeight();s.maxHeight=t,s.isScrollable=s.$list.get(0).scrollHeight>t,s.isActive=!0,s.scrollPositionOnOpen=l(document).scrollTop(),s.render()}),this.$list.on("DOMMouseScroll mousewheel",function(t){var e=t.originalEvent,e=e.wheelDelta||-e.detail;(0<e&&0===this.scrollTop||e<=0&&this.scrollTop>=this.scrollHeight-this.clientHeight)&&t.preventDefault()}),this.$list.on("scroll",function(){var t=this.scrollHeight-this.scrollTop-this.clientHeight<=0;s.isOnBottom!==t&&(s.isOnBottom=t,s.render())}),this.$root.on("mouseenter",function(){s.isHovered=!0}),this.$root.on("mouseleave",function(){s.isHovered=!1}),this.$native.on("change",function(){var t=this.value,e=l(this).find("option:selected"),i=e.attr("orig-text")||e.text();s.didChange=s.selected.value!==t,s.selected={value:t,label:i,swatchUrl:e.attr("data-swatch-url")},s.render(),s.settings.onSizeChange&&s.settings.onSizeChange(t),s.settings.onColorChange&&s.settings.onColorChange(t)}),this.$native.attrchange({trackValues:!0,callback:function(t){"class"===t.attributeName&&(s.isErred=!!t.newValue.match(/error/),s.render())}}),this.$nativeOptions.attrchange({trackValues:!0,callback:function(t){var e=this.value,i="disabled"===t.newValue;"disabled"===t.attributeName&&(i&&s.disabledOptions.indexOf(e)<0?(s.disabledOptions.push(e),e===s.selected.value&&(s.selected={value:"",label:s.$nativeOptions.eq(0).text()},s.settings.onColorChange&&s.settings.onColorChange(s.selected.value),s.settings.onSizeChange)&&s.settings.onSizeChange(s.selected.value)):!i&&-1<s.disabledOptions.indexOf(e)&&(s.disabledOptions=s.disabledOptions.filter(function(t){return t!==e})),s.render())}}),this.$root.on("click",h("option"),function(){var t=l(this),e=t.data("value"),t=t.text();s.selected={value:e,label:t},s.isDirty=!0,s.isActive=!1,s.didChange=!0,s.syncValueWithNative(),s.render()})}t.prototype.close=function(){this.isActive=!1,this.didChange=!1,this.render()},t.prototype.getRootNode=function(){return this.$root?this.$root.get(0):null},t.prototype.getListMaxHeight=function(){var t,e=l(document).scrollTop(),e=this.$list.offset().top-e,e=Math.floor(l(window).height()-e-20);return!0===this.settings.openUpwards&&(e=385,t=this.$list.height()-this.$options.height(),this.$list.css("top",-t)),385<e?385:e},t.prototype.syncValueWithNative=function(){this.$native.val(this.selected.value).change()},t.prototype.remove=function(){l(document).off(this.eventNamespace),this.$root.remove()},t.prototype.setErrorState=function(t){this.isErred=!!t,this.render()},t.prototype.setDisabledOptions=function(e){this.$nativeOptions.each(function(){var t=l(this);t.prop("disabled",0<=e.indexOf(t.val()))})},t.prototype.render=function(){var i=this,t=i.maxHeight-i.$shade.height()-1,s=n.resources.NOT_AVAILABLE_SHORT,e=this.selected.label,o=18;this.$shade.css("transform","translateY("+t+"px)"),this.$list.css("max-height",this.maxHeight),this.$root.toggleClass(a(null,"active"),this.isActive).toggleClass(a(null,"no-change"),!this.didChange).toggleClass(a(null,"scrollable"),this.isActive&&this.isScrollable&&!this.isOnBottom),this.$options.length<2&&(o=22),l(window).width()<770&&(o=37),e.trim().length>o&&(e=e.substring(0,o)+"..."),this.$value.text(e).toggleClass(a("value","dirty"),this.isDirty).toggleClass(a("value","erred"),this.isErred).attr("data-sold-out",s),this.settings.includeSwatch&&""!==this.settings.includeSwatch&&this.$value.prepend('<span class="select__color-swatch"><img src="'+this.selected.swatchUrl+'" ></span>'),this.$options.each(function(){var t=l(this),e=-1<i.disabledOptions.indexOf(t.data("value").toString());t.toggleClass(a("option","disabled"),e).attr("data-sold-out",s).prop("disabled",e)})}})(app,jQuery,NewDesign.Utility);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.