!function(e,t){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,function(e){!function(z){var d=["sanitize","whiteList","sanitizeFn"],v=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],e={"*":["class","dir","id","lang","role","tabindex","style",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},g=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,b=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function B(e,t,i){if(i&&"function"==typeof i)return i(e);for(var s=Object.keys(t),n=0,o=e.length;n]+>/g,"")),s&&(a=m(a)),a=a.toUpperCase(),o="contains"===i?0<=a.indexOf(t):a.startsWith(t)))break}return o}function L(e){return parseInt(e,10)||0}z.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 h={"脌":"A","脕":"A","脗":"A","脙":"A","脛":"A","脜":"A","脿":"a","谩":"a","芒":"a","茫":"a","盲":"a","氓":"a","脟":"C","莽":"c","脨":"D","冒":"d","脠":"E","脡":"E","脢":"E","脣":"E","猫":"e","茅":"e","锚":"e","毛":"e","脤":"I","脥":"I","脦":"I","脧":"I","矛":"i","铆":"i","卯":"i","茂":"i","脩":"N","帽":"n","脪":"O","脫":"O","脭":"O","脮":"O","脰":"O","脴":"O","貌":"o","贸":"o","么":"o","玫":"o","枚":"o","酶":"o","脵":"U","脷":"U","脹":"U","脺":"U","霉":"u","煤":"u","没":"u","眉":"u","脻":"Y","媒":"y","每":"y","脝":"Ae","忙":"ae","脼":"Th","镁":"th","脽":"ss","膧":"A","膫":"A","膭":"A","膩":"a","膬":"a","膮":"a","膯":"C","膱":"C","膴":"C","膶":"C","膰":"c","膲":"c","膵":"c","膷":"c","膸":"D","膼":"D","膹":"d","膽":"d","膾":"E","臄":"E","臇":"E","臉":"E","臍":"E","膿":"e","臅":"e","臈":"e","臋":"e","臎":"e","臏":"G","臑":"G","臓":"G","蘑":"G","臐":"g","臒":"g","摹":"g","模":"g","膜":"H","摩":"H","磨":"h","魔":"h","抹":"I","莫":"I","默":"I","漠":"I","陌":"I","末":"i","墨":"i","沫":"i","寞":"i","谋":"i","拇":"J","牡":"j","亩":"K","姆":"k","母":"k","墓":"L","幕":"L","慕":"L","目":"L","艁":"L","暮":"l","募":"l","木":"l","艀":"l","艂":"l","艃":"N","艆":"N","艊":"N","艎":"N","艅":"n","艈":"n","艌":"n","艐":"n","艑":"O","艓":"O","艕":"O","艒":"o","艔":"o","艖":"o","艛":"R","艝":"R","艠":"R","艜":"r","艞":"r","艡":"r","艢":"S","艤":"S","艦":"S","艩":"S","艣":"s","艥":"s","艧":"s","拧":"s","泞":"T","扭":"T","纽":"T","牛":"t","钮":"t","脓":"t","浓":"U","弄":"U","努":"U","女":"U","虐":"U","挪":"U","农":"u","奴":"u","怒":"u","暖":"u","疟":"u","懦":"u","糯":"W","诺":"w","哦":"Y","欧":"y","鸥":"Y","殴":"Z","呕":"Z","沤":"Z","藕":"z","偶":"z","啪":"z","牟":"IJ","某":"ij","艗":"Oe","艙":"oe","艍":"'n","趴":"s"},p=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,u=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]","g");function f(e){return h[e]}function m(e){return(e=e.toString())&&e.replace(p,f).replace(u,"")}var w,I,x,$,y=(w={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},I="(?:"+Object.keys(w).join("|")+")",x=RegExp(I),$=RegExp(I,"g"),function(e){return e=null==e?"":""+e,x.test(e)?e.replace($,S):e});function S(e){return w[e]}var E={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"},C=27,N=13,D=32,H=9,P=38,W=40,M={success:!1,major:"3"};try{M.full=(z.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split("."),M.major=M.full[0],M.success=!0}catch(e){}var R=0,U=".bs.select",j={DISABLED:"disabled",DIVIDER:"divider",SHOW:"open",DROPUP:"dropup",MENU:"dropdown-menu",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"btn-default",POPOVERHEADER:"popover-title",ICONBASE:"glyphicon",TICKICON:"glyphicon-ok"},V={MENU:"."+j.MENU},F={span:document.createElement("span"),i:document.createElement("i"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode("聽"),fragment:document.createDocumentFragment()};F.a.setAttribute("role","option"),F.subtext.className="text-muted",F.text=F.span.cloneNode(!1),F.text.className="text",F.checkMark=F.span.cloneNode(!1);var _=new RegExp(P+"|"+W),G=new RegExp("^"+H+"$|"+C),q=function(e,t,i){var s=F.li.cloneNode(!1);return e&&(1===e.nodeType||11===e.nodeType?s.appendChild(e):s.innerHTML=e),void 0!==t&&""!==t&&(s.className=t),null!=i&&s.classList.add("optgroup-"+i),s},K=function(e,t,i){var s=F.a.cloneNode(!0);return e&&(11===e.nodeType?s.appendChild(e):s.insertAdjacentHTML("beforeend",e)),void 0!==t&&""!==t&&(s.className=t),"4"===M.major&&s.classList.add("dropdown-item"),i&&s.setAttribute("style",i),s},Y=function(e,t){var i,s,n,o=F.text.cloneNode(!1);if(e.content?o.innerHTML=e.content:(o.textContent=e.text,e.icon&&(s=F.whitespace.cloneNode(!1),(n=(!0===t?F.i:F.span).cloneNode(!1)).className=e.iconBase+" "+e.icon,F.fragment.appendChild(n),F.fragment.appendChild(s)),e.subtext&&((i=F.subtext.cloneNode(!1)).textContent=e.subtext,o.appendChild(i))),!0===t)for(;0'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1,sanitize:!0,sanitizeFn:null,whiteList:e},J.prototype={constructor:J,init:function(){var i=this,e=this.$element.attr("id");R++,this.selectId="bs-select-"+R,this.$element[0].classList.add("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),this.$element[0].classList.contains("show-tick")&&(this.options.showTick=!0),this.$newElement=this.createDropdown(),this.$element.after(this.$newElement).prependTo(this.$newElement),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(V.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),this.$element[0].classList.remove("bs-select-hidden"),!0===this.options.dropdownAlignRight&&this.$menu[0].classList.add(j.MENURIGHT),void 0!==e&&this.$button.attr("data-id",e),this.checkDisabled(),this.clickListener(),this.options.liveSearch?(this.liveSearchListener(),this.focusedParent=this.$searchbox[0]):this.focusedParent=this.$menuInner[0],this.setStyle(),this.render(),this.setWidth(),this.options.container?this.selectPosition():this.$element.on("hide"+U,function(){var e,t;i.isVirtual()&&(t=(e=i.$menuInner[0]).firstChild.cloneNode(!1),e.replaceChild(t,e.firstChild),e.scrollTop=0)}),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(e){i.$element.trigger("hide"+U,e)},"hidden.bs.dropdown":function(e){i.$element.trigger("hidden"+U,e)},"show.bs.dropdown":function(e){i.$element.trigger("show"+U,e)},"shown.bs.dropdown":function(e){i.$element.trigger("shown"+U,e)}}),i.$element[0].hasAttribute("required")&&this.$element.on("invalid"+U,function(){i.$button[0].classList.add("bs-invalid"),i.$element.on("shown"+U+".invalid",function(){i.$element.val(i.$element.val()).off("shown"+U+".invalid")}).on("rendered"+U,function(){this.validity.valid&&i.$button[0].classList.remove("bs-invalid"),i.$element.off("rendered"+U)}),i.$button.on("blur"+U,function(){i.$element.trigger("focus").trigger("blur"),i.$button.off("blur"+U)})}),setTimeout(function(){i.createLi(),i.$element.trigger("loaded"+U)})},createDropdown:function(){var e=this.multiple||this.options.showTick?" show-tick":"",t=this.multiple?' aria-multiselectable="true"':"",i="",s=this.autofocus?" autofocus":"";M.major<4&&this.$element.parent().hasClass("input-group")&&(i=" input-group-btn");var n,o="",r="",l="",a="";return this.options.header&&(o='
'+this.options.header+"
"),this.options.liveSearch&&(r=''),this.multiple&&this.options.actionsBox&&(l='
"),this.multiple&&this.options.doneButton&&(a='
"),n='",z(n)},setPositionData:function(){this.selectpicker.view.canHighlight=[];for(var e=this.selectpicker.view.size=0;e=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(N,e,t){var D,H,i,s,n,o,P=this,r=0,W=[];function l(e,t){var i,s,n,o,r,l,a,c,d=P.selectpicker.current.elements.length,h=[],p=!0,u=P.isVirtual();P.selectpicker.view.scrollTop=e,i=Math.ceil(P.sizeInfo.menuInnerHeight/P.sizeInfo.liHeight*1.5),s=Math.round(d/i)||1;for(var f,m,v,g,b=0;bd-1?0:P.selectpicker.current.data[d-1].position-P.selectpicker.current.data[P.selectpicker.view.position1-1].position,k.firstChild.style.marginTop=I+"px",k.firstChild.style.marginBottom=x+"px"):(k.firstChild.style.marginTop=0,k.firstChild.style.marginBottom=0),k.firstChild.appendChild($),!0===u&&P.sizeInfo.hasScrollBar&&(C=k.firstChild.offsetWidth,t&&CP.sizeInfo.selectWidth?k.firstChild.style.minWidth=P.sizeInfo.menuInnerInnerWidth+"px":C>P.sizeInfo.menuInnerInnerWidth&&(P.$menu[0].style.minWidth=0,(O=k.firstChild.offsetWidth)>P.sizeInfo.menuInnerInnerWidth&&(P.sizeInfo.menuInnerInnerWidth=O,k.firstChild.style.minWidth=P.sizeInfo.menuInnerInnerWidth+"px"),P.$menu[0].style.minWidth=""))}P.prevActiveIndex=P.activeIndex,P.options.liveSearch?N&&t&&(v=0,P.selectpicker.view.canHighlight[v]||(v=1+P.selectpicker.view.canHighlight.slice(1).indexOf(!0)),g=P.selectpicker.view.visibleElements[v],P.defocusItem(P.selectpicker.view.currentActive),P.activeIndex=(P.selectpicker.current.data[v]||{}).index,P.focusItem(g)):P.$menuInner.trigger("focus")}this.selectpicker.current=N?this.selectpicker.search:this.selectpicker.main,this.setPositionData(),e&&(t?r=this.$menuInner[0].scrollTop:P.multiple||("number"!=typeof(s=((i=P.$element[0]).options[i.selectedIndex]||{}).liIndex)||!1===P.options.size||(o=(n=P.selectpicker.main.data[s])&&n.position)&&(r=o-(P.sizeInfo.menuInnerHeight+P.sizeInfo.liHeight)/2))),l(r,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",function(e,t){P.noScroll||l(this.scrollTop,t),P.noScroll=!1}),z(window).off("resize"+U+"."+this.selectId+".createView").on("resize"+U+"."+this.selectId+".createView",function(){P.$newElement.hasClass(j.SHOW)&&l(P.$menuInner[0].scrollTop)})},focusItem:function(e,t,i){var s;e&&(t=t||this.selectpicker.main.data[this.activeIndex],(s=e.firstChild)&&(s.setAttribute("aria-setsize",this.selectpicker.view.size),s.setAttribute("aria-posinset",t.posinset),!0!==i&&(this.focusedParent.setAttribute("aria-activedescendant",s.id),e.classList.add("active"),s.classList.add("active"))))},defocusItem:function(e){e&&(e.classList.remove("active"),e.firstChild&&e.firstChild.classList.remove("active"))},setPlaceholder:function(){var e,t,i,s=!1;return this.options.title&&!this.multiple&&(this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option")),s=!0,e=this.$element[0],i=!1,(t=!this.selectpicker.view.titleOption.parentNode)&&(this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",i=void 0===z(e.options[e.selectedIndex]).attr("selected")&&void 0===this.$element.data("selected")),!t&&0===this.selectpicker.view.titleOption.index||e.insertBefore(this.selectpicker.view.titleOption,e.firstChild),i&&(e.selectedIndex=0)),s},createLi:function(){var c=this,f=this.options.iconBase,m=':not([hidden]):not([data-hidden="true"])',v=[],g=[],d=0,b=0,e=this.setPlaceholder()?1:0;this.options.hideDisabled&&(m+=":not(:disabled)"),!c.options.showTick&&!c.multiple||F.checkMark.parentNode||(F.checkMark.className=f+" "+c.options.tickIcon+" check-mark",F.a.appendChild(F.checkMark));var t=this.$element[0].querySelectorAll("select > *"+m);function w(e){var t=g[g.length-1];t&&"divider"===t.type&&(t.optID||e.optID)||((e=e||{}).type="divider",v.push(q(!1,j.DIVIDER,e.optID?e.optID+"div":void 0)),g.push(e))}function I(e,t){var i,s,n,o,r,l,a;(t=t||{}).divider="true"===e.getAttribute("data-divider"),t.divider?w({optID:t.optID}):(i=g.length,n=(s=e.style.cssText)?y(s):"",o=(e.className||"")+(t.optgroupClass||""),t.optID&&(o="opt "+o),t.text=e.textContent,t.content=e.getAttribute("data-content"),t.tokens=e.getAttribute("data-tokens"),t.subtext=e.getAttribute("data-subtext"),t.icon=e.getAttribute("data-icon"),t.iconBase=f,r=Y(t),(l=q(K(r,o,n),"",t.optID)).firstChild&&(l.firstChild.id=c.selectId+"-"+i),v.push(l),e.liIndex=i,t.display=t.content||t.text,t.type="option",t.index=i,t.option=e,t.disabled=t.disabled||e.disabled,g.push(t),a=0,t.display&&(a+=t.display.length),t.subtext&&(a+=t.subtext.length),t.icon&&(a+=1),d li")},render:function(){this.setPlaceholder();var e,t,i,s=this,n=this.$element[0],o=O(n,this.options.hideDisabled),r=o.length,l=this.$button[0],a=l.querySelector(".filter-option-inner-inner"),c=document.createTextNode(this.options.multipleSeparator),d=F.fragment.cloneNode(!1),h=!1;if(l.classList.toggle("bs-placeholder",s.multiple?!r:!T(n,o)),this.tabIndex(),"static"===this.options.selectedTextFormat)d=Y({text:this.options.title},!0);else if(!1===(this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count")&&1")).length&&r>e[1]||1===e.length&&2<=r))){for(var p=0;p option"+v+", optgroup"+v+" option"+v).length,b="function"==typeof this.options.countSelectedText?this.options.countSelectedText(r,g):this.options.countSelectedText,d=Y({text:b.replace("{0}",r.toString()).replace("{1}",g.toString())},!0)}null==this.options.title&&(this.options.title=this.$element.attr("title")),d.childNodes.length||(d=Y({text:void 0!==this.options.title?this.options.title:this.options.noneSelectedText},!0)),l.title=d.textContent.replace(/<[^>]*>?/g,"").trim(),this.options.sanitize&&h&&B([d],s.options.whiteList,s.options.sanitizeFn),a.innerHTML="",a.appendChild(d),M.major<4&&this.$newElement[0].classList.contains("bs3-has-addon")&&(t=l.querySelector(".filter-expand"),(i=a.cloneNode(!0)).className="filter-expand",t?l.replaceChild(i,t):l.appendChild(i)),this.$element.trigger("rendered"+U)},setStyle:function(e,t){var i,s=this.$button[0],n=this.$newElement[0],o=this.options.style.trim();this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,"")),M.major<4&&(n.classList.add("bs3"),n.parentNode.classList.contains("input-group")&&(n.previousElementSibling||n.nextElementSibling)&&(n.previousElementSibling||n.nextElementSibling).classList.contains("input-group-addon")&&n.classList.add("bs3-has-addon")),i=e?e.trim():o,"add"==t?i&&s.classList.add.apply(s.classList,i.split(" ")):"remove"==t?i&&s.classList.remove.apply(s.classList,i.split(" ")):(o&&s.classList.remove.apply(s.classList,o.split(" ")),i&&s.classList.add.apply(s.classList,i.split(" ")))},liHeight:function(e){var t,i,s,n,o,r,l,a,c,d,h,p,u,f,m,v,g,b,w,I,x,k,$,y,S,E,C,O;(e||!1!==this.options.size&&!this.sizeInfo)&&(this.sizeInfo||(this.sizeInfo={}),t=document.createElement("div"),i=document.createElement("div"),s=document.createElement("div"),n=document.createElement("ul"),o=document.createElement("li"),r=document.createElement("li"),l=document.createElement("li"),a=document.createElement("a"),c=document.createElement("span"),d=this.options.header&&0this.sizeInfo.menuExtras.vert&&l+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot)),"auto"===this.options.size)n=3this.options.size){for(var g=0;gthis.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth),"auto"===this.options.dropdownAlignRight&&this.$menu.toggleClass(j.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRightthis.options.size&&i.off("resize"+U+"."+this.selectId+".setMenuSize scroll"+U+"."+this.selectId+".setMenuSize"),t.createView(!1,!0,e))},setWidth:function(){var i=this;"auto"===this.options.width?requestAnimationFrame(function(){i.$menu.css("min-width","0"),i.$element.on("loaded"+U,function(){i.liHeight(),i.setMenuSize();var e=i.$newElement.clone().appendTo("body"),t=e.css("width","auto").children("button").outerWidth();e.remove(),i.sizeInfo.selectWidth=Math.max(i.sizeInfo.totalMenuWidth,t),i.$newElement.css("width",i.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[0].classList.remove("fit-width")},selectPosition:function(){this.$bsContainer=z('
');function e(e){var t={},i=r.options.display||!!z.fn.dropdown.Constructor.Default&&z.fn.dropdown.Constructor.Default.display;r.$bsContainer.addClass(e.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(j.DROPUP,e.hasClass(j.DROPUP)),s=e.offset(),l.is("body")?n={top:0,left:0}:((n=l.offset()).top+=parseInt(l.css("borderTopWidth"))-l.scrollTop(),n.left+=parseInt(l.css("borderLeftWidth"))-l.scrollLeft()),o=e.hasClass(j.DROPUP)?0:e[0].offsetHeight,(M.major<4||"static"===i)&&(t.top=s.top-n.top+o,t.left=s.left-n.left),t.width=e[0].offsetWidth,r.$bsContainer.css(t)}var s,n,o,r=this,l=z(this.options.container);this.$button.on("click.bs.dropdown.data-api",function(){r.isDisabled()||(e(r.$newElement),r.$bsContainer.appendTo(r.options.container).toggleClass(j.SHOW,!r.$button.hasClass(j.SHOW)).append(r.$menu))}),z(window).off("resize"+U+"."+this.selectId+" scroll"+U+"."+this.selectId).on("resize"+U+"."+this.selectId+" scroll"+U+"."+this.selectId,function(){r.$newElement.hasClass(j.SHOW)&&e(r.$newElement)}),this.$element.on("hide"+U,function(){r.$menu.data("height",r.$menu.height()),r.$bsContainer.detach()})},setOptionStatus:function(e){var t=this;if(t.noScroll=!1,t.selectpicker.view.visibleElements&&t.selectpicker.view.visibleElements.length)for(var i=0;i
');$[2]&&(y=y.replace("{var}",$[2][1"+y+"")),d=!1,C.$element.trigger("maxReached"+U)),g&&w&&(E.append(z("
"+S+"
")),d=!1,C.$element.trigger("maxReachedGrp"+U)),setTimeout(function(){C.setSelected(r,!1)},10),E[0].classList.add("fadeOut"),setTimeout(function(){E.remove()},1050)}}}else c&&(c.selected=!1),h.selected=!0,C.setSelected(r,!0);!C.multiple||C.multiple&&1===C.options.maxOptions?C.$button.trigger("focus"):C.options.liveSearch&&C.$searchbox.trigger("focus"),d&&(!C.multiple&&a===s.selectedIndex||(A=[h.index,p.prop("selected"),l],C.$element.triggerNative("change")))}}),this.$menu.on("click","li."+j.DISABLED+" a, ."+j.POPOVERHEADER+", ."+j.POPOVERHEADER+" :not(.close)",function(e){e.currentTarget==this&&(e.preventDefault(),e.stopPropagation(),C.options.liveSearch&&!z(e.target).hasClass("close")?C.$searchbox.trigger("focus"):C.$button.trigger("focus"))}),this.$menuInner.on("click",".divider, .dropdown-header",function(e){e.preventDefault(),e.stopPropagation(),C.options.liveSearch?C.$searchbox.trigger("focus"):C.$button.trigger("focus")}),this.$menu.on("click","."+j.POPOVERHEADER+" .close",function(){C.$button.trigger("click")}),this.$searchbox.on("click",function(e){e.stopPropagation()}),this.$menu.on("click",".actions-btn",function(e){C.options.liveSearch?C.$searchbox.trigger("focus"):C.$button.trigger("focus"),e.preventDefault(),e.stopPropagation(),z(this).hasClass("bs-select-all")?C.selectAll():C.deselectAll()}),this.$element.on("change"+U,function(){C.render(),C.$element.trigger("changed"+U,A),A=null}).on("focus"+U,function(){C.options.mobile||C.$button.trigger("focus")})},liveSearchListener:function(){var u=this,f=document.createElement("li");this.$button.on("click.bs.dropdown.data-api",function(){u.$searchbox.val()&&u.$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 e=u.$searchbox.val();if(u.selectpicker.search.elements=[],u.selectpicker.search.data=[],e){var t=[],i=e.toUpperCase(),s={},n=[],o=u._searchStyle(),r=u.options.liveSearchNormalize;r&&(i=m(i)),u._$lisSelected=u.$menuInner.find(".selected");for(var l=0;l=a.selectpicker.view.canHighlight.length&&(t=0),a.selectpicker.view.canHighlight[t+f]||(t=t+1+a.selectpicker.view.canHighlight.slice(t+f+1).indexOf(!0))),e.preventDefault();var m=f+t;e.which===P?0===f&&t===c.length-1?(a.$menuInner[0].scrollTop=a.$menuInner[0].scrollHeight,m=a.selectpicker.current.elements.length-1):d=(o=(n=a.selectpicker.current.data[m]).position-n.height)u+a.sizeInfo.menuInnerHeight),s=a.selectpicker.main.elements[v],a.activeIndex=b[w],a.focusItem(s),s&&s.firstChild.focus(),d&&(a.$menuInner[0].scrollTop=o),r.trigger("focus"))}i&&(e.which===D&&!a.selectpicker.keydown.keyHistory||e.which===N||e.which===H&&a.options.selectOnTab)&&(e.which!==D&&e.preventDefault(),a.options.liveSearch&&e.which===D||(a.$menuInner.find(".active a").trigger("click",!0),r.trigger("focus"),a.options.liveSearch||(e.preventDefault(),z(document).data("spaceSelect",!0))))}},mobile:function(){this.$element[0].classList.add("mobile-device")},refresh:function(){var e=z.extend({},this.options,this.$element.data());this.options=e,this.checkDisabled(),this.setStyle(),this.render(),this.createLi(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed"+U)},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(U).removeData("selectpicker").removeClass("bs-select-hidden selectpicker"),z(window).off(U+"."+this.selectId)}};var X=z.fn.selectpicker;z.fn.selectpicker=Q,z.fn.selectpicker.Constructor=J,z.fn.selectpicker.noConflict=function(){return z.fn.selectpicker=X,this},z(document).off("keydown.bs.dropdown.data-api",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select .dropdown-menu').on("keydown"+U,'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',J.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',function(e){e.stopPropagation()}),z(window).on("load"+U+".data-api",function(){z(".selectpicker").each(function(){var e=z(this);Q.call(e,e.data())})})}(e)});