@galaxyproject/galaxy-client
Version:
Galaxy client application build system
2 lines • 907 kB
JavaScript
/*! For license information please see generic.bundled.js.LICENSE.txt */
(()=>{var __webpack_modules__={1029:(e,t,i)=>{"use strict";i.d(t,{y:()=>o});var n=i(1179),a=i(62893),s=i(85486);function o(e,t,i){const o=(0,a.ref)(t);let r=!1;return(0,n.T3)((()=>i.value),(()=>{i.value&&!r&&((0,s.O)(`${e}-${i.value}`,o),r=!0)})),o}},1433:(e,t,i)=>{"use strict";i.d(t,{Vr:()=>n});i(39692),i(2543);const n={computed:{attributes(){return this.toCamelCase(this.$attrs)}},methods:{toCamelCase(e){const t={};for(const i in e){t[i.replace(/-./g,(e=>e[1].toUpperCase()))]=e[i]}return t}}}},2322:(e,t,i)=>{"use strict";function n(e,t){if(null==e){const e=t??TypeError("Value is undefined or null");throw e instanceof Error?e:TypeError(e)}}function a(e,t){return n(e,t),e}i.d(t,{YD:()=>a,iY:()=>n})},2723:(e,t,i)=>{"use strict";i.d(t,{P:()=>s,e:()=>a});var n=i(31866);const a="Default";function s(e){return new o(e)}class o{_data;constructor(e){this._data=e}get rawSourceLabel(){return this._data.quota_source_label??null}get sourceLabel(){return this.rawSourceLabel??a}get quotaInBytes(){return this._data.quota_bytes}get totalDiskUsageInBytes(){return this._data.total_disk_usage}get quotaPercent(){return this._data.quota_percent}get niceQuota(){return this.isUnlimited?"unlimited":void 0!==this.quotaInBytes&&null!==this.quotaInBytes?(0,n.Ar)(this.quotaInBytes,!0,void 0):"unknown"}get niceTotalDiskUsage(){return(0,n.Ar)(this.totalDiskUsageInBytes,!0,void 0)}get isUnlimited(){return!this.quotaInBytes}}},3800:(e,t,i)=>{"use strict";i.d(t,{o:()=>n});const n={SELECTED:"success",UNSELECTED:"default",MIXED:"secondary"}},4291:(e,t,i)=>{"use strict";i.d(t,{y:()=>a});var n=i(7129);class a{elements_states;elements_deleted;populated_state;constructor(e={}){this.elements_states=e.elements_states||{},this.elements_deleted=e.elements_deleted||0,this.populated_state=e.populated_state||null}get(e){return this.elements_states[e]||0}get datasetCount(){return Object.values(this.elements_states).reduce(((e,t)=>e+t),0)}getCount(e){return e.reduce(((e,t)=>e+this.get(t)),0)}get okCount(){return this.getCount(["ok","empty","deferred"])}get errorCount(){return this.getCount(["error","failed_metadata"])}get runningCount(){return this.getCount(["running","setting_metadata"])}get waitingCount(){return this.getCount(["queued","new","upload","paused"])}get deferredCount(){return this.getCount(["deferred","discarded"])}get isTerminal(){return!n.TJ.some((e=>this.get(e)>0))}get state(){return 0===this.datasetCount?this.populated_state||"new":this.errorCount>0?"error":this.runningCount>0?"running":this.waitingCount>0?"queued":this.deferredCount>0?"deferred":this.isTerminal?"ok":"new"}}},6277:(e,t,i)=>{"use strict";i.r(t);var n,a=i(45524),s=i.n(a);void 0===(n=s()).fn.each2&&n.extend(n.fn,{each2:function(e){for(var t=n([0]),i=-1,a=this.length;++i<a&&(t.context=t[0]=this[i])&&!1!==e.call(t[0],i,t););return this}}),function(e,t){if(window.Select2===t){var i,n,a,s,o,r,l,c,u={x:0,y:0},d={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){switch(e=e.which?e.which:e){case d.LEFT:case d.RIGHT:case d.UP:case d.DOWN:return!0}return!1},isControl:function(e){switch(e.which){case d.SHIFT:case d.CTRL:case d.ALT:return!0}return!!e.metaKey},isFunctionKey:function(e){return(e=e.which?e.which:e)>=112&&e<=123}},h={"Ⓐ":"A",A:"A",À:"A",Á:"A",Â:"A",Ầ:"A",Ấ:"A",Ẫ:"A",Ẩ:"A",Ã:"A",Ā:"A",Ă:"A",Ằ:"A",Ắ:"A",Ẵ:"A",Ẳ:"A",Ȧ:"A",Ǡ:"A",Ä:"A",Ǟ:"A",Ả:"A",Å:"A",Ǻ:"A",Ǎ:"A",Ȁ:"A",Ȃ:"A",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w","ⓧ":"x",x:"x",ẋ:"x",ẍ:"x","ⓨ":"y",y:"y",ỳ:"y",ý:"y",ŷ:"y",ỹ:"y",ȳ:"y",ẏ:"y",ÿ:"y",ỷ:"y",ẙ:"y",ỵ:"y",ƴ:"y",ɏ:"y",ỿ:"y","ⓩ":"z",z:"z",ź:"z",ẑ:"z",ż:"z",ž:"z",ẓ:"z",ẕ:"z",ƶ:"z",ȥ:"z",ɀ:"z",ⱬ:"z",ꝣ:"z",Ά:"Α",Έ:"Ε",Ή:"Η",Ί:"Ι",Ϊ:"Ι",Ό:"Ο",Ύ:"Υ",Ϋ:"Υ",Ώ:"Ω",ά:"α",έ:"ε",ή:"η",ί:"ι",ϊ:"ι",ΐ:"ι",ό:"ο",ύ:"υ",ϋ:"υ",ΰ:"υ",ω:"ω",ς:"σ"};r=e(document),c=1,s=function(){return c++},i=I(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(i){var n,a,o=".select2-results";this.opts=i=this.prepareOpts(i),this.id=i.id,i.element.data("select2")!==t&&null!==i.element.data("select2")&&i.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body),this.containerId="s2id_"+(i.element.attr("id")||"autogen"+s()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",i.element.attr("title")),this.body=e("body"),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",i.element.attr("style")),this.container.css(E(i.containerCss,this.opts.element)),this.container.addClass(E(i.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",w),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),x(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(E(i.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",w),this.results=n=this.container.find(o),this.search=a=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",w),this.results.on("mousemove",(function(i){var n=u;n!==t&&n.x===i.pageX&&n.y===i.pageY||e(i.target).trigger("mousemove-filtered",i)})),this.dropdown.on("mousemove-filtered",o,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",o,this.bind((function(e){this._touchEvent=!0,this.highlightUnderEvent(e)}))),this.dropdown.on("touchmove",o,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",o,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind((function(e){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())}))),function(e,t){var i=b(e,(function(e){t.trigger("scroll-debounced",e)}));t.on("scroll",(function(e){m(e.target,t.get())>=0&&i(e)}))}(80,this.results),this.dropdown.on("scroll-debounced",o,this.bind(this.loadMoreIfNeeded)),e(this.container).on("change",".select2-input",(function(e){e.stopPropagation()})),e(this.dropdown).on("change",".select2-input",(function(e){e.stopPropagation()})),e.fn.mousewheel&&n.mousewheel((function(e,t,i,a){var s=n.scrollTop();a>0&&s-a<=0?(n.scrollTop(0),w(e)):a<0&&n.get(0).scrollHeight-n.scrollTop()+a<=n.height()&&(n.scrollTop(n.get(0).scrollHeight-n.height()),w(e))})),y(a),a.on("keyup-change input paste",this.bind(this.updateResults)),a.on("focus",(function(){a.addClass("select2-focused")})),a.on("blur",(function(){a.removeClass("select2-focused")})),this.dropdown.on("mouseup",o,this.bind((function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))}))),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",(function(e){e.stopPropagation()})),this.nextSearchTerm=t,e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==i.maximumInputLength&&this.search.attr("maxlength",i.maximumInputLength);var r=i.element.prop("disabled");r===t&&(r=!1),this.enable(!r);var c=i.element.prop("readonly");c===t&&(c=!1),this.readonly(c),l=l||function(){var t=e("<div class='select2-measure-scrollbar'></div>");t.appendTo("body");var i={width:t.width()-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),i}(),this.autofocus=i.element.prop("autofocus"),i.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",i.searchInputPlaceholder)},destroy:function(){var e=this.opts.element,i=e.data("select2"),n=this;this.close(),e.length&&e[0].detachEvent&&e.each((function(){this.detachEvent("onpropertychange",n._sync)})),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,i!==t&&(i.container.remove(),i.liveRegion.remove(),i.dropdown.remove(),e.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?e.attr({tabindex:this.elementTabIndex}):e.removeAttr("tabindex"),e.show()),L.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(e){return e.is("option")?{id:e.prop("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:e.prop("disabled"),locked:g(e.attr("locked"),"locked")||g(e.data("locked"),!0)}:e.is("optgroup")?{text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")}:void 0},prepareOpts:function(i){var n,a,o,r,l=this;if("select"===(n=i.element).get(0).tagName.toLowerCase()&&(this.select=a=i.element),a&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],(function(){if(this in i)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")})),"function"!=typeof(i=e.extend({},{populateResults:function(n,a,o){var r,c=this.opts.id,u=this.liveRegion;r=function(n,a,d){var h,p,f,m,g,v,_,y,b,w,x=[];for(h=0,p=(n=i.sortResults(n,a,o)).length;h<p;h+=1)m=!(g=!0===(f=n[h]).disabled)&&c(f)!==t,v=f.children&&f.children.length>0,(_=e("<li></li>")).addClass("select2-results-dept-"+d),_.addClass("select2-result"),_.addClass(m?"select2-result-selectable":"select2-result-unselectable"),g&&_.addClass("select2-disabled"),v&&_.addClass("select2-result-with-children"),_.addClass(l.opts.formatResultCssClass(f)),_.attr("role","presentation"),(y=e(document.createElement("div"))).addClass("select2-result-label"),y.attr("id","select2-result-label-"+s()),y.attr("role","option"),(w=i.formatResult(f,y,o,l.opts.escapeMarkup))!==t&&(y.html(w),_.append(y)),v&&((b=e("<ul></ul>")).addClass("select2-result-sub"),r(f.children,b,d+1),_.append(b)),_.data("select2-data",f),x.push(_[0]);a.append(x),u.text(i.formatMatches(n.length))},r(a,n,0)}},e.fn.select2.defaults,i)).id&&(o=i.id,i.id=function(e){return e[o]}),e.isArray(i.element.data("select2Tags"))){if("tags"in i)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+i.element.attr("id");i.tags=i.element.data("select2Tags")}if(a?(i.query=this.bind((function(e){var i,a,s,o={results:[],more:!1},r=e.term;s=function(t,i){var n;t.is("option")?e.matcher(r,t.text(),t)&&i.push(l.optionToData(t)):t.is("optgroup")&&(n=l.optionToData(t),t.children().each2((function(e,t){s(t,n.children)})),n.children.length>0&&i.push(n))},i=n.children(),this.getPlaceholder()!==t&&i.length>0&&(a=this.getPlaceholderOption())&&(i=i.not(a)),i.each2((function(e,t){s(t,o.results)})),e.callback(o)})),i.id=function(e){return e.id}):"query"in i||("ajax"in i?((r=i.element.data("ajax-url"))&&r.length>0&&(i.ajax.url=r),i.query=S.call(i.element,i.ajax)):"data"in i?i.query=T(i.data):"tags"in i&&(i.query=A(i.tags),i.createSearchChoice===t&&(i.createSearchChoice=function(t){return{id:e.trim(t),text:e.trim(t)}}),i.initSelection===t&&(i.initSelection=function(t,n){var a=[];e(v(t.val(),i.separator)).each((function(){var t={id:this,text:this},n=i.tags;e.isFunction(n)&&(n=n()),e(n).each((function(){if(g(this.id,t.id))return t=this,!1})),a.push(t)})),n(a)}))),"function"!=typeof i.query)throw"query function not defined for Select2 "+i.element.attr("id");if("top"===i.createSearchChoicePosition)i.createSearchChoicePosition=function(e,t){e.unshift(t)};else if("bottom"===i.createSearchChoicePosition)i.createSearchChoicePosition=function(e,t){e.push(t)};else if("function"!=typeof i.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return i},monitorSource:function(){var i,n=this.opts.element,a=this;n.on("change.select2",this.bind((function(e){!0!==this.opts.element.data("select2-change-triggered")&&this.initSelection()}))),this._sync=this.bind((function(){var e=n.prop("disabled");e===t&&(e=!1),this.enable(!e);var i=n.prop("readonly");i===t&&(i=!1),this.readonly(i),x(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(E(this.opts.containerCssClass,this.opts.element)),x(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(E(this.opts.dropdownCssClass,this.opts.element))})),n.length&&n[0].attachEvent&&n.each((function(){this.attachEvent("onpropertychange",a._sync)})),(i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver)!==t&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new i((function(t){e.each(t,a._sync)})),this.propertyObserver.observe(n.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(t){var i=e.Event("select2-selecting",{val:this.id(t),object:t,choice:t});return this.opts.element.trigger(i),!i.isDefaultPrevented()},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return!0===this.enabledInterface},enableInterface:function(){var e=this._enabled&&!this._readonly,t=!e;return e!==this.enabledInterface&&(this.container.toggleClass("select2-container-disabled",t),this.close(),this.enabledInterface=e,!0)},enable:function(e){e===t&&(e=!0),this._enabled!==e&&(this._enabled=e,this.opts.element.prop("disabled",!e),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(e){e===t&&(e=!1),this._readonly!==e&&(this._readonly=e,this.opts.element.prop("readonly",e),this.enableInterface())},opened:function(){return!!this.container&&this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t,i,n,a,s,o=this.dropdown,r=this.container.offset(),c=this.container.outerHeight(!1),u=this.container.outerWidth(!1),d=o.outerHeight(!1),h=e(window),p=h.width(),f=h.height(),m=h.scrollLeft()+p,g=h.scrollTop()+f,v=r.top+c,_=r.left,y=v+d<=g,b=r.top-d>=h.scrollTop(),w=o.outerWidth(!1),x=_+w<=m;o.hasClass("select2-drop-above")?(i=!0,!b&&y&&(n=!0,i=!1)):(i=!1,!y&&b&&(n=!0,i=!0)),n&&(o.hide(),r=this.container.offset(),c=this.container.outerHeight(!1),u=this.container.outerWidth(!1),d=o.outerHeight(!1),m=h.scrollLeft()+p,g=h.scrollTop()+f,v=r.top+c,x=(_=r.left)+(w=o.outerWidth(!1))<=m,o.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(s=e(".select2-results",o)[0],o.addClass("select2-drop-auto-width"),o.css("width",""),(w=o.outerWidth(!1)+(s.scrollHeight===s.clientHeight?0:l.width))>u?u=w:w=u,d=o.outerHeight(!1),x=_+w<=m):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(v-=(t=this.body.offset()).top,_-=t.left),x||(_=r.left+this.container.outerWidth(!1)-w),a={left:_,width:u},i?(a.top=r.top-d,a.bottom="auto",this.container.addClass("select2-drop-above"),o.addClass("select2-drop-above")):(a.top=v,a.bottom="auto",this.container.removeClass("select2-drop-above"),o.removeClass("select2-drop-above")),a=e.extend(a,E(this.opts.dropdownCss,this.opts.element)),o.css(a)},shouldOpen:function(){var t;return!this.opened()&&(!1!==this._enabled&&!0!==this._readonly&&(t=e.Event("select2-opening"),this.opts.element.trigger(t),!t.isDefaultPrevented()))},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return!!this.shouldOpen()&&(this.opening(),r.on("mousemove.select2Event",(function(e){u.x=e.pageX,u.y=e.pageY})),!0)},opening:function(){var t,i=this.containerEventName,n="scroll."+i,a="resize."+i,s="orientationchange."+i;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),0==(t=e("#select2-drop-mask")).length&&((t=e(document.createElement("div"))).attr("id","select2-drop-mask").attr("class","select2-drop-mask"),t.hide(),t.appendTo(this.body),t.on("mousedown touchstart click",(function(i){p(t);var n,a=e("#select2-drop");a.length>0&&((n=a.data("select2")).opts.selectOnBlur&&n.selectHighlighted({noFocus:!0}),n.close(),i.preventDefault(),i.stopPropagation())}))),this.dropdown.prev()[0]!==t[0]&&this.dropdown.before(t),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),t.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var o=this;this.container.parents().add(window).each((function(){e(this).on(a+" "+n+" "+s,(function(e){o.opened()&&o.positionDropdown()}))}))},close:function(){if(this.opened()){var t=this.containerEventName,i="scroll."+t,n="resize."+t,a="orientationchange."+t;this.container.parents().add(window).each((function(){e(this).off(i).off(n).off(a)})),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),r.off("mousemove.select2Event"),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(e.Event("select2-close"))}},externalSearch:function(e){this.open(),this.search.val(e),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return E(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var t,i,n,a,s,o,r,l,c=this.results;(i=this.highlight())<0||(0!=i?(t=this.findHighlightableChoices().find(".select2-result-label"),a=(l=((n=e(t[i])).offset()||{}).top||0)+n.outerHeight(!0),i===t.length-1&&(r=c.find("li.select2-more-results")).length>0&&(a=r.offset().top+r.outerHeight(!0)),a>(s=c.offset().top+c.outerHeight(!0))&&c.scrollTop(c.scrollTop()+(a-s)),(o=l-c.offset().top)<0&&"none"!=n.css("display")&&c.scrollTop(c.scrollTop()+o)):c.scrollTop(0))},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(t){for(var i=this.findHighlightableChoices(),n=this.highlight();n>-1&&n<i.length;){var a=e(i[n+=t]);if(a.hasClass("select2-result-selectable")&&!a.hasClass("select2-disabled")&&!a.hasClass("select2-selected")){this.highlight(n);break}}},highlight:function(t){var i,n,a=this.findHighlightableChoices();if(0===arguments.length)return m(a.filter(".select2-highlighted")[0],a.get());t>=a.length&&(t=a.length-1),t<0&&(t=0),this.removeHighlight(),(i=e(a[t])).addClass("select2-highlighted"),this.search.attr("aria-activedescendant",i.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(i.text()),(n=i.data("select2-data"))&&this.opts.element.trigger({type:"select2-highlight",val:this.id(n),choice:n})},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var i=e(t.target).closest(".select2-result-selectable");if(i.length>0&&!i.is(".select2-highlighted")){var n=this.findHighlightableChoices();this.highlight(n.index(i))}else 0==i.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var e=this.results,t=e.find("li.select2-more-results"),i=this.resultsPage+1,n=this,a=this.search.val(),s=this.context;0!==t.length&&t.offset().top-e.offset().top-e.height()<=this.opts.loadMorePadding&&(t.addClass("select2-active"),this.opts.query({element:this.opts.element,term:a,page:i,context:s,matcher:this.opts.matcher,callback:this.bind((function(o){n.opened()&&(n.opts.populateResults.call(this,e,o.results,{term:a,page:i,context:s}),n.postprocessResults(o,!1,!1),!0===o.more?(t.detach().appendTo(e).text(E(n.opts.formatLoadMore,n.opts.element,i+1)),window.setTimeout((function(){n.loadMoreIfNeeded()}),10)):t.remove(),n.positionDropdown(),n.resultsPage=i,n.context=o.context,this.opts.element.trigger({type:"select2-loaded",items:o}))}))}))},tokenize:function(){},updateResults:function(i){var n,a,s,o=this.search,r=this.results,l=this.opts,c=this,u=o.val(),d=e.data(this.container,"select2-last-term");if((!0===i||!d||!g(u,d))&&(e.data(this.container,"select2-last-term",u),!0===i||!1!==this.showSearchInput&&this.opened())){s=++this.queryCount;var h=this.getMaximumSelectionSize();if(!(h>=1&&(n=this.data(),e.isArray(n)&&n.length>=h&&D(l.formatSelectionTooBig,"formatSelectionTooBig"))))return o.val().length<l.minimumInputLength?(D(l.formatInputTooShort,"formatInputTooShort")?f("<li class='select2-no-results'>"+E(l.formatInputTooShort,l.element,o.val(),l.minimumInputLength)+"</li>"):f(""),void(i&&this.showSearch&&this.showSearch(!0))):void(l.maximumInputLength&&o.val().length>l.maximumInputLength?D(l.formatInputTooLong,"formatInputTooLong")?f("<li class='select2-no-results'>"+E(l.formatInputTooLong,l.element,o.val(),l.maximumInputLength)+"</li>"):f(""):(l.formatSearching&&0===this.findHighlightableChoices().length&&f("<li class='select2-searching'>"+E(l.formatSearching,l.element)+"</li>"),o.addClass("select2-active"),this.removeHighlight(),(a=this.tokenize())!=t&&null!=a&&o.val(a),this.resultsPage=1,l.query({element:l.element,term:o.val(),page:this.resultsPage,context:null,matcher:l.matcher,callback:this.bind((function(n){var a;s==this.queryCount&&(this.opened()?n.hasError!==t&&D(l.formatAjaxError,"formatAjaxError")?f("<li class='select2-ajax-error'>"+E(l.formatAjaxError,l.element,n.jqXHR,n.textStatus,n.errorThrown)+"</li>"):(this.context=n.context===t?null:n.context,this.opts.createSearchChoice&&""!==o.val()&&(a=this.opts.createSearchChoice.call(c,o.val(),n.results))!==t&&null!==a&&c.id(a)!==t&&null!==c.id(a)&&0===e(n.results).filter((function(){return g(c.id(this),c.id(a))})).length&&this.opts.createSearchChoicePosition(n.results,a),0===n.results.length&&D(l.formatNoMatches,"formatNoMatches")?f("<li class='select2-no-results'>"+E(l.formatNoMatches,l.element,o.val())+"</li>"):(r.empty(),c.opts.populateResults.call(this,r,n.results,{term:o.val(),page:this.resultsPage,context:null}),!0===n.more&&D(l.formatLoadMore,"formatLoadMore")&&(r.append("<li class='select2-more-results'>"+l.escapeMarkup(E(l.formatLoadMore,l.element,this.resultsPage))+"</li>"),window.setTimeout((function(){c.loadMoreIfNeeded()}),10)),this.postprocessResults(n,i),p(),this.opts.element.trigger({type:"select2-loaded",items:n}))):this.search.removeClass("select2-active"))}))})));f("<li class='select2-selection-limit'>"+E(l.formatSelectionTooBig,l.element,h)+"</li>")}function p(){o.removeClass("select2-active"),c.positionDropdown(),r.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?c.liveRegion.text(r.text()):c.liveRegion.text(c.opts.formatMatches(r.find(".select2-result-selectable").length))}function f(e){r.html(e),p()}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){var e;(e=this.search)[0]!==document.activeElement&&window.setTimeout((function(){var t,i=e[0],n=e.val().length;e.focus(),(i.offsetWidth>0||i.offsetHeight>0)&&i===document.activeElement&&(i.setSelectionRange?i.setSelectionRange(n,n):i.createTextRange&&((t=i.createTextRange()).collapse(!1),t.select()))}),0)},selectHighlighted:function(e){if(this._touchMoved)this.clearTouchMoved();else{var t=this.highlight(),i=this.results.find(".select2-highlighted").closest(".select2-result").data("select2-data");i?(this.highlight(t),this.onSelect(i,e)):e&&e.noFocus&&this.close()}},getPlaceholder:function(){var e;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((e=this.getPlaceholderOption())!==t?e.text():t)},getPlaceholderOption:function(){if(this.select){var i=this.select.children("option").first();if(this.opts.placeholderOption!==t)return"first"===this.opts.placeholderOption&&i||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===e.trim(i.text())&&""===i.val())return i}},initContainerWidth:function(){var i=function(){var i,n,a,s,o;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if((i=this.opts.element.attr("style"))!==t)for(s=0,o=(n=i.split(";")).length;s<o;s+=1)if(null!==(a=n[s].replace(/\s/g,"").match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i))&&a.length>=1)return a[1];return"resolve"===this.opts.width?(i=this.opts.element.css("width")).indexOf("%")>0?i:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px":null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}.call(this);null!==i&&this.container.css("width",i)}}),n=I(i,{createContainer:function(){return e(document.createElement("div")).attr({class:"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'> </span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'"," aria-autocomplete='list' />"," </div>"," <ul class='select2-results' role='listbox'>"," </ul>","</div>"].join(""))},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var i,n,a;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),!1!==this.showSearchInput&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),(i=this.search.get(0)).createTextRange?((n=i.createTextRange()).collapse(!1),n.select()):i.setSelectionRange&&(a=this.search.val().length,i.setSelectionRange(a,a))),""===this.search.val()&&this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){e("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),L.call(this,"selection","focusser")},initContainer:function(){var t,i,n=this.container,a=this.dropdown,o=s();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=t=n.find(".select2-choice"),this.focusser=n.find(".select2-focusser"),t.find(".select2-chosen").attr("id","select2-chosen-"+o),this.focusser.attr("aria-labelledby","select2-chosen-"+o),this.results.attr("id","select2-results-"+o),this.search.attr("aria-owns","select2-results-"+o),this.focusser.attr("id","s2id_autogen"+o),i=e("label[for='"+this.opts.element.attr("id")+"']"),this.focusser.prev().text(i.text()).attr("for",this.focusser.attr("id"));var r=this.opts.element.attr("title");this.opts.element.attr("title",r||i.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(e("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind((function(e){if(this.isInterfaceEnabled()&&229!=e.keyCode)if(e.which!==d.PAGE_UP&&e.which!==d.PAGE_DOWN)switch(e.which){case d.UP:case d.DOWN:return this.moveHighlight(e.which===d.UP?-1:1),void w(e);case d.ENTER:return this.selectHighlighted(),void w(e);case d.TAB:return void this.selectHighlighted({noFocus:!0});case d.ESC:return this.cancel(e),void w(e)}else w(e)}))),this.search.on("blur",this.bind((function(e){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind((function(){this.opened()&&this.search.focus()})),0)}))),this.focusser.on("keydown",this.bind((function(e){if(this.isInterfaceEnabled()&&e.which!==d.TAB&&!d.isControl(e)&&!d.isFunctionKey(e)&&e.which!==d.ESC){if(!1!==this.opts.openOnEnter||e.which!==d.ENTER){if(e.which==d.DOWN||e.which==d.UP||e.which==d.ENTER&&this.opts.openOnEnter){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;return this.open(),void w(e)}return e.which==d.DELETE||e.which==d.BACKSPACE?(this.opts.allowClear&&this.clear(),void w(e)):void 0}w(e)}}))),y(this.focusser),this.focusser.on("keyup-change input",this.bind((function(e){if(this.opts.minimumResultsForSearch>=0){if(e.stopPropagation(),this.opened())return;this.open()}}))),t.on("mousedown touchstart","abbr",this.bind((function(e){var t;this.isInterfaceEnabled()&&(this.clear(),(t=e).preventDefault(),t.stopImmediatePropagation(),this.close(),this.selection.focus())}))),t.on("mousedown touchstart",this.bind((function(i){p(t),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),w(i)}))),a.on("mousedown touchstart",this.bind((function(){this.opts.shouldFocusInput(this)&&this.search.focus()}))),t.on("focus",this.bind((function(e){w(e)}))),this.focusser.on("focus",this.bind((function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")}))).on("blur",this.bind((function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(e.Event("select2-blur")))}))),this.search.on("focus",this.bind((function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")}))),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(t){var i=this.selection.data("select2-data");if(i){var n=e.Event("select2-clearing");if(this.opts.element.trigger(n),n.isDefaultPrevented())return;var a=this.getPlaceholderOption();this.opts.element.val(a?a.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),!1!==t&&(this.opts.element.trigger({type:"select2-removed",val:this.id(i),choice:i}),this.triggerChange({removed:i}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var e=this;this.opts.initSelection.call(null,this.opts.element,(function(i){i!==t&&null!==i&&(e.updateSelection(i),e.close(),e.setPlaceholder(),e.nextSearchTerm=e.opts.nextSearchTerm(i,e.search.val()))}))}},isPlaceholderOptionSelected:function(){var e;return this.getPlaceholder()!==t&&((e=this.getPlaceholderOption())!==t&&e.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===t||null===this.opts.element.val())},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),i=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var n=e.find("option").filter((function(){return this.selected&&!this.disabled}));t(i.optionToData(n))}:"data"in t&&(t.initSelection=t.initSelection||function(i,n){var a=i.val(),s=null;t.query({matcher:function(e,i,n){var o=g(a,t.id(n));return o&&(s=n),o},callback:e.isFunction(n)?function(){n(s)}:e.noop})}),t},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===t?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&e!==t){if(this.select&&this.getPlaceholderOption()===t)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(e,t,i){var n=0,a=this;if(this.findHighlightableChoices().each2((function(e,t){if(g(a.id(t.data("select2-data")),a.opts.element.val()))return n=e,!1})),!1!==i&&(!0===t&&n>=0?this.highlight(n):this.highlight(0)),!0===t){var s=this.opts.minimumResultsForSearch;s>=0&&this.showSearch(M(e.results)>=s)}},showSearch:function(t){this.showSearchInput!==t&&(this.showSearchInput=t,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!t),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!t),e(this.dropdown,this.container).toggleClass("select2-with-searchbox",t))},onSelect:function(e,t){if(this.triggerSelect(e)){var i=this.opts.element.val(),n=this.data();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"select2-selected",val:this.id(e),choice:e}),this.nextSearchTerm=this.opts.nextSearchTerm(e,this.search.val()),this.close(),t&&t.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),g(i,this.id(e))||this.triggerChange({added:e,removed:n})}},updateSelection:function(e){var i,n,a=this.selection.find(".select2-chosen");this.selection.data("select2-data",e),a.empty(),null!==e&&(i=this.opts.formatSelection(e,a,this.opts.escapeMarkup)),i!==t&&a.append(i),(n=this.opts.formatSelectionCssClass(e,a))!==t&&a.addClass(n),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.container.addClass("select2-allowclear")},val:function(){var e,i=!1,n=null,a=this,s=this.data();if(0===arguments.length)return this.opts.element.val();if(e=arguments[0],arguments.length>1&&(i=arguments[1]),this.select)this.select.val(e).find("option").filter((function(){return this.selected})).each2((function(e,t){return n=a.optionToData(t),!1})),this.updateSelection(n),this.setPlaceholder(),i&&this.triggerChange({added:n,removed:s});else{if(!e&&0!==e)return void this.clear(i);if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(e),this.opts.initSelection(this.opts.element,(function(e){a.opts.element.val(e?a.id(e):""),a.updateSelection(e),a.setPlaceholder(),i&&a.triggerChange({added:e,removed:s})}))}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var i,n=!1;if(0===arguments.length)return(i=this.selection.data("select2-data"))==t&&(i=null),i;arguments.length>1&&(n=arguments[1]),e?(i=this.data(),this.opts.element.val(e?this.id(e):""),this.updateSelection(e),n&&this.triggerChange({added:e,removed:i})):this.clear(n)}}),a=I(i,{createContainer:function(){return e(document.createElement("div")).attr({class:"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""))},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),i=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var n=[];e.find("option").filter((function(){return this.selected&&!this.disabled})).each2((function(e,t){n.push(i.optionToData(t))})),t(n)}:"data"in t&&(t.initSelection=t.initSelection||function(i,n){var a=v(i.val(),t.separator),s=[];t.query({matcher:function(i,n,o){var r=e.grep(a,(function(e){return g(e,t.id(o))})).length;return r&&s.push(o),r},callback:e.isFunction(n)?function(){for(var e=[],i=0;i<a.length;i++)for(var o=a[i],r=0;r<s.length;r++){var l=s[r];if(g(o,t.id(l))){e.push(l),s.splice(r,1);break}}n(e)}:e.noop})}),t},selectChoice:function(e){var t=this.container.find(".select2-search-choice-focus");t.length&&e&&e[0]==t[0]||(t.length&&this.opts.element.trigger("choice-deselected",t),t.removeClass("select2-search-choice-focus"),e&&e.length&&(this.close(),e.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",e)))},destroy:function(){e("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),L.call(this,"searchContainer","selection")},initContainer:function(){var t,i=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=t=this.container.find(i);var n=this;this.selection.on("click",".select2-search-choice:not(.select2-locked)",(function(t){n.search[0].focus(),n.selectChoice(e(this))})),this.search.attr("id","s2id_autogen"+s()),this.search.prev().text(e("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("input paste",this.bind((function(){this.search.attr("placeholder")&&0==this.search.val().length||this.isInterfaceEnabled()&&(this.opened()||this.open())}))),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind((function(i){if(this.isInterfaceEnabled()){++this.keydowns;var n=t.find(".select2-search-choice-focus"),a=n.prev(".select2-search-choice:not(.select2-locked)"),s=n.next(".select2-search-choice:not(.select2-locked)"),o=function(t){var i=0,n=0;if("selectionStart"in(t=e(t)[0]))i=t.selectionStart,n=t.selectionEnd-i;else if("selection"in document){t.focus();var a=document.selection.createRange();n=document.selection.createRange().text.length,a.moveStart("character",-t.value.length),i=a.text.length-n}return{offset:i,length:n}}(this.search);if(n.length&&(i.which==d.LEFT||i.which==d.RIGHT||i.which==d.BACKSPACE||i.which==d.DELETE||i.which==d.ENTER)){var r=n;return i.which==d.LEFT&&a.length?r=a:i.which==d.RIGHT?r=s.length?s:null:i.which===d.BACKSPACE?this.unselect(n.first())&&(this.search.width(10),r=a.length?a:s):i.which==d.DELETE?this.unselect(n.first())&&(this.search.width(10),r=s.length?s:null):i.which==d.ENTER&&(r=null),this.selectChoice(r),w(i),void(r&&r.length||this.open())}if((i.which===d.BACKSPACE&&1==this.keydowns||i.which==d.LEFT)&&0==o.offset&&!o.length)return this.selectChoice(t.find(".select2-search-choice:not(.select2-locked)").last()),void w(i);if(this.selectChoice(null),this.opened())switch(i.which){case d.UP:case d.DOWN:return this.moveHighlight(i.which===d.UP?-1:1),void w(i);case d.ENTER:return this.selectHighlighted(),void w(i);case d.TAB:return this.selectHighlighted({noFocus:!0}),void this.close();case d.ESC:return this.cancel(i),void w(i)}if(i.which!==d.TAB&&!d.isControl(i)&&!d.isFunctionKey(i)&&i.which!==d.BACKSPACE&&i.which!==d.ESC){if(i.which===d.ENTER){if(!1===this.opts.openOnEnter)return;if(i.altKey||i.ctrlKey||i.shiftKey||i.metaKey)return}this.open(),i.which!==d.PAGE_UP&&i.which!==d.PAGE_DOWN||w(i),i.which===d.ENTER&&w(i)}}}))),this.search.on("keyup",this.bind((function(e){this.keydowns=0,this.resizeSearch()}))),this.search.on("blur",this.bind((function(t){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),t.stopImmediatePropagation(),this.opts.element.trigger(e.Event("select2-blur"))}))),this.container.on("click",i,this.bind((function(t){this.isInterfaceEnabled()&&(e(t.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.open(),this.focusSearch(),t.preventDefault()))}))),this.container.on("focus",i,this.bind((function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())}))),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var e=this;this.opts.initSelection.call(null,this.opts.element,(function(i){i!==t&&null!==i&&(e.updateSelection(i),e.close(),e.clearSearch())}))}},clearSearch:function(){var e=this.getPlaceholder(),i=this.getMaxSearchWidth();e!==t&&0===this.getVal().length&&!1===this.search.hasClass("select2-focused")?(this.search.val(e).addClass("select2-default"),this.search.width(i>0?i:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var i=[],n=[],a=this;e(t).each((function(){m(a.id(this),i)<0&&(i.push(a.id(this)),n.push(this))})),t=n,this.selection.find(".select2-search-choice").remove(),e(t).each((function(){a.addSelectedChoice(this)})),a.postprocessResults()},tokenize:function(){var e=this.search.val();null!=(e=this.opts.tokenizer.call(this,e,this.data(),this.bind(this.onSelect),this.opts))&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,i){this.triggerSelect(e)&&""!==e.text&&(this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.nextSearchTerm=this.opts.nextSearchTerm(e,this.search.val()),this.moveHighlight(1),!this.select&&this.opts.closeOnSelect||this.postprocessResults(e,!1,!0===this.opts.closeOnSelect),this.opts.closeOnSelect?(this.clearSearch(),this.updateResults(),this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),i&&i.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(i){var n,a,s=!i.locked,o=e("<li class='select2-search-choice'> <div></div> <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),r=e("<li class='select2-search-choice select2-locked'><div></div></li>"),l=s?o:r,c=this.id(i),u=this.getVal();(n=this.opts.formatSelection(i,l.find("div"),this.opts.escapeMarkup))!=t&&l.find("div").replaceWith("<div>"+n+"</div>"),(a=this.opts.formatSelectionCssClass(i,l.find("div")))!=t&&l.addClass(a),s&&l.find(".select2-search-choice-close").on("mousedown",w).on("click dblclick",this.bind((function(t){this.isInterfaceEnabled()&&(this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),w(t),this.close(),this.focusSearch())}))).on("focus",this.bind((function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))}))),l.data("select2-data",i),l.insertBefore(this.searchContainer),u.push(c),this.setVal(u)},unselect:function(t){var i,n,a=this.getVal();if(0===(t=t.closest(".select2-search-choice")).length)throw"Invalid argument: "+t+". Must be .select2-search-choice";if(i=t.data("sel