function cbExtendObjects(){for(var t,n=1,i=arguments.length;i>n;n++)for(t in arguments[n])arguments[n].hasOwnProperty(t)&&(arguments[0][t]=arguments[n][t]);return arguments[0]}if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");if(+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"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(void 0!==i.style[n])return{end:t[n]};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),window.matchMedia=window.matchMedia||function(n){var u,i=n.documentElement,f=i.firstElementChild||i.firstChild,r=n.createElement("body"),t=n.createElement("div");return t.id="mq-test-1",t.style.cssText="position:absolute;top:-100em",r.style.background="none",r.appendChild(t),function(n){return t.innerHTML='&shy;<style media="'+n+'"> #mq-test-1 { width: 42px; }<\/style>',i.insertBefore(r,f),u=t.offsetWidth==42,i.removeChild(r),{matches:u,media:n}}}(document),function(n){function d(){a(!0)}if(n.respond={},respond.update=function(){},respond.mediaQueriesSupported=n.matchMedia&&n.matchMedia("only all").matches,!respond.mediaQueriesSupported){var t=n.document,i=t.documentElement,e=[],u=[],r=[],o={},v=30,f=t.getElementsByTagName("head")[0]||i,g=t.getElementsByTagName("base")[0],s=f.getElementsByTagName("link"),h=[],y=function(){for(var f=s,c=f.length,r=0,t,i,u,e;r<c;r++)t=f[r],i=t.href,u=t.media,e=t.rel&&t.rel.toLowerCase()==="stylesheet",!i||!e||o[i]||(t.styleSheet&&t.styleSheet.rawCssText?(w(t.styleSheet.rawCssText,i,u),o[i]=!0):(/^([a-zA-Z:]*\/\/)/.test(i)||g)&&i.replace(RegExp.$1,"").split("/")[0]!==n.location.host||h.push({href:i,media:u}));p()},p=function(){if(h.length){var n=h.shift();nt(n.href,function(t){w(t,n.href,n.media);o[n.href]=!0;p()})}},w=function(n,t,i){var o=n.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),s=o&&o.length||0,t=t.substring(0,t.lastIndexOf("/")),v=function(n){return n.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+t+"$2$3")},y=!s&&i,h=0,f,c,r,l,p;for(t.length&&(t+="/"),y&&(s=1);h<s;h++)for(f=0,y?(c=i,u.push(v(n))):(c=o[h].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,u.push(RegExp.$2&&v(RegExp.$2))),l=c.split(","),p=l.length;f<p;f++)r=l[f],e.push({media:r.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:u.length-1,hasquery:r.indexOf("(")>-1,minw:r.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:r.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")});a()},c,b,k=function(){var u,r=t.createElement("div"),n=t.body,f=!1;return r.style.cssText="position:absolute;font-size:1em;width:1em",n||(n=f=t.createElement("body"),n.style.background="none"),n.appendChild(r),i.insertBefore(n,i.firstChild),u=r.offsetWidth,f?i.removeChild(n):n.removeChild(r),l=parseFloat(u)},l,a=function(n){var nt="clientWidth",tt=i[nt],it=t.compatMode==="CSS1Compat"&&tt||t.body[nt]||tt,d={},ot=s[s.length-1],rt=(new Date).getTime(),o,h,g;if(n&&c&&rt-c<v){clearTimeout(b);b=setTimeout(a,v);return}c=rt;for(o in e){var y=e[o],p=y.minw,w=y.maxw,ut=p===null,ft=w===null,et="em";!p||(p=parseFloat(p)*(p.indexOf(et)>-1?l||k():1));!w||(w=parseFloat(w)*(w.indexOf(et)>-1?l||k():1));y.hasquery&&(ut&&ft||!(ut||it>=p)||!(ft||it<=w))||(d[y.media]||(d[y.media]=[]),d[y.media].push(u[y.rules]))}for(o in r)r[o]&&r[o].parentNode===f&&f.removeChild(r[o]);for(o in d)h=t.createElement("style"),g=d[o].join("\n"),h.type="text/css",h.media=o,f.insertBefore(h,ot.nextSibling),h.styleSheet?h.styleSheet.cssText=g:h.appendChild(t.createTextNode(g)),r.push(h)},nt=function(n,t){var i=tt();i&&(i.open("GET",n,!0),i.onreadystatechange=function(){i.readyState==4&&(i.status==200||i.status==304)&&t(i.responseText)},i.readyState!=4)&&i.send(null)},tt=function(){var n=!1;try{n=new XMLHttpRequest}catch(t){n=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return n}}();y();respond.update=y;n.addEventListener?n.addEventListener("resize",d,!1):n.attachEvent&&n.attachEvent("onresize",d)}}(this),function(n){n.widget("ech.notify",{options:{speed:500,expires:5e3,stack:"below",custom:!1,queue:!1},_create:function(){var t=this;this.templates={};this.keys=[];this.element.addClass("ui-notify").children().addClass("ui-notify-message ui-notify-message-style").each(function(i){i=this.id||i;t.keys.push(i);t.templates[i]=n(this).removeAttr("id").wrap("<div><\/div>").parent().html()}).end().empty().show()},create:function(t,i,r){return"object"==typeof t&&(r=i,i=t,t=null),t=this.templates[t||this.keys[0]],r&&r.custom&&(t=n(t).removeClass("ui-notify-message-style").wrap("<div><\/div>").parent().html()),this.openNotifications=this.openNotifications||0,new n.ech.notify.instance(this)._create(i,n.extend({},this.options,r),t)}});n.extend(n.ech.notify,{instance:function(n){this.__super=n;this.isOpen=!1}});n.extend(n.ech.notify.instance.prototype,{_create:function(t,i,r){this.options=i;var u=this,r=r.replace(/#(?:\{|%7B)(.*?)(?:\}|%7D)/g,function(n,i){return i in t?t[i]:""}),r=this.element=n(r),f=r.find(".ui-notify-close");return"function"==typeof this.options.click&&r.addClass("ui-notify-click").bind("click",function(n){u._trigger("click",n,u)}),f.length&&f.bind("click",function(){return u.close(),!1}),this.__super.element.queue("notify",function(){u.open();"number"==typeof i.expires&&0<i.expires&&setTimeout(n.proxy(u.close,u),i.expires)}),(!this.options.queue||this.__super.openNotifications<=this.options.queue-1)&&this.__super.element.dequeue("notify"),this},close:function(){var t=this.options.speed;return this.element.fadeTo(t,0).slideUp(t,n.proxy(function(){this._trigger("close");this.isOpen=!1;this.element.remove();this.__super.openNotifications-=1;this.__super.element.dequeue("notify")},this)),this},open:function(){if(this.isOpen||!1===this._trigger("beforeopen"))return this;var n=this;return this.__super.openNotifications+=1,this.element["above"===this.options.stack?"prependTo":"appendTo"](this.__super.element).css({display:"none",opacity:""}).fadeIn(this.options.speed,function(){n._trigger("open");n.isOpen=!0}),this},widget:function(){return this.element},_trigger:function(n,t,i){return this.__super._trigger.call(this,n,t,i)}})}(jQuery),!function(n,t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):n.lightbox=t(n.jQuery)}(this,function(n){function t(t){this.album=[];this.currentImageIndex=void 0;this.init();this.options=n.extend({},this.constructor.defaults);this.option(t)}return t.defaults={albumLabel:"Image %1 of %2",alwaysShowNavOnTouchDevices:!1,fadeDuration:500,fitImagesInViewport:!0,positionFromTop:50,resizeDuration:700,showImageNumberLabel:!0,wrapAround:!1,disableScrolling:!1},t.prototype.option=function(t){n.extend(this.options,t)},t.prototype.imageCountLabel=function(n,t){return this.options.albumLabel.replace(/%1/g,n).replace(/%2/g,t)},t.prototype.init=function(){this.enable();this.build()},t.prototype.enable=function(){var t=this;n("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",function(i){return t.start(n(i.currentTarget)),!1})},t.prototype.build=function(){var t=this;n('<div id="lightboxOverlay" class="lightboxOverlay"><\/div><div id="lightbox" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" /><div class="lb-nav"><a class="lb-prev" href="" ><\/a><a class="lb-next" href="" ><\/a><\/div><div class="lb-loader"><a class="lb-cancel"><\/a><\/div><\/div><\/div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"><\/span><span class="lb-number"><\/span><\/div><div class="lb-closeContainer"><a class="lb-close"><\/a><\/div><\/div><\/div><\/div>').appendTo(n("body"));this.$lightbox=n("#lightbox");this.$overlay=n("#lightboxOverlay");this.$outerContainer=this.$lightbox.find(".lb-outerContainer");this.$container=this.$lightbox.find(".lb-container");this.containerTopPadding=parseInt(this.$container.css("padding-top"),10);this.containerRightPadding=parseInt(this.$container.css("padding-right"),10);this.containerBottomPadding=parseInt(this.$container.css("padding-bottom"),10);this.containerLeftPadding=parseInt(this.$container.css("padding-left"),10);this.$overlay.hide().on("click",function(){return t.end(),!1});this.$lightbox.hide().on("click",function(i){return"lightbox"===n(i.target).attr("id")&&t.end(),!1});this.$outerContainer.on("click",function(i){return"lightbox"===n(i.target).attr("id")&&t.end(),!1});this.$lightbox.find(".lb-prev").on("click",function(){return 0===t.currentImageIndex?t.changeImage(t.album.length-1):t.changeImage(t.currentImageIndex-1),!1});this.$lightbox.find(".lb-next").on("click",function(){return t.currentImageIndex===t.album.length-1?t.changeImage(0):t.changeImage(t.currentImageIndex+1),!1});this.$lightbox.find(".lb-loader, .lb-close").on("click",function(){return t.end(),!1})},t.prototype.start=function(t){function e(n){l.album.push({link:n.attr("href"),title:n.attr("data-title")||n.attr("title")})}var l=this,o=n(window),i,f,s,r,u,h,c;if(o.on("resize",n.proxy(this.sizeOverlay,this)),n("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[],f=0,s=t.attr("data-lightbox"),s)for(i=n(t.prop("tagName")+'[data-lightbox="'+s+'"]'),r=0;r<i.length;r=++r)e(n(i[r])),i[r]===t[0]&&(f=r);else if("lightbox"===t.attr("rel"))e(t);else for(i=n(t.prop("tagName")+'[rel="'+t.attr("rel")+'"]'),u=0;u<i.length;u=++u)e(n(i[u])),i[u]===t[0]&&(f=u);h=o.scrollTop()+this.options.positionFromTop;c=o.scrollLeft();this.$lightbox.css({top:h+"px",left:c+"px"}).fadeIn(this.options.fadeDuration);this.options.disableScrolling&&n("body").addClass("lb-disable-scrolling");this.changeImage(f)},t.prototype.changeImage=function(t){var r=this,u,i;this.disableKeyboardNav();u=this.$lightbox.find(".lb-image");this.$overlay.fadeIn(this.options.fadeDuration);n(".lb-loader").fadeIn("slow");this.$lightbox.find(".lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption").hide();this.$outerContainer.addClass("animating");i=new Image;i.onload=function(){var l,e,o,s,f,h,c;u.attr("src",r.album[t].link);l=n(i);u.width(i.width);u.height(i.height);r.options.fitImagesInViewport&&(c=n(window).width(),h=n(window).height(),f=c-r.containerLeftPadding-r.containerRightPadding-20,s=h-r.containerTopPadding-r.containerBottomPadding-120,r.options.maxWidth&&r.options.maxWidth<f&&(f=r.options.maxWidth),r.options.maxHeight&&r.options.maxHeight<f&&(s=r.options.maxHeight),(i.width>f||i.height>s)&&(i.width/f>i.height/s?(o=f,e=parseInt(i.height/(i.width/o),10),u.width(o),u.height(e)):(e=s,o=parseInt(i.width/(i.height/e),10),u.width(o),u.height(e))));r.sizeContainer(u.width(),u.height())};i.src=this.album[t].link;this.currentImageIndex=t},t.prototype.sizeOverlay=function(){this.$overlay.width(n(document).width()).height(n(document).height())},t.prototype.sizeContainer=function(n,t){function f(){i.$lightbox.find(".lb-dataContainer").width(u);i.$lightbox.find(".lb-prevLink").height(r);i.$lightbox.find(".lb-nextLink").height(r);i.showImage()}var i=this,e=this.$outerContainer.outerWidth(),o=this.$outerContainer.outerHeight(),u=n+this.containerLeftPadding+this.containerRightPadding,r=t+this.containerTopPadding+this.containerBottomPadding;e!==u||o!==r?this.$outerContainer.animate({width:u,height:r},this.options.resizeDuration,"swing",function(){f()}):f()},t.prototype.showImage=function(){this.$lightbox.find(".lb-loader").stop(!0).hide();this.$lightbox.find(".lb-image").fadeIn("slow");this.updateNav();this.updateDetails();this.preloadNeighboringImages();this.enableKeyboardNav()},t.prototype.updateNav=function(){var n=!1;try{document.createEvent("TouchEvent");n=this.options.alwaysShowNavOnTouchDevices?!0:!1}catch(t){}this.$lightbox.find(".lb-nav").show();this.album.length>1&&(this.options.wrapAround?(n&&this.$lightbox.find(".lb-prev, .lb-next").css("opacity","1"),this.$lightbox.find(".lb-prev, .lb-next").show()):(this.currentImageIndex>0&&(this.$lightbox.find(".lb-prev").show(),n&&this.$lightbox.find(".lb-prev").css("opacity","1")),this.currentImageIndex<this.album.length-1&&(this.$lightbox.find(".lb-next").show(),n&&this.$lightbox.find(".lb-next").css("opacity","1"))))},t.prototype.updateDetails=function(){var i=this,t;("undefined"!=typeof this.album[this.currentImageIndex].title&&""!==this.album[this.currentImageIndex].title&&this.$lightbox.find(".lb-caption").html(this.album[this.currentImageIndex].title).fadeIn("fast").find("a").on("click",function(){void 0!==n(this).attr("target")?window.open(n(this).attr("href"),n(this).attr("target")):location.href=n(this).attr("href")}),this.album.length>1&&this.options.showImageNumberLabel)?(t=this.imageCountLabel(this.currentImageIndex+1,this.album.length),this.$lightbox.find(".lb-number").text(t).fadeIn("fast")):this.$lightbox.find(".lb-number").hide();this.$outerContainer.removeClass("animating");this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return i.sizeOverlay()})},t.prototype.preloadNeighboringImages=function(){var n,t;this.album.length>this.currentImageIndex+1&&(n=new Image,n.src=this.album[this.currentImageIndex+1].link);this.currentImageIndex>0&&(t=new Image,t.src=this.album[this.currentImageIndex-1].link)},t.prototype.enableKeyboardNav=function(){n(document).on("keyup.keyboard",n.proxy(this.keyboardAction,this))},t.prototype.disableKeyboardNav=function(){n(document).off(".keyboard")},t.prototype.keyboardAction=function(n){var t=n.keyCode,i=String.fromCharCode(t).toLowerCase();t===27||i.match(/x|o|c/)?this.end():"p"===i||t===37?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1):("n"===i||t===39)&&(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0))},t.prototype.end=function(){this.disableKeyboardNav();n(window).off("resize",this.sizeOverlay);this.$lightbox.fadeOut(this.options.fadeDuration);this.$overlay.fadeOut(this.options.fadeDuration);n("select, object, embed").css({visibility:"visible"});this.options.disableScrolling&&n("body").removeClass("lb-disable-scrolling")},new t}),function(n){n.getComputedStyle||(n.getComputedStyle=function(n){return this.el=n,this.getPropertyValue=function(t){var i=/(\-([a-z]){1})/g;return"float"==t&&(t="styleFloat"),i.test(t)&&(t=t.replace(i,function(){return arguments[2].toUpperCase()})),n.currentStyle[t]?n.currentStyle[t]:null},this})}(window),Function.prototype.bind||(Function.prototype.bind=function(n){"use strict";if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var r=Array.prototype.slice.call(arguments,1),u=this,t=function(){},i=function(){return u.apply(this instanceof t&&n?this:n,r.concat(Array.prototype.slice.call(arguments)))};return t.prototype=this.prototype,i.prototype=new t,i}),function(){"use strict";var n=Object.prototype,u=n.__defineGetter__,f=n.__defineSetter__,i=n.__lookupGetter__,r=n.__lookupSetter__,t=n.hasOwnProperty;u&&f&&i&&r&&(Object.defineProperty||(Object.defineProperty=function(n,e,o){if(arguments.length<3)throw new TypeError("Arguments not optional");if(e+="",t.call(o,"value")&&(i.call(n,e)||r.call(n,e)||(n[e]=o.value),t.call(o,"get")||t.call(o,"set")))throw new TypeError("Cannot specify an accessor and a value");if(!(o.writable&&o.enumerable&&o.configurable))throw new TypeError("This implementation of Object.defineProperty does not support false for configurable, enumerable, or writable.");return o.get&&u.call(n,e,o.get),o.set&&f.call(n,e,o.set),n}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(n,u){if(arguments.length<2)throw new TypeError("Arguments not optional.");u+="";var f={configurable:!0,enumerable:!0,writable:!0},e=i.call(n,u),o=r.call(n,u);return t.call(n,u)?e||o?(delete f.writable,f.get=f.set=void 0,e&&(f.get=e),o&&(f.set=o),f):(f.value=n[u],f):f}),Object.defineProperties||(Object.defineProperties=function(n,i){var r;for(r in i)t.call(i,r)&&Object.defineProperty(n,r,i[r])}))}(),!(document.documentElement.dataset||Object.getOwnPropertyDescriptor(Element.prototype,"dataset")&&Object.getOwnPropertyDescriptor(Element.prototype,"dataset").get)){var propDescriptor={enumerable:!0,get:function(){"use strict";var i,t,r,u,f,n,o=this,e=this.attributes,s=e.length,h=function(n){return n.charAt(1).toUpperCase()},c=function(){return this},l=function(n,t){return"undefined"!=typeof t?this.setAttribute(n,t):this.removeAttribute(n)};try{({}).__defineGetter__("test",function(){});t={}}catch(a){t=document.createElement("div")}for(i=0;s>i;i++)if(n=e[i],n&&n.name&&/^data-\w[\w\-]*$/.test(n.name)){r=n.value;u=n.name;f=u.substr(5).replace(/-./g,h);try{Object.defineProperty(t,f,{enumerable:this.enumerable,get:c.bind(r||""),set:l.bind(o,u)})}catch(v){t[f]=r}}return t}};try{Object.defineProperty(Element.prototype,"dataset",propDescriptor)}catch(e){propDescriptor.enumerable=!1;Object.defineProperty(Element.prototype,"dataset",propDescriptor)}}"document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var n=document.createElement("_"),t,i;(n.classList.add("c1","c2"),n.classList.contains("c2"))||(t=function(n){var t=DOMTokenList.prototype[n];DOMTokenList.prototype[n]=function(n){for(var r=arguments.length,i=0;r>i;i++)n=arguments[i],t.call(this,n)}},t("add"),t("remove"));(n.classList.toggle("c3",!1),n.classList.contains("c3"))&&(i=DOMTokenList.prototype.toggle,DOMTokenList.prototype.toggle=function(n,t){return 1 in arguments&&!this.contains(n)==!t?t:i.call(this,n)});n=null}():!function(n){"use strict";var f;if("Element"in n){var e="classList",t="prototype",o=n.Element[t],r=Object,l=String[t].trim||function(){return this.replace(/^\s+|\s+$/g,"")},a=Array[t].indexOf||function(n){for(var t=0,i=this.length;i>t;t++)if(t in this&&this[t]===n)return t;return-1},s=function(n,t){this.name=n;this.code=DOMException[n];this.message=t},u=function(n,t){if(""===t)throw new s("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new s("INVALID_CHARACTER_ERR","String contains an invalid character");return a.call(n,t)},h=function(n){for(var i=l.call(n.getAttribute("class")||""),r=i?i.split(/\s+/):[],t=0,u=r.length;u>t;t++)this.push(r[t]);this._updateClassName=function(){n.setAttribute("class",this.toString())}},i=h[t]=[],c=function(){return new h(this)};if(s[t]=Error[t],i.item=function(n){return this[n]||null},i.contains=function(n){return n+="",-1!==u(this,n)},i.add=function(){var n,t=arguments,i=0,f=t.length,r=!1;do n=t[i]+"",-1===u(this,n)&&(this.push(n),r=!0);while(++i<f);r&&this._updateClassName()},i.remove=function(){var t,n,i=arguments,r=0,e=i.length,f=!1;do for(t=i[r]+"",n=u(this,t);-1!==n;)this.splice(n,1),f=!0,n=u(this,t);while(++r<e);f&&this._updateClassName()},i.toggle=function(n,t){n+="";var i=this.contains(n),r=i?t!==!0&&"remove":t!==!1&&"add";return r&&this[r](n),t===!0||t===!1?t:!i},i.toString=function(){return this.join(" ")},r.defineProperty){f={get:c,enumerable:!0,configurable:!0};try{r.defineProperty(o,e,f)}catch(v){-2146823252===v.number&&(f.enumerable=!1,r.defineProperty(o,e,f))}}else r[t].__defineGetter__&&o.__defineGetter__(e,c)}}(self));String.prototype.trim||!function(){var n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;String.prototype.trim=function(){return this.replace(n,"")}}();Array.prototype.indexOf||(Array.prototype.indexOf=function(n,t){var r,f,u,i;if(null==this)throw new TypeError('"this" is null or not defined');if((f=Object(this),u=f.length>>>0,0===u)||(i=+t||0,Math.abs(i)===1/0&&(i=0),i>=u))return-1;for(r=Math.max(i>=0?i:u-Math.abs(i),0);u>r;){if(r in f&&f[r]===n)return r;r++}return-1});this.Element&&Element.prototype.attachEvent&&!Element.prototype.addEventListener&&function(){function t(n,t){Window.prototype[n]=HTMLDocument.prototype[n]=Element.prototype[n]=t}function n(){n.interval&&document.body&&(n.interval=clearInterval(n.interval),document.dispatchEvent(new CustomEvent("DOMContentLoaded")))}t("addEventListener",function(n,t){var i=this,u=i.addEventListener.listeners=i.addEventListener.listeners||{},r=u[n]=u[n]||[];r.length||i.attachEvent("on"+n,r.event=function(n){var f=i.document&&i.document.documentElement||i.documentElement||{scrollLeft:0,scrollTop:0},t,u;n.currentTarget=i;n.pageX=n.clientX+f.scrollLeft;n.pageY=n.clientY+f.scrollTop;n.preventDefault=function(){n.returnValue=!1};n.relatedTarget=n.fromElement||null;n.stopImmediatePropagation=function(){s=!1;n.cancelBubble=!0};n.stopPropagation=function(){n.cancelBubble=!0};n.target=n.srcElement||i;n.timeStamp=+new Date;for(var e,o=0,h=[].concat(r),s=!0;s&&(e=h[o]);++o)for(u=0;t=r[u];++u)if(t==e){t.call(i,n);break}});r.push(t)});t("removeEventListener",function(n,t){for(var f,r=this,e=r.addEventListener.listeners=r.addEventListener.listeners||{},i=e[n]=e[n]||[],u=i.length-1;f=i[u];--u)if(f==t){i.splice(u,1);break}!i.length&&i.event&&r.detachEvent("on"+n,i.event)});t("dispatchEvent",function(n){var t=this,i=n.type,r=t.addEventListener.listeners=t.addEventListener.listeners||{},u=r[i]=r[i]||[];try{return t.fireEvent("on"+i,n)}catch(f){return void(u.event&&u.event(n))}});Object.defineProperty(Window.prototype,"CustomEvent",{get:function(){var n=this;return function(t,i){var u,r=n.document.createEventObject();r.type=t;for(u in i)"cancelable"==u?r.returnValue=!i.cancelable:"bubbles"==u?r.cancelBubble=!i.bubbles:"detail"==u&&(r.detail=i.detail);return r}}});n.interval=setInterval(n,1);window.addEventListener("load",n)}();(!this.CustomEvent||"object"==typeof this.CustomEvent)&&function(){this.CustomEvent=function(n,t){var i;t=t||{bubbles:!1,cancelable:!1,detail:void 0};try{i=document.createEvent("CustomEvent");i.initCustomEvent(n,t.bubbles,t.cancelable,t.detail)}catch(r){i=document.createEvent("Event");i.initEvent(n,t.bubbles,t.cancelable);i.detail=t.detail}return i}}();Array.prototype.forEach||(Array.prototype.forEach=function(n,t){"use strict";var u,i,f,r,e;if(null==this)throw new TypeError("this is null or not defined");if(r=Object(this),e=r.length>>>0,"[object Function]"!=={}.toString.call(n))throw new TypeError(n+" is not a function");for(arguments.length>=2&&(u=t),i=0;e>i;)i in r&&(f=r[i],n.call(u,f,i,r)),i++}),function(n,t){try{n.querySelector(":scope body")}catch(i){["querySelector","querySelectorAll"].forEach(function(i){var r=t[i];t[i]=function(t){var u,f;return/(^|,)\s*:scope/.test(t)?(u=this.id,this.id="ID_"+Date.now(),t=t.replace(/((^|,)\s*):scope/g,"$1#"+this.id),f=n[i](t),this.id=u,f):r.call(this,t)}})}}(window.document,Element.prototype);-1===navigator.appVersion.indexOf("MSIE 8.")&&-1===navigator.appVersion.indexOf("MSIE 9.")&&(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(n){"use strict";var u,i,t,r,e;if(void 0===n||null===n)throw new TypeError("Cannot convert first argument to object");for(u=Object(n),i=1;i<arguments.length;i++)if(t=arguments[i],void 0!==t&&null!==t)for(var o=Object.keys(Object(t)),f=0,s=o.length;s>f;f++)r=o[f],e=Object.getOwnPropertyDescriptor(t,r),void 0!==e&&e.enumerable&&(u[r]=t[r]);return u}}));Array.isArray||(Array.isArray=function(n){return"[object Array]"===Object.prototype.toString.call(n)}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):n.Custombox=t()}(this,function(){"use strict";var i={target:null,cache:!1,escKey:!0,zIndex:9999,overlay:!0,overlayColor:"#000",overlayOpacity:.8,overlayClose:!0,overlaySpeed:300,overlayEffect:"auto",width:null,effect:"fadein",position:["center","center"],animation:null,speed:500,loading:!1,open:null,complete:null,close:null},n={oldIE:navigator.appVersion.indexOf("MSIE 8.")>-1||navigator.appVersion.indexOf("MSIE 9.")>-1,oldMobile:/(iPhone|iPad|iPod)\sOS\s6/.test(navigator.userAgent),overlay:{perspective:["letmein","makeway","slip"],together:["corner","slidetogether","scale","door","push","contentscale","simplegenie","slit","slip"]},modal:{position:["slide","flip","rotate"],animationend:["swell","rotatedown","flash"]}},t={set:function(t){var r;if(this.cb&&this.cb.length||(this.cb=[],this.item=-1),this.item++,t&&t.zIndex==="auto"){for(var u=0,f=0,e=document.getElementsByTagName("*"),o=e.length;f<o;f+=1)r=window.getComputedStyle(e[f]).getPropertyValue("z-index"),r&&(r=+r,r>u&&(u=r));t.zIndex=u}this.cb.push({settings:n.oldIE&&typeof cbExtendObjects!="undefined"?cbExtendObjects({},i,t):Object.assign({},i,t)});this.cb[this.item].settings.overlayEffect==="auto"&&(this.cb[this.item].settings.overlayEffect=this.cb[this.item].settings.effect)},isOpen:function(){return!(!this.cb||!this.cb.length)},get:function(){return this.cb[this.cb.length-1]||null},init:function(){document.documentElement.classList.add("custombox-open");document.documentElement.classList.add("custombox-open-"+this.cb[this.item].settings.overlayEffect);n.overlay.perspective.indexOf(this.cb[this.item].settings.overlayEffect)>-1&&(this.cb[this.item].scroll=document.documentElement&&document.documentElement.scrollTop||document.body&&document.body.scrollTop||0,document.documentElement.classList.add("custombox-perspective"),window.scrollTo(0,0));this.main||this.built("container");this.cb[this.item].settings.loading&&this.cb[this.item].settings.loading.parent&&this.built("loading");this.cb[this.item].settings.overlay?this.built("overlay").built("modal").open():this.built("modal").open();this.binds()},built:function(t){var i,u,f,s,r,h,o,e,c;typeof this.item!="undefined"&&(i=this.cb[this.item]);switch(t){case"container":for(this.main=document.createElement("div");document.body.firstChild;)this.main.appendChild(document.body.firstChild);document.body.appendChild(this.main);break;case"overlay":i.overlay||(i.overlay={});i.overlay=document.createElement("div");i.overlay.classList.add("custombox-overlay");i.overlay.classList.add("custombox-overlay-"+i.settings.overlayEffect);i.overlay.style.zIndex=i.settings.zIndex+2;i.overlay.style.backgroundColor=i.settings.overlayColor;n.overlay.perspective.indexOf(i.settings.overlayEffect)>-1||n.overlay.together.indexOf(i.settings.overlayEffect)>-1?i.overlay.style.opacity=i.settings.overlayOpacity:i.overlay.classList.add("custombox-overlay-default");i.overlay.style.transitionDuration=n.overlay.together.indexOf(i.settings.overlayEffect)>-1?i.settings.speed+"ms":i.settings.overlaySpeed+"ms";document.body.insertBefore(i.overlay,document.body.lastChild.nextSibling);break;case"modal":i.settings.overlayEffect==="push"&&(this.main.style.transitionDuration=i.settings.speed+"ms");this.main.classList.add("custombox-container");this.main.classList.add("custombox-container-"+i.settings.overlayEffect);i.wrapper=document.createElement("div");i.wrapper.classList.add("custombox-modal-wrapper");i.wrapper.classList.add("custombox-modal-wrapper-"+i.settings.effect);i.wrapper.style.zIndex=i.settings.zIndex+3;document.body.insertBefore(i.wrapper,document.body.lastChild.nextSibling);i.container=document.createElement("div");i.container.classList.add("custombox-modal-container");i.container.classList.add("custombox-modal-container-"+i.settings.effect);i.container.style.zIndex=i.settings.zIndex+4;n.modal.position.indexOf(i.settings.effect)>-1&&i.settings.animation===null&&(i.settings.animation=i.settings.effect==="slide"?["top"]:i.settings.effect==="flip"?["horizontal"]:["bottom"]);i.modal=document.createElement("div");i.modal.classList.add("custombox-modal");i.modal.classList.add("custombox-modal-"+i.settings.effect+(n.modal.position.indexOf(i.settings.effect)>-1?"-"+i.settings.animation[0].trim():""));i.modal.style.transitionDuration=i.settings.speed+"ms";i.modal.style.zIndex=i.settings.zIndex+4;i.wrapper.appendChild(i.container).appendChild(i.modal);break;case"loading":for(this.loading=document.createElement("div"),this.loading.classList.add("custombox-loading"),u=document.createElement("div"),f=0,s=this.cb[this.item].settings.loading.parent.length;f<s;f++)u.classList.add(this.cb[this.item].settings.loading.parent[f]);if(this.loading.appendChild(u),this.loading.style.zIndex=i.settings.zIndex+3,this.cb[this.item].settings.loading.childrens)for(r=0,h=this.cb[this.item].settings.loading.childrens.length;r<h;r++){for(o=document.createElement("div"),e=0,c=this.cb[this.item].settings.loading.childrens[r].length;e<c;e++)o.classList.add(this.cb[this.item].settings.loading.childrens[r][e]);u.appendChild(o)}document.body.appendChild(this.loading)}return this},load:function(){var n=this.cb[this.item],t;return typeof n.settings.open=="function"&&n.settings.open.call(),document.createEvent&&(t=document.createEvent("Event"),t.initEvent("custombox.open",!0,!0),document.dispatchEvent(t)),n.settings.target!==null&&Array.isArray(n.settings.position)?n.settings.target.charAt(0)==="#"||n.settings.target.charAt(0)==="."&&n.settings.target.charAt(1)!=="/"?document.querySelector(n.settings.target)?(n.inline=document.createElement("div"),n.content=document.querySelector(n.settings.target),n.display=n.content.style.display==="none",n.content.style.display="block",n.content.parentNode.insertBefore(n.inline,n.content),this.size()):this.error():this.ajax():this.error(),this},size:function(){var t=this.cb[this.item],u=t.content.offsetWidth,r;if(n.oldIE&&(window.innerHeight=document.documentElement.clientHeight),t.inline||(n.oldIE?t.content.style.styleFloat="none":t.content.style.cssFloat="none"),t.settings.width!==null&&(isNaN(t.settings.width)?(u=window.innerWidth,t.content.style.height=window.innerHeight+"px"):u=parseInt(t.settings.width,0)),t.size=u,t.size+60>=window.innerWidth){t.container.style.width="auto";t.settings.width!=="full"&&(t.container.style.margin="5%");t.wrapper.style.width=window.innerWidth+"px";for(var i=0,f=t.content.querySelectorAll(":scope > *"),e=f.length;i<e;i++)f[i].offsetWidth>window.innerWidth&&(f[i].style.width="auto")}else{switch(t.settings.position[0].trim()){case"left":t.container.style.marginLeft=0;break;case"right":t.container.style.marginRight=0}t.container.style.width=t.size+"px"}if(t.content.style.width="auto",t.modal.appendChild(t.content),t.content.offsetHeight>=window.innerHeight&&t.settings.width!=="full")t.container.style.marginTop="5%",t.container.style.marginBottom="5%";else{switch(t.settings.position[1].trim()){case"top":r=0;break;case"bottom":r=window.innerHeight-t.content.offsetHeight+"px";break;default:r=window.innerHeight/2-t.content.offsetHeight/2+"px"}t.container.style.marginTop=r}this.loading&&(document.body.removeChild(this.loading),delete this.loading);t.wrapper.classList.add("custombox-modal-open")},ajax:function(){var r=this,t=r.cb[r.item],i=new XMLHttpRequest,u=document.createElement("div");i.onreadystatechange=function(){i.readyState===4&&(i.status===200?(u.innerHTML=i.responseText,t.content=u,t.content.style.display="block",n.oldIE?t.content.style.styleFloat="left":t.content.style.cssFloat="left",t.container.appendChild(t.content),r.size()):r.error())};i.open("GET",t.settings.target+(t.settings.cache?"":(/[?].+=/.test(t.settings.target)?"&_=":"?_=")+Date.now()),!0);i.setRequestHeader("X-Requested-With","XMLHttpRequest");i.send(null)},scrollbar:function(){var n=document.createElement("div"),t;return n.classList.add("custombox-scrollbar"),document.body.appendChild(n),t=n.offsetWidth-n.clientWidth,document.body.removeChild(n),t},open:function(){var t=this,u=0,i=t.cb[t.item],f=t.scrollbar(),r;return f&&(document.body.style.paddingRight=f+"px"),t.main.classList.add("custombox-container-open"),t.cb[t.item].settings.loading&&(u=t.cb[t.item].settings.loading.delay&&!isNaN(t.cb[t.item].settings.loading.delay*1)?t.cb[t.item].settings.loading.delay*1:1e3),r=function(n){n&&i.overlay.removeEventListener("transitionend",r);t.load();i.inline&&i.wrapper.classList.add("custombox-modal-open")},i.settings.overlay?(n.overlay.perspective.indexOf(i.settings.overlayEffect)>-1||n.overlay.together.indexOf(i.settings.overlayEffect)>-1?i.overlay.classList.add("custombox-overlay-open"):i.overlay.style.opacity=i.settings.overlayOpacity,t.cb[t.item].settings.loading?setTimeout(r,u):n.overlay.together.indexOf(i.settings.overlayEffect)>-1||n.oldIE?r(!1):i.overlay.addEventListener("transitionend",r,!1)):t.cb[t.item].settings.loading?setTimeout(r,u):r(!1),t},clean:function(t){var r=this,i=this.cb[t],u;document.documentElement.classList.remove("custombox-open-"+i.settings.overlayEffect);i.settings.overlay&&(i.overlay.style.opacity&&(i.overlay.style.opacity=0),i.overlay.classList.remove("custombox-overlay-open"),r.main.classList.remove("custombox-container-open"));n.oldIE||n.oldMobile||!i.overlay?r.remove(t):(u=function(){i.overlay.removeEventListener("transitionend",u);r.remove(t)},i.overlay.addEventListener("transitionend",u,!1))},remove:function(t){var r=this,i=this.cb[t],u;if(i){if(r.cb.length===1&&(document.documentElement.classList.remove("custombox-open","custombox-perspective"),r.scrollbar()&&(document.body.style.paddingRight=0),typeof i.scroll!="undefined"&&window.scrollTo(0,i.scroll)),i.inline&&(n.oldIE?(i.content.style.removeAttribute("width"),i.content.style.removeAttribute("height"),i.content.style.removeAttribute("display")):(i.content.style.removeProperty("width"),i.content.style.removeProperty("height"),i.content.style.removeProperty("display")),i.display&&(i.content.style.display="none"),i.inline.parentNode.replaceChild(i.content,i.inline)),r.main.classList.remove("custombox-container-"+i.settings.overlayEffect),i.wrapper.parentNode.removeChild(i.wrapper),i.settings.overlay&&i.overlay.parentNode.removeChild(i.overlay),document.createEvent&&(u=document.createEvent("Event"),u.initEvent("custombox.close",!0,!0),document.dispatchEvent(u)),r.cb.length===1){for(var e=document.querySelectorAll(".custombox-container > *"),f=0,o=e.length;f<o;f++)document.body.insertBefore(e[f],r.main);r.main.parentNode&&r.main.parentNode.removeChild(r.main);delete r.main}r.cb.splice(t,1);typeof i.settings.close=="function"&&i.settings.close.call()}},close:function(t,i){var e=this,u,f,s,r,o;if(t){for(f=0,s=this.cb.length;f<s;f++)if(this.cb[f].settings.target===t){u=f;break}}else u=e.cb.length-1;r=e.cb[u];typeof i=="function"&&(r.settings.close=i);n.modal.position.indexOf(r.settings.effect)>-1&&r.settings.animation.length>1&&(r.modal.classList.remove("custombox-modal-"+r.settings.effect+"-"+r.settings.animation[0]),r.modal.classList.add("custombox-modal-"+r.settings.effect+"-"+r.settings.animation[1].trim()));r.wrapper.classList.remove("custombox-modal-open");n.oldIE||n.oldMobile||n.overlay.together.indexOf(r.settings.overlayEffect)>-1?e.clean(u):(o=function(){r.wrapper.removeEventListener("transitionend",o);e.clean(u)},n.modal.animationend.indexOf(r.settings.effect)>-1?r.wrapper.addEventListener("animationend",o,!1):r.wrapper.addEventListener("transitionend",o,!1))},responsive:function(){n.oldIE&&(window.innerHeight=document.documentElement.clientHeight);for(var t=0,r=this.cb.length,i;t<r;t++){if(this.cb[t].size+60>=window.innerWidth)this.cb[t].settings.width!=="full"?(this.cb[t].container.style.marginLeft="5%",this.cb[t].container.style.marginRight="5%"):this.cb[t].content.offsetWidth<=window.innerWidth&&(this.cb[t].content.style.width="auto"),this.cb[t].container.style.width="auto",this.cb[t].wrapper.style.width=window.innerWidth+"px";else{switch(this.cb[t].settings.position[0].trim()){case"left":this.cb[t].container.style.marginLeft=0;break;case"right":this.cb[t].container.style.marginRight=0;break;default:this.cb[t].container.style.marginLeft="auto";this.cb[t].container.style.marginRight="auto"}this.cb[t].container.style.width=this.cb[t].size+"px";this.cb[t].wrapper.style.width="auto"}if(this.cb[t].content.offsetHeight>=window.innerHeight&&this.cb[t].settings.width!=="full")this.cb[t].container.style.marginTop="5%",this.cb[t].container.style.marginBottom="5%";else{this.cb[t].settings.width==="full"&&(this.cb[t].settings.position[1]="top",this.cb[t].content.offsetHeight<=window.innerHeight&&(this.cb[t].content.style.height=window.innerHeight+"px"));switch(this.cb[t].settings.position[1].trim()){case"top":i=0;break;case"bottom":i=window.innerHeight-this.cb[t].content.offsetHeight+"px";break;default:i=window.innerHeight/2-this.cb[t].content.offsetHeight/2+"px"}this.cb[t].container.style.marginTop=i}}},binds:function(){var t=this,i=t.cb[t.item],r=!1,f,u;t.cb.length===1&&(t.esc=function(n){t.cb.length===1&&document.removeEventListener("keydown",t.esc);n=n||window.event;!r&&n.keyCode===27&&t.get()&&t.get().settings.escKey&&(r=!0,t.close())},document.addEventListener("keydown",t.esc,!1),window.addEventListener("onorientationchange"in window?"orientationchange":"resize",function(){t.responsive()},!1));i.wrapper.event=function(n){t.cb.length===1&&document.removeEventListener("keydown",i.wrapper.event);!r&&n.target===i.wrapper&&t.get()&&t.get().settings.overlayClose&&(r=!0,t.close())};i.wrapper.addEventListener("click",i.wrapper.event,!1);document.addEventListener("custombox.close",function(){r=!1});f=function(){var t;if(!i.inline)for(var n=0,r=i.modal.getElementsByTagName("script"),u=r.length;n<u;n++)new Function(r[n].text)();i.settings&&typeof i.settings.complete=="function"&&i.settings.complete.call();document.createEvent&&(t=document.createEvent("Event"),t.initEvent("custombox.complete",!0,!0),document.dispatchEvent(t))};u=function(){f();i.modal.removeEventListener("transitionend",u)};n.oldIE||n.oldMobile?setTimeout(function(){f()},i.settings.overlaySpeed):i.settings.effect!=="slit"?i.modal.addEventListener("transitionend",u,!1):i.modal.addEventListener("animationend",u,!1)},error:function(){var n=this,t=n.cb.length-1;alert("Error to load this target: "+n.cb[t].settings.target);n.remove(t)}};return{set:function(n){n.autobuild&&t.built("container")},open:function(n){t.set(n);t.init()},isOpen:function(){return t.isOpen()},size:function(){t.size()},close:function(n,i){typeof n=="function"&&(i=n,n=!1);t.close(n,i)}}})