+function(a){"use strict";var b=function(b,c){this.options=c,this.$element=a(b),this.$backdrop="",this.isshown=null,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};b.defaults={backdrop:!0,keyboard:!0,show:!0},b.prototype.toggle=function(a){return this[this.isshown?"hide":"show"](a)},b.prototype.show=function(b){var c=this,d=a.event("show.bs.modal",{relatedtarget:b});this.$element.trigger(d),this.isshown||d.isdefaultprevented()||(this.isshown=!0,this.escape(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var d=a.support.transition&&c.$element.hasclass("fade");c.$element.parent().length||c.$element.appendto(document.body),c.$element.show().scrolltop(0),d&&c.$element[0].offsetwidth,c.$element.addclass("in").attr("aria-hidden",!1),c.enforcefocus();var e=a.event("shown.bs.modal",{relatedtarget:b});d?c.$element.find(".modal-dialog").one(a.support.transition.end,function(){c.$element.focus().trigger(e)}).emulatetransitionend(300):c.$element.focus().trigger(e)}))},b.prototype.hide=function(b){b&&b.preventdefault(),b=a.event("hide.bs.modal"),this.$element.trigger(b),this.isshown&&!b.isdefaultprevented()&&(this.isshown=!1,this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeclass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),a.support.transition&&this.$element.hasclass("fade")?this.$element.one(a.support.transition.end,a.proxy(this.hidemodal,this)).emulatetransitionend(300):this.hidemodal())},b.prototype.enforcefocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.focus()},this))},b.prototype.escape=function(){this.isshown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isshown||this.$element.off("keyup.dismiss.bs.modal")},b.prototype.hidemodal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.removebackdrop(),a.$element.trigger("hidden.bs.modal")})},b.prototype.removebackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},b.prototype.backdrop=function(b){var c=this.$element.hasclass("fade")?"fade":"";if(this.isshown&&this.options.backdrop){var d=a.support.transition&&c;if(this.$backdrop=a('
').appendto(document.body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currenttarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),d&&this.$backdrop[0].offsetwidth,this.$backdrop.addclass("in"),!b)return;d?this.$backdrop.one(a.support.transition.end,b).emulatetransitionend(150):b()}else!this.isshown&&this.$backdrop?(this.$backdrop.removeclass("in"),a.support.transition&&this.$element.hasclass("fade")?this.$backdrop.one(a.support.transition.end,b).emulatetransitionend(150):b()):b&&b()};var c=a.fn.modal;a.fn.modal=function(c,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},b.defaults,e.data(),"object"==typeof c&&c);f||e.data("bs.modal",f=new b(this,g)),"string"==typeof c?f[c](d):g.show&&f.show(d)})},a.fn.modal.constructor=b,a.fn.modal.noconflict=function(){return a.fn.modal=c,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());c.is("a")&&b.preventdefault(),e.modal(f,this).one("hide",function(){c.is(":visible")&&c.focus()})}),a(document).on("show.bs.modal",".modal",function(){a(document.body).addclass("modal-open")}).on("hidden.bs.modal",".modal",function(){a(document.body).removeclass("modal-open")})}(jquery);