1 line
No EOL
44 KiB
JavaScript
Executable file
1 line
No EOL
44 KiB
JavaScript
Executable file
!function(e,t){var i=function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=375)}({374:function(e,t){!function(e){"use strict";var t,i,n,s=document.createElement("_");if(s.classList.toggle("c3",!1),s.classList.contains("c3")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:o.call(this,e)}}function l(e){var t,i=[],n=e&&e.options;if(e.multiple)for(var s=0,o=n.length;s<o;s++)(t=n[s]).selected&&i.push(t.value||t.text);else i=e.value;return i}String.prototype.startsWith||(t=function(){try{var e={},t=Object.defineProperty,i=t(e,e,e)&&t}catch(e){}return i}(),i={}.toString,n=function(e){if(null==this)throw new TypeError;var t=String(this);if(e&&"[object RegExp]"==i.call(e))throw new TypeError;var n=t.length,s=String(e),o=s.length,l=arguments.length>1?arguments[1]:void 0,r=l?Number(l):0;r!=r&&(r=0);var c=Math.min(Math.max(r,0),n);if(o+c>n)return!1;for(var a=-1;++a<o;)if(t.charCodeAt(c+a)!=s.charCodeAt(a))return!1;return!0},t?t(String.prototype,"startsWith",{value:n,configurable:!0,writable:!0}):String.prototype.startsWith=n),Object.keys||(Object.keys=function(e,t,i){for(t in i=[],e)i.hasOwnProperty.call(e,t)&&i.push(t);return i});var r={useDefault:!1,_set:e.valHooks.select.set};e.valHooks.select.set=function(t,i){return i&&!r.useDefault&&e(t).data("selected",!0),r._set.apply(this,arguments)};var c=null,a=function(){try{return new Event("change"),!0}catch(e){return!1}}();function d(e,t,i,n){for(var s=["content","subtext","tokens"],o=!1,l=0;l<s.length;l++){var r=s[l],c=e[r];if(c&&(c=c.toString(),"content"===r&&(c=c.replace(/<[^>]+>/g,"")),n&&(c=p(c)),c=c.toUpperCase(),o="contains"===i?c.indexOf(t)>=0:c.startsWith(t)))break}return o}function h(e){return parseInt(e,10)||0}function p(t){return e.each([{re:/[\xC0-\xC6]/g,ch:"A"},{re:/[\xE0-\xE6]/g,ch:"a"},{re:/[\xC8-\xCB]/g,ch:"E"},{re:/[\xE8-\xEB]/g,ch:"e"},{re:/[\xCC-\xCF]/g,ch:"I"},{re:/[\xEC-\xEF]/g,ch:"i"},{re:/[\xD2-\xD6]/g,ch:"O"},{re:/[\xF2-\xF6]/g,ch:"o"},{re:/[\xD9-\xDC]/g,ch:"U"},{re:/[\xF9-\xFC]/g,ch:"u"},{re:/[\xC7-\xE7]/g,ch:"c"},{re:/[\xD1]/g,ch:"N"},{re:/[\xF1]/g,ch:"n"}],function(){t=t?t.replace(this.re,this.ch):""}),t}e.fn.triggerNative=function(e){var t,i=this[0];i.dispatchEvent?(a?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(e,!0,!1),i.dispatchEvent(t)):i.fireEvent?((t=document.createEventObject()).eventType=e,i.fireEvent("on"+e,t)):this.trigger(e)};var u=function(e){var t=function(t){return e[t]},i="(?:"+Object.keys(e).join("|")+")",n=RegExp(i),s=RegExp(i,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(s,t):e}},f=u({"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"}),m=u({"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"}),v={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},g={ESCAPE:27,ENTER:13,SPACE:32,TAB:9,ARROW_UP:38,ARROW_DOWN:40},b={};try{b.full=(e.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split("."),b.major=b.full[0]}catch(e){console.error("There was an issue retrieving Bootstrap's version. Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision.",e),b.major="3"}var x={DISABLED:"disabled",DIVIDER:"4"===b.major?"dropdown-divider":"divider",SHOW:"4"===b.major?"show":"open",DROPUP:"dropup",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"4"===b.major?"btn-light":"btn-default",POPOVERHEADER:"4"===b.major?"popover-header":"popover-title"},w=new RegExp(g.ARROW_UP+"|"+g.ARROW_DOWN),I=new RegExp("^"+g.TAB+"$|"+g.ESCAPE),k=(new RegExp(g.ENTER+"|"+g.SPACE),function(t,i){var n=this;r.useDefault||(e.valHooks.select.set=r._set,r.useDefault=!0),this.$element=e(t),this.$newElement=null,this.$button=null,this.$menu=null,this.options=i,this.selectpicker={main:{map:{newIndex:{},originalIndex:{}}},current:{map:{}},search:{map:{}},view:{},keydown:{keyHistory:"",resetKeyHistory:{start:function(){return setTimeout(function(){n.selectpicker.keydown.keyHistory=""},800)}}}},null===this.options.title&&(this.options.title=this.$element.attr("title"));var s=this.options.windowPadding;"number"==typeof s&&(this.options.windowPadding=[s,s,s,s]),this.val=k.prototype.val,this.render=k.prototype.render,this.refresh=k.prototype.refresh,this.setStyle=k.prototype.setStyle,this.selectAll=k.prototype.selectAll,this.deselectAll=k.prototype.deselectAll,this.destroy=k.prototype.destroy,this.remove=k.prototype.remove,this.show=k.prototype.show,this.hide=k.prototype.hide,this.init()});function $(t){var i,n=arguments,s=t;[].shift.apply(n);var o=this.each(function(){var t=e(this);if(t.is("select")){var o=t.data("selectpicker"),l="object"==typeof s&&s;if(o){if(l)for(var r in l)l.hasOwnProperty(r)&&(o.options[r]=l[r])}else{var c=e.extend({},k.DEFAULTS,e.fn.selectpicker.defaults||{},t.data(),l);c.template=e.extend({},k.DEFAULTS.template,e.fn.selectpicker.defaults?e.fn.selectpicker.defaults.template:{},t.data().template,l.template),t.data("selectpicker",o=new k(this,c))}"string"==typeof s&&(i=o[s]instanceof Function?o[s].apply(o,n):o.options[s])}});return void 0!==i?i:o}k.VERSION="1.13.1",k.DEFAULTS={noneSelectedText:"Nothing selected",noneResultsText:"No results matched {0}",countSelectedText:function(e,t){return 1==e?"{0} item selected":"{0} items selected"},maxOptionsText:function(e,t){return[1==e?"Limit reached ({n} item max)":"Limit reached ({n} items max)",1==t?"Group limit reached ({n} item max)":"Group limit reached ({n} items max)"]},selectAllText:"Select All",deselectAllText:"Deselect All",doneButton:!1,doneButtonText:"Close",multipleSeparator:", ",styleBase:"btn",style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",width:!1,container:!1,hideDisabled:!1,showSubtext:!1,showIcon:!0,showContent:!0,dropupAuto:!0,header:!1,liveSearch:!1,liveSearchPlaceholder:null,liveSearchNormalize:!1,liveSearchStyle:"contains",actionsBox:!1,iconBase:"glyphicon",tickIcon:"glyphicon-ok",showTick:!1,template:{caret:'<span class="caret"></span>'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600},"4"===b.major&&(k.DEFAULTS.style="btn-light",k.DEFAULTS.iconBase="",k.DEFAULTS.tickIcon="bs-ok-default"),k.prototype={constructor:k,init:function(){var e=this,t=this.$element.attr("id");this.$element.addClass("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),this.$newElement=this.createDropdown(),this.createLi(),this.$element.after(this.$newElement).prependTo(this.$newElement),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(".dropdown-menu"),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),this.$element.removeClass("bs-select-hidden"),!0===this.options.dropdownAlignRight&&this.$menu.addClass(x.MENURIGHT),void 0!==t&&this.$button.attr("data-id",t),this.checkDisabled(),this.clickListener(),this.options.liveSearch&&this.liveSearchListener(),this.render(),this.setStyle(),this.setWidth(),this.options.container?this.selectPosition():this.$element.on("hide.bs.select",function(){if(e.isVirtual()){var t=e.$menuInner[0],i=t.firstChild.cloneNode(!1);t.replaceChild(i,t.firstChild),t.scrollTop=0}}),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(t){e.$menuInner.attr("aria-expanded",!1),e.$element.trigger("hide.bs.select",t)},"hidden.bs.dropdown":function(t){e.$element.trigger("hidden.bs.select",t)},"show.bs.dropdown":function(t){e.$menuInner.attr("aria-expanded",!0),e.$element.trigger("show.bs.select",t)},"shown.bs.dropdown":function(t){e.$element.trigger("shown.bs.select",t)}}),e.$element[0].hasAttribute("required")&&this.$element.on("invalid",function(){e.$button.addClass("bs-invalid"),e.$element.on({"shown.bs.select":function(){e.$element.val(e.$element.val()).off("shown.bs.select")},"rendered.bs.select":function(){this.validity.valid&&e.$button.removeClass("bs-invalid"),e.$element.off("rendered.bs.select")}}),e.$button.on("blur.bs.select",function(){e.$element.focus().blur(),e.$button.off("blur.bs.select")})}),setTimeout(function(){e.$element.trigger("loaded.bs.select")})},createDropdown:function(){var t=this.multiple||this.options.showTick?" show-tick":"",i=this.autofocus?" autofocus":"",n=this.options.header?'<div class="'+x.POPOVERHEADER+'"><button type="button" class="close" aria-hidden="true">×</button>'+this.options.header+"</div>":"",s=this.options.liveSearch?'<div class="bs-searchbox"><input type="text" class="form-control" autocomplete="off"'+(null===this.options.liveSearchPlaceholder?"":' placeholder="'+f(this.options.liveSearchPlaceholder)+'"')+' role="textbox" aria-label="Search"></div>':"",o=this.multiple&&this.options.actionsBox?'<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button type="button" class="actions-btn bs-select-all btn '+x.BUTTONCLASS+'">'+this.options.selectAllText+'</button><button type="button" class="actions-btn bs-deselect-all btn '+x.BUTTONCLASS+'">'+this.options.deselectAllText+"</button></div></div>":"",l=this.multiple&&this.options.doneButton?'<div class="bs-donebutton"><div class="btn-group btn-block"><button type="button" class="btn btn-sm '+x.BUTTONCLASS+'">'+this.options.doneButtonText+"</button></div></div>":"",r='<div class="dropdown bootstrap-select'+t+'"><button type="button" class="'+this.options.styleBase+' dropdown-toggle" data-toggle="dropdown"'+i+' role="button"><div class="filter-option"><div class="filter-option-inner"><div class="filter-option-inner-inner"></div></div> </div>'+("4"===b.major?"":'<span class="bs-caret">'+this.options.template.caret+"</span>")+'</button><div class="dropdown-menu '+("4"===b.major?"":x.SHOW)+'" role="combobox">'+n+s+o+'<div class="inner '+x.SHOW+'" role="listbox" aria-expanded="false" tabindex="-1"><ul class="dropdown-menu inner '+("4"===b.major?x.SHOW:"")+'"></ul></div>'+l+"</div></div>";return e(r)},setPositionData:function(){this.selectpicker.view.canHighlight=[];for(var e=0;e<this.selectpicker.current.data.length;e++){var t=this.selectpicker.current.data[e],i=!0;"divider"===t.type?(i=!1,t.height=this.sizeInfo.dividerHeight):"optgroup-label"===t.type?(i=!1,t.height=this.sizeInfo.dropdownHeaderHeight):t.height=this.sizeInfo.liHeight,t.disabled&&(i=!1),this.selectpicker.view.canHighlight.push(i),t.position=(0===e?0:this.selectpicker.current.data[e-1].position)+t.height}},isVirtual:function(){return!1!==this.options.virtualScroll&&this.selectpicker.main.elements.length>=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(t,i){i=i||0;var n=this;this.selectpicker.current=t?this.selectpicker.search:this.selectpicker.main;var s,o,l=[];function r(e,i){var r,c,a,d,h,p,u,f,m,v=n.selectpicker.current.elements.length,g=[],b=void 0,x=!0,w=n.isVirtual();n.selectpicker.view.scrollTop=e,!0===w&&n.sizeInfo.hasScrollBar&&n.$menu[0].offsetWidth>n.sizeInfo.totalMenuWidth&&(n.sizeInfo.menuWidth=n.$menu[0].offsetWidth,n.sizeInfo.totalMenuWidth=n.sizeInfo.menuWidth+n.sizeInfo.scrollBarWidth,n.$menu.css("min-width",n.sizeInfo.menuWidth)),r=Math.ceil(n.sizeInfo.menuInnerHeight/n.sizeInfo.liHeight*1.5),c=Math.round(v/r)||1;for(var I=0;I<c;I++){var k=(I+1)*r;if(I===c-1&&(k=v),g[I]=[I*r+(I?1:0),k],!v)break;void 0===b&&e<=n.selectpicker.current.data[k-1].position-n.sizeInfo.menuInnerHeight&&(b=I)}if(void 0===b&&(b=0),h=[n.selectpicker.view.position0,n.selectpicker.view.position1],a=Math.max(0,b-1),d=Math.min(c-1,b+1),n.selectpicker.view.position0=Math.max(0,g[a][0])||0,n.selectpicker.view.position1=Math.min(v,g[d][1])||0,p=h[0]!==n.selectpicker.view.position0||h[1]!==n.selectpicker.view.position1,void 0!==n.activeIndex&&(o=n.selectpicker.current.elements[n.selectpicker.current.map.newIndex[n.prevActiveIndex]],l=n.selectpicker.current.elements[n.selectpicker.current.map.newIndex[n.activeIndex]],s=n.selectpicker.current.elements[n.selectpicker.current.map.newIndex[n.selectedIndex]],i&&(n.activeIndex!==n.selectedIndex&&(l.classList.remove("active"),l.firstChild&&l.firstChild.classList.remove("active")),n.activeIndex=void 0),n.activeIndex&&n.activeIndex!==n.selectedIndex&&s&&s.length&&(s.classList.remove("active"),s.firstChild&&s.firstChild.classList.remove("active"))),void 0!==n.prevActiveIndex&&n.prevActiveIndex!==n.activeIndex&&n.prevActiveIndex!==n.selectedIndex&&o&&o.length&&(o.classList.remove("active"),o.firstChild&&o.firstChild.classList.remove("active")),(i||p)&&(u=n.selectpicker.view.visibleElements?n.selectpicker.view.visibleElements.slice():[],n.selectpicker.view.visibleElements=n.selectpicker.current.elements.slice(n.selectpicker.view.position0,n.selectpicker.view.position1),n.setOptionStatus(),(t||!1===w&&i)&&(f=u,m=n.selectpicker.view.visibleElements,x=!(f.length===m.length&&f.every(function(e,t){return e===m[t]}))),(i||!0===w)&&x)){var $,E,C=n.$menuInner[0],S=document.createDocumentFragment(),y=C.firstChild.cloneNode(!1),O=!0===w?n.selectpicker.view.visibleElements:n.selectpicker.current.elements;C.replaceChild(y,C.firstChild);for(var I=0,z=O.length;I<z;I++)S.appendChild(O[I]);!0===w&&($=0===n.selectpicker.view.position0?0:n.selectpicker.current.data[n.selectpicker.view.position0-1].position,E=n.selectpicker.view.position1>v-1?0:n.selectpicker.current.data[v-1].position-n.selectpicker.current.data[n.selectpicker.view.position1-1].position,C.firstChild.style.marginTop=$+"px",C.firstChild.style.marginBottom=E+"px"),C.firstChild.appendChild(S)}if(n.prevActiveIndex=n.activeIndex,n.options.liveSearch){if(t&&i){var T,D=0;n.selectpicker.view.canHighlight[D]||(D=1+n.selectpicker.view.canHighlight.slice(1).indexOf(!0)),T=n.selectpicker.view.visibleElements[D],n.selectpicker.view.currentActive&&(n.selectpicker.view.currentActive.classList.remove("active"),n.selectpicker.view.currentActive.firstChild&&n.selectpicker.view.currentActive.firstChild.classList.remove("active")),T&&(T.classList.add("active"),T.firstChild&&T.firstChild.classList.add("active")),n.activeIndex=n.selectpicker.current.map.originalIndex[D]}}else n.$menuInner.focus()}this.setPositionData(),r(i,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",function(e,t){n.noScroll||r(this.scrollTop,t),n.noScroll=!1}),e(window).off("resize.createView").on("resize.createView",function(){r(n.$menuInner[0].scrollTop)})},createLi:function(){var t,i=this,n=[],s=0,o=0,l=[],r=0,c=0,a=-1;this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option"));var d={span:document.createElement("span"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode(" ")},h=d.span.cloneNode(!1),p=document.createDocumentFragment();h.className=i.options.iconBase+" "+i.options.tickIcon+" check-mark",d.a.appendChild(h),d.a.setAttribute("role","option"),d.subtext.className="text-muted",d.text=d.span.cloneNode(!1),d.text.className="text";var u=function(e,t,i,n){var s=d.li.cloneNode(!1);return e&&(1===e.nodeType||11===e.nodeType?s.appendChild(e):s.innerHTML=e),void 0!==i&&""!==i&&(s.className=i),void 0!==n&&null!==n&&s.classList.add("optgroup-"+n),s},m=function(e,t,i){var n=d.a.cloneNode(!0);return e&&(11===e.nodeType?n.appendChild(e):n.insertAdjacentHTML("beforeend",e)),void 0!==t&""!==t&&(n.className=t),"4"===b.major&&n.classList.add("dropdown-item"),i&&n.setAttribute("style",i),n},v=function(e){var t,n,s=d.text.cloneNode(!1);if(e.optionContent)s.innerHTML=e.optionContent;else{if(s.textContent=e.text,e.optionIcon){var o=d.whitespace.cloneNode(!1);(n=d.span.cloneNode(!1)).className=i.options.iconBase+" "+e.optionIcon,p.appendChild(n),p.appendChild(o)}e.optionSubtext&&((t=d.subtext.cloneNode(!1)).innerHTML=e.optionSubtext,s.appendChild(t))}return p.appendChild(s),p};if(this.options.title&&!this.multiple){a--;var g=this.$element[0],w=!1,I=!this.selectpicker.view.titleOption.parentNode;if(I){this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="";var k=e(g.options[g.selectedIndex]);w=void 0===k.attr("selected")&&void 0===this.$element.data("selected")}(I||0!==this.selectpicker.view.titleOption.index)&&g.insertBefore(this.selectpicker.view.titleOption,g.firstChild),w&&(g.selectedIndex=0)}var $=this.$element.find("option");$.each(function(h){var g=e(this);if(a++,!g.hasClass("bs-title-option")){var b,w,I=g.data(),k=this.className||"",E=f(this.style.cssText),C=I.content,S=this.textContent,y=I.tokens,O=I.subtext,z=I.icon,T=g.parent(),D=T[0],H="OPTGROUP"===D.tagName,A=H&&D.disabled,L=this.disabled||A,P=this.previousElementSibling&&"OPTGROUP"===this.previousElementSibling.tagName,N=T.data();if(!0===I.hidden||i.options.hideDisabled&&(L&&!H||A)){if(b=I.prevHiddenIndex,g.next().data("prevHiddenIndex",void 0!==b?b:h),a--,!P&&void 0!==b){var R=$[b].previousElementSibling;R&&"OPTGROUP"===R.tagName&&!R.disabled&&(P=!0)}P&&"divider"!==l[l.length-1].type&&(a++,n.push(u(!1,null,x.DIVIDER,r+"div")),l.push({type:"divider",optID:r,originalIndex:h}))}else{if(H&&!0!==I.divider){if(i.options.hideDisabled&&L){if(void 0===N.allOptionsDisabled){var W=T.children();T.data("allOptionsDisabled",W.filter(":disabled").length===W.length)}if(T.data("allOptionsDisabled"))return void a--}var B=" "+D.className||"";if(!this.previousElementSibling){r+=1;var M=D.label,U=f(M),j=N.subtext,V=N.icon;0!==h&&n.length>0&&(a++,n.push(u(!1,null,x.DIVIDER,r+"div")),l.push({type:"divider",optID:r,originalIndex:h})),a++;var F=function(e){var t,n,s=d.text.cloneNode(!1);if(s.textContent=e.labelEscaped,e.labelIcon){var o=d.whitespace.cloneNode(!1);(n=d.span.cloneNode(!1)).className=i.options.iconBase+" "+e.labelIcon,p.appendChild(n),p.appendChild(o)}return e.labelSubtext&&((t=d.subtext.cloneNode(!1)).textContent=e.labelSubtext,s.appendChild(t)),p.appendChild(s),p}({labelEscaped:U,labelSubtext:j,labelIcon:V});n.push(u(F,null,"dropdown-header"+B,r)),l.push({content:U,subtext:j,type:"optgroup-label",optID:r,originalIndex:h}),c=a-1}if(i.options.hideDisabled&&L||!0===I.hidden)return void a--;w=v({text:S,optionContent:C,optionSubtext:O,optionIcon:z}),n.push(u(m(w,"opt "+k+B,E),h,"",r)),l.push({content:C||S,subtext:O,tokens:y,type:"option",optID:r,headerIndex:c,lastIndex:c+D.childElementCount,originalIndex:h,data:I}),s++}else if(!0===I.divider)n.push(u(!1,h,"divider")),l.push({type:"divider",originalIndex:h});else{if(!P&&i.options.hideDisabled&&void 0!==(b=I.prevHiddenIndex)){var R=$[b].previousElementSibling;R&&"OPTGROUP"===R.tagName&&!R.disabled&&(P=!0)}P&&"divider"!==l[l.length-1].type&&(a++,n.push(u(!1,null,x.DIVIDER,r+"div")),l.push({type:"divider",optID:r,originalIndex:h})),w=v({text:S,optionContent:C,optionSubtext:O,optionIcon:z}),n.push(u(m(w,k,E),h)),l.push({content:C||S,subtext:O,tokens:y,type:"option",originalIndex:h,data:I}),s++}i.selectpicker.main.map.newIndex[h]=a,i.selectpicker.main.map.originalIndex[a]=h;var _=l[l.length-1];_.disabled=L;var G=0;_.content&&(G+=_.content.length),_.subtext&&(G+=_.subtext.length),z&&(G+=1),G>o&&(o=G,t=n[n.length-1])}}}),this.selectpicker.main.elements=n,this.selectpicker.main.data=l,this.selectpicker.current=this.selectpicker.main,this.selectpicker.view.widestOption=t,this.selectpicker.view.availableOptionsCount=s},findLis:function(){return this.$menuInner.find(".inner > li")},render:function(){var e=this.$element.find("option"),t=[],i=[];this.togglePlaceholder(),this.tabIndex();for(var n=0,s=this.selectpicker.main.elements.length;n<s;n++){var o=this.selectpicker.main.map.originalIndex[n],l=e[o];if(l&&l.selected&&(t.push(l),i.length<100&&"count"!==this.options.selectedTextFormat||1===t.length)){if(this.options.hideDisabled&&(l.disabled||"OPTGROUP"===l.parentNode.tagName&&l.parentNode.disabled))return;var r,c,a=this.selectpicker.main.data[n].data,d=a.icon&&this.options.showIcon?'<i class="'+this.options.iconBase+" "+a.icon+'"></i> ':"";r=this.options.showSubtext&&a.subtext&&!this.multiple?' <small class="text-muted">'+a.subtext+"</small>":"",c=l.title?l.title:a.content&&this.options.showContent?a.content.toString():d+l.innerHTML.trim()+r,i.push(c)}}var h=this.multiple?i.join(this.options.multipleSeparator):i[0];if(t.length>50&&(h+="..."),this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count")){var p=this.options.selectedTextFormat.split(">");if(p.length>1&&t.length>p[1]||1===p.length&&t.length>=2){var u=this.selectpicker.view.availableOptionsCount,f="function"==typeof this.options.countSelectedText?this.options.countSelectedText(t.length,u):this.options.countSelectedText;h=f.replace("{0}",t.length.toString()).replace("{1}",u.toString())}}void 0==this.options.title&&(this.options.title=this.$element.attr("title")),"static"==this.options.selectedTextFormat&&(h=this.options.title),h||(h=void 0!==this.options.title?this.options.title:this.options.noneSelectedText),this.$button[0].title=m(h.replace(/<[^>]*>?/g,"").trim()),this.$button.find(".filter-option-inner-inner")[0].innerHTML=h,this.$element.trigger("rendered.bs.select")},setStyle:function(e,t){this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,""));var i=e||this.options.style;"add"==t?this.$button.addClass(i):"remove"==t?this.$button.removeClass(i):(this.$button.removeClass(this.options.style),this.$button.addClass(i))},liHeight:function(t){if(t||!1!==this.options.size&&!this.sizeInfo){this.sizeInfo||(this.sizeInfo={});var i=document.createElement("div"),n=document.createElement("div"),s=document.createElement("div"),o=document.createElement("ul"),l=document.createElement("li"),r=document.createElement("li"),c=document.createElement("li"),a=document.createElement("a"),d=document.createElement("span"),p=this.options.header&&this.$menu.find("."+x.POPOVERHEADER).length>0?this.$menu.find("."+x.POPOVERHEADER)[0].cloneNode(!0):null,u=this.options.liveSearch?document.createElement("div"):null,f=this.options.actionsBox&&this.multiple&&this.$menu.find(".bs-actionsbox").length>0?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,m=this.options.doneButton&&this.multiple&&this.$menu.find(".bs-donebutton").length>0?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null;if(this.sizeInfo.selectWidth=this.$newElement[0].offsetWidth,d.className="text",a.className="dropdown-item",i.className=this.$menu[0].parentNode.className+" "+x.SHOW,i.style.width=this.sizeInfo.selectWidth+"px",n.className="dropdown-menu "+x.SHOW,s.className="inner "+x.SHOW,o.className="dropdown-menu inner "+("4"===b.major?x.SHOW:""),l.className=x.DIVIDER,r.className="dropdown-header",d.appendChild(document.createTextNode("Inner text")),a.appendChild(d),c.appendChild(a),r.appendChild(d.cloneNode(!0)),this.selectpicker.view.widestOption&&o.appendChild(this.selectpicker.view.widestOption.cloneNode(!0)),o.appendChild(c),o.appendChild(l),o.appendChild(r),p&&n.appendChild(p),u){var v=document.createElement("input");u.className="bs-searchbox",v.className="form-control",u.appendChild(v),n.appendChild(u)}f&&n.appendChild(f),s.appendChild(o),n.appendChild(s),m&&n.appendChild(m),i.appendChild(n),document.body.appendChild(i);var g,w=a.offsetHeight,I=r?r.offsetHeight:0,k=p?p.offsetHeight:0,$=u?u.offsetHeight:0,E=f?f.offsetHeight:0,C=m?m.offsetHeight:0,S=e(l).outerHeight(!0),y=!!window.getComputedStyle&&window.getComputedStyle(n),O=n.offsetWidth,z=y?null:e(n),T={vert:h(y?y.paddingTop:z.css("paddingTop"))+h(y?y.paddingBottom:z.css("paddingBottom"))+h(y?y.borderTopWidth:z.css("borderTopWidth"))+h(y?y.borderBottomWidth:z.css("borderBottomWidth")),horiz:h(y?y.paddingLeft:z.css("paddingLeft"))+h(y?y.paddingRight:z.css("paddingRight"))+h(y?y.borderLeftWidth:z.css("borderLeftWidth"))+h(y?y.borderRightWidth:z.css("borderRightWidth"))},D={vert:T.vert+h(y?y.marginTop:z.css("marginTop"))+h(y?y.marginBottom:z.css("marginBottom"))+2,horiz:T.horiz+h(y?y.marginLeft:z.css("marginLeft"))+h(y?y.marginRight:z.css("marginRight"))+2};s.style.overflowY="scroll",g=n.offsetWidth-O,document.body.removeChild(i),this.sizeInfo.liHeight=w,this.sizeInfo.dropdownHeaderHeight=I,this.sizeInfo.headerHeight=k,this.sizeInfo.searchHeight=$,this.sizeInfo.actionsHeight=E,this.sizeInfo.doneButtonHeight=C,this.sizeInfo.dividerHeight=S,this.sizeInfo.menuPadding=T,this.sizeInfo.menuExtras=D,this.sizeInfo.menuWidth=O,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth,this.sizeInfo.scrollBarWidth=g,this.sizeInfo.selectHeight=this.$newElement[0].offsetHeight,this.setPositionData()}},getSelectPosition:function(){var t,i=e(window),n=this.$newElement.offset(),s=e(this.options.container);this.options.container&&!s.is("body")?((t=s.offset()).top+=parseInt(s.css("borderTopWidth")),t.left+=parseInt(s.css("borderLeftWidth"))):t={top:0,left:0};var o=this.options.windowPadding;this.sizeInfo.selectOffsetTop=n.top-t.top-i.scrollTop(),this.sizeInfo.selectOffsetBot=i.height()-this.sizeInfo.selectOffsetTop-this.sizeInfo.selectHeight-t.top-o[2],this.sizeInfo.selectOffsetLeft=n.left-t.left-i.scrollLeft(),this.sizeInfo.selectOffsetRight=i.width()-this.sizeInfo.selectOffsetLeft-this.sizeInfo.selectWidth-t.left-o[1],this.sizeInfo.selectOffsetTop-=o[0],this.sizeInfo.selectOffsetLeft-=o[3]},setMenuSize:function(e){this.getSelectPosition();var t,i,n,s,o,l,r,c=this.sizeInfo.selectWidth,a=this.sizeInfo.liHeight,d=this.sizeInfo.headerHeight,h=this.sizeInfo.searchHeight,p=this.sizeInfo.actionsHeight,u=this.sizeInfo.doneButtonHeight,f=this.sizeInfo.dividerHeight,m=this.sizeInfo.menuPadding,v=0;if(this.options.dropupAuto&&(r=a*this.selectpicker.current.elements.length+m.vert,this.$newElement.toggleClass(x.DROPUP,this.sizeInfo.selectOffsetTop-this.sizeInfo.selectOffsetBot>this.sizeInfo.menuExtras.vert&&r+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot)),"auto"===this.options.size)s=this.selectpicker.current.elements.length>3?3*this.sizeInfo.liHeight+this.sizeInfo.menuExtras.vert-2:0,i=this.sizeInfo.selectOffsetBot-this.sizeInfo.menuExtras.vert,n=s+d+h+p+u,l=Math.max(s-m.vert,0),this.$newElement.hasClass(x.DROPUP)&&(i=this.sizeInfo.selectOffsetTop-this.sizeInfo.menuExtras.vert),o=i,t=i-d-h-p-u-m.vert;else if(this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size){for(var g=0;g<this.options.size;g++)"divider"===this.selectpicker.current.data[g].type&&v++;i=a*this.options.size+v*f+m.vert,t=i-m.vert,o=i+d+h+p+u,n=l=""}"auto"===this.options.dropdownAlignRight&&this.$menu.toggleClass(x.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRight<this.$menu[0].offsetWidth-c),this.$menu.css({"max-height":o+"px",overflow:"hidden","min-height":n+"px"}),this.$menuInner.css({"max-height":t+"px","overflow-y":"auto","min-height":l+"px"}),this.sizeInfo.menuInnerHeight=t,this.selectpicker.current.data.length&&this.selectpicker.current.data[this.selectpicker.current.data.length-1].position>this.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth,this.$menu.css("min-width",this.sizeInfo.totalMenuWidth)),this.dropdown&&this.dropdown._popper&&this.dropdown._popper.update()},setSize:function(t){if(this.liHeight(t),this.options.header&&this.$menu.css("padding-top",0),!1!==this.options.size){var i,n=this,s=e(window),o=0;this.setMenuSize(),"auto"===this.options.size?(this.$searchbox.off("input.setMenuSize propertychange.setMenuSize").on("input.setMenuSize propertychange.setMenuSize",function(){return n.setMenuSize()}),s.off("resize.setMenuSize scroll.setMenuSize").on("resize.setMenuSize scroll.setMenuSize",function(){return n.setMenuSize()})):this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size&&(this.$searchbox.off("input.setMenuSize propertychange.setMenuSize"),s.off("resize.setMenuSize scroll.setMenuSize")),t?o=this.$menuInner[0].scrollTop:n.multiple||"number"==typeof(i=n.selectpicker.main.map.newIndex[n.$element[0].selectedIndex])&&!1!==n.options.size&&(o=(o=n.sizeInfo.liHeight*i)-n.sizeInfo.menuInnerHeight/2+n.sizeInfo.liHeight/2),n.createView(!1,o)}},setWidth:function(){var e=this;"auto"===this.options.width?requestAnimationFrame(function(){e.$menu.css("min-width","0"),e.liHeight(),e.setMenuSize();var t=e.$newElement.clone().appendTo("body"),i=t.css("width","auto").children("button").outerWidth();t.remove(),e.sizeInfo.selectWidth=Math.max(e.sizeInfo.totalMenuWidth,i),e.$newElement.css("width",e.sizeInfo.selectWidth+"px")}):"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width","")),this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement.removeClass("fit-width")},selectPosition:function(){this.$bsContainer=e('<div class="bs-container" />');var t,i,n,s=this,o=e(this.options.container),l=function(e){var l={};s.$bsContainer.addClass(e.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(x.DROPUP,e.hasClass(x.DROPUP)),t=e.offset(),o.is("body")?i={top:0,left:0}:((i=o.offset()).top+=parseInt(o.css("borderTopWidth"))-o.scrollTop(),i.left+=parseInt(o.css("borderLeftWidth"))-o.scrollLeft()),n=e.hasClass(x.DROPUP)?0:e[0].offsetHeight,b.major<4&&(l.top=t.top-i.top+n,l.left=t.left-i.left),l.width=e[0].offsetWidth,s.$bsContainer.css(l)};this.$button.on("click.bs.dropdown.data-api",function(){s.isDisabled()||(l(s.$newElement),s.$bsContainer.appendTo(s.options.container).toggleClass(x.SHOW,!s.$button.hasClass(x.SHOW)).append(s.$menu))}),e(window).on("resize scroll",function(){l(s.$newElement)}),this.$element.on("hide.bs.select",function(){s.$menu.data("height",s.$menu.height()),s.$bsContainer.detach()})},setOptionStatus:function(){var e=this.$element.find("option");if(this.noScroll=!1,this.selectpicker.view.visibleElements&&this.selectpicker.view.visibleElements.length)for(var t=0;t<this.selectpicker.view.visibleElements.length;t++){var i=this.selectpicker.current.map.originalIndex[t+this.selectpicker.view.position0],n=e[i];if(n){var s=this.selectpicker.main.map.newIndex[i],o=this.selectpicker.main.elements[s];this.setDisabled(i,n.disabled||"OPTGROUP"===n.parentNode.tagName&&n.parentNode.disabled,s,o),this.setSelected(i,n.selected,s,o)}}},setSelected:function(e,t,i,n){var s,o,l,r=void 0!==this.activeIndex,c=this.activeIndex===e,a=c||t&&!this.multiple&&!r;i||(i=this.selectpicker.main.map.newIndex[e]),n||(n=this.selectpicker.main.elements[i]),l=n.firstChild,t&&(this.selectedIndex=e),n.classList.toggle("selected",t),n.classList.toggle("active",a),a&&(this.selectpicker.view.currentActive=n,this.activeIndex=e),l&&(l.classList.toggle("selected",t),l.classList.toggle("active",a),l.setAttribute("aria-selected",t)),a||!r&&t&&void 0!==this.prevActiveIndex&&(s=this.selectpicker.main.map.newIndex[this.prevActiveIndex],(o=this.selectpicker.main.elements[s]).classList.remove("selected"),o.classList.remove("active"),o.firstChild&&(o.firstChild.classList.remove("selected"),o.firstChild.classList.remove("active")))},setDisabled:function(e,t,i,n){var s;i||(i=this.selectpicker.main.map.newIndex[e]),n||(n=this.selectpicker.main.elements[i]),s=n.firstChild,n.classList.toggle(x.DISABLED,t),s&&("4"===b.major&&s.classList.toggle(x.DISABLED,t),s.setAttribute("aria-disabled",t),t?s.setAttribute("tabindex",-1):s.setAttribute("tabindex",0))},isDisabled:function(){return this.$element[0].disabled},checkDisabled:function(){var e=this;this.isDisabled()?(this.$newElement.addClass(x.DISABLED),this.$button.addClass(x.DISABLED).attr("tabindex",-1).attr("aria-disabled",!0)):(this.$button.hasClass(x.DISABLED)&&(this.$newElement.removeClass(x.DISABLED),this.$button.removeClass(x.DISABLED).attr("aria-disabled",!1)),-1!=this.$button.attr("tabindex")||this.$element.data("tabindex")||this.$button.removeAttr("tabindex")),this.$button.click(function(){return!e.isDisabled()})},togglePlaceholder:function(){var e=this.$element[0],t=e.selectedIndex,i=-1===t;i||e.options[t].value||(i=!0),this.$button.toggleClass("bs-placeholder",i)},tabIndex:function(){this.$element.data("tabindex")!==this.$element.attr("tabindex")&&-98!==this.$element.attr("tabindex")&&"-98"!==this.$element.attr("tabindex")&&(this.$element.data("tabindex",this.$element.attr("tabindex")),this.$button.attr("tabindex",this.$element.data("tabindex"))),this.$element.attr("tabindex",-98)},clickListener:function(){var t=this,i=e(document);i.data("spaceSelect",!1),this.$button.on("keyup",function(e){/(32)/.test(e.keyCode.toString(10))&&i.data("spaceSelect")&&(e.preventDefault(),i.data("spaceSelect",!1))}),this.$newElement.on("show.bs.dropdown",function(){b.major>3&&!t.dropdown&&(t.dropdown=t.$button.data("bs.dropdown"),t.dropdown._menu=t.$menu[0])}),this.$button.on("click.bs.dropdown.data-api",function(){t.$newElement.hasClass(x.SHOW)||t.setSize()}),this.$element.on("shown.bs.select",function(){t.$menuInner[0].scrollTop!==t.selectpicker.view.scrollTop&&(t.$menuInner[0].scrollTop=t.selectpicker.view.scrollTop),t.options.liveSearch?t.$searchbox.focus():t.$menuInner.focus()}),this.$menuInner.on("click","li a",function(i,n){var s=e(this),o=t.isVirtual()?t.selectpicker.view.position0:0,r=t.selectpicker.current.map.originalIndex[s.parent().index()+o],a=l(t.$element[0]),d=t.$element.prop("selectedIndex"),h=!0;if(t.multiple&&1!==t.options.maxOptions&&i.stopPropagation(),i.preventDefault(),!t.isDisabled()&&!s.parent().hasClass(x.DISABLED)){var p=t.$element.find("option"),u=p.eq(r),f=u.prop("selected"),m=u.parent("optgroup"),v=t.options.maxOptions,g=m.data("maxOptions")||!1;if(r===t.activeIndex&&(n=!0),n||(t.prevActiveIndex=t.activeIndex,t.activeIndex=void 0),t.multiple){if(u.prop("selected",!f),t.setSelected(r,!f),s.blur(),!1!==v||!1!==g){var b=v<p.filter(":selected").length,w=g<m.find("option:selected").length;if(v&&b||g&&w)if(v&&1==v)p.prop("selected",!1),u.prop("selected",!0),t.$menuInner.find(".selected").removeClass("selected"),t.setSelected(r,!0);else if(g&&1==g){m.find("option:selected").prop("selected",!1),u.prop("selected",!0);var I=t.selectpicker.current.data[s.parent().index()+t.selectpicker.view.position0].optID;t.$menuInner.find(".optgroup-"+I).removeClass("selected"),t.setSelected(r,!0)}else{var k="string"==typeof t.options.maxOptionsText?[t.options.maxOptionsText,t.options.maxOptionsText]:t.options.maxOptionsText,$="function"==typeof k?k(v,g):k,E=$[0].replace("{n}",v),C=$[1].replace("{n}",g),S=e('<div class="notify"></div>');$[2]&&(E=E.replace("{var}",$[2][v>1?0:1]),C=C.replace("{var}",$[2][g>1?0:1])),u.prop("selected",!1),t.$menu.append(S),v&&b&&(S.append(e("<div>"+E+"</div>")),h=!1,t.$element.trigger("maxReached.bs.select")),g&&w&&(S.append(e("<div>"+C+"</div>")),h=!1,t.$element.trigger("maxReachedGrp.bs.select")),setTimeout(function(){t.setSelected(r,!1)},10),S.delay(750).fadeOut(300,function(){e(this).remove()})}}}else p.prop("selected",!1),u.prop("selected",!0),t.setSelected(r,!0);!t.multiple||t.multiple&&1===t.options.maxOptions?t.$button.focus():t.options.liveSearch&&t.$searchbox.focus(),h&&(a!=l(t.$element[0])&&t.multiple||d!=t.$element.prop("selectedIndex")&&!t.multiple)&&(c=[r,u.prop("selected"),a],t.$element.triggerNative("change"))}}),this.$menu.on("click","li."+x.DISABLED+" a, ."+x.POPOVERHEADER+", ."+x.POPOVERHEADER+" :not(.close)",function(i){i.currentTarget==this&&(i.preventDefault(),i.stopPropagation(),t.options.liveSearch&&!e(i.target).hasClass("close")?t.$searchbox.focus():t.$button.focus())}),this.$menuInner.on("click",".divider, .dropdown-header",function(e){e.preventDefault(),e.stopPropagation(),t.options.liveSearch?t.$searchbox.focus():t.$button.focus()}),this.$menu.on("click","."+x.POPOVERHEADER+" .close",function(){t.$button.click()}),this.$searchbox.on("click",function(e){e.stopPropagation()}),this.$menu.on("click",".actions-btn",function(i){t.options.liveSearch?t.$searchbox.focus():t.$button.focus(),i.preventDefault(),i.stopPropagation(),e(this).hasClass("bs-select-all")?t.selectAll():t.deselectAll()}),this.$element.on({change:function(){t.render(),t.$element.trigger("changed.bs.select",c),c=null},focus:function(){t.$button.focus()}})},liveSearchListener:function(){var e=this,t=document.createElement("li");this.$button.on("click.bs.dropdown.data-api",function(){e.$searchbox.val()&&e.$searchbox.val("")}),this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",function(e){e.stopPropagation()}),this.$searchbox.on("input propertychange",function(){var i=e.$searchbox.val();if(e.selectpicker.search.map.newIndex={},e.selectpicker.search.map.originalIndex={},e.selectpicker.search.elements=[],e.selectpicker.search.data=[],i){var n=[],s=i.toUpperCase(),o={},l=[],r=e._searchStyle(),c=e.options.liveSearchNormalize;e._$lisSelected=e.$menuInner.find(".selected");for(var a=0;a<e.selectpicker.main.data.length;a++){var h=e.selectpicker.main.data[a];o[a]||(o[a]=d(h,s,r,c)),o[a]&&void 0!==h.headerIndex&&-1===l.indexOf(h.headerIndex)&&(h.headerIndex>0&&(o[h.headerIndex-1]=!0,l.push(h.headerIndex-1)),o[h.headerIndex]=!0,l.push(h.headerIndex),o[h.lastIndex+1]=!0),o[a]&&"optgroup-label"!==h.type&&l.push(a)}for(var a=0,p=l.length;a<p;a++){var u=l[a],m=l[a-1],h=e.selectpicker.main.data[u],v=e.selectpicker.main.data[m];("divider"!==h.type||"divider"===h.type&&v&&"divider"!==v.type&&p-1!==a)&&(e.selectpicker.search.data.push(h),n.push(e.selectpicker.main.elements[u]),e.selectpicker.search.map.newIndex[h.originalIndex]=n.length-1,e.selectpicker.search.map.originalIndex[n.length-1]=h.originalIndex)}e.activeIndex=void 0,e.noScroll=!0,e.$menuInner.scrollTop(0),e.selectpicker.search.elements=n,e.createView(!0),n.length||(t.className="no-results",t.innerHTML=e.options.noneResultsText.replace("{0}",'"'+f(i)+'"'),e.$menuInner[0].firstChild.appendChild(t))}else e.$menuInner.scrollTop(0),e.createView(!1)})},_searchStyle:function(){return this.options.liveSearchStyle||"contains"},val:function(e){return void 0!==e?(this.$element.val(e).triggerNative("change"),this.$element):this.$element.val()},changeAll:function(e){if(this.multiple){void 0===e&&(e=!0);var t=this.$element.find("option"),i=0,n=0,s=l(this.$element[0]);this.$element.addClass("bs-select-hidden");for(var o=0;o<this.selectpicker.current.elements.length;o++){var r=this.selectpicker.current.map.originalIndex[o],a=t[r];a&&(a.selected&&i++,a.selected=e,a.selected&&n++)}this.$element.removeClass("bs-select-hidden"),i!==n&&(this.setOptionStatus(),this.togglePlaceholder(),c=[null,null,s],this.$element.triggerNative("change"))}},selectAll:function(){return this.changeAll(!0)},deselectAll:function(){return this.changeAll(!1)},toggle:function(e){(e=e||window.event)&&e.stopPropagation(),this.$button.trigger("click.bs.dropdown.data-api")},keydown:function(t){var i,n,s,o,l,r=e(this),c=r.is("input")?r.parent().parent():r.parent(),a=c.data("this"),h=a.findLis(),p=!1,u=t.which===g.TAB&&!r.hasClass("dropdown-toggle")&&!a.options.selectOnTab,f=w.test(t.which)||u,m=a.$menuInner[0].scrollTop,b=a.isVirtual(),k=!0===b?a.selectpicker.view.position0:0;if(!(n=a.$newElement.hasClass(x.SHOW))&&(f||t.which>=48&&t.which<=57||t.which>=96&&t.which<=105||t.which>=65&&t.which<=90)&&a.$button.trigger("click.bs.dropdown.data-api"),t.which===g.ESCAPE&&n&&(t.preventDefault(),a.$button.trigger("click.bs.dropdown.data-api").focus()),f){if(!h.length)return;void 0===(i=!0===b?h.index(h.filter(".active")):a.selectpicker.current.map.newIndex[a.activeIndex])&&(i=-1),-1!==i&&((s=a.selectpicker.current.elements[i+k]).classList.remove("active"),s.firstChild&&s.firstChild.classList.remove("active")),t.which===g.ARROW_UP?(-1!==i&&i--,i+k<0&&(i+=h.length),a.selectpicker.view.canHighlight[i+k]||-1==(i=a.selectpicker.view.canHighlight.slice(0,i+k).lastIndexOf(!0)-k)&&(i=h.length-1)):(t.which===g.ARROW_DOWN||u)&&(++i+k>=a.selectpicker.view.canHighlight.length&&(i=0),a.selectpicker.view.canHighlight[i+k]||(i=i+1+a.selectpicker.view.canHighlight.slice(i+k+1).indexOf(!0))),t.preventDefault();var $=k+i;t.which===g.ARROW_UP?0===k&&i===h.length-1?(a.$menuInner[0].scrollTop=a.$menuInner[0].scrollHeight,$=a.selectpicker.current.elements.length-1):(o=a.selectpicker.current.data[$],l=o.position-o.height,p=l<m):(t.which===g.ARROW_DOWN||u)&&(0!==k&&0===i?(a.$menuInner[0].scrollTop=0,$=0):(o=a.selectpicker.current.data[$],l=o.position-a.sizeInfo.menuInnerHeight,p=l>m)),(s=a.selectpicker.current.elements[$]).classList.add("active"),s.firstChild&&s.firstChild.classList.add("active"),a.activeIndex=a.selectpicker.current.map.originalIndex[$],a.selectpicker.view.currentActive=s,p&&(a.$menuInner[0].scrollTop=l),a.options.liveSearch?a.$searchbox.focus():r.focus()}else if(!r.is("input")&&!I.test(t.which)||t.which===g.SPACE&&a.selectpicker.keydown.keyHistory){var E,C,S=[];t.preventDefault(),a.selectpicker.keydown.keyHistory+=v[t.which],a.selectpicker.keydown.resetKeyHistory.cancel&&clearTimeout(a.selectpicker.keydown.resetKeyHistory.cancel),a.selectpicker.keydown.resetKeyHistory.cancel=a.selectpicker.keydown.resetKeyHistory.start(),C=a.selectpicker.keydown.keyHistory,/^(.)\1+$/.test(C)&&(C=C.charAt(0));for(var y=0;y<a.selectpicker.current.data.length;y++){var O=a.selectpicker.current.data[y];d(O,C,"startsWith",!0)&&a.selectpicker.view.canHighlight[y]&&(O.index=y,S.push(O.originalIndex))}if(S.length){var z=0;h.removeClass("active").find("a").removeClass("active"),1===C.length&&(-1===(z=S.indexOf(a.activeIndex))||z===S.length-1?z=0:z++),E=a.selectpicker.current.map.newIndex[S[z]],o=a.selectpicker.current.data[E],m-o.position>0?(l=o.position-o.height,p=!0):(l=o.position-a.sizeInfo.menuInnerHeight,p=o.position>m+a.sizeInfo.menuInnerHeight),(s=a.selectpicker.current.elements[E]).classList.add("active"),s.firstChild&&s.firstChild.classList.add("active"),a.activeIndex=S[z],s.firstChild.focus(),p&&(a.$menuInner[0].scrollTop=l),r.focus()}}n&&(t.which===g.SPACE&&!a.selectpicker.keydown.keyHistory||t.which===g.ENTER||t.which===g.TAB&&a.options.selectOnTab)&&(t.which!==g.SPACE&&t.preventDefault(),a.options.liveSearch&&t.which===g.SPACE||(a.$menuInner.find(".active a").trigger("click",!0),r.focus(),a.options.liveSearch||(t.preventDefault(),e(document).data("spaceSelect",!0))))},mobile:function(){this.$element.addClass("mobile-device")},refresh:function(){var t=e.extend({},this.options,this.$element.data());this.options=t,this.selectpicker.main.map.newIndex={},this.selectpicker.main.map.originalIndex={},this.createLi(),this.checkDisabled(),this.render(),this.setStyle(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed.bs.select")},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove(),this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove(),this.$bsContainer?this.$bsContainer.remove():this.$menu.remove(),this.$element.off(".bs.select").removeData("selectpicker").removeClass("bs-select-hidden selectpicker")}};var E=e.fn.selectpicker;e.fn.selectpicker=$,e.fn.selectpicker.Constructor=k,e.fn.selectpicker.noConflict=function(){return e.fn.selectpicker=E,this},e(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.select",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bs-searchbox input',k.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bs-searchbox input',function(e){e.stopPropagation()}),e(window).on("load.bs.select.data-api",function(){e(".selectpicker").each(function(){var t=e(this);$.call(t,t.data())})})}(jQuery)},375:function(e,t,i){i(374)}});if("object"==typeof i){var n=["object"==typeof module&&"object"==typeof module.exports?module.exports:null,"undefined"!=typeof window?window:null,e&&e!==window?e:null];for(var s in i)n[0]&&(n[0][s]=i[s]),n[1]&&"__esModule"!==s&&(n[1][s]=i[s]),n[2]&&(n[2][s]=i[s])}}(this); |