/*! For license information please see 548.f27921108746d0e5fe91.min.js.LICENSE.txt */
(self.webpackChunkwhitelabel=self.webpackChunkwhitelabel||[]).push([[548],{5246:function(){!function(e,t){var i=function(i,s){var n,o,l=this;s=s||{},this.$element=e(i),this.options=e.extend(!0,{},e.fn.ajaxSelectPicker.defaults,s),this.LOG_ERROR=1,this.LOG_WARNING=2,this.LOG_INFO=3,this.LOG_DEBUG=4,this.lastRequest=!1,this.previousQuery="",this.query="",this.request=!1;var r=[{from:"ajaxResultsPreHook",to:"preprocessData"},{from:"ajaxSearchUrl",to:{ajax:{url:"{{{value}}}"}}},{from:"ajaxOptions",to:"ajax"},{from:"debug",to:function(t){var i={};i.log=Boolean(l.options[t.from])?l.LOG_DEBUG:0,l.options=e.extend(!0,{},l.options,i),delete l.options[t.from],l.log(l.LOG_WARNING,'Deprecated option "'+t.from+'". Update code to use:',i)}},{from:"mixWithCurrents",to:"preserveSelected"},{from:"placeHolderOption",to:{locale:{emptyTitle:"{{{value}}}"}}}];r.length&&e.map(r,(function(t){if(l.options[t.from])if(e.isPlainObject(t.to))l.replaceValue(t.to,"{{{value}}}",l.options[t.from]),l.options=e.extend(!0,{},l.options,t.to),l.log(l.LOG_WARNING,'Deprecated option "'+t.from+'". Update code to use:',t.to),delete l.options[t.from];else if(e.isFunction(t.to))t.to.apply(l,[t]);else{var i={};i[t.to]=l.options[t.from],l.options=e.extend(!0,{},l.options,i),l.log(l.LOG_WARNING,'Deprecated option "'+t.from+'". Update code to use:',i),delete l.options[t.from]}}));var a=this.$element.data();a.searchUrl&&(l.log(l.LOG_WARNING,'Deprecated attribute name: "data-search-url". Update markup to use: \' data-abs-ajax-url="'+a.searchUrl+"\" '"),this.options.ajax.url=a.searchUrl);var c=function(e,t){return t.toLowerCase()},p=function(e,t,i){var s=[].concat(e),n=s.length,o=i||{};if(n){var l=s.shift();o[l]=p(s,t,o[l])}return n?o:t},h=Object.keys(a).filter(/./.test.bind(new RegExp("^abs[A-Z]")));if(h.length){var d={},u=["locale"];for(n=0,o=h.length;n<o;n++){var f=h[n].replace(/^abs([A-Z])/,c).replace(/([A-Z])/g,"-$1").toLowerCase(),g=f.split("-");if(g[0]&&g.length>1&&-1!==u.indexOf(g[0])){for(var m=[g.shift()],v="",b=0;b<g.length;b++)v+=0===b?g[b]:g[b].charAt(0).toUpperCase()+g[b].slice(1);m.push(v),g=m}this.log(this.LOG_DEBUG,'Processing data attribute "data-abs-'+f+'":',a[h[n]]),p(g,a[h[n]],d)}this.options=e.extend(!0,{},this.options,d),this.log(this.LOG_DEBUG,"Merged in the data attribute options: ",d,this.options)}if(this.selectpicker=a.selectpicker,!this.selectpicker)return this.log(this.LOG_ERROR,"Cannot instantiate an AjaxBootstrapSelect instance without selectpicker first being initialized!"),null;if(!this.options.ajax.url)return this.log(this.LOG_ERROR,'Option "ajax.url" must be set! Options:',this.options),null;if(this.locale=e.extend(!0,{},e.fn.ajaxSelectPicker.locale),this.options.langCode=this.options.langCode||t.navigator.userLanguage||t.navigator.language||"en",!this.locale[this.options.langCode]){var w=this.options.langCode;this.options.langCode="en";var k=w.split("-");for(n=0,o=k.length;n<o;n++){var x=k.join("-");if(x.length&&this.locale[x]){this.options.langCode=x;break}k.pop()}this.log(this.LOG_WARNING,'Unknown langCode option: "'+w+'". Using the following langCode instead: "'+this.options.langCode+'".')}this.locale[this.options.langCode]=e.extend(!0,{},this.locale[this.options.langCode],this.options.locale),this.list=new t.AjaxBootstrapSelectList(this),this.list.refresh(),setTimeout((function(){l.init()}),500)};i.prototype.init=function(){var i,s=this;this.options.preserveSelected&&this.selectpicker.$menu.off("click",".actions-btn").on("click",".actions-btn",(function(t){s.selectpicker.options.liveSearch?s.selectpicker.$searchbox.focus():s.selectpicker.$button.focus(),t.preventDefault(),t.stopPropagation(),e(this).is(".bs-select-all")?(null===s.selectpicker.$lis&&(s.selectpicker.$lis=s.selectpicker.$menu.find("li")),s.$element.find("option:enabled").prop("selected",!0),e(s.selectpicker.$lis).not(".disabled").addClass("selected"),s.selectpicker.render()):(null===s.selectpicker.$lis&&(s.selectpicker.$lis=s.selectpicker.$menu.find("li")),s.$element.find("option:enabled").prop("selected",!1),e(s.selectpicker.$lis).not(".disabled").removeClass("selected"),s.selectpicker.render()),s.selectpicker.$element.change()})),this.selectpicker.$searchbox.attr("placeholder",this.t("searchPlaceholder")).off("input propertychange"),this.selectpicker.$searchbox.on(this.options.bindEvent,(function(n){var o=s.selectpicker.$searchbox.val();if(s.log(s.LOG_DEBUG,'Bind event fired: "'+s.options.bindEvent+'", keyCode:',n.keyCode,n),s.options.cache||(s.options.ignoredKeys[13]="enter"),s.options.ignoredKeys[n.keyCode])s.log(s.LOG_DEBUG,"Key ignored.");else if(clearTimeout(i),o.length||(s.options.clearOnEmpty&&s.list.destroy(),s.options.emptyRequest))if(o.length<s.options.minLength)s.list.setStatus(s.t("statusTooShort"));else{if(s.previousQuery=s.query,s.query=o,s.options.cache&&13!==n.keyCode){var l=s.list.cacheGet(s.query);if(l)return s.list.setStatus(l.length?"":s.t("statusNoResults")),s.list.replaceOptions(l),void s.log(s.LOG_INFO,"Rebuilt options from cached data.")}i=setTimeout((function(){s.lastRequest&&s.lastRequest.jqXHR&&e.isFunction(s.lastRequest.jqXHR.abort)&&s.lastRequest.jqXHR.abort(),s.request=new t.AjaxBootstrapSelectRequest(s),s.request.jqXHR.always((function(){s.lastRequest=s.request,s.request=!1}))}),s.options.requestDelay||300)}}))},i.prototype.log=function(e,i){if(t.console&&this.options.log){if("number"!=typeof this.options.log)switch("string"==typeof this.options.log&&(this.options.log=this.options.log.toLowerCase()),this.options.log){case!0:case"debug":this.options.log=this.LOG_DEBUG;break;case"info":this.options.log=this.LOG_INFO;break;case"warn":case"warning":this.options.log=this.LOG_WARNING;break;default:this.options.log=this.LOG_ERROR}if(e<=this.options.log){var s=[].slice.apply(arguments,[2]);switch(e){case this.LOG_DEBUG:e="debug";break;case this.LOG_INFO:e="info";break;case this.LOG_WARNING:e="warn";break;default:case this.LOG_ERROR:e="error"}var n="["+e.toUpperCase()+"] AjaxBootstrapSelect:";"string"==typeof i?s.unshift(n+" "+i):(s.unshift(i),s.unshift(n)),t.console[e].apply(t.console,s)}}},i.prototype.replaceValue=function(t,i,s,n){var o=this;n=e.extend({recursive:!0,depth:!1,limit:!1},n),e.each(t,(function(l,r){if(!1!==n.limit&&"number"==typeof n.limit&&n.limit<=0)return!1;e.isArray(t[l])||e.isPlainObject(t[l])?(n.recursive&&!1===n.depth||n.recursive&&"number"==typeof n.depth&&n.depth>0)&&o.replaceValue(t[l],i,s,n):r===i&&(!1!==n.limit&&"number"==typeof n.limit&&n.limit--,t[l]=s)}))},i.prototype.t=function(e,t){return t=t||this.options.langCode,this.locale[t]&&this.locale[t].hasOwnProperty(e)?this.locale[t][e]:(this.log(this.LOG_WARNING,"Unknown translation key:",e),e)},t.AjaxBootstrapSelect=t.AjaxBootstrapSelect||i;var s=function(t){var i=this;this.$status=e(t.options.templates.status).hide().appendTo(t.selectpicker.$menu);var s=t.t("statusInitialized");s&&s.length&&this.setStatus(s),this.cache={},this.plugin=t,this.selected=[],this.title=null,this.selectedTextFormat=t.selectpicker.options.selectedTextFormat;var n=[];t.$element.find("option").each((function(){var i=e(this),s=i.attr("value");n.push({value:s,text:i.text(),class:i.attr("class")||"",data:i.data()||{},preserved:t.options.preserveSelected,selected:!!i.attr("selected")})})),this.cacheSet("",n),t.options.preserveSelected&&(i.selected=n,t.$element.on("change.abs.preserveSelected",(function(s){var n=t.$element.find(":selected");i.selected=[],t.selectpicker.multiple||(n=n.last()),n.each((function(){var t=e(this),s=t.attr("value");i.selected.push({value:s,text:t.text(),class:t.attr("class")||"",data:t.data()||{},preserved:!0,selected:!0})})),i.replaceOptions(i.cacheGet(i.plugin.query))})))};s.prototype.build=function(t){var i,s,n=t.length,o=e("<select/>"),l=e("<optgroup/>").attr("label",this.plugin.t("currentlySelected"));for(this.plugin.log(this.plugin.LOG_DEBUG,"Building the select list options from data:",t),s=0;s<n;s++){var r=t[s],a=e("<option/>").appendTo(r.preserved?l:o);if(r.hasOwnProperty("divider"))a.attr("data-divider","true");else for(i in a.val(r.value).text(r.text).attr("title",r.text),r.class.length&&a.attr("class",r.class),r.disabled&&a.attr("disabled",!0),r.selected&&!this.plugin.selectpicker.multiple&&o.find(":selected").prop("selected",!1),r.selected&&a.attr("selected",!0),r.data)r.data.hasOwnProperty(i)&&a.attr("data-"+i,r.data[i])}l.find("option").length&&l["before"===this.plugin.options.preserveSelectedPosition?"prependTo":"appendTo"](o);var c=o.html();return this.plugin.log(this.plugin.LOG_DEBUG,c),c},s.prototype.cacheGet=function(e,t){var i=this.cache[e]||t;return this.plugin.log(this.LOG_DEBUG,"Retrieving cache:",e,i),i},s.prototype.cacheSet=function(e,t){this.cache[e]=t,this.plugin.log(this.LOG_DEBUG,"Saving to cache:",e,t)},s.prototype.destroy=function(){this.replaceOptions(),this.plugin.list.setStatus(),this.plugin.log(this.plugin.LOG_DEBUG,"Destroyed select list.")},s.prototype.refresh=function(e){this.plugin.selectpicker.$menu.css("minHeight",0),this.plugin.selectpicker.$menu.find("> .inner").css("minHeight",0);var t=this.plugin.t("emptyTitle");!this.plugin.$element.find("option").length&&t&&t.length?this.setTitle(t):(this.title||"static"!==this.selectedTextFormat&&this.selectedTextFormat!==this.plugin.selectpicker.options.selectedTextFormat)&&this.restoreTitle(),this.plugin.selectpicker.refresh(),this.plugin.selectpicker.findLis(),e&&(this.plugin.log(this.plugin.LOG_DEBUG,"Triggering Change"),this.plugin.$element.trigger("change.$")),this.plugin.log(this.plugin.LOG_DEBUG,"Refreshed select list.")},s.prototype.replaceOptions=function(e){var t,i,s,n="",o=[],l=[],r=[];if(e=e||[],this.selected&&this.selected.length){for(this.plugin.log(this.plugin.LOG_INFO,"Processing preserved selections:",this.selected),i=(l=[].concat(this.selected,e)).length,t=0;t<i;t++)(s=l[t]).hasOwnProperty("value")&&-1===r.indexOf(s.value+"")?(r.push(s.value+""),o.push(s)):this.plugin.log(this.plugin.LOG_DEBUG,"Duplicate item found, ignoring.");e=o}e.length&&(n=this.plugin.list.build(e)),this.plugin.$element.html(n),this.refresh(),this.plugin.log(this.plugin.LOG_DEBUG,"Replaced options with data:",e)},s.prototype.restore=function(){var e=this.plugin.list.cacheGet(this.plugin.previousQuery);return e&&this.plugin.list.replaceOptions(e)&&this.plugin.log(this.plugin.LOG_DEBUG,"Restored select list to the previous query: ",this.plugin.previousQuery),this.plugin.log(this.plugin.LOG_DEBUG,"Unable to restore select list to the previous query:",this.plugin.previousQuery),!1},s.prototype.restoreTitle=function(){this.plugin.request||(this.plugin.selectpicker.options.selectedTextFormat=this.selectedTextFormat,this.title?this.plugin.$element.attr("title",this.title):this.plugin.$element.removeAttr("title"),this.title=null)},s.prototype.setTitle=function(e){this.plugin.request||(this.title=this.plugin.$element.attr("title"),this.plugin.selectpicker.options.selectedTextFormat="static",this.plugin.$element.attr("title",e))},s.prototype.setStatus=function(e){(e=e||"").length?this.$status.html(e).show():this.$status.html("").hide()},t.AjaxBootstrapSelectList=t.AjaxBootstrapSelectList||s;var n=function(t){var i,s=this,n=function(e){return function(){s.plugin.log(s.plugin.LOG_INFO,"Invoking AjaxBootstrapSelectRequest."+e+" callback:",arguments),s[e].apply(s,arguments),s.callbacks[e]&&(s.plugin.log(s.plugin.LOG_INFO,"Invoking ajax."+e+" callback:",arguments),s.callbacks[e].apply(s,arguments))}},o=["beforeSend","success","error","complete"],l=o.length;for(this.plugin=t,this.options=e.extend(!0,{},t.options.ajax),this.callbacks={},i=0;i<l;i++){var r=o[i];this.options[r]&&e.isFunction(this.options[r])&&(this.callbacks[r]=this.options[r]),this.options[r]=n(r)}this.options.data&&e.isFunction(this.options.data)&&(this.options.data=this.options.data.apply(this)||{q:"{{{q}}}"}),this.plugin.replaceValue(this.options.data,"{{{q}}}",this.plugin.query),this.options.url&&e.isFunction(this.options.url)&&(this.options.url=this.options.url.apply(this)),this.jqXHR=e.ajax(this.options)};n.prototype.beforeSend=function(e){this.plugin.list.destroy(),this.plugin.list.setStatus(this.plugin.t("statusSearching"))},n.prototype.complete=function(e,t){if("abort"!==t){var i=this.plugin.list.cacheGet(this.plugin.query);if(i){if(!i.length)return this.plugin.list.destroy(),this.plugin.list.setStatus(this.plugin.t("statusNoResults")),void this.plugin.log(this.plugin.LOG_INFO,"No results were returned.");this.plugin.list.setStatus()}this.plugin.list.refresh(!0)}},n.prototype.error=function(e,t,i){"abort"!==t&&(this.plugin.list.cacheSet(this.plugin.query),this.plugin.options.clearOnError&&this.plugin.list.destroy(),this.plugin.list.setStatus(this.plugin.t("errorText")),this.plugin.options.restoreOnError&&(this.plugin.list.restore(),this.plugin.list.setStatus()))},n.prototype.process=function(t){var i,s,n,o,l,r,a=[],c=[];if(this.plugin.log(this.plugin.LOG_INFO,"Processing raw data for:",this.plugin.query,t),l=t,e.isFunction(this.plugin.options.preprocessData)&&(this.plugin.log(this.plugin.LOG_DEBUG,"Invoking preprocessData callback:",this.plugin.options.processData),null!=(n=this.plugin.options.preprocessData.apply(this,[l]))&&!1!==n&&(l=n)),!e.isArray(l))return this.plugin.log(this.plugin.LOG_ERROR,'The data returned is not an Array. Use the "preprocessData" callback option to parse the results and construct a proper array for this plugin.',l),!1;for(s=l.length,i=0;i<s;i++)o=l[i],this.plugin.log(this.plugin.LOG_DEBUG,"Processing item:",o),e.isPlainObject(o)&&(o.hasOwnProperty("divider")||o.hasOwnProperty("data")&&e.isPlainObject(o.data)&&o.data.divider?(this.plugin.log(this.plugin.LOG_DEBUG,"Item is a divider, ignoring provided data."),a.push({divider:!0})):o.hasOwnProperty("value")?-1===c.indexOf(o.value+"")?(c.push(o.value+""),o=e.extend({text:o.value,class:"",data:{},disabled:!1,selected:!1},o),a.push(o)):this.plugin.log(this.plugin.LOG_DEBUG,"Duplicate item found, ignoring."):this.plugin.log(this.plugin.LOG_DEBUG,'Data item must have a "value" property, skipping.'));if(r=[].concat(a),e.isFunction(this.plugin.options.processData)&&(this.plugin.log(this.plugin.LOG_DEBUG,"Invoking processData callback:",this.plugin.options.processData),null!=(n=this.plugin.options.processData.apply(this,[r]))&&!1!==n)){if(!e.isArray(n))return this.plugin.log(this.plugin.LOG_ERROR,"The processData callback did not return an array.",n),!1;r=n}return this.plugin.list.cacheSet(this.plugin.query,r),this.plugin.log(this.plugin.LOG_INFO,"Processed data:",r),r},n.prototype.success=function(t,i,s){if(!e.isArray(t)&&!e.isPlainObject(t))return this.plugin.log(this.plugin.LOG_ERROR,"Request did not return a JSON Array or Object.",t),void this.plugin.list.destroy();var n=this.process(t);this.plugin.list.replaceOptions(n)},t.AjaxBootstrapSelectRequest=t.AjaxBootstrapSelectRequest||n,e.fn.ajaxSelectPicker=function(i){return this.each((function(){e(this).data("AjaxBootstrapSelect")||e(this).data("AjaxBootstrapSelect",new t.AjaxBootstrapSelect(this,i))}))},e.fn.ajaxSelectPicker.locale={},e.fn.ajaxSelectPicker.defaults={ajax:{url:null,type:"POST",dataType:"json",data:{q:"{{{q}}}"}},minLength:0,bindEvent:"keyup",cache:!0,clearOnEmpty:!0,clearOnError:!0,emptyRequest:!1,ignoredKeys:{9:"tab",16:"shift",17:"ctrl",18:"alt",27:"esc",37:"left",39:"right",38:"up",40:"down",91:"meta"},langCode:null,locale:null,log:"error",preprocessData:function(){},preserveSelected:!0,preserveSelectedPosition:"after",processData:function(){},requestDelay:300,restoreOnError:!1,templates:{status:'<div class="status"></div>'}},e.fn.ajaxSelectPicker.locale["en-US"]={currentlySelected:"Currently Selected",emptyTitle:"Select and begin typing",errorText:"Unable to retrieve results",searchPlaceholder:"Search...",statusInitialized:"Start typing a search query",statusNoResults:"No Results",statusSearching:"Searching...",statusTooShort:"Please enter more characters"},e.fn.ajaxSelectPicker.locale.en=e.fn.ajaxSelectPicker.locale["en-US"]}(jQuery,window)},4536:function(e,t,i){var s,n;void 0===this&&void 0!==window&&window,s=[i(4692)],n=function(e){return function(e){!function(e){"use strict";var t=["sanitize","whiteList","sanitizeFn"],i=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],s={"*":["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:[]},n=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,o=/^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 l(t,s){var l=t.nodeName.toLowerCase();if(-1!==e.inArray(l,s))return-1===e.inArray(l,i)||Boolean(t.nodeValue.match(n)||t.nodeValue.match(o));for(var r=e(s).filter((function(e,t){return t instanceof RegExp})),a=0,c=r.length;a<c;a++)if(l.match(r[a]))return!0;return!1}function r(e,t,i){if(i&&"function"==typeof i)return i(e);for(var s=Object.keys(t),n=0,o=e.length;n<o;n++)for(var r=e[n].querySelectorAll("*"),a=0,c=r.length;a<c;a++){var p=r[a],h=p.nodeName.toLowerCase();if(-1!==s.indexOf(h))for(var d=[].slice.call(p.attributes),u=[].concat(t["*"]||[],t[h]||[]),f=0,g=d.length;f<g;f++){var m=d[f];l(m,u)||p.removeAttribute(m.nodeName)}else p.parentNode.removeChild(p)}}"classList"in document.createElement("_")||function(t){if("Element"in t){var i="classList",s="prototype",n=t.Element[s],o=Object,l=function(){var t=e(this);return{add:function(e){return e=Array.prototype.slice.call(arguments).join(" "),t.addClass(e)},remove:function(e){return e=Array.prototype.slice.call(arguments).join(" "),t.removeClass(e)},toggle:function(e,i){return t.toggleClass(e,i)},contains:function(e){return t.hasClass(e)}}};if(o.defineProperty){var r={get:l,enumerable:!0,configurable:!0};try{o.defineProperty(n,i,r)}catch(e){void 0!==e.number&&-2146823252!==e.number||(r.enumerable=!1,o.defineProperty(n,i,r))}}else o[s].__defineGetter__&&n.__defineGetter__(i,l)}}(window);var a,c,p,h=document.createElement("_");if(h.classList.add("c1","c2"),!h.classList.contains("c2")){var d=DOMTokenList.prototype.add,u=DOMTokenList.prototype.remove;DOMTokenList.prototype.add=function(){Array.prototype.forEach.call(arguments,d.bind(this))},DOMTokenList.prototype.remove=function(){Array.prototype.forEach.call(arguments,u.bind(this))}}if(h.classList.toggle("c3",!1),h.classList.contains("c3")){var f=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:f.call(this,e)}}function g(e,t){return e.length===t.length&&e.every((function(e,i){return e===t[i]}))}function m(e,t){var i,s=e.selectedOptions,n=[];if(t){for(var o=0,l=s.length;o<l;o++)(i=s[o]).disabled||"OPTGROUP"===i.parentNode.tagName&&i.parentNode.disabled||n.push(i);return n}return s}function v(e,t){for(var i,s=[],n=t||e.selectedOptions,o=0,l=n.length;o<l;o++)(i=n[o]).disabled||"OPTGROUP"===i.parentNode.tagName&&i.parentNode.disabled||s.push(i.value);return e.multiple?s:s.length?s[0]:null}h=null,String.prototype.startsWith||(a=function(){try{var e={},t=Object.defineProperty,i=t(e,e,e)&&t}catch(e){}return i}(),c={}.toString,p=function(e){if(null==this)throw new TypeError;var t=String(this);if(e&&"[object RegExp]"==c.call(e))throw new TypeError;var i=t.length,s=String(e),n=s.length,o=arguments.length>1?arguments[1]:void 0,l=o?Number(o):0;l!=l&&(l=0);var r=Math.min(Math.max(l,0),i);if(n+r>i)return!1;for(var a=-1;++a<n;)if(t.charCodeAt(r+a)!=s.charCodeAt(a))return!1;return!0},a?a(String.prototype,"startsWith",{value:p,configurable:!0,writable:!0}):String.prototype.startsWith=p),Object.keys||(Object.keys=function(e,t,i){for(t in i=[],e)i.hasOwnProperty.call(e,t)&&i.push(t);return i}),HTMLSelectElement&&!HTMLSelectElement.prototype.hasOwnProperty("selectedOptions")&&Object.defineProperty(HTMLSelectElement.prototype,"selectedOptions",{get:function(){return this.querySelectorAll(":checked")}});var b={useDefault:!1,_set:e.valHooks.select.set};e.valHooks.select.set=function(t,i){return i&&!b.useDefault&&e(t).data("selected",!0),b._set.apply(this,arguments)};var w=null,k=function(){try{return new Event("change"),!0}catch(e){return!1}}();function x(e,t,i,s){for(var n=["display","subtext","tokens"],o=!1,l=0;l<n.length;l++){var r=n[l],a=e[r];if(a&&(a=a.toString(),"display"===r&&(a=a.replace(/<[^>]+>/g,"")),s&&(a=E(a)),a=a.toUpperCase(),o="contains"===i?a.indexOf(t)>=0:a.startsWith(t)))break}return o}function y(e){return parseInt(e,10)||0}e.fn.triggerNative=function(e){var t,i=this[0];i.dispatchEvent?(k?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 I={"À":"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"},O=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,S=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]","g");function $(e){return I[e]}function E(e){return(e=e.toString())&&e.replace(O,$).replace(S,"")}var C,L,A,T,N,D=(C={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},L=function(e){return C[e]},A="(?:"+Object.keys(C).join("|")+")",T=RegExp(A),N=RegExp(A,"g"),function(e){return e=null==e?"":""+e,T.test(e)?e.replace(N,L):e}),z={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"},R={ESCAPE:27,ENTER:13,SPACE:32,TAB:9,ARROW_UP:38,ARROW_DOWN:40},H={success:!1,major:"3"};try{H.full=(e.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split("."),H.major=H.full[0],H.success=!0}catch(e){}var P=0,B=".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"},U={MENU:"."+G.MENU},W={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(" "),fragment:document.createDocumentFragment()};W.noResults=W.li.cloneNode(!1),W.noResults.className="no-results",W.a.setAttribute("role","option"),W.a.className="dropdown-item",W.subtext.className="text-muted",W.text=W.span.cloneNode(!1),W.text.className="text",W.checkMark=W.span.cloneNode(!1);var j=new RegExp(R.ARROW_UP+"|"+R.ARROW_DOWN),_=new RegExp("^"+R.TAB+"$|"+R.ESCAPE),M={li:function(e,t,i){var s=W.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=W.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=W.text.cloneNode(!1);if(e.content)n.innerHTML=e.content;else{if(n.textContent=e.text,e.icon){var o=W.whitespace.cloneNode(!1);(s=(!0===t?W.i:W.span).cloneNode(!1)).className=this.options.iconBase+" "+e.icon,W.fragment.appendChild(s),W.fragment.appendChild(o)}e.subtext&&((i=W.subtext.cloneNode(!1)).textContent=e.subtext,n.appendChild(i))}if(!0===t)for(;n.childNodes.length>0;)W.fragment.appendChild(n.childNodes[0]);else W.fragment.appendChild(n);return W.fragment},label:function(e){var t,i,s=W.text.cloneNode(!1);if(s.innerHTML=e.display,e.icon){var n=W.whitespace.cloneNode(!1);(i=W.span.cloneNode(!1)).className=this.options.iconBase+" "+e.icon,W.fragment.appendChild(i),W.fragment.appendChild(n)}return e.subtext&&((t=W.subtext.cloneNode(!1)).textContent=e.subtext,s.appendChild(t)),W.fragment.appendChild(s),W.fragment}};function q(e,t){e.length||(W.noResults.innerHTML=this.options.noneResultsText.replace("{0}",'"'+D(t)+'"'),this.$menuInner[0].firstChild.appendChild(W.noResults))}var F=function(t,i){var s=this;b.useDefault||(e.valHooks.select.set=b._set,b.useDefault=!0),this.$element=e(t),this.$newElement=null,this.$button=null,this.$menu=null,this.options=i,this.selectpicker={main:{},search:{},current:{},view:{},isSearching:!1,keydown:{keyHistory:"",resetKeyHistory:{start:function(){return setTimeout((function(){s.selectpicker.keydown.keyHistory=""}),800)}}}},this.sizeInfo={},null===this.options.title&&(this.options.title=this.$element.attr("title"));var n=this.options.windowPadding;"number"==typeof n&&(this.options.windowPadding=[n,n,n,n]),this.val=F.prototype.val,this.render=F.prototype.render,this.refresh=F.prototype.refresh,this.setStyle=F.prototype.setStyle,this.selectAll=F.prototype.selectAll,this.deselectAll=F.prototype.deselectAll,this.destroy=F.prototype.destroy,this.remove=F.prototype.remove,this.show=F.prototype.show,this.hide=F.prototype.hide,this.init()};function V(i){var s,n=arguments,o=i;if([].shift.apply(n),!H.success){try{H.full=(e.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split(".")}catch(e){F.BootstrapVersion?H.full=F.BootstrapVersion.split(" ")[0].split("."):(H.full=[H.major,"0","0"],console.warn("There was an issue retrieving Bootstrap's version. Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.",e))}H.major=H.full[0],H.success=!0}if("4"===H.major){var l=[];F.DEFAULTS.style===G.BUTTONCLASS&&l.push({name:"style",className:"BUTTONCLASS"}),F.DEFAULTS.iconBase===G.ICONBASE&&l.push({name:"iconBase",className:"ICONBASE"}),F.DEFAULTS.tickIcon===G.TICKICON&&l.push({name:"tickIcon",className:"TICKICON"}),G.DIVIDER="dropdown-divider",G.SHOW="show",G.BUTTONCLASS="btn-light",G.POPOVERHEADER="popover-header",G.ICONBASE="",G.TICKICON="bs-ok-default";for(var r=0;r<l.length;r++)i=l[r],F.DEFAULTS[i.name]=G[i.className]}var a=this.each((function(){var i=e(this);if(i.is("select")){var l=i.data("selectpicker"),r="object"==typeof o&&o;if(l){if(r)for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(l.options[a]=r[a])}else{var c=i.data();for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&-1!==e.inArray(p,t)&&delete c[p];var h=e.extend({},F.DEFAULTS,e.fn.selectpicker.defaults||{},c,r);h.template=e.extend({},F.DEFAULTS.template,e.fn.selectpicker.defaults?e.fn.selectpicker.defaults.template:{},c.template,r.template),i.data("selectpicker",l=new F(this,h))}"string"==typeof o&&(s=l[o]instanceof Function?l[o].apply(l,n):l.options[o])}}));return void 0!==s?s:a}F.VERSION="1.13.18",F.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:G.BUTTONCLASS,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:G.ICONBASE,tickIcon:G.TICKICON,showTick:!1,template:{caret:'<span class="caret"></span>'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1,sanitize:!0,sanitizeFn:null,whiteList:s},F.prototype={constructor:F,init:function(){var e=this,t=this.$element.attr("id"),i=this.$element[0],s=i.form;P++,this.selectId="bs-select-"+P,i.classList.add("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),i.classList.contains("show-tick")&&(this.options.showTick=!0),this.$newElement=this.createDropdown(),this.buildData(),this.$element.after(this.$newElement).prependTo(this.$newElement),s&&null===i.form&&(s.id||(s.id="form-"+this.selectId),i.setAttribute("form",s.id)),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(U.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),i.classList.remove("bs-select-hidden"),!0===this.options.dropdownAlignRight&&this.$menu[0].classList.add(G.MENURIGHT),void 0!==t&&this.$button.attr("data-id",t),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"+B,(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.$element.trigger("hide"+B,t)},"hidden.bs.dropdown":function(t){e.$element.trigger("hidden"+B,t)},"show.bs.dropdown":function(t){e.$element.trigger("show"+B,t)},"shown.bs.dropdown":function(t){e.$element.trigger("shown"+B,t)}}),i.hasAttribute("required")&&this.$element.on("invalid"+B,(function(){e.$button[0].classList.add("bs-invalid"),e.$element.on("shown"+B+".invalid",(function(){e.$element.val(e.$element.val()).off("shown"+B+".invalid")})).on("rendered"+B,(function(){this.validity.valid&&e.$button[0].classList.remove("bs-invalid"),e.$element.off("rendered"+B)})),e.$button.on("blur"+B,(function(){e.$element.trigger("focus").trigger("blur"),e.$button.off("blur"+B)}))})),setTimeout((function(){e.buildList(),e.$element.trigger("loaded"+B)}))},createDropdown:function(){var t=this.multiple||this.options.showTick?" show-tick":"",i=this.multiple?' aria-multiselectable="true"':"",s="",n=this.autofocus?" autofocus":"";H.major<4&&this.$element.parent().hasClass("input-group")&&(s=" input-group-btn");var o,l="",r="",a="",c="";return this.options.header&&(l='<div class="'+G.POPOVERHEADER+'"><button type="button" class="close" aria-hidden="true">&times;</button>'+this.options.header+"</div>"),this.options.liveSearch&&(r='<div class="bs-searchbox"><input type="search" class="form-control" autocomplete="off"'+(null===this.options.liveSearchPlaceholder?"":' placeholder="'+D(this.options.liveSearchPlaceholder)+'"')+' role="combobox" aria-label="Search" aria-controls="'+this.selectId+'" aria-autocomplete="list"></div>'),this.multiple&&this.options.actionsBox&&(a='<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button type="button" class="actions-btn bs-select-all btn '+G.BUTTONCLASS+'">'+this.options.selectAllText+'</button><button type="button" class="actions-btn bs-deselect-all btn '+G.BUTTONCLASS+'">'+this.options.deselectAllText+"</button></div></div>"),this.multiple&&this.options.doneButton&&(c='<div class="bs-donebutton"><div class="btn-group btn-block"><button type="button" class="btn btn-sm '+G.BUTTONCLASS+'">'+this.options.doneButtonText+"</button></div></div>"),o='<div class="dropdown bootstrap-select'+t+s+'"><button type="button" tabindex="-1" class="'+this.options.styleBase+' dropdown-toggle" '+("static"===this.options.display?'data-display="static"':"")+'data-toggle="dropdown"'+n+' role="combobox" aria-owns="'+this.selectId+'" aria-haspopup="listbox" aria-expanded="false"><div class="filter-option"><div class="filter-option-inner"><div class="filter-option-inner-inner"></div></div> </div>'+("4"===H.major?"":'<span class="bs-caret">'+this.options.template.caret+"</span>")+'</button><div class="'+G.MENU+" "+("4"===H.major?"":G.SHOW)+'">'+l+r+a+'<div class="inner '+G.SHOW+'" role="listbox" id="'+this.selectId+'" tabindex="-1" '+i+'><ul class="'+G.MENU+" inner "+("4"===H.major?G.SHOW:"")+'" role="presentation"></ul></div>'+c+"</div></div>",e(o)},setPositionData:function(){this.selectpicker.view.canHighlight=[],this.selectpicker.view.size=0,this.selectpicker.view.firstHighlightIndex=!1;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),i&&(this.selectpicker.view.size++,t.posinset=this.selectpicker.view.size,!1===this.selectpicker.view.firstHighlightIndex&&(this.selectpicker.view.firstHighlightIndex=e)),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,s){var n,o,l=this,a=0,c=[];if(this.selectpicker.isSearching=t,this.selectpicker.current=t?this.selectpicker.search:this.selectpicker.main,this.setPositionData(),i)if(s)a=this.$menuInner[0].scrollTop;else if(!l.multiple){var p=l.$element[0],h=(p.options[p.selectedIndex]||{}).liIndex;if("number"==typeof h&&!1!==l.options.size){var d=l.selectpicker.main.data[h],u=d&&d.position;u&&(a=u-(l.sizeInfo.menuInnerHeight+l.sizeInfo.liHeight)/2)}}function f(e,i){var s,a,p,h,d,u,f,m,v=l.selectpicker.current.elements.length,b=[],w=!0,k=l.isVirtual();l.selectpicker.view.scrollTop=e,s=Math.ceil(l.sizeInfo.menuInnerHeight/l.sizeInfo.liHeight*1.5),a=Math.round(v/s)||1;for(var x=0;x<a;x++){var y=(x+1)*s;if(x===a-1&&(y=v),b[x]=[x*s+(x?1:0),y],!v)break;void 0===d&&e-1<=l.selectpicker.current.data[y-1].position-l.sizeInfo.menuInnerHeight&&(d=x)}if(void 0===d&&(d=0),u=[l.selectpicker.view.position0,l.selectpicker.view.position1],p=Math.max(0,d-1),h=Math.min(a-1,d+1),l.selectpicker.view.position0=!1===k?0:Math.max(0,b[p][0])||0,l.selectpicker.view.position1=!1===k?v:Math.min(v,b[h][1])||0,f=u[0]!==l.selectpicker.view.position0||u[1]!==l.selectpicker.view.position1,void 0!==l.activeIndex&&(o=l.selectpicker.main.elements[l.prevActiveIndex],c=l.selectpicker.main.elements[l.activeIndex],n=l.selectpicker.main.elements[l.selectedIndex],i&&(l.activeIndex!==l.selectedIndex&&l.defocusItem(c),l.activeIndex=void 0),l.activeIndex&&l.activeIndex!==l.selectedIndex&&l.defocusItem(n)),void 0!==l.prevActiveIndex&&l.prevActiveIndex!==l.activeIndex&&l.prevActiveIndex!==l.selectedIndex&&l.defocusItem(o),(i||f)&&(m=l.selectpicker.view.visibleElements?l.selectpicker.view.visibleElements.slice():[],l.selectpicker.view.visibleElements=!1===k?l.selectpicker.current.elements:l.selectpicker.current.elements.slice(l.selectpicker.view.position0,l.selectpicker.view.position1),l.setOptionStatus(),(t||!1===k&&i)&&(w=!g(m,l.selectpicker.view.visibleElements)),(i||!0===k)&&w)){var I,O,S=l.$menuInner[0],$=document.createDocumentFragment(),E=S.firstChild.cloneNode(!1),C=l.selectpicker.view.visibleElements,L=[];S.replaceChild(E,S.firstChild),x=0;for(var A=C.length;x<A;x++){var T,N,D=C[x];l.options.sanitize&&(T=D.lastChild)&&(N=l.selectpicker.current.data[x+l.selectpicker.view.position0])&&N.content&&!N.sanitized&&(L.push(T),N.sanitized=!0),$.appendChild(D)}if(l.options.sanitize&&L.length&&r(L,l.options.whiteList,l.options.sanitizeFn),!0===k?(I=0===l.selectpicker.view.position0?0:l.selectpicker.current.data[l.selectpicker.view.position0-1].position,O=l.selectpicker.view.position1>v-1?0:l.selectpicker.current.data[v-1].position-l.selectpicker.current.data[l.selectpicker.view.position1-1].position,S.firstChild.style.marginTop=I+"px",S.firstChild.style.marginBottom=O+"px"):(S.firstChild.style.marginTop=0,S.firstChild.style.marginBottom=0),S.firstChild.appendChild($),!0===k&&l.sizeInfo.hasScrollBar){var z=S.firstChild.offsetWidth;if(i&&z<l.sizeInfo.menuInnerInnerWidth&&l.sizeInfo.totalMenuWidth>l.sizeInfo.selectWidth)S.firstChild.style.minWidth=l.sizeInfo.menuInnerInnerWidth+"px";else if(z>l.sizeInfo.menuInnerInnerWidth){l.$menu[0].style.minWidth=0;var R=S.firstChild.offsetWidth;R>l.sizeInfo.menuInnerInnerWidth&&(l.sizeInfo.menuInnerInnerWidth=R,S.firstChild.style.minWidth=l.sizeInfo.menuInnerInnerWidth+"px"),l.$menu[0].style.minWidth=""}}}if(l.prevActiveIndex=l.activeIndex,l.options.liveSearch){if(t&&i){var H,P=0;l.selectpicker.view.canHighlight[P]||(P=1+l.selectpicker.view.canHighlight.slice(1).indexOf(!0)),H=l.selectpicker.view.visibleElements[P],l.defocusItem(l.selectpicker.view.currentActive),l.activeIndex=(l.selectpicker.current.data[P]||{}).index,l.focusItem(H)}}else l.$menuInner.trigger("focus")}f(a,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",(function(e,t){l.noScroll||f(this.scrollTop,t),l.noScroll=!1})),e(window).off("resize"+B+"."+this.selectId+".createView").on("resize"+B+"."+this.selectId+".createView",(function(){l.$newElement.hasClass(G.SHOW)&&f(l.$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.title&&!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=window.performance&&window.performance.getEntriesByType("navigation"),a=r&&r.length?"back_forward"!==r[0].type:2!==window.performance.navigation.type;n&&(this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",s=!l||0===o&&!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&&a?i.selectedIndex=0:"complete"!==document.readyState&&window.addEventListener("pageshow",(function(){e.selectpicker.view.displayedValue!==i.value&&e.render()}))}return t},buildData:function(){var e=':not([hidden]):not([data-hidden="true"])',t=[],i=0,s=this.setPlaceholder()?1:0;this.options.hideDisabled&&(e+=":not(:disabled)");var n=this.$element[0].querySelectorAll("select > *"+e);function o(e){var i=t[t.length-1];i&&"divider"===i.type&&(i.optID||e.optID)||((e=e||{}).type="divider",t.push(e))}function l(e,i){if((i=i||{}).divider="true"===e.getAttribute("data-divider"),i.divider)o({optID:i.optID});else{var s=t.length,n=e.style.cssText,l=n?D(n):"",r=(e.className||"")+(i.optgroupClass||"");i.optID&&(r="opt "+r),i.optionClass=r.trim(),i.inlineStyle=l,i.text=e.textContent,i.content=e.getAttribute("data-content"),i.tokens=e.getAttribute("data-tokens"),i.subtext=e.getAttribute("data-subtext"),i.icon=e.getAttribute("data-icon"),e.liIndex=s,i.display=i.content||i.text,i.type="option",i.index=s,i.option=e,i.selected=!!e.selected,i.disabled=i.disabled||!!e.disabled,t.push(i)}}function r(n,r){var a=r[n],c=!(n-1<s)&&r[n-1],p=r[n+1],h=a.querySelectorAll("option"+e);if(h.length){var d,u,f={display:D(a.label),subtext:a.getAttribute("data-subtext"),icon:a.getAttribute("data-icon"),type:"optgroup-label",optgroupClass:" "+(a.className||"")};i++,c&&o({optID:i}),f.optID=i,t.push(f);for(var g=0,m=h.length;g<m;g++){var v=h[g];0===g&&(u=(d=t.length-1)+m),l(v,{headerIndex:d,lastIndex:u,optID:f.optID,optgroupClass:f.optgroupClass,disabled:a.disabled})}p&&o({optID:i})}}for(var a=n.length,c=s;c<a;c++){var p=n[c];"OPTGROUP"!==p.tagName?l(p,{}):r(c,n)}this.selectpicker.main.data=this.selectpicker.current.data=t},buildList:function(){var e=this,t=this.selectpicker.main.data,i=[],s=0;function n(t){var n,o=0;switch(t.type){case"divider":n=M.li(!1,G.DIVIDER,t.optID?t.optID+"div":void 0);break;case"option":(n=M.li(M.a(M.text.call(e,t),t.optionClass,t.inlineStyle),"",t.optID)).firstChild&&(n.firstChild.id=e.selectId+"-"+t.index);break;case"optgroup-label":n=M.li(M.label.call(e,t),"dropdown-header"+t.optgroupClass,t.optID)}t.element=n,i.push(n),t.display&&(o+=t.display.length),t.subtext&&(o+=t.subtext.length),t.icon&&(o+=1),o>s&&(s=o,e.selectpicker.view.widestOption=i[i.length-1])}!e.options.showTick&&!e.multiple||W.checkMark.parentNode||(W.checkMark.className=this.options.iconBase+" "+e.options.tickIcon+" check-mark",W.a.appendChild(W.checkMark));for(var o=t.length,l=0;l<o;l++)n(t[l]);this.selectpicker.main.elements=this.selectpicker.current.elements=i},findLis:function(){return this.$menuInner.find(".inner > li")},render:function(){var e,t,i=this,s=this.$element[0],n=this.setPlaceholder()&&0===s.selectedIndex,o=m(s,this.options.hideDisabled),l=o.length,a=this.$button[0],c=a.querySelector(".filter-option-inner-inner"),p=document.createTextNode(this.options.multipleSeparator),h=W.fragment.cloneNode(!1),d=!1;if(a.classList.toggle("bs-placeholder",i.multiple?!l:!v(s,o)),i.multiple||1!==o.length||(i.selectpicker.view.displayedValue=v(s,o)),"static"===this.options.selectedTextFormat)h=M.text.call(this,{text:this.options.title},!0);else if((e=this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count")&&l>1)&&(e=(t=this.options.selectedTextFormat.split(">")).length>1&&l>t[1]||1===t.length&&l>=2),!1===e){if(!n){for(var u=0;u<l&&u<50;u++){var f=o[u],g=this.selectpicker.main.data[f.liIndex],b={};this.multiple&&u>0&&h.appendChild(p.cloneNode(!1)),f.title?b.text=f.title:g&&(g.content&&i.options.showContent?(b.content=g.content.toString(),d=!0):(i.options.showIcon&&(b.icon=g.icon),i.options.showSubtext&&!i.multiple&&g.subtext&&(b.subtext=" "+g.subtext),b.text=f.textContent.trim())),h.appendChild(M.text.call(this,b,!0))}l>49&&h.appendChild(document.createTextNode("..."))}}else{var w=':not([hidden]):not([data-hidden="true"]):not([data-divider="true"])';this.options.hideDisabled&&(w+=":not(:disabled)");var k=this.$element[0].querySelectorAll("select > option"+w+", optgroup"+w+" option"+w).length,x="function"==typeof this.options.countSelectedText?this.options.countSelectedText(l,k):this.options.countSelectedText;h=M.text.call(this,{text:x.replace("{0}",l.toString()).replace("{1}",k.toString())},!0)}if(null==this.options.title&&(this.options.title=this.$element.attr("title")),h.childNodes.length||(h=M.text.call(this,{text:void 0!==this.options.title?this.options.title:this.options.noneSelectedText},!0)),a.title=h.textContent.replace(/<[^>]*>?/g,"").trim(),this.options.sanitize&&d&&r([h],i.options.whiteList,i.options.sanitizeFn),c.innerHTML="",c.appendChild(h),H.major<4&&this.$newElement[0].classList.contains("bs3-has-addon")){var y=a.querySelector(".filter-expand"),I=c.cloneNode(!0);I.className="filter-expand",y?a.replaceChild(I,y):a.appendChild(I)}this.$element.trigger("rendered"+B)},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,"")),H.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(t){if(t||!1!==this.options.size&&!Object.keys(this.sizeInfo).length){var i,s=W.div.cloneNode(!1),n=W.div.cloneNode(!1),o=W.div.cloneNode(!1),l=document.createElement("ul"),r=W.li.cloneNode(!1),a=W.li.cloneNode(!1),c=W.a.cloneNode(!1),p=W.span.cloneNode(!1),h=this.options.header&&this.$menu.find("."+G.POPOVERHEADER).length>0?this.$menu.find("."+G.POPOVERHEADER)[0].cloneNode(!0):null,d=this.options.liveSearch?W.div.cloneNode(!1):null,u=this.options.actionsBox&&this.multiple&&this.$menu.find(".bs-actionsbox").length>0?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,f=this.options.doneButton&&this.multiple&&this.$menu.find(".bs-donebutton").length>0?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null,g=this.$element.find("option")[0];if(this.sizeInfo.selectWidth=this.$newElement[0].offsetWidth,p.className="text",c.className="dropdown-item "+(g?g.className:""),s.className=this.$menu[0].parentNode.className+" "+G.SHOW,s.style.width=0,"auto"===this.options.width&&(n.style.minWidth=0),n.className=G.MENU+" "+G.SHOW,o.className="inner "+G.SHOW,l.className=G.MENU+" inner "+("4"===H.major?G.SHOW:""),r.className=G.DIVIDER,a.className="dropdown-header",p.appendChild(document.createTextNode("​")),this.selectpicker.current.data.length)for(var m=0;m<this.selectpicker.current.data.length;m++){var v=this.selectpicker.current.data[m];if("option"===v.type){i=v.element;break}}else i=W.li.cloneNode(!1),c.appendChild(p),i.appendChild(c);if(a.appendChild(p.cloneNode(!0)),this.selectpicker.view.widestOption&&l.appendChild(this.selectpicker.view.widestOption.cloneNode(!0)),l.appendChild(i),l.appendChild(r),l.appendChild(a),h&&n.appendChild(h),d){var b=document.createElement("input");d.className="bs-searchbox",b.className="form-control",d.appendChild(b),n.appendChild(d)}u&&n.appendChild(u),o.appendChild(l),n.appendChild(o),f&&n.appendChild(f),s.appendChild(n),document.body.appendChild(s);var w,k=i.offsetHeight,x=a?a.offsetHeight:0,I=h?h.offsetHeight:0,O=d?d.offsetHeight:0,S=u?u.offsetHeight:0,$=f?f.offsetHeight:0,E=e(r).outerHeight(!0),C=!!window.getComputedStyle&&window.getComputedStyle(n),L=n.offsetWidth,A=C?null:e(n),T={vert:y(C?C.paddingTop:A.css("paddingTop"))+y(C?C.paddingBottom:A.css("paddingBottom"))+y(C?C.borderTopWidth:A.css("borderTopWidth"))+y(C?C.borderBottomWidth:A.css("borderBottomWidth")),horiz:y(C?C.paddingLeft:A.css("paddingLeft"))+y(C?C.paddingRight:A.css("paddingRight"))+y(C?C.borderLeftWidth:A.css("borderLeftWidth"))+y(C?C.borderRightWidth:A.css("borderRightWidth"))},N={vert:T.vert+y(C?C.marginTop:A.css("marginTop"))+y(C?C.marginBottom:A.css("marginBottom"))+2,horiz:T.horiz+y(C?C.marginLeft:A.css("marginLeft"))+y(C?C.marginRight:A.css("marginRight"))+2};o.style.overflowY="scroll",w=n.offsetWidth-L,document.body.removeChild(s),this.sizeInfo.liHeight=k,this.sizeInfo.dropdownHeaderHeight=x,this.sizeInfo.headerHeight=I,this.sizeInfo.searchHeight=O,this.sizeInfo.actionsHeight=S,this.sizeInfo.doneButtonHeight=$,this.sizeInfo.dividerHeight=E,this.sizeInfo.menuPadding=T,this.sizeInfo.menuExtras=N,this.sizeInfo.menuWidth=L,this.sizeInfo.menuInnerInnerWidth=L-T.horiz,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth,this.sizeInfo.scrollBarWidth=w,this.sizeInfo.selectHeight=this.$newElement[0].offsetHeight,this.setPositionData()}},getSelectPosition:function(){var t,i=this,s=e(window),n=i.$newElement.offset(),o=e(i.options.container);i.options.container&&o.length&&!o.is("body")?((t=o.offset()).top+=parseInt(o.css("borderTopWidth")),t.left+=parseInt(o.css("borderLeftWidth"))):t={top:0,left:0};var l=i.options.windowPadding;this.sizeInfo.selectOffsetTop=n.top-t.top-s.scrollTop(),this.sizeInfo.selectOffsetBot=s.height()-this.sizeInfo.selectOffsetTop-this.sizeInfo.selectHeight-t.top-l[2],this.sizeInfo.selectOffsetLeft=n.left-t.left-s.scrollLeft(),this.sizeInfo.selectOffsetRight=s.width()-this.sizeInfo.selectOffsetLeft-this.sizeInfo.selectWidth-t.left-l[1],this.sizeInfo.selectOffsetTop-=l[0],this.sizeInfo.selectOffsetLeft-=l[3]},setMenuSize:function(e){this.getSelectPosition();var t,i,s,n,o,l,r,a,c=this.sizeInfo.selectWidth,p=this.sizeInfo.liHeight,h=this.sizeInfo.headerHeight,d=this.sizeInfo.searchHeight,u=this.sizeInfo.actionsHeight,f=this.sizeInfo.doneButtonHeight,g=this.sizeInfo.dividerHeight,m=this.sizeInfo.menuPadding,v=0;if(this.options.dropupAuto&&(r=p*this.selectpicker.current.elements.length+m.vert,a=this.sizeInfo.selectOffsetTop-this.sizeInfo.selectOffsetBot>this.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=this.selectpicker.current.elements.length>3?3*this.sizeInfo.liHeight+this.sizeInfo.menuExtras.vert-2:0,i=this.sizeInfo.selectOffsetBot-this.sizeInfo.menuExtras.vert,s=n+h+d+u+f,l=Math.max(n-m.vert,0),this.$newElement.hasClass(G.DROPUP)&&(i=this.sizeInfo.selectOffsetTop-this.sizeInfo.menuExtras.vert),o=i,t=i-h-d-u-f-m.vert;else if(this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size){for(var b=0;b<this.options.size;b++)"divider"===this.selectpicker.current.data[b].type&&v++;t=(i=p*this.options.size+v*g+m.vert)-m.vert,o=i+h+d+u+f,s=l=""}this.$menu.css({"max-height":o+"px",overflow:"hidden","min-height":s+"px"}),this.$menuInner.css({"max-height":t+"px","overflow-y":"auto","min-height":l+"px"}),this.sizeInfo.menuInnerHeight=Math.max(t,1),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),"auto"===this.options.dropdownAlignRight&&this.$menu.toggleClass(G.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRight<this.sizeInfo.totalMenuWidth-c),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=this,s=e(window);this.setMenuSize(),this.options.liveSearch&&this.$searchbox.off("input.setMenuSize propertychange.setMenuSize").on("input.setMenuSize propertychange.setMenuSize",(function(){return i.setMenuSize()})),"auto"===this.options.size?s.off("resize"+B+"."+this.selectId+".setMenuSize scroll"+B+"."+this.selectId+".setMenuSize").on("resize"+B+"."+this.selectId+".setMenuSize scroll"+B+"."+this.selectId+".setMenuSize",(function(){return i.setMenuSize()})):this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size&&s.off("resize"+B+"."+this.selectId+".setMenuSize scroll"+B+"."+this.selectId+".setMenuSize")}this.createView(!1,!0,t)},setWidth:function(){var e=this;"auto"===this.options.width?requestAnimationFrame((function(){e.$menu.css("min-width","0"),e.$element.on("loaded"+B,(function(){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[0].classList.remove("fit-width")},selectPosition:function(){this.$bsContainer=e('<div class="bs-container" />');var t,i,s,n=this,o=e(this.options.container),l=function(l){var r={},a=n.options.display||!!e.fn.dropdown.Constructor.Default&&e.fn.dropdown.Constructor.Default.display;n.$bsContainer.addClass(l.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(G.DROPUP,l.hasClass(G.DROPUP)),t=l.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()),s=l.hasClass(G.DROPUP)?0:l[0].offsetHeight,(H.major<4||"static"===a)&&(r.top=t.top-i.top+s,r.left=t.left-i.left),r.width=l[0].offsetWidth,n.$bsContainer.css(r)};this.$button.on("click.bs.dropdown.data-api",(function(){n.isDisabled()||(l(n.$newElement),n.$bsContainer.appendTo(n.options.container).toggleClass(G.SHOW,!n.$button.hasClass(G.SHOW)).append(n.$menu))})),e(window).off("resize"+B+"."+this.selectId+" scroll"+B+"."+this.selectId).on("resize"+B+"."+this.selectId+" scroll"+B+"."+this.selectId,(function(){n.$newElement.hasClass(G.SHOW)&&l(n.$newElement)})),this.$element.on("hide"+B,(function(){n.$menu.data("height",n.$menu.height()),n.$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<t.selectpicker.view.visibleElements.length;i++){var s=t.selectpicker.current.data[i+t.selectpicker.view.position0],n=s.option;n&&(!0!==e&&t.setDisabled(s.index,s.disabled),t.setSelected(s.index,n.selected))}},setSelected:function(e,t){var i,s,n=this.selectpicker.main.elements[e],o=this.selectpicker.main.data[e],l=void 0!==this.activeIndex,r=this.activeIndex===e||t&&!this.multiple&&!l;o.selected=t,s=n.firstChild,t&&(this.selectedIndex=e),n.classList.toggle("selected",t),r?(this.focusItem(n,o),this.selectpicker.view.currentActive=n,this.activeIndex=e):this.defocusItem(n),s&&(s.classList.toggle("selected",t),t?s.setAttribute("aria-selected",!0):this.multiple?s.setAttribute("aria-selected",!1):s.removeAttribute("aria-selected")),r||l||!t||void 0===this.prevActiveIndex||(i=this.selectpicker.main.elements[this.prevActiveIndex],this.defocusItem(i))},setDisabled:function(e,t){var i,s=this.selectpicker.main.elements[e];this.selectpicker.main.data[e].disabled=t,i=s.firstChild,s.classList.toggle(G.DISABLED,t),i&&("4"===H.major&&i.classList.toggle(G.DISABLED,t),t?(i.setAttribute("aria-disabled",t),i.setAttribute("tabindex",-1)):(i.removeAttribute("aria-disabled"),i.setAttribute("tabindex",0)))},isDisabled:function(){return this.$element[0].disabled},checkDisabled:function(){this.isDisabled()?(this.$newElement[0].classList.add(G.DISABLED),this.$button.addClass(G.DISABLED).attr("aria-disabled",!0)):this.$button[0].classList.contains(G.DISABLED)&&(this.$newElement[0].classList.remove(G.DISABLED),this.$button.removeClass(G.DISABLED).attr("aria-disabled",!1))},clickListener:function(){var t=this,i=e(document);function s(){t.options.liveSearch?t.$searchbox.trigger("focus"):t.$menuInner.trigger("focus")}function n(){t.dropdown&&t.dropdown._popper&&t.dropdown._popper.state.isCreated?s():requestAnimationFrame(n)}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(){H.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(G.SHOW)||t.setSize()})),this.$element.on("shown"+B,(function(){t.$menuInner[0].scrollTop!==t.selectpicker.view.scrollTop&&(t.$menuInner[0].scrollTop=t.selectpicker.view.scrollTop),H.major>3?requestAnimationFrame(n):s()})),this.$menuInner.on("mouseenter","li a",(function(e){var i=this.parentElement,s=t.isVirtual()?t.selectpicker.view.position0:0,n=Array.prototype.indexOf.call(i.parentElement.children,i),o=t.selectpicker.current.data[n+s];t.focusItem(i,o,!0)})),this.$menuInner.on("click","li a",(function(i,s){var n=e(this),o=t.$element[0],l=t.isVirtual()?t.selectpicker.view.position0:0,r=t.selectpicker.current.data[n.parent().index()+l],a=r.index,c=v(o),p=o.selectedIndex,h=o.options[p],d=!0;if(t.multiple&&1!==t.options.maxOptions&&i.stopPropagation(),i.preventDefault(),!t.isDisabled()&&!n.parent().hasClass(G.DISABLED)){var u=r.option,f=e(u),g=u.selected,b=f.parent("optgroup"),k=b.find("option"),x=t.options.maxOptions,y=b.data("maxOptions")||!1;if(a===t.activeIndex&&(s=!0),s||(t.prevActiveIndex=t.activeIndex,t.activeIndex=void 0),t.multiple){if(u.selected=!g,t.setSelected(a,!g),t.focusedParent.focus(),!1!==x||!1!==y){var I=x<m(o).length,O=y<b.find("option:selected").length;if(x&&I||y&&O)if(x&&1==x)o.selectedIndex=-1,u.selected=!0,t.setOptionStatus(!0);else if(y&&1==y){for(var S=0;S<k.length;S++){var $=k[S];$.selected=!1,t.setSelected($.liIndex,!1)}u.selected=!0,t.setSelected(a,!0)}else{var E="string"==typeof t.options.maxOptionsText?[t.options.maxOptionsText,t.options.maxOptionsText]:t.options.maxOptionsText,C="function"==typeof E?E(x,y):E,L=C[0].replace("{n}",x),A=C[1].replace("{n}",y),T=e('<div class="notify"></div>');C[2]&&(L=L.replace("{var}",C[2][x>1?0:1]),A=A.replace("{var}",C[2][y>1?0:1])),u.selected=!1,t.$menu.append(T),x&&I&&(T.append(e("<div>"+L+"</div>")),d=!1,t.$element.trigger("maxReached"+B)),y&&O&&(T.append(e("<div>"+A+"</div>")),d=!1,t.$element.trigger("maxReachedGrp"+B)),setTimeout((function(){t.setSelected(a,!1)}),10),T[0].classList.add("fadeOut"),setTimeout((function(){T.remove()}),1050)}}}else h&&(h.selected=!1),u.selected=!0,t.setSelected(a,!0);!t.multiple||t.multiple&&1===t.options.maxOptions?t.$button.trigger("focus"):t.options.liveSearch&&t.$searchbox.trigger("focus"),d&&(t.multiple||p!==o.selectedIndex)&&(w=[u.index,f.prop("selected"),c],t.$element.triggerNative("change"))}})),this.$menu.on("click","li."+G.DISABLED+" a, ."+G.POPOVERHEADER+", ."+G.POPOVERHEADER+" :not(.close)",(function(i){i.currentTarget==this&&(i.preventDefault(),i.stopPropagation(),t.options.liveSearch&&!e(i.target).hasClass("close")?t.$searchbox.trigger("focus"):t.$button.trigger("focus"))})),this.$menuInner.on("click",".divider, .dropdown-header",(function(e){e.preventDefault(),e.stopPropagation(),t.options.liveSearch?t.$searchbox.trigger("focus"):t.$button.trigger("focus")})),this.$menu.on("click","."+G.POPOVERHEADER+" .close",(function(){t.$button.trigger("click")})),this.$searchbox.on("click",(function(e){e.stopPropagation()})),this.$menu.on("click",".actions-btn",(function(i){t.options.liveSearch?t.$searchbox.trigger("focus"):t.$button.trigger("focus"),i.preventDefault(),i.stopPropagation(),e(this).hasClass("bs-select-all")?t.selectAll():t.deselectAll()})),this.$button.on("focus"+B,(function(e){var i=t.$element[0].getAttribute("tabindex");void 0!==i&&e.originalEvent&&e.originalEvent.isTrusted&&(this.setAttribute("tabindex",i),t.$element[0].setAttribute("tabindex",-1),t.selectpicker.view.tabindex=i)})).on("blur"+B,(function(e){void 0!==t.selectpicker.view.tabindex&&e.originalEvent&&e.originalEvent.isTrusted&&(t.$element[0].setAttribute("tabindex",t.selectpicker.view.tabindex),this.setAttribute("tabindex",-1),t.selectpicker.view.tabindex=void 0)})),this.$element.on("change"+B,(function(){t.render(),t.$element.trigger("changed"+B,w),w=null})).on("focus"+B,(function(){t.options.mobile||t.$button[0].focus()}))},liveSearchListener:function(){var e=this;this.$button.on("click.bs.dropdown.data-api",(function(){e.$searchbox.val()&&(e.$searchbox.val(""),e.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=e.$searchbox[0].value;if(e.selectpicker.search.elements=[],e.selectpicker.search.data=[],t){var i=[],s=t.toUpperCase(),n={},o=[],l=e._searchStyle(),r=e.options.liveSearchNormalize;r&&(s=E(s));for(var a=0;a<e.selectpicker.main.data.length;a++){var c=e.selectpicker.main.data[a];n[a]||(n[a]=x(c,s,l,r)),n[a]&&void 0!==c.headerIndex&&-1===o.indexOf(c.headerIndex)&&(c.headerIndex>0&&(n[c.headerIndex-1]=!0,o.push(c.headerIndex-1)),n[c.headerIndex]=!0,o.push(c.headerIndex),n[c.lastIndex+1]=!0),n[a]&&"optgroup-label"!==c.type&&o.push(a)}a=0;for(var p=o.length;a<p;a++){var h=o[a],d=o[a-1],u=(c=e.selectpicker.main.data[h],e.selectpicker.main.data[d]);("divider"!==c.type||"divider"===c.type&&u&&"divider"!==u.type&&p-1!==a)&&(e.selectpicker.search.data.push(c),i.push(e.selectpicker.main.elements[h]))}e.activeIndex=void 0,e.noScroll=!0,e.$menuInner.scrollTop(0),e.selectpicker.search.elements=i,e.createView(!0),q.call(e,i,t)}else e.selectpicker.search.previousValue&&(e.$menuInner.scrollTop(0),e.createView(!1));e.selectpicker.search.previousValue=t}))},_searchStyle:function(){return this.options.liveSearchStyle||"contains"},val:function(e){var t=this.$element[0];if(void 0!==e){var i=v(t);if(w=[null,null,i],this.$element.val(e).trigger("changed"+B,w),this.$newElement.hasClass(G.SHOW))if(this.multiple)this.setOptionStatus(!0);else{var s=(t.options[t.selectedIndex]||{}).liIndex;"number"==typeof s&&(this.setSelected(this.selectedIndex,!1),this.setSelected(s,!0))}return this.render(),w=null,this.$element}return this.$element.val()},changeAll:function(e){if(this.multiple){void 0===e&&(e=!0);var t=this.$element[0],i=0,s=0,n=v(t);t.classList.add("bs-select-hidden");for(var o=0,l=this.selectpicker.current.data,r=l.length;o<r;o++){var a=l[o],c=a.option;c&&!a.disabled&&"divider"!==a.type&&(a.selected&&i++,c.selected=e,!0===e&&s++)}t.classList.remove("bs-select-hidden"),i!==s&&(this.setOptionStatus(),w=[null,null,n],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,s,n,o,l,r=e(this),a=r.hasClass("dropdown-toggle"),c=(a?r.closest(".dropdown"):r.closest(U.MENU)).data("this"),p=c.findLis(),h=!1,d=t.which===R.TAB&&!a&&!c.options.selectOnTab,u=j.test(t.which)||d,f=c.$menuInner[0].scrollTop,g=!0===c.isVirtual()?c.selectpicker.view.position0:0;if(!(t.which>=112&&t.which<=123))if(!(s=c.$newElement.hasClass(G.SHOW))&&(u||t.which>=48&&t.which<=57||t.which>=96&&t.which<=105||t.which>=65&&t.which<=90)&&(c.$button.trigger("click.bs.dropdown.data-api"),c.options.liveSearch))c.$searchbox.trigger("focus");else{if(t.which===R.ESCAPE&&s&&(t.preventDefault(),c.$button.trigger("click.bs.dropdown.data-api").trigger("focus")),u){if(!p.length)return;-1!==(i=(n=c.selectpicker.main.elements[c.activeIndex])?Array.prototype.indexOf.call(n.parentElement.children,n):-1)&&c.defocusItem(n),t.which===R.ARROW_UP?(-1!==i&&i--,i+g<0&&(i+=p.length),c.selectpicker.view.canHighlight[i+g]||-1==(i=c.selectpicker.view.canHighlight.slice(0,i+g).lastIndexOf(!0)-g)&&(i=p.length-1)):(t.which===R.ARROW_DOWN||d)&&(++i+g>=c.selectpicker.view.canHighlight.length&&(i=c.selectpicker.view.firstHighlightIndex),c.selectpicker.view.canHighlight[i+g]||(i=i+1+c.selectpicker.view.canHighlight.slice(i+g+1).indexOf(!0))),t.preventDefault();var m=g+i;t.which===R.ARROW_UP?0===g&&i===p.length-1?(c.$menuInner[0].scrollTop=c.$menuInner[0].scrollHeight,m=c.selectpicker.current.elements.length-1):h=(l=(o=c.selectpicker.current.data[m]).position-o.height)<f:(t.which===R.ARROW_DOWN||d)&&(i===c.selectpicker.view.firstHighlightIndex?(c.$menuInner[0].scrollTop=0,m=c.selectpicker.view.firstHighlightIndex):h=(l=(o=c.selectpicker.current.data[m]).position-c.sizeInfo.menuInnerHeight)>f),n=c.selectpicker.current.elements[m],c.activeIndex=c.selectpicker.current.data[m].index,c.focusItem(n),c.selectpicker.view.currentActive=n,h&&(c.$menuInner[0].scrollTop=l),c.options.liveSearch?c.$searchbox.trigger("focus"):r.trigger("focus")}else if(!r.is("input")&&!_.test(t.which)||t.which===R.SPACE&&c.selectpicker.keydown.keyHistory){var v,b,w=[];t.preventDefault(),c.selectpicker.keydown.keyHistory+=z[t.which],c.selectpicker.keydown.resetKeyHistory.cancel&&clearTimeout(c.selectpicker.keydown.resetKeyHistory.cancel),c.selectpicker.keydown.resetKeyHistory.cancel=c.selectpicker.keydown.resetKeyHistory.start(),b=c.selectpicker.keydown.keyHistory,/^(.)\1+$/.test(b)&&(b=b.charAt(0));for(var k=0;k<c.selectpicker.current.data.length;k++){var y=c.selectpicker.current.data[k];x(y,b,"startsWith",!0)&&c.selectpicker.view.canHighlight[k]&&w.push(y.index)}if(w.length){var I=0;p.removeClass("active").find("a").removeClass("active"),1===b.length&&(-1===(I=w.indexOf(c.activeIndex))||I===w.length-1?I=0:I++),v=w[I],f-(o=c.selectpicker.main.data[v]).position>0?(l=o.position-o.height,h=!0):(l=o.position-c.sizeInfo.menuInnerHeight,h=o.position>f+c.sizeInfo.menuInnerHeight),n=c.selectpicker.main.elements[v],c.activeIndex=w[I],c.focusItem(n),n&&n.firstChild.focus(),h&&(c.$menuInner[0].scrollTop=l),r.trigger("focus")}}s&&(t.which===R.SPACE&&!c.selectpicker.keydown.keyHistory||t.which===R.ENTER||t.which===R.TAB&&c.options.selectOnTab)&&(t.which!==R.SPACE&&t.preventDefault(),c.options.liveSearch&&t.which===R.SPACE||(c.$menuInner.find(".active a").trigger("click",!0),r.trigger("focus"),c.options.liveSearch||(t.preventDefault(),e(document).data("spaceSelect",!0))))}},mobile:function(){this.options.mobile=!0,this.$element[0].classList.add("mobile-device")},refresh:function(){var t=e.extend({},this.options,this.$element.data());this.options=t,this.checkDisabled(),this.buildData(),this.setStyle(),this.render(),this.buildList(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed"+B)},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(B).removeData("selectpicker").removeClass("bs-select-hidden selectpicker"),e(window).off(B+"."+this.selectId)}};var K=e.fn.selectpicker;function Q(){if(e.fn.dropdown)return(e.fn.dropdown.Constructor._dataApiKeydownHandler||e.fn.dropdown.Constructor.prototype.keydown).apply(this,arguments)}e.fn.selectpicker=V,e.fn.selectpicker.Constructor=F,e.fn.selectpicker.noConflict=function(){return e.fn.selectpicker=K,this},e(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.dropdown.data-api",':not(.bootstrap-select) > [data-toggle="dropdown"]',Q).on("keydown.bs.dropdown.data-api",":not(.bootstrap-select) > .dropdown-menu",Q).on("keydown"+B,'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',F.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',(function(e){e.stopPropagation()})),e(window).on("load"+B+".data-api",(function(){e(".selectpicker").each((function(){var t=e(this);V.call(t,t.data())}))}))}(e)}(e)}.apply(t,s),void 0===n||(e.exports=n)}}]);