if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(n){"use strict";var t=n.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1==t[0]&&9==t[1]&&t[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher");}(jQuery);+function(n){"use strict";function t(){var i=document.createElement("bootstrap"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var t in n)if(void 0!==i.style[t])return{end:n[t]};return!1}n.fn.emulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one("bsTransitionEnd",function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this};n(function(){n.support.transition=t();n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery);+function(n){"use strict";function u(i){return this.each(function(){var r=n(this),u=r.data("bs.alert");u||r.data("bs.alert",u=new t(this));"string"==typeof i&&u[i].call(r)})}var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.VERSION="3.3.5";t.TRANSITION_DURATION=150;t.prototype.close=function(i){function e(){r.detach().trigger("closed.bs.alert").remove()}var f=n(this),u=f.attr("data-target"),r;u||(u=f.attr("href"),u=u&&u.replace(/.*(?=#[^\s]*$)/,""));r=n(u);i&&i.preventDefault();r.length||(r=f.closest(".alert"));r.trigger(i=n.Event("close.bs.alert"));i.isDefaultPrevented()||(r.removeClass("in"),n.support.transition&&r.hasClass("fade")?r.one("bsTransitionEnd",e).emulateTransitionEnd(t.TRANSITION_DURATION):e())};r=n.fn.alert;n.fn.alert=u;n.fn.alert.Constructor=t;n.fn.alert.noConflict=function(){return n.fn.alert=r,this};n(document).on("click.bs.alert.data-api",i,t.prototype.close)}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.button"),f="object"==typeof i&&i;r||u.data("bs.button",r=new t(this,f));"toggle"==i?r.toggle():i&&r.setState(i)})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.isLoading=!1},r;t.VERSION="3.3.5";t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(t){var r="disabled",i=this.$element,f=i.is("input")?"val":"html",u=i.data();t+="Text";null==u.resetText&&i.data("resetText",i[f]());setTimeout(n.proxy(function(){i[f](null==u[t]?this.options[t]:u[t]);"loadingText"==t?(this.isLoading=!0,i.addClass(r).attr(r,r)):this.isLoading&&(this.isLoading=!1,i.removeClass(r).removeAttr(r))},this),0)};t.prototype.toggle=function(){var t=!0,i=this.$element.closest('[data-toggle="buttons"]'),n;i.length?(n=this.$element.find("input"),"radio"==n.prop("type")?(n.prop("checked")&&(t=!1),i.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),t&&n.trigger("change")):(this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active"))};r=n.fn.button;n.fn.button=i;n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=r,this};n(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var r=n(t.target);r.hasClass("btn")||(r=r.closest(".btn"));i.call(r,"toggle");n(t.target).is('input[type="radio"]')||n(t.target).is('input[type="checkbox"]')||t.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){n(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.carousel"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i),e="string"==typeof i?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));"number"==typeof i?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})}var t=function(t,i){this.$element=n(t);this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=null;this.sliding=null;this.interval=null;this.$active=null;this.$items=null;this.options.keyboard&&this.$element.on("keydown.bs.carousel",n.proxy(this.keydown,this));"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",n.proxy(this.pause,this)).on("mouseleave.bs.carousel",n.proxy(this.cycle,this))},u,r;t.VERSION="3.3.5";t.TRANSITION_DURATION=600;t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0};t.prototype.keydown=function(n){if(!/input|textarea/i.test(n.target.tagName)){switch(n.which){case 37:this.prev();break;case 39:this.next();break;default:return}n.preventDefault()}};t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this};t.prototype.getItemIndex=function(n){return this.$items=n.parent().children(".item"),this.$items.index(n||this.$active)};t.prototype.getItemForDirection=function(n,t){var i=this.getItemIndex(t),f="prev"==n&&0===i||"next"==n&&i==this.$items.length-1,r,u;return f&&!this.options.wrap?t:(r="prev"==n?-1:1,u=(i+r)%this.$items.length,this.$items.eq(u))};t.prototype.to=function(n){var i=this,t=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(n>this.$items.length-1)&&!(0>n))return this.sliding?this.$element.one("slid.bs.carousel",function(){i.to(n)}):t==n?this.pause().cycle():this.slide(n>t?"next":"prev",this.$items.eq(n))};t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition&&(this.$element.trigger(n.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};t.prototype.next=function(){if(!this.sliding)return this.slide("next")};t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};t.prototype.slide=function(i,r){var e=this.$element.find(".item.active"),u=r||this.getItemForDirection(i,e),l=this.interval,f="next"==i?"left":"right",a=this,o,s,h,c;return u.hasClass("active")?this.sliding=!1:(o=u[0],s=n.Event("slide.bs.carousel",{relatedTarget:o,direction:f}),(this.$element.trigger(s),!s.isDefaultPrevented())?((this.sliding=!0,l&&this.pause(),this.$indicators.length)&&(this.$indicators.find(".active").removeClass("active"),h=n(this.$indicators.children()[this.getItemIndex(u)]),h&&h.addClass("active")),c=n.Event("slid.bs.carousel",{relatedTarget:o,direction:f}),n.support.transition&&this.$element.hasClass("slide")?(u.addClass(i),u[0].offsetWidth,e.addClass(f),u.addClass(f),e.one("bsTransitionEnd",function(){u.removeClass([i,f].join(" ")).addClass("active");e.removeClass(["active",f].join(" "));a.sliding=!1;setTimeout(function(){a.$element.trigger(c)},0)}).emulateTransitionEnd(t.TRANSITION_DURATION)):(e.removeClass("active"),u.addClass("active"),this.sliding=!1,this.$element.trigger(c)),l&&this.cycle(),this):void 0)};u=n.fn.carousel;n.fn.carousel=i;n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=u,this};r=function(t){var o,r=n(this),u=n(r.attr("data-target")||(o=r.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,"")),e,f;u.hasClass("carousel")&&(e=n.extend({},u.data(),r.data()),f=r.attr("data-slide-to"),f&&(e.interval=!1),i.call(u,e),f&&u.data("bs.carousel").to(f),t.preventDefault())};n(document).on("click.bs.carousel.data-api","[data-slide]",r).on("click.bs.carousel.data-api","[data-slide-to]",r);n(window).on("load",function(){n('[data-ride="carousel"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery);+function(n){"use strict";function r(t){var i,r=t.attr("data-target")||(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return n(r)}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.collapse"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i);!r&&f.toggle&&/show|hide/.test(i)&&(f.toggle=!1);r||u.data("bs.collapse",r=new t(this,f));"string"==typeof i&&r[i]()})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.$trigger=n('[data-toggle="collapse"][href="#'+i.id+'"],[data-toggle="collapse"][data-target="#'+i.id+'"]');this.transitioning=null;this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger);this.options.toggle&&this.toggle()},u;t.VERSION="3.3.5";t.TRANSITION_DURATION=350;t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){var n=this.$element.hasClass("width");return n?"width":"height"};t.prototype.show=function(){var f,r,e,u,o,s;if(!this.transitioning&&!this.$element.hasClass("in")&&(r=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing"),!(r&&r.length&&(f=r.data("bs.collapse"),f&&f.transitioning))&&(e=n.Event("show.bs.collapse"),this.$element.trigger(e),!e.isDefaultPrevented()))){if(r&&r.length&&(i.call(r,"hide"),f||r.data("bs.collapse",null)),u=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[u](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1,o=function(){this.$element.removeClass("collapsing").addClass("collapse in")[u]("");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return o.call(this);s=n.camelCase(["scroll",u].join("-"));this.$element.one("bsTransitionEnd",n.proxy(o,this)).emulateTransitionEnd(t.TRANSITION_DURATION)[u](this.$element[0][s])}};t.prototype.hide=function(){var r,i,u;if(!this.transitioning&&this.$element.hasClass("in")&&(r=n.Event("hide.bs.collapse"),this.$element.trigger(r),!r.isDefaultPrevented()))return i=this.dimension(),this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1,u=function(){this.transitioning=0;this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")},n.support.transition?void this.$element[i](0).one("bsTransitionEnd",n.proxy(u,this)).emulateTransitionEnd(t.TRANSITION_DURATION):u.call(this)};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};t.prototype.getParent=function(){return n(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(n.proxy(function(t,i){var u=n(i);this.addAriaAndCollapsedClass(r(u),u)},this)).end()};t.prototype.addAriaAndCollapsedClass=function(n,t){var i=n.hasClass("in");n.attr("aria-expanded",i);t.toggleClass("collapsed",!i).attr("aria-expanded",i)};u=n.fn.collapse;n.fn.collapse=i;n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=u,this};n(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var u=n(this);u.attr("data-target")||t.preventDefault();var f=r(u),e=f.data("bs.collapse"),o=e?"toggle":u.data();i.call(f,o)})}(jQuery);+function(n){"use strict";function r(t){var i=t.attr("data-target"),r;return i||(i=t.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r=i&&n(i),r&&r.length?r:t.parent()}function u(t){t&&3===t.which||(n(o).remove(),n(i).each(function(){var u=n(this),i=r(u),f={relatedTarget:this};i.hasClass("open")&&(t&&"click"==t.type&&/input|textarea/i.test(t.target.tagName)&&n.contains(i[0],t.target)||(i.trigger(t=n.Event("hide.bs.dropdown",f)),t.isDefaultPrevented()||(u.attr("aria-expanded","false"),i.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function e(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));"string"==typeof i&&u[i].call(r)})}var o=".dropdown-backdrop",i='[data-toggle="dropdown"]',t=function(t){n(t).on("click.bs.dropdown",this.toggle)},f;t.VERSION="3.3.5";t.prototype.toggle=function(t){var f=n(this),i,o,e;if(!f.is(".disabled, :disabled")){if(i=r(f),o=i.hasClass("open"),u(),!o){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&n(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(n(this)).on("click",u),e={relatedTarget:this},i.trigger(t=n.Event("show.bs.dropdown",e)),t.isDefaultPrevented())return;f.trigger("focus").attr("aria-expanded","true");i.toggleClass("open").trigger("shown.bs.dropdown",e)}return!1}};t.prototype.keydown=function(t){var e,o,s,h,f,u;if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(o=r(e),s=o.hasClass("open"),!s&&27!=t.which||s&&27==t.which)return 27==t.which&&o.find(i).trigger("focus"),e.trigger("click");h=" li:not(.disabled):visible a";f=o.find(".dropdown-menu"+h);f.length&&(u=f.index(t.target),38==t.which&&u>0&&u--,40==t.which&&u<f.length-1&&u++,~u||(u=0),f.eq(u).trigger("focus"))}};f=n.fn.dropdown;n.fn.dropdown=e;n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.bs.dropdown.data-api",u).on("click.bs.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("click.bs.dropdown.data-api",i,t.prototype.toggle).on("keydown.bs.dropdown.data-api",i,t.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",t.prototype.keydown)}(jQuery);+function(n){"use strict";function i(i,r){return this.each(function(){var f=n(this),u=f.data("bs.modal"),e=n.extend({},t.DEFAULTS,f.data(),"object"==typeof i&&i);u||f.data("bs.modal",u=new t(this,e));"string"==typeof i?u[i](r):e.show&&u.show(r)})}var t=function(t,i){this.options=i;this.$body=n(document.body);this.$element=n(t);this.$dialog=this.$element.find(".modal-dialog");this.$backdrop=null;this.isShown=null;this.originalBodyPad=null;this.scrollbarWidth=0;this.ignoreBackdropClick=!1;this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,n.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))},r;t.VERSION="3.3.5";t.TRANSITION_DURATION=300;t.BACKDROP_TRANSITION_DURATION=150;t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};t.prototype.toggle=function(n){return this.isShown?this.hide():this.show(n)};t.prototype.show=function(i){var r=this,u=n.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(u);this.isShown||u.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){r.$element.one("mouseup.dismiss.bs.modal",function(t){n(t.target).is(r.$element)&&(r.ignoreBackdropClick=!0)})}),this.backdrop(function(){var f=n.support.transition&&r.$element.hasClass("fade"),u;r.$element.parent().length||r.$element.appendTo(r.$body);r.$element.show().scrollTop(0);r.adjustDialog();f&&r.$element[0].offsetWidth;r.$element.addClass("in");r.enforceFocus();u=n.Event("shown.bs.modal",{relatedTarget:i});f?r.$dialog.one("bsTransitionEnd",function(){r.$element.trigger("focus").trigger(u)}).emulateTransitionEnd(t.TRANSITION_DURATION):r.$element.trigger("focus").trigger(u)}))};t.prototype.hide=function(i){i&&i.preventDefault();i=n.Event("hide.bs.modal");this.$element.trigger(i);this.isShown&&!i.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",n.proxy(this.hideModal,this)).emulateTransitionEnd(t.TRANSITION_DURATION):this.hideModal())};t.prototype.enforceFocus=function(){n(document).off("focusin.bs.modal").on("focusin.bs.modal",n.proxy(function(n){this.$element[0]===n.target||this.$element.has(n.target).length||this.$element.trigger("focus")},this))};t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",n.proxy(function(n){27==n.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")};t.prototype.resize=function(){this.isShown?n(window).on("resize.bs.modal",n.proxy(this.handleUpdate,this)):n(window).off("resize.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.$body.removeClass("modal-open");n.resetAdjustments();n.resetScrollbar();n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(i){var e=this,f=this.$element.hasClass("fade")?"fade":"",r,u;if(this.isShown&&this.options.backdrop){if(r=n.support.transition&&f,this.$backdrop=n(document.createElement("div")).addClass("modal-backdrop "+f).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",n.proxy(function(n){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(n.target===n.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),r&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!i)return;r?this.$backdrop.one("bsTransitionEnd",i).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):i()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),u=function(){e.removeBackdrop();i&&i()},n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",u).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):u()):i&&i()};t.prototype.handleUpdate=function(){this.adjustDialog()};t.prototype.adjustDialog=function(){var n=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&n?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!n?this.scrollbarWidth:""})};t.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})};t.prototype.checkScrollbar=function(){var n=window.innerWidth,t;n||(t=document.documentElement.getBoundingClientRect(),n=t.right-Math.abs(t.left));this.bodyIsOverflowing=document.body.clientWidth<n;this.scrollbarWidth=this.measureScrollbar()};t.prototype.setScrollbar=function(){var n=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";this.bodyIsOverflowing&&this.$body.css("padding-right",n+this.scrollbarWidth)};t.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)};t.prototype.measureScrollbar=function(){var n=document.createElement("div"),t;return n.className="modal-scrollbar-measure",this.$body.append(n),t=n.offsetWidth-n.clientWidth,this.$body[0].removeChild(n),t};r=n.fn.modal;n.fn.modal=i;n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=r,this};n(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var r=n(this),f=r.attr("href"),u=n(r.attr("data-target")||f&&f.replace(/.*(?=#[^\s]+$)/,"")),e=u.data("bs.modal")?"toggle":n.extend({remote:!/#/.test(f)&&f},u.data(),r.data());r.is("a")&&t.preventDefault();u.one("show.bs.modal",function(n){n.isDefaultPrevented()||u.one("hidden.bs.modal",function(){r.is(":visible")&&r.trigger("focus")})});i.call(u,e,this)})}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f="object"==typeof i&&i;(r||!/destroy|hide/.test(i))&&(r||u.data("bs.tooltip",r=new t(this,f)),"string"==typeof i&&r[i]())})}var t=function(n,t){this.type=null;this.options=null;this.enabled=null;this.timeout=null;this.hoverState=null;this.$element=null;this.inState=null;this.init("tooltip",n,t)},i;t.VERSION="3.3.5";t.TRANSITION_DURATION=150;t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}};t.prototype.init=function(t,i,r){var f,e,u,o,s;if(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&n(n.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],"click"==u)this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else"manual"!=u&&(o="hover"==u?"mouseenter":"focusin",s="hover"==u?"mouseleave":"focusout",this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this)));this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){return t=n.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),t instanceof n.Event&&(i.inState["focusin"==t.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState?void(i.hoverState="in"):(clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show())};t.prototype.isInStateTrue=function(){for(var n in this.inState)if(this.inState[n])return!0;return!1};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),t instanceof n.Event&&(i.inState["focusout"==t.type?"focus":"hover"]=!1),i.isInStateTrue()?void 0:(clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide())};t.prototype.show=function(){var c=n.Event("show.bs."+this.type),l,p,e,w,h;if(this.hasContent()&&this.enabled){if(this.$element.trigger(c),l=n.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]),c.isDefaultPrevented()||!l)return;var u=this,r=this.tip(),a=this.getUID(this.type);this.setContent();r.attr("id",a);this.$element.attr("aria-describedby",a);this.options.animation&&r.addClass("fade");var i="function"==typeof this.options.placement?this.options.placement.call(this,r[0],this.$element[0]):this.options.placement,v=/\s?auto?\s?/i,y=v.test(i);y&&(i=i.replace(v,"")||"top");r.detach().css({top:0,left:0,display:"block"}).addClass(i).data("bs."+this.type,this);this.options.container?r.appendTo(this.options.container):r.insertAfter(this.$element);this.$element.trigger("inserted.bs."+this.type);var f=this.getPosition(),o=r[0].offsetWidth,s=r[0].offsetHeight;y&&(p=i,e=this.getPosition(this.$viewport),i="bottom"==i&&f.bottom+s>e.bottom?"top":"top"==i&&f.top-s<e.top?"bottom":"right"==i&&f.right+o>e.width?"left":"left"==i&&f.left-o<e.left?"right":i,r.removeClass(p).addClass(i));w=this.getCalculatedOffset(i,f,o,s);this.applyPlacement(w,i);h=function(){var n=u.hoverState;u.$element.trigger("shown.bs."+u.type);u.hoverState=null;"out"==n&&u.leave(u)};n.support.transition&&this.$tip.hasClass("fade")?r.one("bsTransitionEnd",h).emulateTransitionEnd(t.TRANSITION_DURATION):h()}};t.prototype.applyPlacement=function(t,i){var r=this.tip(),l=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),h,f,u;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top+=o;t.left+=s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");h=r[0].offsetWidth;f=r[0].offsetHeight;"top"==i&&f!=e&&(t.top=t.top+e-f);u=this.getViewportAdjustedDelta(i,t,h,f);u.left?t.left+=u.left:t.top+=u.top;var c=/top|bottom/.test(i),a=c?2*u.left-l+h:2*u.top-e+f,v=c?"offsetWidth":"offsetHeight";r.offset(t);this.replaceArrow(a,r[0][v],c)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i?"left":"top",50*(1-n/t)+"%").css(i?"top":"left","")};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")};t.prototype.hide=function(i){function f(){"in"!=u.hoverState&&r.detach();u.$element.removeAttr("aria-describedby").trigger("hidden.bs."+u.type);i&&i()}var u=this,r=n(this.$tip),e=n.Event("hide.bs."+this.type);return this.$element.trigger(e),e.isDefaultPrevented()?void 0:(r.removeClass("in"),n.support.transition&&r.hasClass("fade")?r.one("bsTransitionEnd",f).emulateTransitionEnd(t.TRANSITION_DURATION):f(),this.hoverState=null,this)};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||"string"!=typeof n.attr("data-original-title"))&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(t){t=t||this.$element;var u=t[0],r="BODY"==u.tagName,i=u.getBoundingClientRect();null==i.width&&(i=n.extend({},i,{width:i.right-i.left,height:i.bottom-i.top}));var f=r?{top:0,left:0}:t.offset(),e={scroll:r?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},o=r?{width:n(window).width(),height:n(window).height()}:null;return n.extend({},i,e,o,f)};t.prototype.getCalculatedOffset=function(n,t,i,r){return"bottom"==n?{top:t.top+t.height,left:t.left+t.width/2-i/2}:"top"==n?{top:t.top-r,left:t.left+t.width/2-i/2}:"left"==n?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getViewportAdjustedDelta=function(n,t,i,r){var f={top:0,left:0},e,u,o,s,h,c;return this.$viewport?(e=this.options.viewport&&this.options.viewport.padding||0,u=this.getPosition(this.$viewport),/right|left/.test(n)?(o=t.top-e-u.scroll,s=t.top+e-u.scroll+r,o<u.top?f.top=u.top-o:s>u.top+u.height&&(f.top=u.top+u.height-s)):(h=t.left-e,c=t.left+e+i,h<u.left?f.left=u.left-h:c>u.right&&(f.left=u.left+u.width-c)),f):f};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)};t.prototype.getUID=function(n){do n+=~~(1e6*Math.random());while(document.getElementById(n));return n};t.prototype.tip=function(){if(!this.$tip&&(this.$tip=n(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=this;t&&(i=n(t.currentTarget).data("bs."+this.type),i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)));t?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){var n=this;clearTimeout(this.timeout);this.hide(function(){n.$element.off("."+n.type).removeData("bs."+n.type);n.$tip&&n.$tip.detach();n.$tip=null;n.$arrow=null;n.$viewport=null})};i=n.fn.tooltip;n.fn.tooltip=r;n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f="object"==typeof i&&i;(r||!/destroy|hide/.test(i))&&(r||u.data("bs.popover",r=new t(this,f)),"string"==typeof i&&r[i]())})}var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.VERSION="3.3.5";t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype);t.prototype.constructor=t;t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),i=this.getTitle(),t=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](i);n.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof t?"html":"append":"text"](t);n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||("function"==typeof n.content?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};i=n.fn.popover;n.fn.popover=r;n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(jQuery);+function(n){"use strict";function t(i,r){this.$body=n(document.body);this.$scrollElement=n(n(i).is(document.body)?window:i);this.options=n.extend({},t.DEFAULTS,r);this.selector=(this.options.target||"")+" .nav li > a";this.offsets=[];this.targets=[];this.activeTarget=null;this.scrollHeight=0;this.$scrollElement.on("scroll.bs.scrollspy",n.proxy(this.process,this));this.refresh();this.process()}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f="object"==typeof i&&i;r||u.data("bs.scrollspy",r=new t(this,f));"string"==typeof i&&r[i]()})}t.VERSION="3.3.5";t.DEFAULTS={offset:10};t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)};t.prototype.refresh=function(){var t=this,i="offset",r=0;this.offsets=[];this.targets=[];this.scrollHeight=this.getScrollHeight();n.isWindow(this.$scrollElement[0])||(i="position",r=this.$scrollElement.scrollTop());this.$body.find(this.selector).map(function(){var f=n(this),u=f.data("target")||f.attr("href"),t=/^#./.test(u)&&n(u);return t&&t.length&&t.is(":visible")&&[[t[i]().top+r,u]]||null}).sort(function(n,t){return n[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})};t.prototype.process=function(){var n,i=this.$scrollElement.scrollTop()+this.options.offset,f=this.getScrollHeight(),e=this.options.offset+f-this.$scrollElement.height(),t=this.offsets,r=this.targets,u=this.activeTarget;if(this.scrollHeight!=f&&this.refresh(),i>=e)return u!=(n=r[r.length-1])&&this.activate(n);if(u&&i<t[0])return this.activeTarget=null,this.clear();for(n=t.length;n--;)u!=r[n]&&i>=t[n]&&(void 0===t[n+1]||i<t[n+1])&&this.activate(r[n])};t.prototype.activate=function(t){this.activeTarget=t;this.clear();var r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=n(r).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate.bs.scrollspy")};t.prototype.clear=function(){n(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var r=n.fn.scrollspy;n.fn.scrollspy=i;n.fn.scrollspy.Constructor=t;n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=r,this};n(window).on("load.bs.scrollspy.data-api",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));"string"==typeof i&&r[i]()})}var t=function(t){this.element=n(t)},u,i;t.VERSION="3.3.5";t.TRANSITION_DURATION=150;t.prototype.show=function(){var t=this.element,f=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),u;if(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var r=f.find(".active:last a"),e=n.Event("hide.bs.tab",{relatedTarget:t[0]}),o=n.Event("show.bs.tab",{relatedTarget:r[0]});(r.trigger(e),t.trigger(o),o.isDefaultPrevented()||e.isDefaultPrevented())||(u=n(i),this.activate(t.closest("li"),f),this.activate(u,u.parent(),function(){r.trigger({type:"hidden.bs.tab",relatedTarget:t[0]});t.trigger({type:"shown.bs.tab",relatedTarget:r[0]})}))}};t.prototype.activate=function(i,r,u){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1);i.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0);o?(i[0].offsetWidth,i.addClass("in")):i.removeClass("fade");i.parent(".dropdown-menu").length&&i.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0);u&&u()}var f=r.find("> .active"),o=u&&n.support.transition&&(f.length&&f.hasClass("fade")||!!r.find("> .fade").length);f.length&&o?f.one("bsTransitionEnd",e).emulateTransitionEnd(t.TRANSITION_DURATION):e();f.removeClass("in")};u=n.fn.tab;n.fn.tab=r;n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=u,this};i=function(t){t.preventDefault();r.call(n(this),"show")};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.affix"),f="object"==typeof i&&i;r||u.data("bs.affix",r=new t(this,f));"string"==typeof i&&r[i]()})}var t=function(i,r){this.options=n.extend({},t.DEFAULTS,r);this.$target=n(this.options.target).on("scroll.bs.affix.data-api",n.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",n.proxy(this.checkPositionWithEventLoop,this));this.$element=n(i);this.affixed=null;this.unpin=null;this.pinnedOffset=null;this.checkPosition()},r;t.VERSION="3.3.5";t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0,target:window};t.prototype.getState=function(n,t,i,r){var u=this.$target.scrollTop(),f=this.$element.offset(),e=this.$target.height();if(null!=i&&"top"==this.affixed)return i>u?"top":!1;if("bottom"==this.affixed)return null!=i?u+this.unpin<=f.top?!1:"bottom":n-r>=u+e?!1:"bottom";var o=null==this.affixed,s=o?u:f.top,h=o?e:t;return null!=i&&i>=u?"top":null!=r&&s+h>=n-r?"bottom":!1};t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var n=this.$target.scrollTop(),i=this.$element.offset();return this.pinnedOffset=i.top-n};t.prototype.checkPositionWithEventLoop=function(){setTimeout(n.proxy(this.checkPosition,this),1)};t.prototype.checkPosition=function(){var i,e,o;if(this.$element.is(":visible")){var s=this.$element.height(),r=this.options.offset,f=r.top,u=r.bottom,h=Math.max(n(document).height(),n(document.body).height());if("object"!=typeof r&&(u=f=r),"function"==typeof f&&(f=r.top(this.$element)),"function"==typeof u&&(u=r.bottom(this.$element)),i=this.getState(h,s,f,u),this.affixed!=i){if(null!=this.unpin&&this.$element.css("top",""),e="affix"+(i?"-"+i:""),o=n.Event(e+".bs.affix"),this.$element.trigger(o),o.isDefaultPrevented())return;this.affixed=i;this.unpin="bottom"==i?this.getPinnedOffset():null;this.$element.removeClass(t.RESET).addClass(e).trigger(e.replace("affix","affixed")+".bs.affix")}"bottom"==i&&this.$element.offset({top:h-s-u})}};r=n.fn.affix;n.fn.affix=i;n.fn.affix.Constructor=t;n.fn.affix.noConflict=function(){return n.fn.affix=r,this};n(window).on("load",function(){n('[data-spy="affix"]').each(function(){var r=n(this),t=r.data();t.offset=t.offset||{};null!=t.offsetBottom&&(t.offset.bottom=t.offsetBottom);null!=t.offsetTop&&(t.offset.top=t.offsetTop);i.call(r,t)})})}(jQuery);!function(n,t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):n.bootbox=t(n.jQuery)}(this,function a(n,t){"use strict";function a(n){var t=f[o.locale];return t?t[n]:f.en[n]}function e(t,i,r){t.stopPropagation();t.preventDefault();var u=n.isFunction(r)&&r.call(i,t)===!1;u||i.modal("hide")}function v(n){var i,t=0;for(i in n)t++;return t}function r(t,i){var r=0;n.each(t,function(n,t){i(n,t,r++)})}function y(t){var i,u;if("object"!=typeof t)throw new Error("Please supply an object of options");if(!t.message)throw new Error("Please specify a message");return t=n.extend({},o,t),t.buttons||(t.buttons={}),i=t.buttons,u=v(i),r(i,function(t,r,f){if(n.isFunction(r)&&(r=i[t]={callback:r}),"object"!==n.type(r))throw new Error("button with key "+t+" must be an object");r.label||(r.label=t);r.className||(r.className=2>=u&&f===u-1?"btn-primary":"btn-default")}),t}function p(n,t){var r=n.length,i={};if(1>r||r>2)throw new Error("Invalid argument length");return 2===r||"string"==typeof n[0]?(i[t[0]]=n[0],i[t[1]]=n[1]):i=n[0],i}function s(t,i,r){return n.extend(!0,{},t,p(i,r))}function h(n,t,i,r){var u={className:"bootbox-"+n,buttons:c.apply(null,t)};return l(s(u,r,i),t)}function c(){for(var t={},n=0,r=arguments.length;r>n;n++){var i=arguments[n],u=i.toLowerCase(),f=i.toUpperCase();t[u]={label:a(f)}}return t}function l(n,i){var u={};return r(i,function(n,t){u[t]=!0}),r(n.buttons,function(n){if(u[n]===t)throw new Error("button key "+n+" is not allowed (options are "+i.join("\n")+")");}),n}var u={dialog:"<div class='bootbox modal' tabindex='-1' role='dialog'><div class='modal-dialog'><div class='modal-content'><div class='modal-body'><div class='bootbox-body'><\/div><\/div><\/div><\/div><\/div>",header:"<div class='modal-header'><h4 class='modal-title'><\/h4><\/div>",footer:"<div class='modal-footer'><\/div>",closeButton:"<button type='button' class='bootbox-close-button close' data-dismiss='modal' aria-hidden='true'>&times;<\/button>",form:"<form class='bootbox-form'><\/form>",inputs:{text:"<input class='bootbox-input bootbox-input-text form-control' autocomplete=off type=text />",textarea:"<textarea class='bootbox-input bootbox-input-textarea form-control'><\/textarea>",email:"<input class='bootbox-input bootbox-input-email form-control' autocomplete='off' type='email' />",select:"<select class='bootbox-input bootbox-input-select form-control'><\/select>",checkbox:"<div class='checkbox'><label><input class='bootbox-input bootbox-input-checkbox' type='checkbox' /><\/label><\/div>",date:"<input class='bootbox-input bootbox-input-date form-control' autocomplete=off type='date' />",time:"<input class='bootbox-input bootbox-input-time form-control' autocomplete=off type='time' />",number:"<input class='bootbox-input bootbox-input-number form-control' autocomplete=off type='number' />",password:"<input class='bootbox-input bootbox-input-password form-control' autocomplete='off' type='password' />"}},o={locale:"en",backdrop:"static",animate:!0,className:null,closeButton:!0,show:!0,container:"body"},i={},f;return i.alert=function(){var t;if(t=h("alert",["ok"],["message","callback"],arguments),t.callback&&!n.isFunction(t.callback))throw new Error("alert requires callback property to be a function when provided");return t.buttons.ok.callback=t.onEscape=function(){return n.isFunction(t.callback)?t.callback.call(this):!0},i.dialog(t)},i.confirm=function(){var t;if(t=h("confirm",["cancel","confirm"],["message","callback"],arguments),t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,!1)},t.buttons.confirm.callback=function(){return t.callback.call(this,!0)},!n.isFunction(t.callback))throw new Error("confirm requires a callback");return i.dialog(t)},i.prompt=function(){var f,y,h,v,e,p,o,a,w;if(v=n(u.form),y={className:"bootbox-prompt",buttons:c("cancel","confirm"),value:"",inputType:"text"},f=l(s(y,arguments,["title","callback"]),["cancel","confirm"]),p=f.show===t?!0:f.show,f.message=v,f.buttons.cancel.callback=f.onEscape=function(){return f.callback.call(this,null)},f.buttons.confirm.callback=function(){var t,i;switch(f.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":t=e.val();break;case"checkbox":i=e.find("input:checked");t=[];r(i,function(i,r){t.push(n(r).val())})}return f.callback.call(this,t)},f.show=!1,!f.title)throw new Error("prompt requires a title");if(!n.isFunction(f.callback))throw new Error("prompt requires a callback");if(!u.inputs[f.inputType])throw new Error("invalid prompt type");switch(e=n(u.inputs[f.inputType]),f.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":e.val(f.value);break;case"select":if(a={},o=f.inputOptions||[],!n.isArray(o))throw new Error("Please pass an array of input options");if(!o.length)throw new Error("prompt with select requires options");r(o,function(i,r){var u=e;if(r.value===t||r.text===t)throw new Error("given options in wrong format");r.group&&(a[r.group]||(a[r.group]=n("<optgroup/>").attr("label",r.group)),u=a[r.group]);u.append("<option value='"+r.value+"'>"+r.text+"<\/option>")});r(a,function(n,t){e.append(t)});e.val(f.value);break;case"checkbox":if(w=n.isArray(f.value)?f.value:[f.value],o=f.inputOptions||[],!o.length)throw new Error("prompt with checkbox requires options");if(!o[0].value||!o[0].text)throw new Error("given options in wrong format");e=n("<div/>");r(o,function(t,i){var o=n(u.inputs[f.inputType]);o.find("input").attr("value",i.value);o.find("label").append(i.text);r(w,function(n,t){t===i.value&&o.find("input").prop("checked",!0)});e.append(o)})}return f.placeholder&&e.attr("placeholder",f.placeholder),f.pattern&&e.attr("pattern",f.pattern),f.maxlength&&e.attr("maxlength",f.maxlength),v.append(e),v.on("submit",function(n){n.preventDefault();n.stopPropagation();h.find(".btn-primary").click()}),h=i.dialog(f),h.off("shown.bs.modal"),h.on("shown.bs.modal",function(){e.focus()}),p===!0&&h.modal("show"),h},i.dialog=function(i){var c;i=y(i);var f=n(u.dialog),l=f.find(".modal-dialog"),s=f.find(".modal-body"),a=i.buttons,h="",o={onEscape:i.onEscape};if(n.fn.modal===t)throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details.");return(r(a,function(n,t){h+="<button data-bb-handler='"+n+"' type='button' class='btn "+t.className+"'>"+t.label+"<\/button>";o[n]=t.callback}),s.find(".bootbox-body").html(i.message),i.animate===!0&&f.addClass("fade"),i.className&&f.addClass(i.className),"large"===i.size?l.addClass("modal-lg"):"small"===i.size&&l.addClass("modal-sm"),i.title&&s.before(u.header),i.closeButton)&&(c=n(u.closeButton),i.title?f.find(".modal-header").prepend(c):c.css("margin-top","-10px").prependTo(s)),i.title&&f.find(".modal-title").html(i.title),h.length&&(s.after(u.footer),f.find(".modal-footer").html(h)),f.on("hidden.bs.modal",function(n){n.target===this&&f.remove()}),f.on("shown.bs.modal",function(){f.find(".btn-primary:first").focus()}),"static"!==i.backdrop&&f.on("click.dismiss.bs.modal",function(n){f.children(".modal-backdrop").length&&(n.currentTarget=f.children(".modal-backdrop").get(0));n.target===n.currentTarget&&f.trigger("escape.close.bb")}),f.on("escape.close.bb",function(n){o.onEscape&&e(n,f,o.onEscape)}),f.on("click",".modal-footer button",function(t){var i=n(this).data("bb-handler");e(t,f,o[i])}),f.on("click",".bootbox-close-button",function(n){e(n,f,o.onEscape)}),f.on("keyup",function(n){27===n.which&&f.trigger("escape.close.bb")}),n(i.container).append(f),f.modal({backdrop:i.backdrop?"static":!1,keyboard:!1,show:!1}),i.show&&f.modal("show"),f},i.setDefaults=function(){var t={};2===arguments.length?t[arguments[0]]=arguments[1]:t=arguments[0];n.extend(o,t)},i.hideAll=function(){return n(".bootbox").modal("hide"),i},f={bg_BG:{OK:"Ок",CANCEL:"Отказ",CONFIRM:"Потвърждавам"},br:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Sim"},cs:{OK:"OK",CANCEL:"Zrušit",CONFIRM:"Potvrdit"},da:{OK:"OK",CANCEL:"Annuller",CONFIRM:"Accepter"},de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"},el:{OK:"Εντάξει",CANCEL:"Ακύρωση",CONFIRM:"Επιβεβαίωση"},en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},es:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Aceptar"},et:{OK:"OK",CANCEL:"Katkesta",CONFIRM:"OK"},fa:{OK:"قبول",CANCEL:"لغو",CONFIRM:"تایید"},fi:{OK:"OK",CANCEL:"Peruuta",CONFIRM:"OK"},fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"D'accord"},he:{OK:"אישור",CANCEL:"ביטול",CONFIRM:"אישור"},hu:{OK:"OK",CANCEL:"Mégsem",CONFIRM:"Megerősít"},hr:{OK:"OK",CANCEL:"Odustani",CONFIRM:"Potvrdi"},id:{OK:"OK",CANCEL:"Batal",CONFIRM:"OK"},it:{OK:"OK",CANCEL:"Annulla",CONFIRM:"Conferma"},ja:{OK:"OK",CANCEL:"キャンセル",CONFIRM:"確認"},lt:{OK:"Gerai",CANCEL:"Atšaukti",CONFIRM:"Patvirtinti"},lv:{OK:"Labi",CANCEL:"Atcelt",CONFIRM:"Apstiprināt"},nl:{OK:"OK",CANCEL:"Annuleren",CONFIRM:"Accepteren"},no:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},pl:{OK:"OK",CANCEL:"Anuluj",CONFIRM:"Potwierdź"},pt:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Confirmar"},ru:{OK:"OK",CANCEL:"Отмена",CONFIRM:"Применить"},sq:{OK:"OK",CANCEL:"Anulo",CONFIRM:"Prano"},sv:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},th:{OK:"ตกลง",CANCEL:"ยกเลิก",CONFIRM:"ยืนยัน"},tr:{OK:"Tamam",CANCEL:"İptal",CONFIRM:"Onayla"},zh_CN:{OK:"OK",CANCEL:"取消",CONFIRM:"确认"},zh_TW:{OK:"OK",CANCEL:"取消",CONFIRM:"確認"}},i.addLocale=function(t,r){return n.each(["OK","CANCEL","CONFIRM"],function(n,t){if(!r[t])throw new Error("Please supply a translation for '"+t+"'");}),f[t]={OK:r.OK,CANCEL:r.CANCEL,CONFIRM:r.CONFIRM},i},i.removeLocale=function(n){return delete f[n],i},i.setLocale=function(n){return i.setDefaults("locale",n)},i.init=function(t){return a(t||n)},i}),function(n,t){n===undefined&&window!==undefined&&(n=window);typeof define=="function"&&define.amd?define(["jquery"],function(n){return t(n)}):typeof module=="object"&&module.exports?module.exports=t(require("jquery")):t(n.jQuery)}(this,function(n){(function(n){"use strict";function k(n,t){return n.length===t.length&&n.every(function(n,i){return n===t[i]})}function h(n){var r=[],u=n&&n.options,t,i,f;if(n.multiple)for(i=0,f=u.length;i<f;i++)t=u[i],t.selected&&r.push(t.value||t.text);else r=n.value;return r}function y(n,t,i,r){for(var o,u,s=["content","subtext","tokens"],f=!1,e=0;e<s.length;e++)if(o=s[e],u=n[o],u&&(u=u.toString(),o==="content"&&(u=u.replace(/<[^>]+>/g,"")),r&&(u=d(u)),u=u.toUpperCase(),f=i==="contains"?u.indexOf(t)>=0:u.startsWith(t),f))break;return f}function f(n){return parseInt(n,10)||0}function d(t){return n.each([{re:/[\xC0-\xC6]/g,ch:"A"},{re:/[\xE0-\xE6]/g,ch:"a"},{re:/[\xC8-\xCB]/g,ch:"E"},{re:/[\xE8-\xEB]/g,ch:"e"},{re:/[\xCC-\xCF]/g,ch:"I"},{re:/[\xEC-\xEF]/g,ch:"i"},{re:/[\xD2-\xD6]/g,ch:"O"},{re:/[\xF2-\xF6]/g,ch:"o"},{re:/[\xD9-\xDC]/g,ch:"U"},{re:/[\xF9-\xFC]/g,ch:"u"},{re:/[\xC7-\xE7]/g,ch:"c"},{re:/[\xD1]/g,ch:"N"},{re:/[\xF1]/g,ch:"n"}],function(){t=t?t.replace(this.re,this.ch):""}),t}function w(u){var o=arguments,f=u,e,s;if([].shift.apply(o),!r.success){try{r.full=(n.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split(".")}catch(h){r.full=i.BootstrapVersion.split(" ")[0].split(".")}r.major=r.full[0];r.success=!0;r.major==="4"&&(t.DIVIDER="dropdown-divider",t.SHOW="show",t.BUTTONCLASS="btn-light",i.DEFAULTS.style=t.BUTTONCLASS="btn-light",t.POPOVERHEADER="popover-header")}return s=this.each(function(){var u=n(this),t,r,h,s;if(u.is("select")){if(t=u.data("selectpicker"),r=typeof f=="object"&&f,t){if(r)for(s in r)r.hasOwnProperty(s)&&(t.options[s]=r[s])}else h=n.extend({},i.DEFAULTS,n.fn.selectpicker.defaults||{},u.data(),r),h.template=n.extend({},i.DEFAULTS.template,n.fn.selectpicker.defaults?n.fn.selectpicker.defaults.template:{},u.data().template,r.template),u.data("selectpicker",t=new i(this,h));typeof f=="string"&&(e=t[f]instanceof Function?t[f].apply(t,o):t.options[f])}}),typeof e!="undefined"?e:s}var l=document.createElement("_"),a,e,o,v,t,c,b;l.classList.toggle("c3",!1);l.classList.contains("c3")&&(a=DOMTokenList.prototype.toggle,DOMTokenList.prototype.toggle=function(n,t){return 1 in arguments&&!this.contains(n)==!t?t:a.call(this,n)});String.prototype.startsWith||function(){var n=function(){try{var n={},t=Object.defineProperty,i=t(n,n,n)&&t}catch(r){}return i}(),i={}.toString,t=function(n){var u,f,r;if(this==null)throw new TypeError;if(u=String(this),n&&i.call(n)=="[object RegExp]")throw new TypeError;var e=u.length,o=String(n),s=o.length,h=arguments.length>1?arguments[1]:undefined,t=h?Number(h):0;if(t!=t&&(t=0),f=Math.min(Math.max(t,0),e),s+f>e)return!1;for(r=-1;++r<s;)if(u.charCodeAt(f+r)!=o.charCodeAt(r))return!1;return!0};n?n(String.prototype,"startsWith",{value:t,configurable:!0,writable:!0}):String.prototype.startsWith=t}();Object.keys||(Object.keys=function(n,t,i){i=[];for(t in n)i.hasOwnProperty.call(n,t)&&i.push(t);return i});e={useDefault:!1,_set:n.valHooks.select.set};n.valHooks.select.set=function(t,i){return i&&!e.useDefault&&n(t).data("selected",!0),e._set.apply(this,arguments)};o=null;v=function(){try{return new Event("change"),!0}catch(n){return!1}}();n.fn.triggerNative=function(n){var i=this[0],t;i.dispatchEvent?(v?t=new Event(n,{bubbles:!0}):(t=document.createEvent("Event"),t.initEvent(n,!0,!1)),i.dispatchEvent(t)):i.fireEvent?(t=document.createEventObject(),t.eventType=n,i.fireEvent("on"+n,t)):this.trigger(n)};var p=function(n){var i=function(t){return n[t]},t="(?:"+Object.keys(n).join("|")+")",r=RegExp(t),u=RegExp(t,"g");return function(n){return n=n==null?"":""+n,r.test(n)?n.replace(u,i):n}},s=p({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"}),g=p({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#x27;":"'","&#x60;":"`"}),nt={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"},u={ESCAPE:27,ENTER:13,SPACE:32,TAB:9,ARROW_UP:38,ARROW_DOWN:40},r={success:!1,major:"3"};try{r.full=(n.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split(".");r.major=r.full[0];r.success=!0}catch(tt){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.",tt)}t={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"};c={MENU:"."+t.MENU};r.major==="4"&&(t.DIVIDER="dropdown-divider",t.SHOW="show",t.BUTTONCLASS="btn-light",t.POPOVERHEADER="popover-header");var it=new RegExp(u.ARROW_UP+"|"+u.ARROW_DOWN),rt=new RegExp("^"+u.TAB+"$|"+u.ESCAPE),ut=new RegExp(u.ENTER+"|"+u.SPACE),i=function(t,r){var f=this,u;e.useDefault||(n.valHooks.select.set=e._set,e.useDefault=!0);this.$element=n(t);this.$newElement=null;this.$button=null;this.$menu=null;this.options=r;this.selectpicker={main:{map:{newIndex:{},originalIndex:{}}},current:{map:{}},search:{map:{}},view:{},keydown:{keyHistory:"",resetKeyHistory:{start:function(){return setTimeout(function(){f.selectpicker.keydown.keyHistory=""},800)}}}};this.options.title===null&&(this.options.title=this.$element.attr("title"));u=this.options.windowPadding;typeof u=="number"&&(this.options.windowPadding=[u,u,u,u]);this.val=i.prototype.val;this.render=i.prototype.render;this.refresh=i.prototype.refresh;this.setStyle=i.prototype.setStyle;this.selectAll=i.prototype.selectAll;this.deselectAll=i.prototype.deselectAll;this.destroy=i.prototype.destroy;this.remove=i.prototype.remove;this.show=i.prototype.show;this.hide=i.prototype.hide;this.init()};i.VERSION="1.13.2";i.BootstrapVersion=r.major;i.DEFAULTS={noneSelectedText:"Nothing selected",noneResultsText:"No results matched {0}",countSelectedText:function(n){return n==1?"{0} item selected":"{0} items selected"},maxOptionsText:function(n,t){return[n==1?"Limit reached ({n} item max)":"Limit reached ({n} items max)",t==1?"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:t.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:"glyphicon",tickIcon:"glyphicon-ok",showTick:!1,template:{caret:'<span class="caret"><\/span>'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1};r.major==="4"&&(i.DEFAULTS.style="btn-light",i.DEFAULTS.iconBase="",i.DEFAULTS.tickIcon="bs-ok-default");i.prototype={constructor:i,init:function(){var n=this,i=this.$element.attr("id");if(this.$element.addClass("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),this.$newElement=this.createDropdown(),this.createLi(),this.$element.after(this.$newElement).prependTo(this.$newElement),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(c.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),this.$element.removeClass("bs-select-hidden"),this.options.dropdownAlignRight===!0&&this.$menu.addClass(t.MENURIGHT),typeof i!="undefined"&&this.$button.attr("data-id",i),this.checkDisabled(),this.clickListener(),this.options.liveSearch&&this.liveSearchListener(),this.render(),this.setStyle(),this.setWidth(),this.options.container)this.selectPosition();else this.$element.on("hide.bs.select",function(){if(n.isVirtual()){var t=n.$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){n.$menuInner.attr("aria-expanded",!1);n.$element.trigger("hide.bs.select",t)},"hidden.bs.dropdown":function(t){n.$element.trigger("hidden.bs.select",t)},"show.bs.dropdown":function(t){n.$menuInner.attr("aria-expanded",!0);n.$element.trigger("show.bs.select",t)},"shown.bs.dropdown":function(t){n.$element.trigger("shown.bs.select",t)}});if(n.$element[0].hasAttribute("required"))this.$element.on("invalid",function(){n.$button.addClass("bs-invalid");n.$element.on({"shown.bs.select":function(){n.$element.val(n.$element.val()).off("shown.bs.select")},"rendered.bs.select":function(){this.validity.valid&&n.$button.removeClass("bs-invalid");n.$element.off("rendered.bs.select")}});n.$button.on("blur.bs.select",function(){n.$element.focus().blur();n.$button.off("blur.bs.select")})});setTimeout(function(){n.$element.trigger("loaded.bs.select")})},createDropdown:function(){var i=this.multiple||this.options.showTick?" show-tick":"",u=this.autofocus?" autofocus":"",f=this.options.header?'<div class="'+t.POPOVERHEADER+'"><button type="button" class="close" aria-hidden="true">&times;<\/button>'+this.options.header+"<\/div>":"",e=this.options.liveSearch?'<div class="bs-searchbox"><input type="text" class="form-control" autocomplete="off"'+(null===this.options.liveSearchPlaceholder?"":' placeholder="'+s(this.options.liveSearchPlaceholder)+'"')+' role="textbox" aria-label="Search"><\/div>':"",o=this.multiple&&this.options.actionsBox?'<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button type="button" class="actions-btn bs-select-all btn '+t.BUTTONCLASS+'">'+this.options.selectAllText+'<\/button><button type="button" class="actions-btn bs-deselect-all btn '+t.BUTTONCLASS+'">'+this.options.deselectAllText+"<\/button><\/div><\/div>":"",h=this.multiple&&this.options.doneButton?'<div class="bs-donebutton"><div class="btn-group btn-block"><button type="button" class="btn btn-sm '+t.BUTTONCLASS+'">'+this.options.doneButtonText+"<\/button><\/div><\/div>":"",c='<div class="dropdown bootstrap-select'+i+'"><button type="button" class="'+this.options.styleBase+' dropdown-toggle" '+(this.options.display==="static"?'data-display="static"':"")+'data-toggle="dropdown"'+u+' role="button"><div class="filter-option"><div class="filter-option-inner"><div class="filter-option-inner-inner"><\/div><\/div> <\/div>'+(r.major==="4"?"":'<span class="bs-caret">'+this.options.template.caret+"<\/span>")+'<\/button><div class="'+t.MENU+" "+(r.major==="4"?"":t.SHOW)+'" role="combobox">'+f+e+o+'<div class="inner '+t.SHOW+'" role="listbox" aria-expanded="false" tabindex="-1"><ul class="'+t.MENU+" inner "+(r.major==="4"?t.SHOW:"")+'"><\/ul><\/div>'+h+"<\/div><\/div>";return n(c)},setPositionData:function(){var t,n,i;for(this.selectpicker.view.canHighlight=[],t=0;t<this.selectpicker.current.data.length;t++)n=this.selectpicker.current.data[t],i=!0,n.type==="divider"?(i=!1,n.height=this.sizeInfo.dividerHeight):n.type==="optgroup-label"?(i=!1,n.height=this.sizeInfo.dropdownHeaderHeight):n.height=this.sizeInfo.liHeight,n.disabled&&(i=!1),this.selectpicker.view.canHighlight.push(i),n.position=(t===0?0:this.selectpicker.current.data[t-1].position)+n.height},isVirtual:function(){return this.options.virtualScroll!==!1&&this.selectpicker.main.elements.length>=this.options.virtualScroll||this.options.virtualScroll===!0},createView:function(t,i){function o(n,i){var s=r.selectpicker.current.elements.length,b=[],y,p,g,nt,h=undefined,d,tt,it,rt=!0,l=r.isVirtual(),w,o,st,a,v;for(r.selectpicker.view.scrollTop=n,l===!0&&r.sizeInfo.hasScrollBar&&r.$menu[0].offsetWidth>r.sizeInfo.totalMenuWidth&&(r.sizeInfo.menuWidth=r.$menu[0].offsetWidth,r.sizeInfo.totalMenuWidth=r.sizeInfo.menuWidth+r.sizeInfo.scrollBarWidth,r.$menu.css("min-width",r.sizeInfo.menuWidth)),y=Math.ceil(r.sizeInfo.menuInnerHeight/r.sizeInfo.liHeight*1.5),p=Math.round(s/y)||1,o=0;o<p;o++){if(w=(o+1)*y,o===p-1&&(w=s),b[o]=[o*y+(o?1:0),w],!s)break;h===undefined&&n<=r.selectpicker.current.data[w-1].position-r.sizeInfo.menuInnerHeight&&(h=o)}if(h===undefined&&(h=0),d=[r.selectpicker.view.position0,r.selectpicker.view.position1],g=Math.max(0,h-1),nt=Math.min(p-1,h+1),r.selectpicker.view.position0=Math.max(0,b[g][0])||0,r.selectpicker.view.position1=Math.min(s,b[nt][1])||0,tt=d[0]!==r.selectpicker.view.position0||d[1]!==r.selectpicker.view.position1,r.activeIndex!==undefined&&(f=r.selectpicker.current.elements[r.selectpicker.current.map.newIndex[r.prevActiveIndex]],e=r.selectpicker.current.elements[r.selectpicker.current.map.newIndex[r.activeIndex]],u=r.selectpicker.current.elements[r.selectpicker.current.map.newIndex[r.selectedIndex]],i&&(r.activeIndex!==r.selectedIndex&&(e.classList.remove("active"),e.firstChild&&e.firstChild.classList.remove("active")),r.activeIndex=undefined),r.activeIndex&&r.activeIndex!==r.selectedIndex&&u&&u.length&&(u.classList.remove("active"),u.firstChild&&u.firstChild.classList.remove("active"))),r.prevActiveIndex!==undefined&&r.prevActiveIndex!==r.activeIndex&&r.prevActiveIndex!==r.selectedIndex&&f&&f.length&&(f.classList.remove("active"),f.firstChild&&f.firstChild.classList.remove("active")),(i||tt)&&(it=r.selectpicker.view.visibleElements?r.selectpicker.view.visibleElements.slice():[],r.selectpicker.view.visibleElements=r.selectpicker.current.elements.slice(r.selectpicker.view.position0,r.selectpicker.view.position1),r.setOptionStatus(),(t||l===!1&&i)&&(rt=!k(it,r.selectpicker.view.visibleElements)),(i||l===!0)&&rt)){var c=r.$menuInner[0],ut=document.createDocumentFragment(),ht=c.firstChild.cloneNode(!1),ft,et,ot=l===!0?r.selectpicker.view.visibleElements:r.selectpicker.current.elements;for(c.replaceChild(ht,c.firstChild),o=0,st=ot.length;o<st;o++)ut.appendChild(ot[o]);l===!0&&(ft=r.selectpicker.view.position0===0?0:r.selectpicker.current.data[r.selectpicker.view.position0-1].position,et=r.selectpicker.view.position1>s-1?0:r.selectpicker.current.data[s-1].position-r.selectpicker.current.data[r.selectpicker.view.position1-1].position,c.firstChild.style.marginTop=ft+"px",c.firstChild.style.marginBottom=et+"px");c.firstChild.appendChild(ut)}r.prevActiveIndex=r.activeIndex;r.options.liveSearch?t&&i&&(a=0,r.selectpicker.view.canHighlight[a]||(a=1+r.selectpicker.view.canHighlight.slice(1).indexOf(!0)),v=r.selectpicker.view.visibleElements[a],r.selectpicker.view.currentActive&&(r.selectpicker.view.currentActive.classList.remove("active"),r.selectpicker.view.currentActive.firstChild&&r.selectpicker.view.currentActive.firstChild.classList.remove("active")),v&&(v.classList.add("active"),v.firstChild&&v.firstChild.classList.add("active")),r.activeIndex=r.selectpicker.current.map.originalIndex[a]):r.$menuInner.focus()}var r,e,u,f;i=i||0;r=this;this.selectpicker.current=t?this.selectpicker.search:this.selectpicker.main;e=[];this.setPositionData();o(i,!0);this.$menuInner.off("scroll.createView").on("scroll.createView",function(n,t){r.noScroll||o(this.scrollTop,t);r.noScroll=!1});n(window).off("resize.createView").on("resize.createView",function(){o(r.$menuInner[0].scrollTop)})},createLi:function(){var h=this,e=[],w,y=0,b=0,u=[],o=0,p=0,f=-1,it,v;this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option"));var i={span:document.createElement("span"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode(" ")},k=i.span.cloneNode(!1),c=document.createDocumentFragment();k.className=h.options.iconBase+" "+h.options.tickIcon+" check-mark";i.a.appendChild(k);i.a.setAttribute("role","option");i.subtext.className="text-muted";i.text=i.span.cloneNode(!1);i.text.className="text";var l=function(n,t,r,u){var f=i.li.cloneNode(!1);return n&&(n.nodeType===1||n.nodeType===11?f.appendChild(n):f.innerHTML=n),typeof r!="undefined"&&""!==r&&(f.className=r),typeof u!="undefined"&&null!==u&&f.classList.add("optgroup-"+u),f},d=function(n,t,u){var f=i.a.cloneNode(!0);return n&&(n.nodeType===11?f.appendChild(n):f.insertAdjacentHTML("beforeend",n)),typeof t!="undefined"&""!==t&&(f.className=t),r.major==="4"&&f.classList.add("dropdown-item"),u&&f.setAttribute("style",u),f},g=function(n){var t=i.text.cloneNode(!1),r,u,f;return n.optionContent?t.innerHTML=n.optionContent:(t.textContent=n.text,n.optionIcon&&(f=i.whitespace.cloneNode(!1),u=i.span.cloneNode(!1),u.className=h.options.iconBase+" "+n.optionIcon,c.appendChild(u),c.appendChild(f)),n.optionSubtext&&(r=i.subtext.cloneNode(!1),r.innerHTML=n.optionSubtext,t.appendChild(r))),c.appendChild(t),c},rt=function(n){var t=i.text.cloneNode(!1),r,u,f;return t.innerHTML=n.labelEscaped,n.labelIcon&&(f=i.whitespace.cloneNode(!1),u=i.span.cloneNode(!1),u.className=h.options.iconBase+" "+n.labelIcon,c.appendChild(u),c.appendChild(f)),n.labelSubtext&&(r=i.subtext.cloneNode(!1),r.textContent=n.labelSubtext,t.appendChild(r)),c.appendChild(t),c};if(this.options.title&&!this.multiple){f--;var a=this.$element[0],nt=!1,tt=!this.selectpicker.view.titleOption.parentNode;tt&&(this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",it=n(a.options[a.selectedIndex]),nt=it.attr("selected")===undefined&&this.$element.data("selected")===undefined);(tt||this.selectpicker.view.titleOption.index!==0)&&a.insertBefore(this.selectpicker.view.titleOption,a.firstChild);nt&&(a.selectedIndex=0)}v=this.$element.find("option");v.each(function(i){var ft=n(this),yt,pt,ti,a,nt,tt;if(f++,!ft.hasClass("bs-title-option")){var r=ft.data(),wt=this.className||"",bt=s(this.style.cssText),et=r.content,ot=this.textContent,kt=r.tokens,st=r.subtext,lt=r.icon,it=ft.parent(),ut=it[0],at=ut.tagName==="OPTGROUP",dt=at&&ut.disabled,ht=this.disabled||dt,c,k=this.previousElementSibling&&this.previousElementSibling.tagName==="OPTGROUP",ct,vt=it.data();if(r.hidden===!0||h.options.hideDisabled&&(ht&&!at||dt)){c=r.prevHiddenIndex;ft.next().data("prevHiddenIndex",c!==undefined?c:i);f--;k||c!==undefined&&(a=v[c].previousElementSibling,a&&a.tagName==="OPTGROUP"&&!a.disabled&&(k=!0));k&&u[u.length-1].type!=="divider"&&(f++,e.push(l(!1,null,t.DIVIDER,o+"div")),u.push({type:"divider",optID:o}));return}if(at&&r.divider!==!0){if(h.options.hideDisabled&&ht&&(vt.allOptionsDisabled===undefined&&(yt=it.children(),it.data("allOptionsDisabled",yt.filter(":disabled").length===yt.length)),it.data("allOptionsDisabled"))){f--;return}if(pt=" "+ut.className||"",!this.previousElementSibling){o+=1;var ii=ut.label,gt=s(ii),ni=vt.subtext,ri=vt.icon;i!==0&&e.length>0&&(f++,e.push(l(!1,null,t.DIVIDER,o+"div")),u.push({type:"divider",optID:o}));f++;ti=rt({labelEscaped:gt,labelSubtext:ni,labelIcon:ri});e.push(l(ti,null,"dropdown-header"+pt,o));u.push({content:gt,subtext:ni,type:"optgroup-label",optID:o});p=f-1}if(h.options.hideDisabled&&ht||r.hidden===!0){f--;return}ct=g({text:ot,optionContent:et,optionSubtext:st,optionIcon:lt});e.push(l(d(ct,"opt "+wt+pt,bt),i,"",o));u.push({content:et||ot,subtext:st,tokens:kt,type:"option",optID:o,headerIndex:p,lastIndex:p+ut.childElementCount,originalIndex:i,data:r});y++}else r.divider===!0?(e.push(l(!1,i,t.DIVIDER)),u.push({type:"divider",originalIndex:i,data:r})):(!k&&h.options.hideDisabled&&(c=r.prevHiddenIndex,c!==undefined&&(a=v[c].previousElementSibling,a&&a.tagName==="OPTGROUP"&&!a.disabled&&(k=!0))),k&&u[u.length-1].type!=="divider"&&(f++,e.push(l(!1,null,t.DIVIDER,o+"div")),u.push({type:"divider",optID:o})),ct=g({text:ot,optionContent:et,optionSubtext:st,optionIcon:lt}),e.push(l(d(ct,wt,bt),i)),u.push({content:et||ot,subtext:st,tokens:kt,type:"option",originalIndex:i,data:r}),y++);h.selectpicker.main.map.newIndex[i]=f;h.selectpicker.main.map.originalIndex[f]=i;nt=u[u.length-1];nt.disabled=ht;tt=0;nt.content&&(tt+=nt.content.length);nt.subtext&&(tt+=nt.subtext.length);lt&&(tt+=1);tt>b&&(b=tt,w=e[e.length-1])}});this.selectpicker.main.elements=e;this.selectpicker.main.data=u;this.selectpicker.current=this.selectpicker.main;this.selectpicker.view.widestOption=w;this.selectpicker.view.availableOptionsCount=y},findLis:function(){return this.$menuInner.find(".inner > li")},render:function(){var i=this,p=this.$element.find("option"),r=[],e=[],f,h,c,n,u,l,a,v,t,o,s,y;for(this.togglePlaceholder(),this.tabIndex(),f=0,h=this.selectpicker.main.elements.length;f<h;f++)if(c=this.selectpicker.main.map.originalIndex[f],n=p[c],n&&n.selected&&(r.push(n),e.length<100&&i.options.selectedTextFormat!=="count"||r.length===1)){if(i.options.hideDisabled&&(n.disabled||n.parentNode.tagName==="OPTGROUP"&&n.parentNode.disabled))return;u=this.selectpicker.main.data[f].data;l=u.icon&&i.options.showIcon?'<i class="'+i.options.iconBase+" "+u.icon+'"><\/i> ':"";a=i.options.showSubtext&&u.subtext&&!i.multiple?' <small class="text-muted">'+u.subtext+"<\/small>":"";v=n.title?n.title:u.content&&i.options.showContent?u.content.toString():l+n.innerHTML.trim()+a;e.push(v)}t=this.multiple?e.join(this.options.multipleSeparator):e[0];r.length>50&&(t+="...");this.multiple&&this.options.selectedTextFormat.indexOf("count")!==-1&&(o=this.options.selectedTextFormat.split(">"),(o.length>1&&r.length>o[1]||o.length===1&&r.length>=2)&&(s=this.selectpicker.view.availableOptionsCount,y=typeof this.options.countSelectedText=="function"?this.options.countSelectedText(r.length,s):this.options.countSelectedText,t=y.replace("{0}",r.length.toString()).replace("{1}",s.toString())));this.options.title==undefined&&(this.options.title=this.$element.attr("title"));this.options.selectedTextFormat=="static"&&(t=this.options.title);t||(t=typeof this.options.title!="undefined"?this.options.title:this.options.noneSelectedText);this.$button[0].title=g(t.replace(/<[^>]*>?/g,"").trim());this.$button.find(".filter-option-inner-inner")[0].innerHTML=t;this.$element.trigger("rendered.bs.select")},setStyle:function(n,t){this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,""));var i=n?n:this.options.style;t=="add"?this.$button.addClass(i):t=="remove"?this.$button.removeClass(i):(this.$button.removeClass(this.options.style),this.$button.addClass(i))},liHeight:function(i){var d;if(i||this.options.size!==!1&&!this.sizeInfo){this.sizeInfo||(this.sizeInfo={});var c=document.createElement("div"),e=document.createElement("div"),a=document.createElement("div"),s=document.createElement("ul"),k=document.createElement("li"),l=document.createElement("li"),nt=document.createElement("li"),v=document.createElement("a"),y=document.createElement("span"),p=this.options.header&&this.$menu.find("."+t.POPOVERHEADER).length>0?this.$menu.find("."+t.POPOVERHEADER)[0].cloneNode(!0):null,h=this.options.liveSearch?document.createElement("div"):null,w=this.options.actionsBox&&this.multiple&&this.$menu.find(".bs-actionsbox").length>0?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,b=this.options.doneButton&&this.multiple&&this.$menu.find(".bs-donebutton").length>0?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null;this.sizeInfo.selectWidth=this.$newElement[0].offsetWidth;y.className="text";v.className="dropdown-item "+this.$element.find("option")[0].className;c.className=this.$menu[0].parentNode.className+" "+t.SHOW;c.style.width=this.sizeInfo.selectWidth+"px";this.options.width==="auto"&&(e.style.minWidth=0);e.className=t.MENU+" "+t.SHOW;a.className="inner "+t.SHOW;s.className=t.MENU+" inner "+(r.major==="4"?t.SHOW:"");k.className=t.DIVIDER;l.className="dropdown-header";y.appendChild(document.createTextNode("Inner text"));v.appendChild(y);nt.appendChild(v);l.appendChild(y.cloneNode(!0));this.selectpicker.view.widestOption&&s.appendChild(this.selectpicker.view.widestOption.cloneNode(!0));s.appendChild(nt);s.appendChild(k);s.appendChild(l);p&&e.appendChild(p);h&&(d=document.createElement("input"),h.className="bs-searchbox",d.className="form-control",h.appendChild(d),e.appendChild(h));w&&e.appendChild(w);a.appendChild(s);e.appendChild(a);b&&e.appendChild(b);c.appendChild(e);document.body.appendChild(c);var rt=v.offsetHeight,ut=l?l.offsetHeight:0,ft=p?p.offsetHeight:0,et=h?h.offsetHeight:0,ot=w?w.offsetHeight:0,st=b?b.offsetHeight:0,ht=n(k).outerHeight(!0),u=window.getComputedStyle?window.getComputedStyle(e):!1,tt=e.offsetWidth,o=u?null:n(e),g={vert:f(u?u.paddingTop:o.css("paddingTop"))+f(u?u.paddingBottom:o.css("paddingBottom"))+f(u?u.borderTopWidth:o.css("borderTopWidth"))+f(u?u.borderBottomWidth:o.css("borderBottomWidth")),horiz:f(u?u.paddingLeft:o.css("paddingLeft"))+f(u?u.paddingRight:o.css("paddingRight"))+f(u?u.borderLeftWidth:o.css("borderLeftWidth"))+f(u?u.borderRightWidth:o.css("borderRightWidth"))},ct={vert:g.vert+f(u?u.marginTop:o.css("marginTop"))+f(u?u.marginBottom:o.css("marginBottom"))+2,horiz:g.horiz+f(u?u.marginLeft:o.css("marginLeft"))+f(u?u.marginRight:o.css("marginRight"))+2},it;a.style.overflowY="scroll";it=e.offsetWidth-tt;document.body.removeChild(c);this.sizeInfo.liHeight=rt;this.sizeInfo.dropdownHeaderHeight=ut;this.sizeInfo.headerHeight=ft;this.sizeInfo.searchHeight=et;this.sizeInfo.actionsHeight=ot;this.sizeInfo.doneButtonHeight=st;this.sizeInfo.dividerHeight=ht;this.sizeInfo.menuPadding=g;this.sizeInfo.menuExtras=ct;this.sizeInfo.menuWidth=tt;this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth;this.sizeInfo.scrollBarWidth=it;this.sizeInfo.selectHeight=this.$newElement[0].offsetHeight;this.setPositionData()}},getSelectPosition:function(){var r=this,u=n(window),e=r.$newElement.offset(),f=n(r.options.container),t,i;r.options.container&&!f.is("body")?(t=f.offset(),t.top+=parseInt(f.css("borderTopWidth")),t.left+=parseInt(f.css("borderLeftWidth"))):t={top:0,left:0};i=r.options.windowPadding;this.sizeInfo.selectOffsetTop=e.top-t.top-u.scrollTop();this.sizeInfo.selectOffsetBot=u.height()-this.sizeInfo.selectOffsetTop-this.sizeInfo.selectHeight-t.top-i[2];this.sizeInfo.selectOffsetLeft=e.left-t.left-u.scrollLeft();this.sizeInfo.selectOffsetRight=u.width()-this.sizeInfo.selectOffsetLeft-this.sizeInfo.selectWidth-t.left-i[1];this.sizeInfo.selectOffsetTop-=i[0];this.sizeInfo.selectOffsetLeft-=i[3]},setMenuSize:function(){var u;this.getSelectPosition();var w=this.sizeInfo.selectWidth,v=this.sizeInfo.liHeight,f=this.sizeInfo.headerHeight,e=this.sizeInfo.searchHeight,o=this.sizeInfo.actionsHeight,s=this.sizeInfo.doneButtonHeight,b=this.sizeInfo.dividerHeight,i=this.sizeInfo.menuPadding,r,n,y=0,h,c,l,a,p;if(this.options.dropupAuto&&(p=v*this.selectpicker.current.elements.length+i.vert,this.$newElement.toggleClass(t.DROPUP,this.sizeInfo.selectOffsetTop-this.sizeInfo.selectOffsetBot>this.sizeInfo.menuExtras.vert&&p+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot)),this.options.size==="auto")c=this.selectpicker.current.elements.length>3?this.sizeInfo.liHeight*3+this.sizeInfo.menuExtras.vert-2:0,n=this.sizeInfo.selectOffsetBot-this.sizeInfo.menuExtras.vert,h=c+f+e+o+s,a=Math.max(c-i.vert,0),this.$newElement.hasClass(t.DROPUP)&&(n=this.sizeInfo.selectOffsetTop-this.sizeInfo.menuExtras.vert),l=n,r=n-f-e-o-s-i.vert;else if(this.options.size&&this.options.size!="auto"&&this.selectpicker.current.elements.length>this.options.size){for(u=0;u<this.options.size;u++)this.selectpicker.current.data[u].type==="divider"&&y++;n=v*this.options.size+y*b+i.vert;r=n-i.vert;l=n+f+e+o+s;h=a=""}this.options.dropdownAlignRight==="auto"&&this.$menu.toggleClass(t.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRight<this.$menu[0].offsetWidth-w);this.$menu.css({"max-height":l+"px",overflow:"hidden","min-height":h+"px"});this.$menuInner.css({"max-height":r+"px","overflow-y":"auto","min-height":a+"px"});this.sizeInfo.menuInnerHeight=r;this.selectpicker.current.data.length&&this.selectpicker.current.data[this.selectpicker.current.data.length-1].position>this.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth,this.$menu.css("min-width",this.sizeInfo.totalMenuWidth));this.dropdown&&this.dropdown._popper&&this.dropdown._popper.update()},setSize:function(t){if(this.liHeight(t),this.options.header&&this.$menu.css("padding-top",0),this.options.size!==!1){var i=this,f=n(window),u,r=0;if(this.setMenuSize(),this.options.size==="auto"){this.$searchbox.off("input.setMenuSize propertychange.setMenuSize").on("input.setMenuSize propertychange.setMenuSize",function(){return i.setMenuSize()});f.off("resize.setMenuSize scroll.setMenuSize").on("resize.setMenuSize scroll.setMenuSize",function(){return i.setMenuSize()})}else this.options.size&&this.options.size!="auto"&&this.selectpicker.current.elements.length>this.options.size&&(this.$searchbox.off("input.setMenuSize propertychange.setMenuSize"),f.off("resize.setMenuSize scroll.setMenuSize"));t?r=this.$menuInner[0].scrollTop:i.multiple||(u=i.selectpicker.main.map.newIndex[i.$element[0].selectedIndex],typeof u=="number"&&i.options.size!==!1&&(r=i.sizeInfo.liHeight*u,r=r-i.sizeInfo.menuInnerHeight/2+i.sizeInfo.liHeight/2));i.createView(!1,r)}},setWidth:function(){var n=this;this.options.width==="auto"?requestAnimationFrame(function(){n.$menu.css("min-width","0");n.liHeight();n.setMenuSize();var t=n.$newElement.clone().appendTo("body"),i=t.css("width","auto").children("button").outerWidth();t.remove();n.sizeInfo.selectWidth=Math.max(n.sizeInfo.totalMenuWidth,i);n.$newElement.css("width",n.sizeInfo.selectWidth+"px")}):this.options.width==="fit"?(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")&&this.options.width!=="fit"&&this.$newElement.removeClass("fit-width")},selectPosition:function(){this.$bsContainer=n('<div class="bs-container" />');var i=this,u=n(this.options.container),e,f,o,s=function(s){var h={},c=i.options.display||n.fn.dropdown.Constructor.Default.display;i.$bsContainer.addClass(s.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(t.DROPUP,s.hasClass(t.DROPUP));e=s.offset();u.is("body")?f={top:0,left:0}:(f=u.offset(),f.top+=parseInt(u.css("borderTopWidth"))-u.scrollTop(),f.left+=parseInt(u.css("borderLeftWidth"))-u.scrollLeft());o=s.hasClass(t.DROPUP)?0:s[0].offsetHeight;(r.major<4||c==="static")&&(h.top=e.top-f.top+o,h.left=e.left-f.left);h.width=s[0].offsetWidth;i.$bsContainer.css(h)};this.$button.on("click.bs.dropdown.data-api",function(){i.isDisabled()||(s(i.$newElement),i.$bsContainer.appendTo(i.options.container).toggleClass(t.SHOW,!i.$button.hasClass(t.SHOW)).append(i.$menu))});n(window).on("resize scroll",function(){s(i.$newElement)});this.$element.on("hide.bs.select",function(){i.$menu.data("height",i.$menu.height());i.$bsContainer.detach()})},setOptionStatus:function(){var n=this,e=this.$element.find("option"),r,i,t,u,f;if(n.noScroll=!1,n.selectpicker.view.visibleElements&&n.selectpicker.view.visibleElements.length)for(r=0;r<n.selectpicker.view.visibleElements.length;r++)i=n.selectpicker.current.map.originalIndex[r+n.selectpicker.view.position0],t=e[i],t&&(u=this.selectpicker.main.map.newIndex[i],f=this.selectpicker.main.elements[u],n.setDisabled(i,t.disabled||t.parentNode.tagName==="OPTGROUP"&&t.parentNode.disabled,u,f),n.setSelected(i,t.selected,u,f))},setSelected:function(n,t,i,r){var o=this.activeIndex!==undefined,h=this.activeIndex===n,s,u,f,e=h||t&&!this.multiple&&!o;i||(i=this.selectpicker.main.map.newIndex[n]);r||(r=this.selectpicker.main.elements[i]);f=r.firstChild;t&&(this.selectedIndex=n);r.classList.toggle("selected",t);r.classList.toggle("active",e);e&&(this.selectpicker.view.currentActive=r,this.activeIndex=n);f&&(f.classList.toggle("selected",t),f.classList.toggle("active",e),f.setAttribute("aria-selected",t));e||!o&&t&&this.prevActiveIndex!==undefined&&(s=this.selectpicker.main.map.newIndex[this.prevActiveIndex],u=this.selectpicker.main.elements[s],u.classList.toggle("selected",t),u.classList.remove("active"),u.firstChild&&(u.firstChild.classList.toggle("selected",t),u.firstChild.classList.remove("active")))},setDisabled:function(n,i,u,f){var e;u||(u=this.selectpicker.main.map.newIndex[n]);f||(f=this.selectpicker.main.elements[u]);e=f.firstChild;f.classList.toggle(t.DISABLED,i);e&&(r.major==="4"&&e.classList.toggle(t.DISABLED,i),e.setAttribute("aria-disabled",i),i?e.setAttribute("tabindex",-1):e.setAttribute("tabindex",0))},isDisabled:function(){return this.$element[0].disabled},checkDisabled:function(){var n=this;this.isDisabled()?(this.$newElement.addClass(t.DISABLED),this.$button.addClass(t.DISABLED).attr("tabindex",-1).attr("aria-disabled",!0)):(this.$button.hasClass(t.DISABLED)&&(this.$newElement.removeClass(t.DISABLED),this.$button.removeClass(t.DISABLED).attr("aria-disabled",!1)),this.$button.attr("tabindex")!=-1||this.$element.data("tabindex")||this.$button.removeAttr("tabindex"));this.$button.click(function(){return!n.isDisabled()})},togglePlaceholder:function(){var t=this.$element[0],i=t.selectedIndex,n=i===-1;n||t.options[i].value||(n=!0);this.$button.toggleClass("bs-placeholder",n)},tabIndex:function(){this.$element.data("tabindex")!==this.$element.attr("tabindex")&&this.$element.attr("tabindex")!==-98&&this.$element.attr("tabindex")!=="-98"&&(this.$element.data("tabindex",this.$element.attr("tabindex")),this.$button.attr("tabindex",this.$element.data("tabindex")));this.$element.attr("tabindex",-98)},clickListener:function(){function f(){i.options.liveSearch?i.$searchbox.focus():i.$menuInner.focus()}function e(){i.dropdown&&i.dropdown._popper&&i.dropdown._popper.state.isCreated?f():requestAnimationFrame(e)}var i=this,u=n(document);u.data("spaceSelect",!1);this.$button.on("keyup",function(n){/(32)/.test(n.keyCode.toString(10))&&u.data("spaceSelect")&&(n.preventDefault(),u.data("spaceSelect",!1))});this.$newElement.on("show.bs.dropdown",function(){r.major>3&&!i.dropdown&&(i.dropdown=i.$button.data("bs.dropdown"),i.dropdown._menu=i.$menu[0])});this.$button.on("click.bs.dropdown.data-api",function(){i.$newElement.hasClass(t.SHOW)||i.setSize()});this.$element.on("shown.bs.select",function(){i.$menuInner[0].scrollTop!==i.selectpicker.view.scrollTop&&(i.$menuInner[0].scrollTop=i.selectpicker.view.scrollTop);r.major>3?requestAnimationFrame(e):f()});this.$menuInner.on("click","li a",function(r,u){var w=n(this),et=i.isVirtual()?i.selectpicker.view.position0:0,s=i.selectpicker.current.map.originalIndex[w.parent().index()+et],it=h(i.$element[0]),ot=i.$element.prop("selectedIndex"),b=!0,k,d,l,ft;if(i.multiple&&i.options.maxOptions!==1&&r.stopPropagation(),r.preventDefault(),!i.isDisabled()&&!w.parent().hasClass(t.DISABLED)){var a=i.$element.find("option"),c=a.eq(s),rt=c.prop("selected"),y=c.parent("optgroup"),ut=y.find("option"),f=i.options.maxOptions,e=y.data("maxOptions")||!1;if(s===i.activeIndex&&(u=!0),u||(i.prevActiveIndex=i.activeIndex,i.activeIndex=undefined),i.multiple){if(c.prop("selected",!rt),i.setSelected(s,!rt),w.blur(),(f!==!1||e!==!1)&&(k=f<a.filter(":selected").length,d=e<y.find("option:selected").length,f&&k||e&&d))if(f&&f==1){for(a.prop("selected",!1),c.prop("selected",!0),l=0;l<a.length;l++)i.setSelected(l,!1);i.setSelected(s,!0)}else if(e&&e==1){for(y.find("option:selected").prop("selected",!1),c.prop("selected",!0),l=0;l<ut.length;l++)ft=ut[l],i.setSelected(a.index(ft),!1);i.setSelected(s,!0)}else{var g=typeof i.options.maxOptionsText=="string"?[i.options.maxOptionsText,i.options.maxOptionsText]:i.options.maxOptionsText,v=typeof g=="function"?g(f,e):g,nt=v[0].replace("{n}",f),tt=v[1].replace("{n}",e),p=n('<div class="notify"><\/div>');v[2]&&(nt=nt.replace("{var}",v[2][f>1?0:1]),tt=tt.replace("{var}",v[2][e>1?0:1]));c.prop("selected",!1);i.$menu.append(p);f&&k&&(p.append(n("<div>"+nt+"<\/div>")),b=!1,i.$element.trigger("maxReached.bs.select"));e&&d&&(p.append(n("<div>"+tt+"<\/div>")),b=!1,i.$element.trigger("maxReachedGrp.bs.select"));setTimeout(function(){i.setSelected(s,!1)},10);p.delay(750).fadeOut(300,function(){n(this).remove()})}}else a.prop("selected",!1),c.prop("selected",!0),i.setSelected(s,!0);!i.multiple||i.multiple&&i.options.maxOptions===1?i.$button.focus():i.options.liveSearch&&i.$searchbox.focus();b&&(it!=h(i.$element[0])&&i.multiple||ot!=i.$element.prop("selectedIndex")&&!i.multiple)&&(o=[s,c.prop("selected"),it],i.$element.triggerNative("change"))}});this.$menu.on("click","li."+t.DISABLED+" a, ."+t.POPOVERHEADER+", ."+t.POPOVERHEADER+" :not(.close)",function(t){t.currentTarget==this&&(t.preventDefault(),t.stopPropagation(),i.options.liveSearch&&!n(t.target).hasClass("close")?i.$searchbox.focus():i.$button.focus())});this.$menuInner.on("click",".divider, .dropdown-header",function(n){n.preventDefault();n.stopPropagation();i.options.liveSearch?i.$searchbox.focus():i.$button.focus()});this.$menu.on("click","."+t.POPOVERHEADER+" .close",function(){i.$button.click()});this.$searchbox.on("click",function(n){n.stopPropagation()});this.$menu.on("click",".actions-btn",function(t){i.options.liveSearch?i.$searchbox.focus():i.$button.focus();t.preventDefault();t.stopPropagation();n(this).hasClass("bs-select-all")?i.selectAll():i.deselectAll()});this.$element.on({change:function(){i.render();i.$element.trigger("changed.bs.select",o);o=null},focus:function(){i.$button.focus()}})},liveSearchListener:function(){var n=this,t=document.createElement("li");this.$button.on("click.bs.dropdown.data-api",function(){!n.$searchbox.val()||n.$searchbox.val("")});this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",function(n){n.stopPropagation()});this.$searchbox.on("input propertychange",function(){var o=n.$searchbox.val(),i,r,h;if(n.selectpicker.search.map.newIndex={},n.selectpicker.search.map.originalIndex={},n.selectpicker.search.elements=[],n.selectpicker.search.data=[],o){var r,e=[],a=o.toUpperCase(),u={},f=[],v=n._searchStyle(),p=n.options.liveSearchNormalize;for(n._$lisSelected=n.$menuInner.find(".selected"),r=0;r<n.selectpicker.main.data.length;r++)i=n.selectpicker.main.data[r],u[r]||(u[r]=y(i,a,v,p)),u[r]&&i.headerIndex!==undefined&&f.indexOf(i.headerIndex)===-1&&(i.headerIndex>0&&(u[i.headerIndex-1]=!0,f.push(i.headerIndex-1)),u[i.headerIndex]=!0,f.push(i.headerIndex),u[i.lastIndex+1]=!0),u[r]&&i.type!=="optgroup-label"&&f.push(r);for(r=0,h=f.length;r<h;r++){var c=f[r],w=f[r-1],i=n.selectpicker.main.data[c],l=n.selectpicker.main.data[w];(i.type!=="divider"||i.type==="divider"&&l&&l.type!=="divider"&&h-1!==r)&&(n.selectpicker.search.data.push(i),e.push(n.selectpicker.main.elements[c]),i.hasOwnProperty("originalIndex")&&(n.selectpicker.search.map.newIndex[i.originalIndex]=e.length-1,n.selectpicker.search.map.originalIndex[e.length-1]=i.originalIndex))}n.activeIndex=undefined;n.noScroll=!0;n.$menuInner.scrollTop(0);n.selectpicker.search.elements=e;n.createView(!0);e.length||(t.className="no-results",t.innerHTML=n.options.noneResultsText.replace("{0}",'"'+s(o)+'"'),n.$menuInner[0].firstChild.appendChild(t))}else n.$menuInner.scrollTop(0),n.createView(!1)})},_searchStyle:function(){return this.options.liveSearchStyle||"contains"},val:function(n){return typeof n!="undefined"?(this.$element.val(n).triggerNative("change"),this.$element):this.$element.val()},changeAll:function(n){var t;if(this.multiple){typeof n=="undefined"&&(n=!0);var f=this.$element.find("option"),r=0,u=0,e=h(this.$element[0]);for(this.$element.addClass("bs-select-hidden"),t=0;t<this.selectpicker.current.elements.length;t++){var s=this.selectpicker.current.data[t],c=this.selectpicker.current.map.originalIndex[t],i=f[c];i&&!i.disabled&&s.type!=="divider"&&(i.selected&&r++,i.selected=n,i.selected&&u++)}(this.$element.removeClass("bs-select-hidden"),r!==u)&&(this.setOptionStatus(),this.togglePlaceholder(),o=[null,null,e],this.$element.triggerNative("change"))}},selectAll:function(){return this.changeAll(!0)},deselectAll:function(){return this.changeAll(!1)},toggle:function(n){n=n||window.event;n&&n.stopPropagation();this.$button.trigger("click.bs.dropdown.data-api")},keydown:function(i){var a=n(this),ot=a.hasClass("dropdown-toggle"),lt=ot?a.closest(".dropdown"):a.closest(c.MENU),r=lt.data("this"),v=r.findLis(),f,g,e,o,h,b=!1,ft=i.which===u.TAB&&!ot&&!r.options.selectOnTab,st=it.test(i.which)||ft,tt=r.$menuInner[0].scrollTop,ht=r.isVirtual(),s=ht===!0?r.selectpicker.view.position0:0,p,et,w,k,d,ut,ct,l;if(g=r.$newElement.hasClass(t.SHOW),!g&&(st||i.which>=48&&i.which<=57||i.which>=96&&i.which<=105||i.which>=65&&i.which<=90)&&r.$button.trigger("click.bs.dropdown.data-api"),i.which===u.ESCAPE&&g&&(i.preventDefault(),r.$button.trigger("click.bs.dropdown.data-api").focus()),st){if(!v.length)return;f=ht===!0?v.index(v.filter(".active")):r.selectpicker.current.map.newIndex[r.activeIndex];f===undefined&&(f=-1);f!==-1&&(e=r.selectpicker.current.elements[f+s],e.classList.remove("active"),e.firstChild&&e.firstChild.classList.remove("active"));i.which===u.ARROW_UP?(f!==-1&&f--,f+s<0&&(f+=v.length),r.selectpicker.view.canHighlight[f+s]||(f=r.selectpicker.view.canHighlight.slice(0,f+s).lastIndexOf(!0)-s,f===-1&&(f=v.length-1))):(i.which===u.ARROW_DOWN||ft)&&(f++,f+s>=r.selectpicker.view.canHighlight.length&&(f=0),r.selectpicker.view.canHighlight[f+s]||(f=f+1+r.selectpicker.view.canHighlight.slice(f+s+1).indexOf(!0)));i.preventDefault();p=s+f;i.which===u.ARROW_UP?s===0&&f===v.length-1?(r.$menuInner[0].scrollTop=r.$menuInner[0].scrollHeight,p=r.selectpicker.current.elements.length-1):(o=r.selectpicker.current.data[p],h=o.position-o.height,b=h<tt):(i.which===u.ARROW_DOWN||ft)&&(f===0?(r.$menuInner[0].scrollTop=0,p=0):(o=r.selectpicker.current.data[p],h=o.position-r.sizeInfo.menuInnerHeight,b=h>tt));e=r.selectpicker.current.elements[p];e&&(e.classList.add("active"),e.firstChild&&e.firstChild.classList.add("active"));r.activeIndex=r.selectpicker.current.map.originalIndex[p];r.selectpicker.view.currentActive=e;b&&(r.$menuInner[0].scrollTop=h);r.options.liveSearch?r.$searchbox.focus():a.focus()}else if(!a.is("input")&&!rt.test(i.which)||i.which===u.SPACE&&r.selectpicker.keydown.keyHistory){for(w=[],i.preventDefault(),r.selectpicker.keydown.keyHistory+=nt[i.which],r.selectpicker.keydown.resetKeyHistory.cancel&&clearTimeout(r.selectpicker.keydown.resetKeyHistory.cancel),r.selectpicker.keydown.resetKeyHistory.cancel=r.selectpicker.keydown.resetKeyHistory.start(),k=r.selectpicker.keydown.keyHistory,/^(.)\1+$/.test(k)&&(k=k.charAt(0)),d=0;d<r.selectpicker.current.data.length;d++)ut=r.selectpicker.current.data[d],ct=y(ut,k,"startsWith",!0),ct&&r.selectpicker.view.canHighlight[d]&&(ut.index=d,w.push(ut.originalIndex));w.length&&(l=0,v.removeClass("active").find("a").removeClass("active"),k.length===1&&(l=w.indexOf(r.activeIndex),l===-1||l===w.length-1?l=0:l++),et=r.selectpicker.current.map.newIndex[w[l]],o=r.selectpicker.current.data[et],tt-o.position>0?(h=o.position-o.height,b=!0):(h=o.position-r.sizeInfo.menuInnerHeight,b=o.position>tt+r.sizeInfo.menuInnerHeight),e=r.selectpicker.current.elements[et],e.classList.add("active"),e.firstChild&&e.firstChild.classList.add("active"),r.activeIndex=w[l],e.firstChild.focus(),b&&(r.$menuInner[0].scrollTop=h),a.focus())}g&&(i.which===u.SPACE&&!r.selectpicker.keydown.keyHistory||i.which===u.ENTER||i.which===u.TAB&&r.options.selectOnTab)&&(i.which!==u.SPACE&&i.preventDefault(),r.options.liveSearch&&i.which===u.SPACE||(r.$menuInner.find(".active a").trigger("click",!0),a.focus(),r.options.liveSearch||(i.preventDefault(),n(document).data("spaceSelect",!0))))},mobile:function(){this.$element.addClass("mobile-device")},refresh:function(){var t=n.extend({},this.options,this.$element.data());this.options=t;this.selectpicker.main.map.newIndex={};this.selectpicker.main.map.originalIndex={};this.createLi();this.checkDisabled();this.render();this.setStyle();this.setWidth();this.setSize(!0);this.$element.trigger("refreshed.bs.select")},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove();this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove();this.$bsContainer?this.$bsContainer.remove():this.$menu.remove();this.$element.off(".bs.select").removeData("selectpicker").removeClass("bs-select-hidden selectpicker")}};b=n.fn.selectpicker;n.fn.selectpicker=w;n.fn.selectpicker.Constructor=i;n.fn.selectpicker.noConflict=function(){return n.fn.selectpicker=b,this};n(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.select",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bs-searchbox input',i.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bs-searchbox input',function(n){n.stopPropagation()});n(window).on("load.bs.select.data-api",function(){n(".selectpicker").each(function(){var t=n(this);w.call(t,t.data())})})})(n)})