/*! * Bootstrap-select v1.14.0-beta2 (https://developer.snapappointments.com/bootstrap-select) * * Copyright 2012-2021 SnapAppointments, LLC * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE) */ !function(e,t){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,function(e){!function(T){"use strict";var d=["sanitize","whiteList","sanitizeFn"],l=["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:[]},r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,a=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i,n=["title","placeholder"];function v(e,t){var i=e.nodeName.toLowerCase();if(-1!==T.inArray(i,t))return-1===T.inArray(i,l)||Boolean(e.nodeValue.match(r)||e.nodeValue.match(a));for(var s=T(t).filter(function(e,t){return t instanceof RegExp}),n=0,o=s.length;n]+>/g,"")),s&&(a=I(a)),a=a.toUpperCase(),o="function"==typeof i?i(a,t):"contains"===i?0<=a.indexOf(t):a.startsWith(t)))break}return o}function L(e){return parseInt(e,10)||0}T.fn.triggerNative=function(e){var t,i=this[0];i.dispatchEvent&&(f?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(e,!0,!1),i.dispatchEvent(t))};var m={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"},g=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,b=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]","g");function w(e){return m[e]}function I(e){return(e=e.toString())&&e.replace(g,w).replace(b,"")}var x,y,$,S,E=(x={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},y="(?:"+Object.keys(x).join("|")+")",$=RegExp(y),S=RegExp(y,"g"),function(e){return e=null==e?"":""+e,$.test(e)?e.replace(S,C):e});function C(e){return x[e]}var O={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"},N=27,H=13,W=32,B=9,M=38,R=40,U=window.Dropdown||bootstrap.Dropdown;function V(){var t;try{t=T.fn.dropdown.Constructor.VERSION}catch(e){t=U.VERSION}return t}var j={success:!1,major:"3"};try{j.full=(V()||"").split(" ")[0].split("."),j.major=j.full[0],j.success=!0}catch(e){}var _=0,F=".bs.select",G={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"},q={MENU:"."+G.MENU,DATA_TOGGLE:'data-toggle="dropdown"'},K={div:document.createElement("div"),span:document.createElement("span"),i:document.createElement("i"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode("\xa0"),fragment:document.createDocumentFragment(),option:document.createElement("option")};K.selectedOption=K.option.cloneNode(!1),K.selectedOption.setAttribute("selected",!0),K.noResults=K.li.cloneNode(!1),K.noResults.className="no-results",K.a.setAttribute("role","option"),K.a.className="dropdown-item",K.subtext.className="text-muted",K.text=K.span.cloneNode(!1),K.text.className="text",K.checkMark=K.span.cloneNode(!1);var Q=new RegExp(M+"|"+R),Y=new RegExp("^"+B+"$|"+N),Z={li:function(e,t,i){var s=K.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},a:function(e,t,i){var s=K.a.cloneNode(!0);return e&&(11===e.nodeType?s.appendChild(e):s.insertAdjacentHTML("beforeend",e)),void 0!==t&&""!==t&&s.classList.add.apply(s.classList,t.split(/\s+/)),i&&s.setAttribute("style",i),s},text:function(e,t){var i,s,n=K.text.cloneNode(!1);if(e.content)n.innerHTML=e.content;else{if(n.textContent=e.text,e.icon){var o=K.whitespace.cloneNode(!1);(s=(!0===t?K.i:K.span).cloneNode(!1)).className=this.options.iconBase+" "+e.icon,K.fragment.appendChild(s),K.fragment.appendChild(o)}e.subtext&&((i=K.subtext.cloneNode(!1)).textContent=e.subtext,n.appendChild(i))}if(!0===t)for(;0'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1,sanitize:!0,sanitizeFn:null,whiteList:e},te.prototype={constructor:te,init:function(){var i=this,e=this.$element.attr("id"),t=this.$element[0],s=t.form;_++,this.selectId="bs-select-"+_,t.classList.add("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),t.classList.contains("show-tick")&&(this.options.showTick=!0),this.$newElement=this.createDropdown(),this.$element.after(this.$newElement).prependTo(this.$newElement),s&&null===t.form&&(s.id||(s.id="form-"+this.selectId),t.setAttribute("form",s.id)),this.$button=this.$newElement.children("button"),this.options.allowClear&&(this.$clearButton=this.$button.children(".bs-select-clear-selected")),this.$menu=this.$newElement.children(q.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),t.classList.remove("bs-select-hidden"),this.fetchData(function(){i.render(!0),i.buildList(),requestAnimationFrame(function(){i.$element.trigger("loaded"+F)})}),this.fetchData(function(){i.render(!0),i.buildList(),requestAnimationFrame(function(){i.$element.trigger("loaded"+F)})}),!0===this.options.dropdownAlignRight&&this.$menu[0].classList.add(G.MENURIGHT),void 0!==e&&this.$button.attr("data-id",e),this.checkDisabled(),this.clickListener(),4'+this.options.header+""),this.options.liveSearch&&(l=''),this.multiple&&this.options.actionsBox&&(r='
"),this.multiple&&this.options.doneButton&&(a='
"),this.options.allowClear&&(c='×'),n='",T(n)},setPositionData:function(){this.selectpicker.view.canHighlight=[],this.selectpicker.view.size=0,this.selectpicker.view.firstHighlightIndex=!1;for(var e=0;e=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(z,e,t){var D,L,N=this,i=0,H=[];if(this.selectpicker.isSearching=z,this.selectpicker.current=z?this.selectpicker.search:this.selectpicker.main,this.setPositionData(),e)if(t)i=this.$menuInner[0].scrollTop;else if(!N.multiple){var s=N.$element[0],n=(s.options[s.selectedIndex]||{}).liIndex;if("number"==typeof n&&!1!==N.options.size){var o=N.selectpicker.main.data[n],l=o&&o.position;l&&(i=l-(N.sizeInfo.menuInnerHeight+N.sizeInfo.liHeight)/2)}}function W(e,t){var i,s,n,o,l,r,a,c,d=N.selectpicker.current.data.length,h=[],p=!0,u=N.isVirtual();N.selectpicker.view.scrollTop=e,i=N.options.chunkSize,s=Math.ceil(d/i)||1;for(var f=0;fd-1?0:N.selectpicker.current.data[d-1].position-N.selectpicker.current.data[N.selectpicker.view.position1-1].position,b.firstChild.style.marginTop=v+"px",b.firstChild.style.marginBottom=g+"px"):(b.firstChild.style.marginTop=0,b.firstChild.style.marginBottom=0),b.firstChild.appendChild(w),!0===u&&N.sizeInfo.hasScrollBar){var C=b.firstChild.offsetWidth;if(t&&CN.sizeInfo.selectWidth)b.firstChild.style.minWidth=N.sizeInfo.menuInnerInnerWidth+"px";else if(C>N.sizeInfo.menuInnerInnerWidth){N.$menu[0].style.minWidth=0;var O=b.firstChild.offsetWidth;O>N.sizeInfo.menuInnerInnerWidth&&(N.sizeInfo.menuInnerInnerWidth=O,b.firstChild.style.minWidth=N.sizeInfo.menuInnerInnerWidth+"px"),N.$menu[0].style.minWidth=""}}}(!z&&N.options.source.load||z&&N.options.source.search)&&l===s-1&&N.fetchData(function(){N.render(),N.buildList(d,z),N.setPositionData(),W(e)},z?"search":"load",l+1,z?N.selectpicker.search.previousValue:void 0)}if(N.prevActiveIndex=N.activeIndex,N.options.liveSearch){if(z&&t){var A,T=0;N.selectpicker.view.canHighlight[T]||(T=1+N.selectpicker.view.canHighlight.slice(1).indexOf(!0)),A=N.selectpicker.view.visibleElements[T],N.defocusItem(N.selectpicker.view.currentActive),N.activeIndex=(N.selectpicker.current.data[T]||{}).index,N.focusItem(A)}}else N.$menuInner.trigger("focus")}W(i,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",function(e,t){N.noScroll||W(this.scrollTop,t),N.noScroll=!1}),T(window).off("resize"+F+"."+this.selectId+".createView").on("resize"+F+"."+this.selectId+".createView",function(){N.$newElement.hasClass(G.SHOW)&&W(N.$menuInner[0].scrollTop)})},focusItem:function(e,t,i){if(e){t=t||this.selectpicker.main.data[this.activeIndex];var s=e.firstChild;s&&(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=this,t=!1;if((this.options.placeholder||this.options.allowClear)&&!this.multiple){this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option")),t=!0;var i=this.$element[0],s=!1,n=!this.selectpicker.view.titleOption.parentNode,o=i.selectedIndex,l=i.options[o],r=i.querySelector("select > *:not(:disabled)"),a=r?r.index:0,c=window.performance&&window.performance.getEntriesByType("navigation"),d=c&&c.length?"back_forward"!==c[0].type:2!==window.performance.navigation.type;n&&(this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",s=!l||o===a&&!1===l.defaultSelected&&void 0===this.$element.data("selected")),!n&&0===this.selectpicker.view.titleOption.index||i.insertBefore(this.selectpicker.view.titleOption,i.firstChild),s&&d?i.selectedIndex=0:"complete"!==document.readyState&&window.addEventListener("pageshow",function(){e.selectpicker.view.displayedValue!==i.value&&e.render()})}return t},fetchData:function(t,i,e,s){i=i||"data";var n,o=this,l=this.options.source[i];l?(this.options.virtualScroll=!0,"function"==typeof l?l.call(this,function(e){n=o.buildData(e,i),t.call(o,n)},e,s):Array.isArray(l)&&(n=o.buildData(l,i),t.call(o,n))):(n=this.buildData(!1,i),t.call(o,n))},buildData:function(p,e){var u=!1===p?J.fromOption:J.fromDataSource,f=':not([hidden]):not([data-hidden="true"])',m=[],l=0,v=0,g=this.setPlaceholder()&&!p?1:0;"load"===e?l=this.selectpicker.main.data.length:"search"===e&&(l=this.selectpicker.search.data.length),this.options.hideDisabled&&(f+=":not(:disabled)");var t=p?p.filter(ee,this):this.$element[0].querySelectorAll("select > *"+f);function b(e){var t=m[m.length-1];t&&"divider"===t.type&&(t.optID||e.optID)||((e=e||{}).type="divider",m.push(e))}function w(e,t){if((t=t||{}).divider=u(e,"divider"),!0===t.divider)b({optID:t.optID});else{var i=m.length+l,s=u(e,"style"),n=s?E(s):"",o=(e.className||"")+(t.optgroupClass||"");t.optID&&(o="opt "+o),t.optionClass=o.trim(),t.inlineStyle=n,t.text=u(e,"text"),t.content=u(e,"content"),t.tokens=u(e,"tokens"),t.subtext=u(e,"subtext"),t.icon=u(e,"icon"),t.display=t.content||t.text,t.value=void 0===e.value?e.text:e.value,t.type="option",t.index=i,t.option=e.option?e.option:e,t.option.liIndex=i,t.selected=!!e.selected,t.disabled=t.disabled||!!e.disabled,m.push(t)}}function i(e,t){var i=t[e],s=!(e-1 li")},render:function(e){var t,i=this,s=this.$element[0],n=this.setPlaceholder()&&0===s.selectedIndex,o=A.call(this),l=o.length,r=z.call(this,o),a=this.$button[0],c=a.querySelector(".filter-option-inner-inner"),d=document.createTextNode(this.options.multipleSeparator),h=K.fragment.cloneNode(!1),p=!1;if(this.options.source.data&&e&&(o.map(function e(t){t.selected?i.createOption(t,!0):t.children&&t.children.length&&t.children.map(e)}),s.appendChild(this.selectpicker.main.optionQueue),n=n&&0===s.selectedIndex),a.classList.toggle("bs-placeholder",i.multiple?!l:!r&&0!==r),i.multiple||1!==o.length||(i.selectpicker.view.displayedValue=r),"static"===this.options.selectedTextFormat)h=Z.text.call(this,{text:this.options.placeholder},!0);else if(!1===(this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count")&&1")).length&&l>t[1]||1===t.length&&2<=l))){if(!n){for(var u=0;u option"+v+", optgroup"+v+" option"+v).length,b="function"==typeof this.options.countSelectedText?this.options.countSelectedText(l,g):this.options.countSelectedText;h=Z.text.call(this,{text:b.replace("{0}",l.toString()).replace("{1}",g.toString())},!0)}if(h.childNodes.length||(h=Z.text.call(this,{text:this.options.placeholder?this.options.placeholder:this.options.noneSelectedText},!0)),a.title=h.textContent.replace(/<[^>]*>?/g,"").trim(),this.options.sanitize&&p&&P([h],i.options.whiteList,i.options.sanitizeFn),c.innerHTML="",c.appendChild(h),j.major<4&&this.$newElement[0].classList.contains("bs3-has-addon")){var w=a.querySelector(".filter-expand"),I=c.cloneNode(!0);I.className="filter-expand",w?a.replaceChild(I,w):a.appendChild(I)}this.$element.trigger("rendered"+F)},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,"")),j.major<4&&(n.classList.add("bs3"),n.parentNode.classList&&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){if(e||!1!==this.options.size&&!Object.keys(this.sizeInfo).length){var t,i=K.div.cloneNode(!1),s=K.div.cloneNode(!1),n=K.div.cloneNode(!1),o=document.createElement("ul"),l=K.li.cloneNode(!1),r=K.li.cloneNode(!1),a=K.a.cloneNode(!1),c=K.span.cloneNode(!1),d=this.options.header&&0this.sizeInfo.menuExtras.vert&&r+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot,!0===this.selectpicker.isSearching&&(a=this.selectpicker.dropup),this.$newElement.toggleClass(G.DROPUP,a),this.selectpicker.dropup=a),"auto"===this.options.size)n=3this.options.size){for(var b=0;bthis.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth),"auto"===this.options.dropdownAlignRight&&this.$menu.toggleClass(G.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRightthis.options.size&&i.off("resize"+F+"."+this.selectId+".setMenuSize scroll"+F+"."+this.selectId+".setMenuSize")}this.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"+F,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=T('
');function e(e){var t={},i=l.options.display||!!T.fn.dropdown.Constructor.Default&&T.fn.dropdown.Constructor.Default.display;l.$bsContainer.addClass(e.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(G.DROPUP,e.hasClass(G.DROPUP)),s=e.offset(),r.is("body")?n={top:0,left:0}:((n=r.offset()).top+=parseInt(r.css("borderTopWidth"))-r.scrollTop(),n.left+=parseInt(r.css("borderLeftWidth"))-r.scrollLeft()),o=e.hasClass(G.DROPUP)?0:e[0].offsetHeight,(j.major<4||"static"===i)&&(t.top=s.top-n.top+o,t.left=s.left-n.left),t.width=e[0].offsetWidth,l.$bsContainer.css(t)}var s,n,o,l=this,r=T(this.options.container);this.$button.on("click.bs.dropdown.data-api",function(){l.isDisabled()||(e(l.$newElement),l.$bsContainer.appendTo(l.options.container).toggleClass(G.SHOW,!l.$button.hasClass(G.SHOW)).append(l.$menu))}),T(window).off("resize"+F+"."+this.selectId+" scroll"+F+"."+this.selectId).on("resize"+F+"."+this.selectId+" scroll"+F+"."+this.selectId,function(){l.$newElement.hasClass(G.SHOW)&&e(l.$newElement)}),this.$element.on("hide"+F,function(){l.$menu.data("height",l.$menu.height()),l.$bsContainer.detach()})},createOption:function(e,t){var i=e.option?e.option:e;if(i&&1!==i.nodeType){var s=(t?K.selectedOption:K.option).cloneNode(!0);void 0!==i.value&&(s.value=i.value),s.textContent=i.text,s.selected=!0,void 0!==i.liIndex?s.liIndex=i.liIndex:t||(s.liIndex=e.index),e.option=s,this.selectpicker.main.optionQueue.appendChild(s)}},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]&&(S=S.replace("{var}",$[2][1"+S+"")),h=!1,O.$element.trigger("maxReached"+F)),b&&I&&(C.append(T("
"+E+"
")),h=!1,O.$element.trigger("maxReachedGrp"+F)),setTimeout(function(){O.setSelected(l,!1)},10),C[0].classList.add("fadeOut"),setTimeout(function(){C.remove()},1050)}}}else d&&O.setSelected(d,!1),O.setSelected(o,!0);O.options.source.data&&O.$element[0].appendChild(O.selectpicker.main.optionQueue),!O.multiple||O.multiple&&1===O.options.maxOptions?O.$button.trigger("focus"):O.options.liveSearch&&O.$searchbox.trigger("focus"),h&&(!O.multiple&&a===s.selectedIndex||(D=[p.index,u.prop("selected"),r],O.$element.triggerNative("change")))}}),this.$menu.on("click","li."+G.DISABLED+" a, ."+G.POPOVERHEADER+", ."+G.POPOVERHEADER+" :not(.close)",function(e){e.currentTarget==this&&(e.preventDefault(),e.stopPropagation(),O.options.liveSearch&&!T(e.target).hasClass("close")?O.$searchbox.trigger("focus"):O.$button.trigger("focus"))}),this.$menuInner.on("click",".divider, .dropdown-header",function(e){e.preventDefault(),e.stopPropagation(),O.options.liveSearch?O.$searchbox.trigger("focus"):O.$button.trigger("focus")}),this.$menu.on("click","."+G.POPOVERHEADER+" .close",function(){O.$button.trigger("click")}),this.$searchbox.on("click",function(e){e.stopPropagation()}),this.$menu.on("click",".actions-btn",function(e){O.options.liveSearch?O.$searchbox.trigger("focus"):O.$button.trigger("focus"),e.preventDefault(),e.stopPropagation(),T(this).hasClass("bs-select-all")?O.selectAll():O.deselectAll()}),this.$button.on("focus"+F,function(e){var t=O.$element[0].getAttribute("tabindex");void 0!==t&&e.originalEvent&&e.originalEvent.isTrusted&&(this.setAttribute("tabindex",t),O.$element[0].setAttribute("tabindex",-1),O.selectpicker.view.tabindex=t)}).on("blur"+F,function(e){void 0!==O.selectpicker.view.tabindex&&e.originalEvent&&e.originalEvent.isTrusted&&(O.$element[0].setAttribute("tabindex",O.selectpicker.view.tabindex),this.setAttribute("tabindex",-1),O.selectpicker.view.tabindex=void 0)}),this.$element.on("change"+F,function(){O.render(),O.$element.trigger("changed"+F,D),D=null}).on("focus"+F,function(){O.options.mobile||O.$button[0].focus()})},liveSearchListener:function(){var u=this;this.$button.on("click.bs.dropdown.data-api",function(){u.$searchbox.val()&&(u.$searchbox.val(""),u.selectpicker.search.previousValue=void 0)}),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 t=u.$searchbox[0].value;if(u.selectpicker.search.elements=[],u.selectpicker.search.data=[],t)if(u.options.source.search)u.fetchData(function(e){u.render(),u.buildList(void 0,!0),u.createView(!0),X.call(u,e,t)},"search",0,t);else{var e=[],i=t.toUpperCase(),s={},n=[],o=u._searchStyle(),l=u.options.liveSearchNormalize;l&&(i=I(i));for(var r=0;r=a.selectpicker.view.canHighlight.length&&(t=a.selectpicker.view.firstHighlightIndex),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===M?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[x],a.focusItem(s),s&&s.firstChild.focus(),d&&(a.$menuInner[0].scrollTop=o),l.trigger("focus")}}i&&(e.which===W&&!a.selectpicker.keydown.keyHistory||e.which===H||e.which===B&&a.options.selectOnTab)&&(e.which!==W&&e.preventDefault(),a.options.liveSearch&&e.which===W||(a.$menuInner.find(".active a").trigger("click",!0),l.trigger("focus"),a.options.liveSearch||(e.preventDefault(),T(document).data("spaceSelect",!0))))}},mobile:function(){this.options.mobile=!0,this.$element[0].classList.add("mobile-device")},refresh:function(){var e=this,t=T.extend({},this.options,h(this.$element),this.$element.data());this.options=t,this.options.source.data?(this.render(),this.buildList()):this.fetchData(function(){e.render(),e.buildList()}),this.checkDisabled(),this.setStyle(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed"+F)},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.selectpicker.view.titleOption&&this.selectpicker.view.titleOption.parentNode&&this.selectpicker.view.titleOption.parentNode.removeChild(this.selectpicker.view.titleOption),this.$element.off(F).removeData("selectpicker").removeClass("bs-select-hidden selectpicker"),T(window).off(F+"."+this.selectId)}};var se=T.fn.selectpicker;function ne(){return j.major<5?T.fn.dropdown?(T.fn.dropdown.Constructor._dataApiKeydownHandler||T.fn.dropdown.Constructor.prototype.keydown).apply(this,arguments):void 0:U.dataApiKeydownHandler}T.fn.selectpicker=ie,T.fn.selectpicker.Constructor=te,T.fn.selectpicker.noConflict=function(){return T.fn.selectpicker=se,this},T(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.dropdown.data-api",":not(.bootstrap-select) > ["+q.DATA_TOGGLE+"]",ne).on("keydown.bs.dropdown.data-api",":not(.bootstrap-select) > .dropdown-menu",ne).on("keydown"+F,".bootstrap-select ["+q.DATA_TOGGLE+'], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',te.prototype.keydown).on("focusin.modal",".bootstrap-select ["+q.DATA_TOGGLE+'], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',function(e){e.stopPropagation()}),document.addEventListener("DOMContentLoaded",function(){T(".selectpicker").each(function(){var e=T(this);ie.call(e,e.data())})})}(e)}); //# sourceMappingURL=bootstrap-select.min.js.map