File indexing completed on 2025-02-09 07:15:20

0001 /*!
0002  * Bootstrap v3.3.7 (http://getbootstrap.com)
0003  * Copyright 2011-2016 Twitter, Inc.
0004  * Licensed under the MIT license
0005  */
0006 
0007 if (typeof jQuery === 'undefined') {
0008   throw new Error('Bootstrap\'s JavaScript requires jQuery')
0009 }
0010 
0011 +function ($) {
0012   'use strict';
0013   var version = $.fn.jquery.split(' ')[0].split('.')
0014   if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) {
0015     throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')
0016   }
0017 }(jQuery);
0018 
0019 /* ========================================================================
0020  * Bootstrap: transition.js v3.3.7
0021  * http://getbootstrap.com/javascript/#transitions
0022  * ========================================================================
0023  * Copyright 2011-2016 Twitter, Inc.
0024  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
0025  * ======================================================================== */
0026 
0027 
0028 +function ($) {
0029   'use strict';
0030 
0031   // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
0032   // ============================================================
0033 
0034   function transitionEnd() {
0035     var el = document.createElement('bootstrap')
0036 
0037     var transEndEventNames = {
0038       WebkitTransition : 'webkitTransitionEnd',
0039       MozTransition    : 'transitionend',
0040       OTransition      : 'oTransitionEnd otransitionend',
0041       transition       : 'transitionend'
0042     }
0043 
0044     for (var name in transEndEventNames) {
0045       if (el.style[name] !== undefined) {
0046         return { end: transEndEventNames[name] }
0047       }
0048     }
0049 
0050     return false // explicit for ie8 (  ._.)
0051   }
0052 
0053   // http://blog.alexmaccaw.com/css-transitions
0054   $.fn.emulateTransitionEnd = function (duration) {
0055     var called = false
0056     var $el = this
0057     $(this).one('bsTransitionEnd', function () { called = true })
0058     var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
0059     setTimeout(callback, duration)
0060     return this
0061   }
0062 
0063   $(function () {
0064     $.support.transition = transitionEnd()
0065 
0066     if (!$.support.transition) return
0067 
0068     $.event.special.bsTransitionEnd = {
0069       bindType: $.support.transition.end,
0070       delegateType: $.support.transition.end,
0071       handle: function (e) {
0072         if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
0073       }
0074     }
0075   })
0076 
0077 }(jQuery);
0078 
0079 /* ========================================================================
0080  * Bootstrap: alert.js v3.3.7
0081  * http://getbootstrap.com/javascript/#alerts
0082  * ========================================================================
0083  * Copyright 2011-2016 Twitter, Inc.
0084  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
0085  * ======================================================================== */
0086 
0087 
0088 +function ($) {
0089   'use strict';
0090 
0091   // ALERT CLASS DEFINITION
0092   // ======================
0093 
0094   var dismiss = '[data-dismiss="alert"]'
0095   var Alert   = function (el) {
0096     $(el).on('click', dismiss, this.close)
0097   }
0098 
0099   Alert.VERSION = '3.3.7'
0100 
0101   Alert.TRANSITION_DURATION = 150
0102 
0103   Alert.prototype.close = function (e) {
0104     var $this    = $(this)
0105     var selector = $this.attr('data-target')
0106 
0107     if (!selector) {
0108       selector = $this.attr('href')
0109       selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
0110     }
0111 
0112     var $parent = $(selector === '#' ? [] : selector)
0113 
0114     if (e) e.preventDefault()
0115 
0116     if (!$parent.length) {
0117       $parent = $this.closest('.alert')
0118     }
0119 
0120     $parent.trigger(e = $.Event('close.bs.alert'))
0121 
0122     if (e.isDefaultPrevented()) return
0123 
0124     $parent.removeClass('in')
0125 
0126     function removeElement() {
0127       // detach from parent, fire event then clean up data
0128       $parent.detach().trigger('closed.bs.alert').remove()
0129     }
0130 
0131     $.support.transition && $parent.hasClass('fade') ?
0132       $parent
0133         .one('bsTransitionEnd', removeElement)
0134         .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
0135       removeElement()
0136   }
0137 
0138 
0139   // ALERT PLUGIN DEFINITION
0140   // =======================
0141 
0142   function Plugin(option) {
0143     return this.each(function () {
0144       var $this = $(this)
0145       var data  = $this.data('bs.alert')
0146 
0147       if (!data) $this.data('bs.alert', (data = new Alert(this)))
0148       if (typeof option == 'string') data[option].call($this)
0149     })
0150   }
0151 
0152   var old = $.fn.alert
0153 
0154   $.fn.alert             = Plugin
0155   $.fn.alert.Constructor = Alert
0156 
0157 
0158   // ALERT NO CONFLICT
0159   // =================
0160 
0161   $.fn.alert.noConflict = function () {
0162     $.fn.alert = old
0163     return this
0164   }
0165 
0166 
0167   // ALERT DATA-API
0168   // ==============
0169 
0170   $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
0171 
0172 }(jQuery);
0173 
0174 /* ========================================================================
0175  * Bootstrap: button.js v3.3.7
0176  * http://getbootstrap.com/javascript/#buttons
0177  * ========================================================================
0178  * Copyright 2011-2016 Twitter, Inc.
0179  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
0180  * ======================================================================== */
0181 
0182 
0183 +function ($) {
0184   'use strict';
0185 
0186   // BUTTON PUBLIC CLASS DEFINITION
0187   // ==============================
0188 
0189   var Button = function (element, options) {
0190     this.$element  = $(element)
0191     this.options   = $.extend({}, Button.DEFAULTS, options)
0192     this.isLoading = false
0193   }
0194 
0195   Button.VERSION  = '3.3.7'
0196 
0197   Button.DEFAULTS = {
0198     loadingText: 'loading...'
0199   }
0200 
0201   Button.prototype.setState = function (state) {
0202     var d    = 'disabled'
0203     var $el  = this.$element
0204     var val  = $el.is('input') ? 'val' : 'html'
0205     var data = $el.data()
0206 
0207     state += 'Text'
0208 
0209     if (data.resetText == null) $el.data('resetText', $el[val]())
0210 
0211     // push to event loop to allow forms to submit
0212     setTimeout($.proxy(function () {
0213       $el[val](data[state] == null ? this.options[state] : data[state])
0214 
0215       if (state == 'loadingText') {
0216         this.isLoading = true
0217         $el.addClass(d).attr(d, d).prop(d, true)
0218       } else if (this.isLoading) {
0219         this.isLoading = false
0220         $el.removeClass(d).removeAttr(d).prop(d, false)
0221       }
0222     }, this), 0)
0223   }
0224 
0225   Button.prototype.toggle = function () {
0226     var changed = true
0227     var $parent = this.$element.closest('[data-toggle="buttons"]')
0228 
0229     if ($parent.length) {
0230       var $input = this.$element.find('input')
0231       if ($input.prop('type') == 'radio') {
0232         if ($input.prop('checked')) changed = false
0233         $parent.find('.active').removeClass('active')
0234         this.$element.addClass('active')
0235       } else if ($input.prop('type') == 'checkbox') {
0236         if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
0237         this.$element.toggleClass('active')
0238       }
0239       $input.prop('checked', this.$element.hasClass('active'))
0240       if (changed) $input.trigger('change')
0241     } else {
0242       this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
0243       this.$element.toggleClass('active')
0244     }
0245   }
0246 
0247 
0248   // BUTTON PLUGIN DEFINITION
0249   // ========================
0250 
0251   function Plugin(option) {
0252     return this.each(function () {
0253       var $this   = $(this)
0254       var data    = $this.data('bs.button')
0255       var options = typeof option == 'object' && option
0256 
0257       if (!data) $this.data('bs.button', (data = new Button(this, options)))
0258 
0259       if (option == 'toggle') data.toggle()
0260       else if (option) data.setState(option)
0261     })
0262   }
0263 
0264   var old = $.fn.button
0265 
0266   $.fn.button             = Plugin
0267   $.fn.button.Constructor = Button
0268 
0269 
0270   // BUTTON NO CONFLICT
0271   // ==================
0272 
0273   $.fn.button.noConflict = function () {
0274     $.fn.button = old
0275     return this
0276   }
0277 
0278 
0279   // BUTTON DATA-API
0280   // ===============
0281 
0282   $(document)
0283     .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
0284       var $btn = $(e.target).closest('.btn')
0285       Plugin.call($btn, 'toggle')
0286       if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) {
0287         // Prevent double click on radios, and the double selections (so cancellation) on checkboxes
0288         e.preventDefault()
0289         // The target component still receive the focus
0290         if ($btn.is('input,button')) $btn.trigger('focus')
0291         else $btn.find('input:visible,button:visible').first().trigger('focus')
0292       }
0293     })
0294     .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
0295       $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
0296     })
0297 
0298 }(jQuery);
0299 
0300 /* ========================================================================
0301  * Bootstrap: carousel.js v3.3.7
0302  * http://getbootstrap.com/javascript/#carousel
0303  * ========================================================================
0304  * Copyright 2011-2016 Twitter, Inc.
0305  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
0306  * ======================================================================== */
0307 
0308 
0309 +function ($) {
0310   'use strict';
0311 
0312   // CAROUSEL CLASS DEFINITION
0313   // =========================
0314 
0315   var Carousel = function (element, options) {
0316     this.$element    = $(element)
0317     this.$indicators = this.$element.find('.carousel-indicators')
0318     this.options     = options
0319     this.paused      = null
0320     this.sliding     = null
0321     this.interval    = null
0322     this.$active     = null
0323     this.$items      = null
0324 
0325     this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
0326 
0327     this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
0328       .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
0329       .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
0330   }
0331 
0332   Carousel.VERSION  = '3.3.7'
0333 
0334   Carousel.TRANSITION_DURATION = 600
0335 
0336   Carousel.DEFAULTS = {
0337     interval: 5000,
0338     pause: 'hover',
0339     wrap: true,
0340     keyboard: true
0341   }
0342 
0343   Carousel.prototype.keydown = function (e) {
0344     if (/input|textarea/i.test(e.target.tagName)) return
0345     switch (e.which) {
0346       case 37: this.prev(); break
0347       case 39: this.next(); break
0348       default: return
0349     }
0350 
0351     e.preventDefault()
0352   }
0353 
0354   Carousel.prototype.cycle = function (e) {
0355     e || (this.paused = false)
0356 
0357     this.interval && clearInterval(this.interval)
0358 
0359     this.options.interval
0360       && !this.paused
0361       && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
0362 
0363     return this
0364   }
0365 
0366   Carousel.prototype.getItemIndex = function (item) {
0367     this.$items = item.parent().children('.item')
0368     return this.$items.index(item || this.$active)
0369   }
0370 
0371   Carousel.prototype.getItemForDirection = function (direction, active) {
0372     var activeIndex = this.getItemIndex(active)
0373     var willWrap = (direction == 'prev' && activeIndex === 0)
0374                 || (direction == 'next' && activeIndex == (this.$items.length - 1))
0375     if (willWrap && !this.options.wrap) return active
0376     var delta = direction == 'prev' ? -1 : 1
0377     var itemIndex = (activeIndex + delta) % this.$items.length
0378     return this.$items.eq(itemIndex)
0379   }
0380 
0381   Carousel.prototype.to = function (pos) {
0382     var that        = this
0383     var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
0384 
0385     if (pos > (this.$items.length - 1) || pos < 0) return
0386 
0387     if (this.sliding)       return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
0388     if (activeIndex == pos) return this.pause().cycle()
0389 
0390     return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
0391   }
0392 
0393   Carousel.prototype.pause = function (e) {
0394     e || (this.paused = true)
0395 
0396     if (this.$element.find('.next, .prev').length && $.support.transition) {
0397       this.$element.trigger($.support.transition.end)
0398       this.cycle(true)
0399     }
0400 
0401     this.interval = clearInterval(this.interval)
0402 
0403     return this
0404   }
0405 
0406   Carousel.prototype.next = function () {
0407     if (this.sliding) return
0408     return this.slide('next')
0409   }
0410 
0411   Carousel.prototype.prev = function () {
0412     if (this.sliding) return
0413     return this.slide('prev')
0414   }
0415 
0416   Carousel.prototype.slide = function (type, next) {
0417     var $active   = this.$element.find('.item.active')
0418     var $next     = next || this.getItemForDirection(type, $active)
0419     var isCycling = this.interval
0420     var direction = type == 'next' ? 'left' : 'right'
0421     var that      = this
0422 
0423     if ($next.hasClass('active')) return (this.sliding = false)
0424 
0425     var relatedTarget = $next[0]
0426     var slideEvent = $.Event('slide.bs.carousel', {
0427       relatedTarget: relatedTarget,
0428       direction: direction
0429     })
0430     this.$element.trigger(slideEvent)
0431     if (slideEvent.isDefaultPrevented()) return
0432 
0433     this.sliding = true
0434 
0435     isCycling && this.pause()
0436 
0437     if (this.$indicators.length) {
0438       this.$indicators.find('.active').removeClass('active')
0439       var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
0440       $nextIndicator && $nextIndicator.addClass('active')
0441     }
0442 
0443     var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
0444     if ($.support.transition && this.$element.hasClass('slide')) {
0445       $next.addClass(type)
0446       $next[0].offsetWidth // force reflow
0447       $active.addClass(direction)
0448       $next.addClass(direction)
0449       $active
0450         .one('bsTransitionEnd', function () {
0451           $next.removeClass([type, direction].join(' ')).addClass('active')
0452           $active.removeClass(['active', direction].join(' '))
0453           that.sliding = false
0454           setTimeout(function () {
0455             that.$element.trigger(slidEvent)
0456           }, 0)
0457         })
0458         .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
0459     } else {
0460       $active.removeClass('active')
0461       $next.addClass('active')
0462       this.sliding = false
0463       this.$element.trigger(slidEvent)
0464     }
0465 
0466     isCycling && this.cycle()
0467 
0468     return this
0469   }
0470 
0471 
0472   // CAROUSEL PLUGIN DEFINITION
0473   // ==========================
0474 
0475   function Plugin(option) {
0476     return this.each(function () {
0477       var $this   = $(this)
0478       var data    = $this.data('bs.carousel')
0479       var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
0480       var action  = typeof option == 'string' ? option : options.slide
0481 
0482       if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
0483       if (typeof option == 'number') data.to(option)
0484       else if (action) data[action]()
0485       else if (options.interval) data.pause().cycle()
0486     })
0487   }
0488 
0489   var old = $.fn.carousel
0490 
0491   $.fn.carousel             = Plugin
0492   $.fn.carousel.Constructor = Carousel
0493 
0494 
0495   // CAROUSEL NO CONFLICT
0496   // ====================
0497 
0498   $.fn.carousel.noConflict = function () {
0499     $.fn.carousel = old
0500     return this
0501   }
0502 
0503 
0504   // CAROUSEL DATA-API
0505   // =================
0506 
0507   var clickHandler = function (e) {
0508     var href
0509     var $this   = $(this)
0510     var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
0511     if (!$target.hasClass('carousel')) return
0512     var options = $.extend({}, $target.data(), $this.data())
0513     var slideIndex = $this.attr('data-slide-to')
0514     if (slideIndex) options.interval = false
0515 
0516     Plugin.call($target, options)
0517 
0518     if (slideIndex) {
0519       $target.data('bs.carousel').to(slideIndex)
0520     }
0521 
0522     e.preventDefault()
0523   }
0524 
0525   $(document)
0526     .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
0527     .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
0528 
0529   $(window).on('load', function () {
0530     $('[data-ride="carousel"]').each(function () {
0531       var $carousel = $(this)
0532       Plugin.call($carousel, $carousel.data())
0533     })
0534   })
0535 
0536 }(jQuery);
0537 
0538 /* ========================================================================
0539  * Bootstrap: collapse.js v3.3.7
0540  * http://getbootstrap.com/javascript/#collapse
0541  * ========================================================================
0542  * Copyright 2011-2016 Twitter, Inc.
0543  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
0544  * ======================================================================== */
0545 
0546 /* jshint latedef: false */
0547 
0548 +function ($) {
0549   'use strict';
0550 
0551   // COLLAPSE PUBLIC CLASS DEFINITION
0552   // ================================
0553 
0554   var Collapse = function (element, options) {
0555     this.$element      = $(element)
0556     this.options       = $.extend({}, Collapse.DEFAULTS, options)
0557     this.$trigger      = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
0558                            '[data-toggle="collapse"][data-target="#' + element.id + '"]')
0559     this.transitioning = null
0560 
0561     if (this.options.parent) {
0562       this.$parent = this.getParent()
0563     } else {
0564       this.addAriaAndCollapsedClass(this.$element, this.$trigger)
0565     }
0566 
0567     if (this.options.toggle) this.toggle()
0568   }
0569 
0570   Collapse.VERSION  = '3.3.7'
0571 
0572   Collapse.TRANSITION_DURATION = 350
0573 
0574   Collapse.DEFAULTS = {
0575     toggle: true
0576   }
0577 
0578   Collapse.prototype.dimension = function () {
0579     var hasWidth = this.$element.hasClass('width')
0580     return hasWidth ? 'width' : 'height'
0581   }
0582 
0583   Collapse.prototype.show = function () {
0584     if (this.transitioning || this.$element.hasClass('in')) return
0585 
0586     var activesData
0587     var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
0588 
0589     if (actives && actives.length) {
0590       activesData = actives.data('bs.collapse')
0591       if (activesData && activesData.transitioning) return
0592     }
0593 
0594     var startEvent = $.Event('show.bs.collapse')
0595     this.$element.trigger(startEvent)
0596     if (startEvent.isDefaultPrevented()) return
0597 
0598     if (actives && actives.length) {
0599       Plugin.call(actives, 'hide')
0600       activesData || actives.data('bs.collapse', null)
0601     }
0602 
0603     var dimension = this.dimension()
0604 
0605     this.$element
0606       .removeClass('collapse')
0607       .addClass('collapsing')[dimension](0)
0608       .attr('aria-expanded', true)
0609 
0610     this.$trigger
0611       .removeClass('collapsed')
0612       .attr('aria-expanded', true)
0613 
0614     this.transitioning = 1
0615 
0616     var complete = function () {
0617       this.$element
0618         .removeClass('collapsing')
0619         .addClass('collapse in')[dimension]('')
0620       this.transitioning = 0
0621       this.$element
0622         .trigger('shown.bs.collapse')
0623     }
0624 
0625     if (!$.support.transition) return complete.call(this)
0626 
0627     var scrollSize = $.camelCase(['scroll', dimension].join('-'))
0628 
0629     this.$element
0630       .one('bsTransitionEnd', $.proxy(complete, this))
0631       .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
0632   }
0633 
0634   Collapse.prototype.hide = function () {
0635     if (this.transitioning || !this.$element.hasClass('in')) return
0636 
0637     var startEvent = $.Event('hide.bs.collapse')
0638     this.$element.trigger(startEvent)
0639     if (startEvent.isDefaultPrevented()) return
0640 
0641     var dimension = this.dimension()
0642 
0643     this.$element[dimension](this.$element[dimension]())[0].offsetHeight
0644 
0645     this.$element
0646       .addClass('collapsing')
0647       .removeClass('collapse in')
0648       .attr('aria-expanded', false)
0649 
0650     this.$trigger
0651       .addClass('collapsed')
0652       .attr('aria-expanded', false)
0653 
0654     this.transitioning = 1
0655 
0656     var complete = function () {
0657       this.transitioning = 0
0658       this.$element
0659         .removeClass('collapsing')
0660         .addClass('collapse')
0661         .trigger('hidden.bs.collapse')
0662     }
0663 
0664     if (!$.support.transition) return complete.call(this)
0665 
0666     this.$element
0667       [dimension](0)
0668       .one('bsTransitionEnd', $.proxy(complete, this))
0669       .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
0670   }
0671 
0672   Collapse.prototype.toggle = function () {
0673     this[this.$element.hasClass('in') ? 'hide' : 'show']()
0674   }
0675 
0676   Collapse.prototype.getParent = function () {
0677     return $(this.options.parent)
0678       .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
0679       .each($.proxy(function (i, element) {
0680         var $element = $(element)
0681         this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
0682       }, this))
0683       .end()
0684   }
0685 
0686   Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
0687     var isOpen = $element.hasClass('in')
0688 
0689     $element.attr('aria-expanded', isOpen)
0690     $trigger
0691       .toggleClass('collapsed', !isOpen)
0692       .attr('aria-expanded', isOpen)
0693   }
0694 
0695   function getTargetFromTrigger($trigger) {
0696     var href
0697     var target = $trigger.attr('data-target')
0698       || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
0699 
0700     return $(target)
0701   }
0702 
0703 
0704   // COLLAPSE PLUGIN DEFINITION
0705   // ==========================
0706 
0707   function Plugin(option) {
0708     return this.each(function () {
0709       var $this   = $(this)
0710       var data    = $this.data('bs.collapse')
0711       var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
0712 
0713       if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
0714       if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
0715       if (typeof option == 'string') data[option]()
0716     })
0717   }
0718 
0719   var old = $.fn.collapse
0720 
0721   $.fn.collapse             = Plugin
0722   $.fn.collapse.Constructor = Collapse
0723 
0724 
0725   // COLLAPSE NO CONFLICT
0726   // ====================
0727 
0728   $.fn.collapse.noConflict = function () {
0729     $.fn.collapse = old
0730     return this
0731   }
0732 
0733 
0734   // COLLAPSE DATA-API
0735   // =================
0736 
0737   $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
0738     var $this   = $(this)
0739 
0740     if (!$this.attr('data-target')) e.preventDefault()
0741 
0742     var $target = getTargetFromTrigger($this)
0743     var data    = $target.data('bs.collapse')
0744     var option  = data ? 'toggle' : $this.data()
0745 
0746     Plugin.call($target, option)
0747   })
0748 
0749 }(jQuery);
0750 
0751 /* ========================================================================
0752  * Bootstrap: dropdown.js v3.3.7
0753  * http://getbootstrap.com/javascript/#dropdowns
0754  * ========================================================================
0755  * Copyright 2011-2016 Twitter, Inc.
0756  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
0757  * ======================================================================== */
0758 
0759 
0760 +function ($) {
0761   'use strict';
0762 
0763   // DROPDOWN CLASS DEFINITION
0764   // =========================
0765 
0766   var backdrop = '.dropdown-backdrop'
0767   var toggle   = '[data-toggle="dropdown"]'
0768   var Dropdown = function (element) {
0769     $(element).on('click.bs.dropdown', this.toggle)
0770   }
0771 
0772   Dropdown.VERSION = '3.3.7'
0773 
0774   function getParent($this) {
0775     var selector = $this.attr('data-target')
0776 
0777     if (!selector) {
0778       selector = $this.attr('href')
0779       selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
0780     }
0781 
0782     var $parent = selector && $(selector)
0783 
0784     return $parent && $parent.length ? $parent : $this.parent()
0785   }
0786 
0787   function clearMenus(e) {
0788     if (e && e.which === 3) return
0789     $(backdrop).remove()
0790     $(toggle).each(function () {
0791       var $this         = $(this)
0792       var $parent       = getParent($this)
0793       var relatedTarget = { relatedTarget: this }
0794 
0795       if (!$parent.hasClass('open')) return
0796 
0797       if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
0798 
0799       $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
0800 
0801       if (e.isDefaultPrevented()) return
0802 
0803       $this.attr('aria-expanded', 'false')
0804       $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
0805     })
0806   }
0807 
0808   Dropdown.prototype.toggle = function (e) {
0809     var $this = $(this)
0810 
0811     if ($this.is('.disabled, :disabled')) return
0812 
0813     var $parent  = getParent($this)
0814     var isActive = $parent.hasClass('open')
0815 
0816     clearMenus()
0817 
0818     if (!isActive) {
0819       if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
0820         // if mobile we use a backdrop because click events don't delegate
0821         $(document.createElement('div'))
0822           .addClass('dropdown-backdrop')
0823           .insertAfter($(this))
0824           .on('click', clearMenus)
0825       }
0826 
0827       var relatedTarget = { relatedTarget: this }
0828       $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
0829 
0830       if (e.isDefaultPrevented()) return
0831 
0832       $this
0833         .trigger('focus')
0834         .attr('aria-expanded', 'true')
0835 
0836       $parent
0837         .toggleClass('open')
0838         .trigger($.Event('shown.bs.dropdown', relatedTarget))
0839     }
0840 
0841     return false
0842   }
0843 
0844   Dropdown.prototype.keydown = function (e) {
0845     if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
0846 
0847     var $this = $(this)
0848 
0849     e.preventDefault()
0850     e.stopPropagation()
0851 
0852     if ($this.is('.disabled, :disabled')) return
0853 
0854     var $parent  = getParent($this)
0855     var isActive = $parent.hasClass('open')
0856 
0857     if (!isActive && e.which != 27 || isActive && e.which == 27) {
0858       if (e.which == 27) $parent.find(toggle).trigger('focus')
0859       return $this.trigger('click')
0860     }
0861 
0862     var desc = ' li:not(.disabled):visible a'
0863     var $items = $parent.find('.dropdown-menu' + desc)
0864 
0865     if (!$items.length) return
0866 
0867     var index = $items.index(e.target)
0868 
0869     if (e.which == 38 && index > 0)                 index--         // up
0870     if (e.which == 40 && index < $items.length - 1) index++         // down
0871     if (!~index)                                    index = 0
0872 
0873     $items.eq(index).trigger('focus')
0874   }
0875 
0876 
0877   // DROPDOWN PLUGIN DEFINITION
0878   // ==========================
0879 
0880   function Plugin(option) {
0881     return this.each(function () {
0882       var $this = $(this)
0883       var data  = $this.data('bs.dropdown')
0884 
0885       if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
0886       if (typeof option == 'string') data[option].call($this)
0887     })
0888   }
0889 
0890   var old = $.fn.dropdown
0891 
0892   $.fn.dropdown             = Plugin
0893   $.fn.dropdown.Constructor = Dropdown
0894 
0895 
0896   // DROPDOWN NO CONFLICT
0897   // ====================
0898 
0899   $.fn.dropdown.noConflict = function () {
0900     $.fn.dropdown = old
0901     return this
0902   }
0903 
0904 
0905   // APPLY TO STANDARD DROPDOWN ELEMENTS
0906   // ===================================
0907 
0908   $(document)
0909     .on('click.bs.dropdown.data-api', clearMenus)
0910     .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
0911     .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
0912     .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
0913     .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
0914 
0915 }(jQuery);
0916 
0917 /* ========================================================================
0918  * Bootstrap: modal.js v3.3.7
0919  * http://getbootstrap.com/javascript/#modals
0920  * ========================================================================
0921  * Copyright 2011-2016 Twitter, Inc.
0922  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
0923  * ======================================================================== */
0924 
0925 
0926 +function ($) {
0927   'use strict';
0928 
0929   // MODAL CLASS DEFINITION
0930   // ======================
0931 
0932   var Modal = function (element, options) {
0933     this.options             = options
0934     this.$body               = $(document.body)
0935     this.$element            = $(element)
0936     this.$dialog             = this.$element.find('.modal-dialog')
0937     this.$backdrop           = null
0938     this.isShown             = null
0939     this.originalBodyPad     = null
0940     this.scrollbarWidth      = 0
0941     this.ignoreBackdropClick = false
0942 
0943     if (this.options.remote) {
0944       this.$element
0945         .find('.modal-content')
0946         .load(this.options.remote, $.proxy(function () {
0947           this.$element.trigger('loaded.bs.modal')
0948         }, this))
0949     }
0950   }
0951 
0952   Modal.VERSION  = '3.3.7'
0953 
0954   Modal.TRANSITION_DURATION = 300
0955   Modal.BACKDROP_TRANSITION_DURATION = 150
0956 
0957   Modal.DEFAULTS = {
0958     backdrop: true,
0959     keyboard: true,
0960     show: true
0961   }
0962 
0963   Modal.prototype.toggle = function (_relatedTarget) {
0964     return this.isShown ? this.hide() : this.show(_relatedTarget)
0965   }
0966 
0967   Modal.prototype.show = function (_relatedTarget) {
0968     var that = this
0969     var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
0970 
0971     this.$element.trigger(e)
0972 
0973     if (this.isShown || e.isDefaultPrevented()) return
0974 
0975     this.isShown = true
0976 
0977     this.checkScrollbar()
0978     this.setScrollbar()
0979     this.$body.addClass('modal-open')
0980 
0981     this.escape()
0982     this.resize()
0983 
0984     this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
0985 
0986     this.$dialog.on('mousedown.dismiss.bs.modal', function () {
0987       that.$element.one('mouseup.dismiss.bs.modal', function (e) {
0988         if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
0989       })
0990     })
0991 
0992     this.backdrop(function () {
0993       var transition = $.support.transition && that.$element.hasClass('fade')
0994 
0995       if (!that.$element.parent().length) {
0996         that.$element.appendTo(that.$body) // don't move modals dom position
0997       }
0998 
0999       that.$element
1000         .show()
1001         .scrollTop(0)
1002 
1003       that.adjustDialog()
1004 
1005       if (transition) {
1006         that.$element[0].offsetWidth // force reflow
1007       }
1008 
1009       that.$element.addClass('in')
1010 
1011       that.enforceFocus()
1012 
1013       var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
1014 
1015       transition ?
1016         that.$dialog // wait for modal to slide in
1017           .one('bsTransitionEnd', function () {
1018             that.$element.trigger('focus').trigger(e)
1019           })
1020           .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
1021         that.$element.trigger('focus').trigger(e)
1022     })
1023   }
1024 
1025   Modal.prototype.hide = function (e) {
1026     if (e) e.preventDefault()
1027 
1028     e = $.Event('hide.bs.modal')
1029 
1030     this.$element.trigger(e)
1031 
1032     if (!this.isShown || e.isDefaultPrevented()) return
1033 
1034     this.isShown = false
1035 
1036     this.escape()
1037     this.resize()
1038 
1039     $(document).off('focusin.bs.modal')
1040 
1041     this.$element
1042       .removeClass('in')
1043       .off('click.dismiss.bs.modal')
1044       .off('mouseup.dismiss.bs.modal')
1045 
1046     this.$dialog.off('mousedown.dismiss.bs.modal')
1047 
1048     $.support.transition && this.$element.hasClass('fade') ?
1049       this.$element
1050         .one('bsTransitionEnd', $.proxy(this.hideModal, this))
1051         .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
1052       this.hideModal()
1053   }
1054 
1055   Modal.prototype.enforceFocus = function () {
1056     $(document)
1057       .off('focusin.bs.modal') // guard against infinite focus loop
1058       .on('focusin.bs.modal', $.proxy(function (e) {
1059         if (document !== e.target &&
1060             this.$element[0] !== e.target &&
1061             !this.$element.has(e.target).length) {
1062           this.$element.trigger('focus')
1063         }
1064       }, this))
1065   }
1066 
1067   Modal.prototype.escape = function () {
1068     if (this.isShown && this.options.keyboard) {
1069       this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
1070         e.which == 27 && this.hide()
1071       }, this))
1072     } else if (!this.isShown) {
1073       this.$element.off('keydown.dismiss.bs.modal')
1074     }
1075   }
1076 
1077   Modal.prototype.resize = function () {
1078     if (this.isShown) {
1079       $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
1080     } else {
1081       $(window).off('resize.bs.modal')
1082     }
1083   }
1084 
1085   Modal.prototype.hideModal = function () {
1086     var that = this
1087     this.$element.hide()
1088     this.backdrop(function () {
1089       that.$body.removeClass('modal-open')
1090       that.resetAdjustments()
1091       that.resetScrollbar()
1092       that.$element.trigger('hidden.bs.modal')
1093     })
1094   }
1095 
1096   Modal.prototype.removeBackdrop = function () {
1097     this.$backdrop && this.$backdrop.remove()
1098     this.$backdrop = null
1099   }
1100 
1101   Modal.prototype.backdrop = function (callback) {
1102     var that = this
1103     var animate = this.$element.hasClass('fade') ? 'fade' : ''
1104 
1105     if (this.isShown && this.options.backdrop) {
1106       var doAnimate = $.support.transition && animate
1107 
1108       this.$backdrop = $(document.createElement('div'))
1109         .addClass('modal-backdrop ' + animate)
1110         .appendTo(this.$body)
1111 
1112       this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
1113         if (this.ignoreBackdropClick) {
1114           this.ignoreBackdropClick = false
1115           return
1116         }
1117         if (e.target !== e.currentTarget) return
1118         this.options.backdrop == 'static'
1119           ? this.$element[0].focus()
1120           : this.hide()
1121       }, this))
1122 
1123       if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
1124 
1125       this.$backdrop.addClass('in')
1126 
1127       if (!callback) return
1128 
1129       doAnimate ?
1130         this.$backdrop
1131           .one('bsTransitionEnd', callback)
1132           .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
1133         callback()
1134 
1135     } else if (!this.isShown && this.$backdrop) {
1136       this.$backdrop.removeClass('in')
1137 
1138       var callbackRemove = function () {
1139         that.removeBackdrop()
1140         callback && callback()
1141       }
1142       $.support.transition && this.$element.hasClass('fade') ?
1143         this.$backdrop
1144           .one('bsTransitionEnd', callbackRemove)
1145           .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
1146         callbackRemove()
1147 
1148     } else if (callback) {
1149       callback()
1150     }
1151   }
1152 
1153   // these following methods are used to handle overflowing modals
1154 
1155   Modal.prototype.handleUpdate = function () {
1156     this.adjustDialog()
1157   }
1158 
1159   Modal.prototype.adjustDialog = function () {
1160     var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
1161 
1162     this.$element.css({
1163       paddingLeft:  !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
1164       paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
1165     })
1166   }
1167 
1168   Modal.prototype.resetAdjustments = function () {
1169     this.$element.css({
1170       paddingLeft: '',
1171       paddingRight: ''
1172     })
1173   }
1174 
1175   Modal.prototype.checkScrollbar = function () {
1176     var fullWindowWidth = window.innerWidth
1177     if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
1178       var documentElementRect = document.documentElement.getBoundingClientRect()
1179       fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
1180     }
1181     this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
1182     this.scrollbarWidth = this.measureScrollbar()
1183   }
1184 
1185   Modal.prototype.setScrollbar = function () {
1186     var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
1187     this.originalBodyPad = document.body.style.paddingRight || ''
1188     if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
1189   }
1190 
1191   Modal.prototype.resetScrollbar = function () {
1192     this.$body.css('padding-right', this.originalBodyPad)
1193   }
1194 
1195   Modal.prototype.measureScrollbar = function () { // thx walsh
1196     var scrollDiv = document.createElement('div')
1197     scrollDiv.className = 'modal-scrollbar-measure'
1198     this.$body.append(scrollDiv)
1199     var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
1200     this.$body[0].removeChild(scrollDiv)
1201     return scrollbarWidth
1202   }
1203 
1204 
1205   // MODAL PLUGIN DEFINITION
1206   // =======================
1207 
1208   function Plugin(option, _relatedTarget) {
1209     return this.each(function () {
1210       var $this   = $(this)
1211       var data    = $this.data('bs.modal')
1212       var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
1213 
1214       if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
1215       if (typeof option == 'string') data[option](_relatedTarget)
1216       else if (options.show) data.show(_relatedTarget)
1217     })
1218   }
1219 
1220   var old = $.fn.modal
1221 
1222   $.fn.modal             = Plugin
1223   $.fn.modal.Constructor = Modal
1224 
1225 
1226   // MODAL NO CONFLICT
1227   // =================
1228 
1229   $.fn.modal.noConflict = function () {
1230     $.fn.modal = old
1231     return this
1232   }
1233 
1234 
1235   // MODAL DATA-API
1236   // ==============
1237 
1238   $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
1239     var $this   = $(this)
1240     var href    = $this.attr('href')
1241     var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
1242     var option  = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
1243 
1244     if ($this.is('a')) e.preventDefault()
1245 
1246     $target.one('show.bs.modal', function (showEvent) {
1247       if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
1248       $target.one('hidden.bs.modal', function () {
1249         $this.is(':visible') && $this.trigger('focus')
1250       })
1251     })
1252     Plugin.call($target, option, this)
1253   })
1254 
1255 }(jQuery);
1256 
1257 /* ========================================================================
1258  * Bootstrap: tooltip.js v3.3.7
1259  * http://getbootstrap.com/javascript/#tooltip
1260  * Inspired by the original jQuery.tipsy by Jason Frame
1261  * ========================================================================
1262  * Copyright 2011-2016 Twitter, Inc.
1263  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1264  * ======================================================================== */
1265 
1266 
1267 +function ($) {
1268   'use strict';
1269 
1270   // TOOLTIP PUBLIC CLASS DEFINITION
1271   // ===============================
1272 
1273   var Tooltip = function (element, options) {
1274     this.type       = null
1275     this.options    = null
1276     this.enabled    = null
1277     this.timeout    = null
1278     this.hoverState = null
1279     this.$element   = null
1280     this.inState    = null
1281 
1282     this.init('tooltip', element, options)
1283   }
1284 
1285   Tooltip.VERSION  = '3.3.7'
1286 
1287   Tooltip.TRANSITION_DURATION = 150
1288 
1289   Tooltip.DEFAULTS = {
1290     animation: true,
1291     placement: 'top',
1292     selector: false,
1293     template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
1294     trigger: 'hover focus',
1295     title: '',
1296     delay: 0,
1297     html: false,
1298     container: false,
1299     viewport: {
1300       selector: 'body',
1301       padding: 0
1302     }
1303   }
1304 
1305   Tooltip.prototype.init = function (type, element, options) {
1306     this.enabled   = true
1307     this.type      = type
1308     this.$element  = $(element)
1309     this.options   = this.getOptions(options)
1310     this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
1311     this.inState   = { click: false, hover: false, focus: false }
1312 
1313     if (this.$element[0] instanceof document.constructor && !this.options.selector) {
1314       throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
1315     }
1316 
1317     var triggers = this.options.trigger.split(' ')
1318 
1319     for (var i = triggers.length; i--;) {
1320       var trigger = triggers[i]
1321 
1322       if (trigger == 'click') {
1323         this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1324       } else if (trigger != 'manual') {
1325         var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focusin'
1326         var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
1327 
1328         this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1329         this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1330       }
1331     }
1332 
1333     this.options.selector ?
1334       (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1335       this.fixTitle()
1336   }
1337 
1338   Tooltip.prototype.getDefaults = function () {
1339     return Tooltip.DEFAULTS
1340   }
1341 
1342   Tooltip.prototype.getOptions = function (options) {
1343     options = $.extend({}, this.getDefaults(), this.$element.data(), options)
1344 
1345     if (options.delay && typeof options.delay == 'number') {
1346       options.delay = {
1347         show: options.delay,
1348         hide: options.delay
1349       }
1350     }
1351 
1352     return options
1353   }
1354 
1355   Tooltip.prototype.getDelegateOptions = function () {
1356     var options  = {}
1357     var defaults = this.getDefaults()
1358 
1359     this._options && $.each(this._options, function (key, value) {
1360       if (defaults[key] != value) options[key] = value
1361     })
1362 
1363     return options
1364   }
1365 
1366   Tooltip.prototype.enter = function (obj) {
1367     var self = obj instanceof this.constructor ?
1368       obj : $(obj.currentTarget).data('bs.' + this.type)
1369 
1370     if (!self) {
1371       self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
1372       $(obj.currentTarget).data('bs.' + this.type, self)
1373     }
1374 
1375     if (obj instanceof $.Event) {
1376       self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
1377     }
1378 
1379     if (self.tip().hasClass('in') || self.hoverState == 'in') {
1380       self.hoverState = 'in'
1381       return
1382     }
1383 
1384     clearTimeout(self.timeout)
1385 
1386     self.hoverState = 'in'
1387 
1388     if (!self.options.delay || !self.options.delay.show) return self.show()
1389 
1390     self.timeout = setTimeout(function () {
1391       if (self.hoverState == 'in') self.show()
1392     }, self.options.delay.show)
1393   }
1394 
1395   Tooltip.prototype.isInStateTrue = function () {
1396     for (var key in this.inState) {
1397       if (this.inState[key]) return true
1398     }
1399 
1400     return false
1401   }
1402 
1403   Tooltip.prototype.leave = function (obj) {
1404     var self = obj instanceof this.constructor ?
1405       obj : $(obj.currentTarget).data('bs.' + this.type)
1406 
1407     if (!self) {
1408       self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
1409       $(obj.currentTarget).data('bs.' + this.type, self)
1410     }
1411 
1412     if (obj instanceof $.Event) {
1413       self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
1414     }
1415 
1416     if (self.isInStateTrue()) return
1417 
1418     clearTimeout(self.timeout)
1419 
1420     self.hoverState = 'out'
1421 
1422     if (!self.options.delay || !self.options.delay.hide) return self.hide()
1423 
1424     self.timeout = setTimeout(function () {
1425       if (self.hoverState == 'out') self.hide()
1426     }, self.options.delay.hide)
1427   }
1428 
1429   Tooltip.prototype.show = function () {
1430     var e = $.Event('show.bs.' + this.type)
1431 
1432     if (this.hasContent() && this.enabled) {
1433       this.$element.trigger(e)
1434 
1435       var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
1436       if (e.isDefaultPrevented() || !inDom) return
1437       var that = this
1438 
1439       var $tip = this.tip()
1440 
1441       var tipId = this.getUID(this.type)
1442 
1443       this.setContent()
1444       $tip.attr('id', tipId)
1445       this.$element.attr('aria-describedby', tipId)
1446 
1447       if (this.options.animation) $tip.addClass('fade')
1448 
1449       var placement = typeof this.options.placement == 'function' ?
1450         this.options.placement.call(this, $tip[0], this.$element[0]) :
1451         this.options.placement
1452 
1453       var autoToken = /\s?auto?\s?/i
1454       var autoPlace = autoToken.test(placement)
1455       if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
1456 
1457       $tip
1458         .detach()
1459         .css({ top: 0, left: 0, display: 'block' })
1460         .addClass(placement)
1461         .data('bs.' + this.type, this)
1462 
1463       this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
1464       this.$element.trigger('inserted.bs.' + this.type)
1465 
1466       var pos          = this.getPosition()
1467       var actualWidth  = $tip[0].offsetWidth
1468       var actualHeight = $tip[0].offsetHeight
1469 
1470       if (autoPlace) {
1471         var orgPlacement = placement
1472         var viewportDim = this.getPosition(this.$viewport)
1473 
1474         placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top'    :
1475                     placement == 'top'    && pos.top    - actualHeight < viewportDim.top    ? 'bottom' :
1476                     placement == 'right'  && pos.right  + actualWidth  > viewportDim.width  ? 'left'   :
1477                     placement == 'left'   && pos.left   - actualWidth  < viewportDim.left   ? 'right'  :
1478                     placement
1479 
1480         $tip
1481           .removeClass(orgPlacement)
1482           .addClass(placement)
1483       }
1484 
1485       var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
1486 
1487       this.applyPlacement(calculatedOffset, placement)
1488 
1489       var complete = function () {
1490         var prevHoverState = that.hoverState
1491         that.$element.trigger('shown.bs.' + that.type)
1492         that.hoverState = null
1493 
1494         if (prevHoverState == 'out') that.leave(that)
1495       }
1496 
1497       $.support.transition && this.$tip.hasClass('fade') ?
1498         $tip
1499           .one('bsTransitionEnd', complete)
1500           .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
1501         complete()
1502     }
1503   }
1504 
1505   Tooltip.prototype.applyPlacement = function (offset, placement) {
1506     var $tip   = this.tip()
1507     var width  = $tip[0].offsetWidth
1508     var height = $tip[0].offsetHeight
1509 
1510     // manually read margins because getBoundingClientRect includes difference
1511     var marginTop = parseInt($tip.css('margin-top'), 10)
1512     var marginLeft = parseInt($tip.css('margin-left'), 10)
1513 
1514     // we must check for NaN for ie 8/9
1515     if (isNaN(marginTop))  marginTop  = 0
1516     if (isNaN(marginLeft)) marginLeft = 0
1517 
1518     offset.top  += marginTop
1519     offset.left += marginLeft
1520 
1521     // $.fn.offset doesn't round pixel values
1522     // so we use setOffset directly with our own function B-0
1523     $.offset.setOffset($tip[0], $.extend({
1524       using: function (props) {
1525         $tip.css({
1526           top: Math.round(props.top),
1527           left: Math.round(props.left)
1528         })
1529       }
1530     }, offset), 0)
1531 
1532     $tip.addClass('in')
1533 
1534     // check to see if placing tip in new offset caused the tip to resize itself
1535     var actualWidth  = $tip[0].offsetWidth
1536     var actualHeight = $tip[0].offsetHeight
1537 
1538     if (placement == 'top' && actualHeight != height) {
1539       offset.top = offset.top + height - actualHeight
1540     }
1541 
1542     var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
1543 
1544     if (delta.left) offset.left += delta.left
1545     else offset.top += delta.top
1546 
1547     var isVertical          = /top|bottom/.test(placement)
1548     var arrowDelta          = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
1549     var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
1550 
1551     $tip.offset(offset)
1552     this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
1553   }
1554 
1555   Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
1556     this.arrow()
1557       .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
1558       .css(isVertical ? 'top' : 'left', '')
1559   }
1560 
1561   Tooltip.prototype.setContent = function () {
1562     var $tip  = this.tip()
1563     var title = this.getTitle()
1564 
1565     $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1566     $tip.removeClass('fade in top bottom left right')
1567   }
1568 
1569   Tooltip.prototype.hide = function (callback) {
1570     var that = this
1571     var $tip = $(this.$tip)
1572     var e    = $.Event('hide.bs.' + this.type)
1573 
1574     function complete() {
1575       if (that.hoverState != 'in') $tip.detach()
1576       if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary.
1577         that.$element
1578           .removeAttr('aria-describedby')
1579           .trigger('hidden.bs.' + that.type)
1580       }
1581       callback && callback()
1582     }
1583 
1584     this.$element.trigger(e)
1585 
1586     if (e.isDefaultPrevented()) return
1587 
1588     $tip.removeClass('in')
1589 
1590     $.support.transition && $tip.hasClass('fade') ?
1591       $tip
1592         .one('bsTransitionEnd', complete)
1593         .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
1594       complete()
1595 
1596     this.hoverState = null
1597 
1598     return this
1599   }
1600 
1601   Tooltip.prototype.fixTitle = function () {
1602     var $e = this.$element
1603     if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
1604       $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
1605     }
1606   }
1607 
1608   Tooltip.prototype.hasContent = function () {
1609     return this.getTitle()
1610   }
1611 
1612   Tooltip.prototype.getPosition = function ($element) {
1613     $element   = $element || this.$element
1614 
1615     var el     = $element[0]
1616     var isBody = el.tagName == 'BODY'
1617 
1618     var elRect    = el.getBoundingClientRect()
1619     if (elRect.width == null) {
1620       // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
1621       elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
1622     }
1623     var isSvg = window.SVGElement && el instanceof window.SVGElement
1624     // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3.
1625     // See https://github.com/twbs/bootstrap/issues/20280
1626     var elOffset  = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset())
1627     var scroll    = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
1628     var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
1629 
1630     return $.extend({}, elRect, scroll, outerDims, elOffset)
1631   }
1632 
1633   Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
1634     return placement == 'bottom' ? { top: pos.top + pos.height,   left: pos.left + pos.width / 2 - actualWidth / 2 } :
1635            placement == 'top'    ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
1636            placement == 'left'   ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
1637         /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
1638 
1639   }
1640 
1641   Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
1642     var delta = { top: 0, left: 0 }
1643     if (!this.$viewport) return delta
1644 
1645     var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
1646     var viewportDimensions = this.getPosition(this.$viewport)
1647 
1648     if (/right|left/.test(placement)) {
1649       var topEdgeOffset    = pos.top - viewportPadding - viewportDimensions.scroll
1650       var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
1651       if (topEdgeOffset < viewportDimensions.top) { // top overflow
1652         delta.top = viewportDimensions.top - topEdgeOffset
1653       } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
1654         delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
1655       }
1656     } else {
1657       var leftEdgeOffset  = pos.left - viewportPadding
1658       var rightEdgeOffset = pos.left + viewportPadding + actualWidth
1659       if (leftEdgeOffset < viewportDimensions.left) { // left overflow
1660         delta.left = viewportDimensions.left - leftEdgeOffset
1661       } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
1662         delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
1663       }
1664     }
1665 
1666     return delta
1667   }
1668 
1669   Tooltip.prototype.getTitle = function () {
1670     var title
1671     var $e = this.$element
1672     var o  = this.options
1673 
1674     title = $e.attr('data-original-title')
1675       || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
1676 
1677     return title
1678   }
1679 
1680   Tooltip.prototype.getUID = function (prefix) {
1681     do prefix += ~~(Math.random() * 1000000)
1682     while (document.getElementById(prefix))
1683     return prefix
1684   }
1685 
1686   Tooltip.prototype.tip = function () {
1687     if (!this.$tip) {
1688       this.$tip = $(this.options.template)
1689       if (this.$tip.length != 1) {
1690         throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
1691       }
1692     }
1693     return this.$tip
1694   }
1695 
1696   Tooltip.prototype.arrow = function () {
1697     return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
1698   }
1699 
1700   Tooltip.prototype.enable = function () {
1701     this.enabled = true
1702   }
1703 
1704   Tooltip.prototype.disable = function () {
1705     this.enabled = false
1706   }
1707 
1708   Tooltip.prototype.toggleEnabled = function () {
1709     this.enabled = !this.enabled
1710   }
1711 
1712   Tooltip.prototype.toggle = function (e) {
1713     var self = this
1714     if (e) {
1715       self = $(e.currentTarget).data('bs.' + this.type)
1716       if (!self) {
1717         self = new this.constructor(e.currentTarget, this.getDelegateOptions())
1718         $(e.currentTarget).data('bs.' + this.type, self)
1719       }
1720     }
1721 
1722     if (e) {
1723       self.inState.click = !self.inState.click
1724       if (self.isInStateTrue()) self.enter(self)
1725       else self.leave(self)
1726     } else {
1727       self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
1728     }
1729   }
1730 
1731   Tooltip.prototype.destroy = function () {
1732     var that = this
1733     clearTimeout(this.timeout)
1734     this.hide(function () {
1735       that.$element.off('.' + that.type).removeData('bs.' + that.type)
1736       if (that.$tip) {
1737         that.$tip.detach()
1738       }
1739       that.$tip = null
1740       that.$arrow = null
1741       that.$viewport = null
1742       that.$element = null
1743     })
1744   }
1745 
1746 
1747   // TOOLTIP PLUGIN DEFINITION
1748   // =========================
1749 
1750   function Plugin(option) {
1751     return this.each(function () {
1752       var $this   = $(this)
1753       var data    = $this.data('bs.tooltip')
1754       var options = typeof option == 'object' && option
1755 
1756       if (!data && /destroy|hide/.test(option)) return
1757       if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
1758       if (typeof option == 'string') data[option]()
1759     })
1760   }
1761 
1762   var old = $.fn.tooltip
1763 
1764   $.fn.tooltip             = Plugin
1765   $.fn.tooltip.Constructor = Tooltip
1766 
1767 
1768   // TOOLTIP NO CONFLICT
1769   // ===================
1770 
1771   $.fn.tooltip.noConflict = function () {
1772     $.fn.tooltip = old
1773     return this
1774   }
1775 
1776 }(jQuery);
1777 
1778 /* ========================================================================
1779  * Bootstrap: popover.js v3.3.7
1780  * http://getbootstrap.com/javascript/#popovers
1781  * ========================================================================
1782  * Copyright 2011-2016 Twitter, Inc.
1783  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1784  * ======================================================================== */
1785 
1786 
1787 +function ($) {
1788   'use strict';
1789 
1790   // POPOVER PUBLIC CLASS DEFINITION
1791   // ===============================
1792 
1793   var Popover = function (element, options) {
1794     this.init('popover', element, options)
1795   }
1796 
1797   if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
1798 
1799   Popover.VERSION  = '3.3.7'
1800 
1801   Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
1802     placement: 'right',
1803     trigger: 'click',
1804     content: '',
1805     template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
1806   })
1807 
1808 
1809   // NOTE: POPOVER EXTENDS tooltip.js
1810   // ================================
1811 
1812   Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
1813 
1814   Popover.prototype.constructor = Popover
1815 
1816   Popover.prototype.getDefaults = function () {
1817     return Popover.DEFAULTS
1818   }
1819 
1820   Popover.prototype.setContent = function () {
1821     var $tip    = this.tip()
1822     var title   = this.getTitle()
1823     var content = this.getContent()
1824 
1825     $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1826     $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
1827       this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
1828     ](content)
1829 
1830     $tip.removeClass('fade top bottom left right in')
1831 
1832     // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
1833     // this manually by checking the contents.
1834     if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
1835   }
1836 
1837   Popover.prototype.hasContent = function () {
1838     return this.getTitle() || this.getContent()
1839   }
1840 
1841   Popover.prototype.getContent = function () {
1842     var $e = this.$element
1843     var o  = this.options
1844 
1845     return $e.attr('data-content')
1846       || (typeof o.content == 'function' ?
1847             o.content.call($e[0]) :
1848             o.content)
1849   }
1850 
1851   Popover.prototype.arrow = function () {
1852     return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
1853   }
1854 
1855 
1856   // POPOVER PLUGIN DEFINITION
1857   // =========================
1858 
1859   function Plugin(option) {
1860     return this.each(function () {
1861       var $this   = $(this)
1862       var data    = $this.data('bs.popover')
1863       var options = typeof option == 'object' && option
1864 
1865       if (!data && /destroy|hide/.test(option)) return
1866       if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
1867       if (typeof option == 'string') data[option]()
1868     })
1869   }
1870 
1871   var old = $.fn.popover
1872 
1873   $.fn.popover             = Plugin
1874   $.fn.popover.Constructor = Popover
1875 
1876 
1877   // POPOVER NO CONFLICT
1878   // ===================
1879 
1880   $.fn.popover.noConflict = function () {
1881     $.fn.popover = old
1882     return this
1883   }
1884 
1885 }(jQuery);
1886 
1887 /* ========================================================================
1888  * Bootstrap: scrollspy.js v3.3.7
1889  * http://getbootstrap.com/javascript/#scrollspy
1890  * ========================================================================
1891  * Copyright 2011-2016 Twitter, Inc.
1892  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1893  * ======================================================================== */
1894 
1895 
1896 +function ($) {
1897   'use strict';
1898 
1899   // SCROLLSPY CLASS DEFINITION
1900   // ==========================
1901 
1902   function ScrollSpy(element, options) {
1903     this.$body          = $(document.body)
1904     this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
1905     this.options        = $.extend({}, ScrollSpy.DEFAULTS, options)
1906     this.selector       = (this.options.target || '') + ' .nav li > a'
1907     this.offsets        = []
1908     this.targets        = []
1909     this.activeTarget   = null
1910     this.scrollHeight   = 0
1911 
1912     this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
1913     this.refresh()
1914     this.process()
1915   }
1916 
1917   ScrollSpy.VERSION  = '3.3.7'
1918 
1919   ScrollSpy.DEFAULTS = {
1920     offset: 10
1921   }
1922 
1923   ScrollSpy.prototype.getScrollHeight = function () {
1924     return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
1925   }
1926 
1927   ScrollSpy.prototype.refresh = function () {
1928     var that          = this
1929     var offsetMethod  = 'offset'
1930     var offsetBase    = 0
1931 
1932     this.offsets      = []
1933     this.targets      = []
1934     this.scrollHeight = this.getScrollHeight()
1935 
1936     if (!$.isWindow(this.$scrollElement[0])) {
1937       offsetMethod = 'position'
1938       offsetBase   = this.$scrollElement.scrollTop()
1939     }
1940 
1941     this.$body
1942       .find(this.selector)
1943       .map(function () {
1944         var $el   = $(this)
1945         var href  = $el.data('target') || $el.attr('href')
1946         var $href = /^#./.test(href) && $(href)
1947 
1948         return ($href
1949           && $href.length
1950           && $href.is(':visible')
1951           && [[$href[offsetMethod]().top + offsetBase, href]]) || null
1952       })
1953       .sort(function (a, b) { return a[0] - b[0] })
1954       .each(function () {
1955         that.offsets.push(this[0])
1956         that.targets.push(this[1])
1957       })
1958   }
1959 
1960   ScrollSpy.prototype.process = function () {
1961     var scrollTop    = this.$scrollElement.scrollTop() + this.options.offset
1962     var scrollHeight = this.getScrollHeight()
1963     var maxScroll    = this.options.offset + scrollHeight - this.$scrollElement.height()
1964     var offsets      = this.offsets
1965     var targets      = this.targets
1966     var activeTarget = this.activeTarget
1967     var i
1968 
1969     if (this.scrollHeight != scrollHeight) {
1970       this.refresh()
1971     }
1972 
1973     if (scrollTop >= maxScroll) {
1974       return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
1975     }
1976 
1977     if (activeTarget && scrollTop < offsets[0]) {
1978       this.activeTarget = null
1979       return this.clear()
1980     }
1981 
1982     for (i = offsets.length; i--;) {
1983       activeTarget != targets[i]
1984         && scrollTop >= offsets[i]
1985         && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
1986         && this.activate(targets[i])
1987     }
1988   }
1989 
1990   ScrollSpy.prototype.activate = function (target) {
1991     this.activeTarget = target
1992 
1993     this.clear()
1994 
1995     var selector = this.selector +
1996       '[data-target="' + target + '"],' +
1997       this.selector + '[href="' + target + '"]'
1998 
1999     var active = $(selector)
2000       .parents('li')
2001       .addClass('active')
2002 
2003     if (active.parent('.dropdown-menu').length) {
2004       active = active
2005         .closest('li.dropdown')
2006         .addClass('active')
2007     }
2008 
2009     active.trigger('activate.bs.scrollspy')
2010   }
2011 
2012   ScrollSpy.prototype.clear = function () {
2013     $(this.selector)
2014       .parentsUntil(this.options.target, '.active')
2015       .removeClass('active')
2016   }
2017 
2018 
2019   // SCROLLSPY PLUGIN DEFINITION
2020   // ===========================
2021 
2022   function Plugin(option) {
2023     return this.each(function () {
2024       var $this   = $(this)
2025       var data    = $this.data('bs.scrollspy')
2026       var options = typeof option == 'object' && option
2027 
2028       if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
2029       if (typeof option == 'string') data[option]()
2030     })
2031   }
2032 
2033   var old = $.fn.scrollspy
2034 
2035   $.fn.scrollspy             = Plugin
2036   $.fn.scrollspy.Constructor = ScrollSpy
2037 
2038 
2039   // SCROLLSPY NO CONFLICT
2040   // =====================
2041 
2042   $.fn.scrollspy.noConflict = function () {
2043     $.fn.scrollspy = old
2044     return this
2045   }
2046 
2047 
2048   // SCROLLSPY DATA-API
2049   // ==================
2050 
2051   $(window).on('load.bs.scrollspy.data-api', function () {
2052     $('[data-spy="scroll"]').each(function () {
2053       var $spy = $(this)
2054       Plugin.call($spy, $spy.data())
2055     })
2056   })
2057 
2058 }(jQuery);
2059 
2060 /* ========================================================================
2061  * Bootstrap: tab.js v3.3.7
2062  * http://getbootstrap.com/javascript/#tabs
2063  * ========================================================================
2064  * Copyright 2011-2016 Twitter, Inc.
2065  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2066  * ======================================================================== */
2067 
2068 
2069 +function ($) {
2070   'use strict';
2071 
2072   // TAB CLASS DEFINITION
2073   // ====================
2074 
2075   var Tab = function (element) {
2076     // jscs:disable requireDollarBeforejQueryAssignment
2077     this.element = $(element)
2078     // jscs:enable requireDollarBeforejQueryAssignment
2079   }
2080 
2081   Tab.VERSION = '3.3.7'
2082 
2083   Tab.TRANSITION_DURATION = 150
2084 
2085   Tab.prototype.show = function () {
2086     var $this    = this.element
2087     var $ul      = $this.closest('ul:not(.dropdown-menu)')
2088     var selector = $this.data('target')
2089 
2090     if (!selector) {
2091       selector = $this.attr('href')
2092       selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
2093     }
2094 
2095     if ($this.parent('li').hasClass('active')) return
2096 
2097     var $previous = $ul.find('.active:last a')
2098     var hideEvent = $.Event('hide.bs.tab', {
2099       relatedTarget: $this[0]
2100     })
2101     var showEvent = $.Event('show.bs.tab', {
2102       relatedTarget: $previous[0]
2103     })
2104 
2105     $previous.trigger(hideEvent)
2106     $this.trigger(showEvent)
2107 
2108     if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
2109 
2110     var $target = $(selector)
2111 
2112     this.activate($this.closest('li'), $ul)
2113     this.activate($target, $target.parent(), function () {
2114       $previous.trigger({
2115         type: 'hidden.bs.tab',
2116         relatedTarget: $this[0]
2117       })
2118       $this.trigger({
2119         type: 'shown.bs.tab',
2120         relatedTarget: $previous[0]
2121       })
2122     })
2123   }
2124 
2125   Tab.prototype.activate = function (element, container, callback) {
2126     var $active    = container.find('> .active')
2127     var transition = callback
2128       && $.support.transition
2129       && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
2130 
2131     function next() {
2132       $active
2133         .removeClass('active')
2134         .find('> .dropdown-menu > .active')
2135           .removeClass('active')
2136         .end()
2137         .find('[data-toggle="tab"]')
2138           .attr('aria-expanded', false)
2139 
2140       element
2141         .addClass('active')
2142         .find('[data-toggle="tab"]')
2143           .attr('aria-expanded', true)
2144 
2145       if (transition) {
2146         element[0].offsetWidth // reflow for transition
2147         element.addClass('in')
2148       } else {
2149         element.removeClass('fade')
2150       }
2151 
2152       if (element.parent('.dropdown-menu').length) {
2153         element
2154           .closest('li.dropdown')
2155             .addClass('active')
2156           .end()
2157           .find('[data-toggle="tab"]')
2158             .attr('aria-expanded', true)
2159       }
2160 
2161       callback && callback()
2162     }
2163 
2164     $active.length && transition ?
2165       $active
2166         .one('bsTransitionEnd', next)
2167         .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
2168       next()
2169 
2170     $active.removeClass('in')
2171   }
2172 
2173 
2174   // TAB PLUGIN DEFINITION
2175   // =====================
2176 
2177   function Plugin(option) {
2178     return this.each(function () {
2179       var $this = $(this)
2180       var data  = $this.data('bs.tab')
2181 
2182       if (!data) $this.data('bs.tab', (data = new Tab(this)))
2183       if (typeof option == 'string') data[option]()
2184     })
2185   }
2186 
2187   var old = $.fn.tab
2188 
2189   $.fn.tab             = Plugin
2190   $.fn.tab.Constructor = Tab
2191 
2192 
2193   // TAB NO CONFLICT
2194   // ===============
2195 
2196   $.fn.tab.noConflict = function () {
2197     $.fn.tab = old
2198     return this
2199   }
2200 
2201 
2202   // TAB DATA-API
2203   // ============
2204 
2205   var clickHandler = function (e) {
2206     e.preventDefault()
2207     Plugin.call($(this), 'show')
2208   }
2209 
2210   $(document)
2211     .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
2212     .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
2213 
2214 }(jQuery);
2215 
2216 /* ========================================================================
2217  * Bootstrap: affix.js v3.3.7
2218  * http://getbootstrap.com/javascript/#affix
2219  * ========================================================================
2220  * Copyright 2011-2016 Twitter, Inc.
2221  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2222  * ======================================================================== */
2223 
2224 
2225 +function ($) {
2226   'use strict';
2227 
2228   // AFFIX CLASS DEFINITION
2229   // ======================
2230 
2231   var Affix = function (element, options) {
2232     this.options = $.extend({}, Affix.DEFAULTS, options)
2233 
2234     this.$target = $(this.options.target)
2235       .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
2236       .on('click.bs.affix.data-api',  $.proxy(this.checkPositionWithEventLoop, this))
2237 
2238     this.$element     = $(element)
2239     this.affixed      = null
2240     this.unpin        = null
2241     this.pinnedOffset = null
2242 
2243     this.checkPosition()
2244   }
2245 
2246   Affix.VERSION  = '3.3.7'
2247 
2248   Affix.RESET    = 'affix affix-top affix-bottom'
2249 
2250   Affix.DEFAULTS = {
2251     offset: 0,
2252     target: window
2253   }
2254 
2255   Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
2256     var scrollTop    = this.$target.scrollTop()
2257     var position     = this.$element.offset()
2258     var targetHeight = this.$target.height()
2259 
2260     if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
2261 
2262     if (this.affixed == 'bottom') {
2263       if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
2264       return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
2265     }
2266 
2267     var initializing   = this.affixed == null
2268     var colliderTop    = initializing ? scrollTop : position.top
2269     var colliderHeight = initializing ? targetHeight : height
2270 
2271     if (offsetTop != null && scrollTop <= offsetTop) return 'top'
2272     if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
2273 
2274     return false
2275   }
2276 
2277   Affix.prototype.getPinnedOffset = function () {
2278     if (this.pinnedOffset) return this.pinnedOffset
2279     this.$element.removeClass(Affix.RESET).addClass('affix')
2280     var scrollTop = this.$target.scrollTop()
2281     var position  = this.$element.offset()
2282     return (this.pinnedOffset = position.top - scrollTop)
2283   }
2284 
2285   Affix.prototype.checkPositionWithEventLoop = function () {
2286     setTimeout($.proxy(this.checkPosition, this), 1)
2287   }
2288 
2289   Affix.prototype.checkPosition = function () {
2290     if (!this.$element.is(':visible')) return
2291 
2292     var height       = this.$element.height()
2293     var offset       = this.options.offset
2294     var offsetTop    = offset.top
2295     var offsetBottom = offset.bottom
2296     var scrollHeight = Math.max($(document).height(), $(document.body).height())
2297 
2298     if (typeof offset != 'object')         offsetBottom = offsetTop = offset
2299     if (typeof offsetTop == 'function')    offsetTop    = offset.top(this.$element)
2300     if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
2301 
2302     var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
2303 
2304     if (this.affixed != affix) {
2305       if (this.unpin != null) this.$element.css('top', '')
2306 
2307       var affixType = 'affix' + (affix ? '-' + affix : '')
2308       var e         = $.Event(affixType + '.bs.affix')
2309 
2310       this.$element.trigger(e)
2311 
2312       if (e.isDefaultPrevented()) return
2313 
2314       this.affixed = affix
2315       this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
2316 
2317       this.$element
2318         .removeClass(Affix.RESET)
2319         .addClass(affixType)
2320         .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
2321     }
2322 
2323     if (affix == 'bottom') {
2324       this.$element.offset({
2325         top: scrollHeight - height - offsetBottom
2326       })
2327     }
2328   }
2329 
2330 
2331   // AFFIX PLUGIN DEFINITION
2332   // =======================
2333 
2334   function Plugin(option) {
2335     return this.each(function () {
2336       var $this   = $(this)
2337       var data    = $this.data('bs.affix')
2338       var options = typeof option == 'object' && option
2339 
2340       if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
2341       if (typeof option == 'string') data[option]()
2342     })
2343   }
2344 
2345   var old = $.fn.affix
2346 
2347   $.fn.affix             = Plugin
2348   $.fn.affix.Constructor = Affix
2349 
2350 
2351   // AFFIX NO CONFLICT
2352   // =================
2353 
2354   $.fn.affix.noConflict = function () {
2355     $.fn.affix = old
2356     return this
2357   }
2358 
2359 
2360   // AFFIX DATA-API
2361   // ==============
2362 
2363   $(window).on('load', function () {
2364     $('[data-spy="affix"]').each(function () {
2365       var $spy = $(this)
2366       var data = $spy.data()
2367 
2368       data.offset = data.offset || {}
2369 
2370       if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
2371       if (data.offsetTop    != null) data.offset.top    = data.offsetTop
2372 
2373       Plugin.call($spy, data)
2374     })
2375   })
2376 
2377 }(jQuery);