PageSourceSearch

https://scubamonkeydivecenter.com/js/bootstrap.js

js scubamonkeydivecenter.com collected 2026-09-29 20:34:23 UTC 71,995 bytes, 2,311 lines download raw bytes

vendor: 51,454 bytes, lines 1-1609
1if (typeof jQuery === 'undefined') {
2    throw new Error('Bootstrap\'s JavaScript requires jQuery')
3  }
4  
5  +function ($) {
6    'use strict';
7    var version = $.fn.jquery.split(' ')[0].split('.')
8    if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {
9      throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')
10    }
11  }(jQuery);
12  
13  /* ========================================================================
14   * Bootstrap: transition.js v3.3.4
15   * http://getbootstrap.com/javascript/#transitions
16   * ========================================================================
17   * Copyright 2011-2015 Twitter, Inc.
18   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
19   * ======================================================================== */
20  
21  
22  +function ($) {
23    'use strict';
24  
25    // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
26    // ============================================================
27  
28    function transitionEnd() {
29      var el = document.createElement('bootstrap')
30  
31      var transEndEventNames = {
32        WebkitTransition : 'webkitTransitionEnd',
33        MozTransition    : 'transitionend',
34        OTransition      : 'oTransitionEnd otransitionend',
35        transition       : 'transitionend'
36      }
37  
38      for (var name in transEndEventNames) {
39        if (el.style[name] !== undefined) {
40          return { end: transEndEventNames[name] }
41        }
42      }
43  
44      return false // explicit for ie8 (  ._.)
45    }
46  
47    // http://blog.alexmaccaw.com/css-transitions
48    $.fn.emulateTransitionEnd = function (duration) {
49      var called = false
50      var $el = this
51      $(this).one('bsTransitionEnd', function () { called = true })
52      var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
53      setTimeout(callback, duration)
54      return this
55    }
56  
57    $(function () {
58      $.support.transition = transitionEnd()
59  
60      if (!$.support.transition) return
61  
62      $.event.special.bsTransitionEnd = {
63        bindType: $.support.transition.end,
64        delegateType: $.support.transition.end,
65        handle: function (e) {
66          if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
67        }
68      }
69    })
70  
71  }(jQuery);
72  
73  /* ========================================================================
74   * Bootstrap: alert.js v3.3.4
75   * http://getbootstrap.com/javascript/#alerts
76   * ========================================================================
77   * Copyright 2011-2015 Twitter, Inc.
78   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
79   * ======================================================================== */
80  
81  
82  +function ($) {
83    'use strict';
84  
85    // ALERT CLASS DEFINITION
86    // ======================
87  
88    var dismiss = '[data-dismiss="alert"]'
89    var Alert   = function (el) {
90      $(el).on('click', dismiss, this.close)
91    }
92  
93    Alert.VERSION = '3.3.4'
94  
95    Alert.TRANSITION_DURATION = 150
96  
97    Alert.prototype.close = function (e) {
98      var $this    = $(this)
99      var selector = $this.attr('data-target')
100  
101      if (!selector) {
102        selector = $this.attr('href')
103        selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
104      }
105  
106      var $parent = $(selector)
107  
108      if (e) e.preventDefault()
109  
110      if (!$parent.length) {
111        $parent = $this.closest('.alert')
112      }
113  
114      $parent.trigger(e = $.Event('close.bs.alert'))
115  
116      if (e.isDefaultPrevented()) return
117  
118      $parent.removeClass('in')
119  
120      function removeElement() {
121        // detach from parent, fire event then clean up data
122        $parent.detach().trigger('closed.bs.alert').remove()
123      }
124  
125      $.support.transition && $parent.hasClass('fade') ?
126        $parent
127          .one('bsTransitionEnd', removeElement)
128          .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
129        removeElement()
130    }
131  
132  
133    // ALERT PLUGIN DEFINITION
134    // =======================
135  
136    function Plugin(option) {
137      return this.each(function () {
138        var $this = $(this)
139        var data  = $this.data('bs.alert')
140  
141        if (!data) $this.data('bs.alert', (data = new Alert(this)))
142        if (typeof option == 'string') data[option].call($this)
143      })
144    }
145  
146    var old = $.fn.alert
147  
148    $.fn.alert             = Plugin
149    $.fn.alert.Constructor = Alert
150  
151  
152    // ALERT NO CONFLICT
153    // =================
154  
155    $.fn.alert.noConflict = function () {
156      $.fn.alert = old
157      return this
158    }
159  
160  
161    // ALERT DATA-API
162    // ==============
163  
164    $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
165  
166  }(jQuery);
167  
168  /* ========================================================================
169   * Bootstrap: button.js v3.3.4
170   * http://getbootstrap.com/javascript/#buttons
171   * ========================================================================
172   * Copyright 2011-2015 Twitter, Inc.
173   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
174   * ======================================================================== */
175  
176  
177  +function ($) {
178    'use strict';
179  
180    // BUTTON PUBLIC CLASS DEFINITION
181    // ==============================
182  
183    var Button = function (element, options) {
184      this.$element  = $(element)
185      this.options   = $.extend({}, Button.DEFAULTS, options)
186      this.isLoading = false
187    }
188  
189    Button.VERSION  = '3.3.4'
190  
191    Button.DEFAULTS = {
192      loadingText: 'loading...'
193    }
194  
195    Button.prototype.setState = function (state) {
196      var d    = 'disabled'
197      var $el  = this.$element
198      var val  = $el.is('input') ? 'val' : 'html'
199      var data = $el.data()
200  
201      state = state + 'Text'
202  
203      if (data.resetText == null) $el.data('resetText', $el[val]())
204  
205      // push to event loop to allow forms to submit
206      setTimeout($.proxy(function () {
207        $el[val](data[state] == null ? this.options[state] : data[state])
208  
209        if (state == 'loadingText') {
210          this.isLoading = true
211          $el.addClass(d).attr(d, d)
212        } else if (this.isLoading) {
213          this.isLoading = false
214          $el.removeClass(d).removeAttr(d)
215        }
216      }, this), 0)
217    }
218  
219    Button.prototype.toggle = function () {
220      var changed = true
221      var $parent = this.$element.closest('[data-toggle="buttons"]')
222  
223      if ($parent.length) {
224        var $input = this.$element.find('input')
225        if ($input.prop('type') == 'radio') {
226          if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
227          else $parent.find('.active').removeClass('active')
228        }
229        if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
230      } else {
231        this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
232      }
233  
234      if (changed) this.$element.toggleClass('active')
235    }
236  
237  
238    // BUTTON PLUGIN DEFINITION
239    // ========================
240  
241    function Plugin(option) {
242      return this.each(function () {
243        var $this   = $(this)
244        var data    = $this.data('bs.button')
245        var options = typeof option == 'object' && option
246  
247        if (!data) $this.data('bs.button', (data = new Button(this, options)))
248  
249        if (option == 'toggle') data.toggle()
250        else if (option) data.setState(option)
251      })
252    }
253  
254    var old = $.fn.button
255  
256    $.fn.button             = Plugin
257    $.fn.button.Constructor = Button
258  
259  
260    // BUTTON NO CONFLICT
261    // ==================
262  
263    $.fn.button.noConflict = function () {
264      $.fn.button = old
265      return this
266    }
267  
268  
269    // BUTTON DATA-API
270    // ===============
271  
272    $(document)
273      .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
274        var $btn = $(e.target)
275        if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
276        Plugin.call($btn, 'toggle')
277        e.preventDefault()
278      })
279      .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
280        $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
281      })
282  
283  }(jQuery);
284  
285  /* ========================================================================
286   * Bootstrap: carousel.js v3.3.4
287   * http://getbootstrap.com/javascript/#carousel
288   * ========================================================================
289   * Copyright 2011-2015 Twitter, Inc.
290   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
291   * ======================================================================== */
292  
293  
294  +function ($) {
295    'use strict';
296  
297    // CAROUSEL CLASS DEFINITION
298    // =========================
299  
300    var Carousel = function (element, options) {
301      this.$element    = $(element)
302      this.$indicators = this.$element.find('.carousel-indicators')
303      this.options     = options
304      this.paused      = null
305      this.sliding     = null
306      this.interval    = null
307      this.$active     = null
308      this.$items      = null
309  
310      this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
311  
312      this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
313        .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
314        .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
315    }
316  
317    Carousel.VERSION  = '3.3.4'
318  
319    Carousel.TRANSITION_DURATION = 600
320  
321    Carousel.DEFAULTS = {
322      interval: 5000,
323      pause: 'hover',
324      wrap: true,
325      keyboard: true
326    }
327  
328    Carousel.prototype.keydown = function (e) {
329      if (/input|textarea/i.test(e.target.tagName)) return
330      switch (e.which) {
331        case 37: this.prev(); break
332        case 39: this.next(); break
333        default: return
334      }
335  
336      e.preventDefault()
337    }
338  
339    Carousel.prototype.cycle = function (e) {
340      e || (this.paused = false)
341  
342      this.interval && clearInterval(this.interval)
343  
344      this.options.interval
345        && !this.paused
346        && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
347  
348      return this
349    }
350  
351    Carousel.prototype.getItemIndex = function (item) {
352      this.$items = item.parent().children('.item')
353      return this.$items.index(item || this.$active)
354    }
355  
356    Carousel.prototype.getItemForDirection = function (direction, active) {
357      var activeIndex = this.getItemIndex(active)
358      var willWrap = (direction == 'prev' && activeIndex === 0)
359                  || (direction == 'next' && activeIndex == (this.$items.length - 1))
360      if (willWrap && !this.options.wrap) return active
361      var delta = direction == 'prev' ? -1 : 1
362      var itemIndex = (activeIndex + delta) % this.$items.length
363      return this.$items.eq(itemIndex)
364    }
365  
366    Carousel.prototype.to = function (pos) {
367      var that        = this
368      var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
369  
370      if (pos > (this.$items.length - 1) || pos < 0) return
371  
372      if (this.sliding)       return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
373      if (activeIndex == pos) return this.pause().cycle()
374  
375      return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
376    }
377  
378    Carousel.prototype.pause = function (e) {
379      e || (this.paused = true)
380  
381      if (this.$element.find('.next, .prev').length && $.support.transition) {
382        this.$element.trigger($.support.transition.end)
383        this.cycle(true)
384      }
385  
386      this.interval = clearInterval(this.interval)
387  
388      return this
389    }
390  
391    Carousel.prototype.next = function () {
392      if (this.sliding) return
393      return this.slide('next')
394    }
395  
396    Carousel.prototype.prev = function () {
397      if (this.sliding) return
398      return this.slide('prev')
399    }
400  
401    Carousel.prototype.slide = function (type, next) {
402      var $active   = this.$element.find('.item.active')
403      var $next     = next || this.getItemForDirection(type, $active)
404      var isCycling = this.interval
405      var direction = type == 'next' ? 'left' : 'right'
406      var that      = this
407  
408      if ($next.hasClass('active')) return (this.sliding = false)
409  
410      var relatedTarget = $next[0]
411      var slideEvent = $.Event('slide.bs.carousel', {
412        relatedTarget: relatedTarget,
413        direction: direction
414      })
415      this.$element.trigger(slideEvent)
416      if (slideEvent.isDefaultPrevented()) return
417  
418      this.sliding = true
419  
420      isCycling && this.pause()
421  
422      if (this.$indicators.length) {
423        this.$indicators.find('.active').removeClass('active')
424        var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
425        $nextIndicator && $nextIndicator.addClass('active')
426      }
427  
428      var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
429      if ($.support.transition && this.$element.hasClass('slide')) {
430        $next.addClass(type)
431        $next[0].offsetWidth // force reflow
432        $active.addClass(direction)
433        $next.addClass(direction)
434        $active
435          .one('bsTransitionEnd', function () {
436            $next.removeClass([type, direction].join(' ')).addClass('active')
437            $active.removeClass(['active', direction].join(' '))
438            that.sliding = false
439            setTimeout(function () {
440              that.$element.trigger(slidEvent)
441            }, 0)
442          })
443          .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
444      } else {
445        $active.removeClass('active')
446        $next.addClass('active')
447        this.sliding = false
448        this.$element.trigger(slidEvent)
449      }
450  
451      isCycling && this.cycle()
452  
453      return this
454    }
455  
456  
457    // CAROUSEL PLUGIN DEFINITION
458    // ==========================
459  
460    function Plugin(option) {
461      return this.each(function () {
462        var $this   = $(this)
463        var data    = $this.data('bs.carousel')
464        var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
465        var action  = typeof option == 'string' ? option : options.slide
466  
467        if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
468        if (typeof option == 'number') data.to(option)
469        else if (action) data[action]()
470        else if (options.interval) data.pause().cycle()
471      })
472    }
473  
474    var old = $.fn.carousel
475  
476    $.fn.carousel             = Plugin
477    $.fn.carousel.Constructor = Carousel
478  
479  
480    // CAROUSEL NO CONFLICT
481    // ====================
482  
483    $.fn.carousel.noConflict = function () {
484      $.fn.carousel = old
485      return this
486    }
487  
488  
489    // CAROUSEL DATA-API
490    // =================
491  
492    var clickHandler = function (e) {
493      var href
494      var $this   = $(this)
495      var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
496      if (!$target.hasClass('carousel')) return
497      var options = $.extend({}, $target.data(), $this.data())
498      var slideIndex = $this.attr('data-slide-to')
499      if (slideIndex) options.interval = false
500  
501      Plugin.call($target, options)
502  
503      if (slideIndex) {
504        $target.data('bs.carousel').to(slideIndex)
505      }
506  
507      e.preventDefault()
508    }
509  
510    $(document)
511      .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
512      .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
513  
514    $(window).on('load', function () {
515      $('[data-ride="carousel"]').each(function () {
516        var $carousel = $(this)
517        Plugin.call($carousel, $carousel.data())
518      })
519    })
520  
521  }(jQuery);
522  
523  /* ========================================================================
524   * Bootstrap: collapse.js v3.3.4
525   * http://getbootstrap.com/javascript/#collapse
526   * ========================================================================
527   * Copyright 2011-2015 Twitter, Inc.
528   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
529   * ======================================================================== */
530  
531  
532  +function ($) {
533    'use strict';
534  
535    // COLLAPSE PUBLIC CLASS DEFINITION
536    // ================================
537  
538    var Collapse = function (element, options) {
539      this.$element      = $(element)
540      this.options       = $.extend({}, Collapse.DEFAULTS, options)
541      this.$trigger      = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
542                             '[data-toggle="collapse"][data-target="#' + element.id + '"]')
543      this.transitioning = null
544  
545      if (this.options.parent) {
546        this.$parent = this.getParent()
547      } else {
548        this.addAriaAndCollapsedClass(this.$element, this.$trigger)
549      }
550  
551      if (this.options.toggle) this.toggle()
552    }
553  
554    Collapse.VERSION  = '3.3.4'
555  
556    Collapse.TRANSITION_DURATION = 350
557  
558    Collapse.DEFAULTS = {
559      toggle: true
560    }
561  
562    Collapse.prototype.dimension = function () {
563      var hasWidth = this.$element.hasClass('width')
564      return hasWidth ? 'width' : 'height'
565    }
566  
567    Collapse.prototype.show = function () {
568      if (this.transitioning || this.$element.hasClass('in')) return
569  
570      var activesData
571      var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
572  
573      if (actives && actives.length) {
574        activesData = actives.data('bs.collapse')
575        if (activesData && activesData.transitioning) return
576      }
577  
578      var startEvent = $.Event('show.bs.collapse')
579      this.$element.trigger(startEvent)
580      if (startEvent.isDefaultPrevented()) return
581  
582      if (actives && actives.length) {
583        Plugin.call(actives, 'hide')
584        activesData || actives.data('bs.collapse', null)
585      }
586  
587      var dimension = this.dimension()
588  
589      this.$element
590        .removeClass('collapse')
591        .addClass('collapsing')[dimension](0)
592        .attr('aria-expanded', true)
593  
594      this.$trigger
595        .removeClass('collapsed')
596        .attr('aria-expanded', true)
597  
598      this.transitioning = 1
599  
600      var complete = function () {
601        this.$element
602          .removeClass('collapsing')
603          .addClass('collapse in')[dimension]('')
604        this.transitioning = 0
605        this.$element
606          .trigger('shown.bs.collapse')
607      }
608  
609      if (!$.support.transition) return complete.call(this)
610  
611      var scrollSize = $.camelCase(['scroll', dimension].join('-'))
612  
613      this.$element
614        .one('bsTransitionEnd', $.proxy(complete, this))
615        .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
616    }
617  
618    Collapse.prototype.hide = function () {
619      if (this.transitioning || !this.$element.hasClass('in')) return
620  
621      var startEvent = $.Event('hide.bs.collapse')
622      this.$element.trigger(startEvent)
623      if (startEvent.isDefaultPrevented()) return
624  
625      var dimension = this.dimension()
626  
627      this.$element[dimension](this.$element[dimension]())[0].offsetHeight
628  
629      this.$element
630        .addClass('collapsing')
631        .removeClass('collapse in')
632        .attr('aria-expanded', false)
633  
634      this.$trigger
635        .addClass('collapsed')
636        .attr('aria-expanded', false)
637  
638      this.transitioning = 1
639  
640      var complete = function () {
641        this.transitioning = 0
642        this.$element
643          .removeClass('collapsing')
644          .addClass('collapse')
645          .trigger('hidden.bs.collapse')
646      }
647  
648      if (!$.support.transition) return complete.call(this)
649  
650      this.$element
651        [dimension](0)
652        .one('bsTransitionEnd', $.proxy(complete, this))
653        .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
654    }
655  
656    Collapse.prototype.toggle = function () {
657      this[this.$element.hasClass('in') ? 'hide' : 'show']()
658    }
659  
660    Collapse.prototype.getParent = function () {
661      return $(this.options.parent)
662        .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
663        .each($.proxy(function (i, element) {
664          var $element = $(element)
665          this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
666        }, this))
667        .end()
668    }
669  
670    Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
671      var isOpen = $element.hasClass('in')
672  
673      $element.attr('aria-expanded', isOpen)
674      $trigger
675        .toggleClass('collapsed', !isOpen)
676        .attr('aria-expanded', isOpen)
677    }
678  
679    function getTargetFromTrigger($trigger) {
680      var href
681      var target = $trigger.attr('data-target')
682        || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
683  
684      return $(target)
685    }
686  
687  
688    // COLLAPSE PLUGIN DEFINITION
689    // ==========================
690  
691    function Plugin(option) {
692      return this.each(function () {
693        var $this   = $(this)
694        var data    = $this.data('bs.collapse')
695        var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
696  
697        if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
698        if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
699        if (typeof option == 'string') data[option]()
700      })
701    }
702  
703    var old = $.fn.collapse
704  
705    $.fn.collapse             = Plugin
706    $.fn.collapse.Constructor = Collapse
707  
708  
709    // COLLAPSE NO CONFLICT
710    // ====================
711  
712    $.fn.collapse.noConflict = function () {
713      $.fn.collapse = old
714      return this
715    }
716  
717  
718    // COLLAPSE DATA-API
719    // =================
720  
721    $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
722      var $this   = $(this)
723  
724      if (!$this.attr('data-target')) e.preventDefault()
725  
726      var $target = getTargetFromTrigger($this)
727      var data    = $target.data('bs.collapse')
728      var option  = data ? 'toggle' : $this.data()
729  
730      Plugin.call($target, option)
731    })
732  
733  }(jQuery);
734  
735  /* ========================================================================
736   * Bootstrap: dropdown.js v3.3.4
737   * http://getbootstrap.com/javascript/#dropdowns
738   * ========================================================================
739   * Copyright 2011-2015 Twitter, Inc.
740   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
741   * ======================================================================== */
742  
743  
744  +function ($) {
745    'use strict';
746  
747    // DROPDOWN CLASS DEFINITION
748    // =========================
749  
750    var backdrop = '.dropdown-backdrop'
751    var toggle   = '[data-toggle="dropdown"]'
752    var Dropdown = function (element) {
753      $(element).on('click.bs.dropdown', this.toggle)
754    }
755  
756    Dropdown.VERSION = '3.3.4'
757  
758    Dropdown.prototype.toggle = function (e) {
759      var $this = $(this)
760  
761      if ($this.is('.disabled, :disabled')) return
762  
763      var $parent  = getParent($this)
764      var isActive = $parent.hasClass('open')
765  
766      clearMenus()
767  
768      if (!isActive) {
769        if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
770          // if mobile we use a backdrop because click events don't delegate
771          $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
772        }
773  
774        var relatedTarget = { relatedTarget: this }
775        $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
776  
777        if (e.isDefaultPrevented()) return
778  
779        $this
780          .trigger('focus')
781          .attr('aria-expanded', 'true')
782  
783        $parent
784          .toggleClass('open')
785          .trigger('shown.bs.dropdown', relatedTarget)
786      }
787  
788      return false
789    }
790  
791    Dropdown.prototype.keydown = function (e) {
792      if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
793  
794      var $this = $(this)
795  
796      e.preventDefault()
797      e.stopPropagation()
798  
799      if ($this.is('.disabled, :disabled')) return
800  
801      var $parent  = getParent($this)
802      var isActive = $parent.hasClass('open')
803  
804      if ((!isActive && e.which != 27) || (isActive && e.which == 27)) {
805        if (e.which == 27) $parent.find(toggle).trigger('focus')
806        return $this.trigger('click')
807      }
808  
809      var desc = ' li:not(.disabled):visible a'
810      var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
811  
812      if (!$items.length) return
813  
814      var index = $items.index(e.target)
815  
816      if (e.which == 38 && index > 0)                 index--                        // up
817      if (e.which == 40 && index < $items.length - 1) index++                        // down
818      if (!~index)                                      index = 0
819  
820      $items.eq(index).trigger('focus')
821    }
822  
823    function clearMenus(e) {
824      if (e && e.which === 3) return
825      $(backdrop).remove()
826      $(toggle).each(function () {
827        var $this         = $(this)
828        var $parent       = getParent($this)
829        var relatedTarget = { relatedTarget: this }
830  
831        if (!$parent.hasClass('open')) return
832  
833        $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
834  
835        if (e.isDefaultPrevented()) return
836  
837        $this.attr('aria-expanded', 'false')
838        $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
839      })
840    }
841  
842    function getParent($this) {
843      var selector = $this.attr('data-target')
844  
845      if (!selector) {
846        selector = $this.attr('href')
847        selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
848      }
849  
850      var $parent = selector && $(selector)
851  
852      return $parent && $parent.length ? $parent : $this.parent()
853    }
854  
855  
856    // DROPDOWN PLUGIN DEFINITION
857    // ==========================
858  
859    function Plugin(option) {
860      return this.each(function () {
861        var $this = $(this)
862        var data  = $this.data('bs.dropdown')
863  
864        if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
865        if (typeof option == 'string') data[option].call($this)
866      })
867    }
868  
869    var old = $.fn.dropdown
870  
871    $.fn.dropdown             = Plugin
872    $.fn.dropdown.Constructor = Dropdown
873  
874  
875    // DROPDOWN NO CONFLICT
876    // ====================
877  
878    $.fn.dropdown.noConflict = function () {
879      $.fn.dropdown = old
880      return this
881    }
882  
883  
884    // APPLY TO STANDARD DROPDOWN ELEMENTS
885    // ===================================
886  
887    $(document)
888      .on('click.bs.dropdown.data-api', clearMenus)
889      .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
890      .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
891      .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
892      .on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown)
893      .on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown)
894  
895  }(jQuery);
896  
897  /* ========================================================================
898   * Bootstrap: modal.js v3.3.4
899   * http://getbootstrap.com/javascript/#modals
900   * ========================================================================
901   * Copyright 2011-2015 Twitter, Inc.
902   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
903   * ======================================================================== */
904  
905  
906  +function ($) {
907    'use strict';
908  
909    // MODAL CLASS DEFINITION
910    // ======================
911  
912    var Modal = function (element, options) {
913      this.options             = options
914      this.$body               = $(document.body)
915      this.$element            = $(element)
916      this.$dialog             = this.$element.find('.modal-dialog')
917      this.$backdrop           = null
918      this.isShown             = null
919      this.originalBodyPad     = null
920      this.scrollbarWidth      = 0
921      this.ignoreBackdropClick = false
922  
923      if (this.options.remote) {
924        this.$element
925          .find('.modal-content')
926          .load(this.options.remote, $.proxy(function () {
927            this.$element.trigger('loaded.bs.modal')
928          }, this))
929      }
930    }
931  
932    Modal.VERSION  = '3.3.4'
933  
934    Modal.TRANSITION_DURATION = 300
935    Modal.BACKDROP_TRANSITION_DURATION = 150
936  
937    Modal.DEFAULTS = {
938      backdrop: true,
939      keyboard: true,
940      show: true
941    }
942  
943    Modal.prototype.toggle = function (_relatedTarget) {
944      return this.isShown ? this.hide() : this.show(_relatedTarget)
945    }
946  
947    Modal.prototype.show = function (_relatedTarget) {
948      var that = this
949      var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
950  
951      this.$element.trigger(e)
952  
953      if (this.isShown || e.isDefaultPrevented()) return
954  
955      this.isShown = true
956  
957      this.checkScrollbar()
958      this.setScrollbar()
959      this.$body.addClass('modal-open')
960  
961      this.escape()
962      this.resize()
963  
964      this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
965  
966      this.$dialog.on('mousedown.dismiss.bs.modal', function () {
967        that.$element.one('mouseup.dismiss.bs.modal', function (e) {
968          if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
969        })
970      })
971  
972      this.backdrop(function () {
973        var transition = $.support.transition && that.$element.hasClass('fade')
974  
975        if (!that.$element.parent().length) {
976          that.$element.appendTo(that.$body) // don't move modals dom position
977        }
978  
979        that.$element
980          .show()
981          .scrollTop(0)
982  
983        that.adjustDialog()
984  
985        if (transition) {
986          that.$element[0].offsetWidth // force reflow
987        }
988  
989        that.$element
990          .addClass('in')
991          .attr('aria-hidden', false)
992  
993        that.enforceFocus()
994  
995        var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
996  
997        transition ?
998          that.$dialog // wait for modal to slide in
999            .one('bsTransitionEnd', function () {
1000              that.$element.trigger('focus').trigger(e)
1001            })
1002            .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
1003          that.$element.trigger('focus').trigger(e)
1004      })
1005    }
1006  
1007    Modal.prototype.hide = function (e) {
1008      if (e) e.preventDefault()
1009  
1010      e = $.Event('hide.bs.modal')
1011  
1012      this.$element.trigger(e)
1013  
1014      if (!this.isShown || e.isDefaultPrevented()) return
1015  
1016      this.isShown = false
1017  
1018      this.escape()
1019      this.resize()
1020  
1021      $(document).off('focusin.bs.modal')
1022  
1023      this.$element
1024        .removeClass('in')
1025        .attr('aria-hidden', true)
1026        .off('click.dismiss.bs.modal')
1027        .off('mouseup.dismiss.bs.modal')
1028  
1029      this.$dialog.off('mousedown.dismiss.bs.modal')
1030  
1031      $.support.transition && this.$element.hasClass('fade') ?
1032        this.$element
1033          .one('bsTransitionEnd', $.proxy(this.hideModal, this))
1034          .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
1035        this.hideModal()
1036    }
1037  
1038    Modal.prototype.enforceFocus = function () {
1039      $(document)
1040        .off('focusin.bs.modal') // guard against infinite focus loop
1041        .on('focusin.bs.modal', $.proxy(function (e) {
1042          if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
1043            this.$element.trigger('focus')
1044          }
1045        }, this))
1046    }
1047  
1048    Modal.prototype.escape = function () {
1049      if (this.isShown && this.options.keyboard) {
1050        this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
1051          e.which == 27 && this.hide()
1052        }, this))
1053      } else if (!this.isShown) {
1054        this.$element.off('keydown.dismiss.bs.modal')
1055      }
1056    }
1057  
1058    Modal.prototype.resize = function () {
1059      if (this.isShown) {
1060        $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
1061      } else {
1062        $(window).off('resize.bs.modal')
1063      }
1064    }
1065  
1066    Modal.prototype.hideModal = function () {
1067      var that = this
1068      this.$element.hide()
1069      this.backdrop(function () {
1070        that.$body.removeClass('modal-open')
1071        that.resetAdjustments()
1072        that.resetScrollbar()
1073        that.$element.trigger('hidden.bs.modal')
1074      })
1075    }
1076  
1077    Modal.prototype.removeBackdrop = function () {
1078      this.$backdrop && this.$backdrop.remove()
1079      this.$backdrop = null
1080    }
1081  
1082    Modal.prototype.backdrop = function (callback) {
1083      var that = this
1084      var animate = this.$element.hasClass('fade') ? 'fade' : ''
1085  
1086      if (this.isShown && this.options.backdrop) {
1087        var doAnimate = $.support.transition && animate
1088  
1089        this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
1090          .appendTo(this.$body)
1091  
1092        this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
1093          if (this.ignoreBackdropClick) {
1094            this.ignoreBackdropClick = false
1095            return
1096          }
1097          if (e.target !== e.currentTarget) return
1098          this.options.backdrop == 'static'
1099            ? this.$element[0].focus()
1100            : this.hide()
1101        }, this))
1102  
1103        if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
1104  
1105        this.$backdrop.addClass('in')
1106  
1107        if (!callback) return
1108  
1109        doAnimate ?
1110          this.$backdrop
1111            .one('bsTransitionEnd', callback)
1112            .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
1113          callback()
1114  
1115      } else if (!this.isShown && this.$backdrop) {
1116        this.$backdrop.removeClass('in')
1117  
1118        var callbackRemove = function () {
1119          that.removeBackdrop()
1120          callback && callback()
1121        }
1122        $.support.transition && this.$element.hasClass('fade') ?
1123          this.$backdrop
1124            .one('bsTransitionEnd', callbackRemove)
1125            .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
1126          callbackRemove()
1127  
1128      } else if (callback) {
1129        callback()
1130      }
1131    }
1132  
1133    // these following methods are used to handle overflowing modals
1134  
1135    Modal.prototype.handleUpdate = function () {
1136      this.adjustDialog()
1137    }
1138  
1139    Modal.prototype.adjustDialog = function () {
1140      var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
1141  
1142      this.$element.css({
1143        paddingLeft:  !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
1144        paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
1145      })
1146    }
1147  
1148    Modal.prototype.resetAdjustments = function () {
1149      this.$element.css({
1150        paddingLeft: '',
1151        paddingRight: ''
1152      })
1153    }
1154  
1155    Modal.prototype.checkScrollbar = function () {
1156      var fullWindowWidth = window.innerWidth
1157      if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
1158        var documentElementRect = document.documentElement.getBoundingClientRect()
1159        fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
1160      }
1161      this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
1162      this.scrollbarWidth = this.measureScrollbar()
1163    }
1164  
1165    Modal.prototype.setScrollbar = function () {
1166      var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
1167      this.originalBodyPad = document.body.style.paddingRight || ''
1168      if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
1169    }
1170  
1171    Modal.prototype.resetScrollbar = function () {
1172      this.$body.css('padding-right', this.originalBodyPad)
1173    }
1174  
1175    Modal.prototype.measureScrollbar = function () { // thx walsh
1176      var scrollDiv = document.createElement('div')
1177      scrollDiv.className = 'modal-scrollbar-measure'
1178      this.$body.append(scrollDiv)
1179      var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
1180      this.$body[0].removeChild(scrollDiv)
1181      return scrollbarWidth
1182    }
1183  
1184  
1185    // MODAL PLUGIN DEFINITION
1186    // =======================
1187  
1188    function Plugin(option, _relatedTarget) {
1189      return this.each(function () {
1190        var $this   = $(this)
1191        var data    = $this.data('bs.modal')
1192        var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
1193  
1194        if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
1195        if (typeof option == 'string') data[option](_relatedTarget)
1196        else if (options.show) data.show(_relatedTarget)
1197      })
1198    }
1199  
1200    var old = $.fn.modal
1201  
1202    $.fn.modal             = Plugin
1203    $.fn.modal.Constructor = Modal
1204  
1205  
1206    // MODAL NO CONFLICT
1207    // =================
1208  
1209    $.fn.modal.noConflict = function () {
1210      $.fn.modal = old
1211      return this
1212    }
1213  
1214  
1215    // MODAL DATA-API
1216    // ==============
1217  
1218    $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
1219      var $this   = $(this)
1220      var href    = $this.attr('href')
1221      var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
1222      var option  = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
1223  
1224      if ($this.is('a')) e.preventDefault()
1225  
1226      $target.one('show.bs.modal', function (showEvent) {
1227        if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
1228        $target.one('hidden.bs.modal', function () {
1229          $this.is(':visible') && $this.trigger('focus')
1230        })
1231      })
1232      Plugin.call($target, option, this)
1233    })
1234  
1235  }(jQuery);
1236  
1237  /* ========================================================================
1238   * Bootstrap: tooltip.js v3.3.4
1239   * http://getbootstrap.com/javascript/#tooltip
1240   * Inspired by the original jQuery.tipsy by Jason Frame
1241   * ========================================================================
1242   * Copyright 2011-2015 Twitter, Inc.
1243   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1244   * ======================================================================== */
1245  
1246  
1247  +function ($) {
1248    'use strict';
1249  
1250    // TOOLTIP PUBLIC CLASS DEFINITION
1251    // ===============================
1252  
1253    var Tooltip = function (element, options) {
1254      this.type       = null
1255      this.options    = null
1256      this.enabled    = null
1257      this.timeout    = null
1258      this.hoverState = null
1259      this.$element   = null
1260  
1261      this.init('tooltip', element, options)
1262    }
1263  
1264    Tooltip.VERSION  = '3.3.4'
1265  
1266    Tooltip.TRANSITION_DURATION = 150
1267  
1268    Tooltip.DEFAULTS = {
1269      animation: true,
1270      placement: 'top',
1271      selector: false,
1272      template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
1273      trigger: 'hover focus',
1274      title: '',
1275      delay: 0,
1276      html: false,
1277      container: false,
1278      viewport: {
1279        selector: 'body',
1280        padding: 0
1281      }
1282    }
1283  
1284    Tooltip.prototype.init = function (type, element, options) {
1285      this.enabled   = true
1286      this.type      = type
1287      this.$element  = $(element)
1288      this.options   = this.getOptions(options)
1289      this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
1290  
1291      if (this.$element[0] instanceof document.constructor && !this.options.selector) {
1292        throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
1293      }
1294  
1295      var triggers = this.options.trigger.split(' ')
1296  
1297      for (var i = triggers.length; i--;) {
1298        var trigger = triggers[i]
1299  
1300        if (trigger == 'click') {
1301          this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1302        } else if (trigger != 'manual') {
1303          var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focusin'
1304          var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
1305  
1306          this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1307          this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1308        }
1309      }
1310  
1311      this.options.selector ?
1312        (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1313        this.fixTitle()
1314    }
1315  
1316    Tooltip.prototype.getDefaults = function () {
1317      return Tooltip.DEFAULTS
1318    }
1319  
1320    Tooltip.prototype.getOptions = function (options) {
1321      options = $.extend({}, this.getDefaults(), this.$element.data(), options)
1322  
1323      if (options.delay && typeof options.delay == 'number') {
1324        options.delay = {
1325          show: options.delay,
1326          hide: options.delay
1327        }
1328      }
1329  
1330      return options
1331    }
1332  
1333    Tooltip.prototype.getDelegateOptions = function () {
1334      var options  = {}
1335      var defaults = this.getDefaults()
1336  
1337      this._options && $.each(this._options, function (key, value) {
1338        if (defaults[key] != value) options[key] = value
1339      })
1340  
1341      return options
1342    }
1343  
1344    Tooltip.prototype.enter = function (obj) {
1345      var self = obj instanceof this.constructor ?
1346        obj : $(obj.currentTarget).data('bs.' + this.type)
1347  
1348      if (self && self.$tip && self.$tip.is(':visible')) {
1349        self.hoverState = 'in'
1350        return
1351      }
1352  
1353      if (!self) {
1354        self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
1355        $(obj.currentTarget).data('bs.' + this.type, self)
1356      }
1357  
1358      clearTimeout(self.timeout)
1359  
1360      self.hoverState = 'in'
1361  
1362      if (!self.options.delay || !self.options.delay.show) return self.show()
1363  
1364      self.timeout = setTimeout(function () {
1365        if (self.hoverState == 'in') self.show()
1366      }, self.options.delay.show)
1367    }
1368  
1369    Tooltip.prototype.leave = function (obj) {
1370      var self = obj instanceof this.constructor ?
1371        obj : $(obj.currentTarget).data('bs.' + this.type)
1372  
1373      if (!self) {
1374        self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
1375        $(obj.currentTarget).data('bs.' + this.type, self)
1376      }
1377  
1378      clearTimeout(self.timeout)
1379  
1380      self.hoverState = 'out'
1381  
1382      if (!self.options.delay || !self.options.delay.hide) return self.hide()
1383  
1384      self.timeout = setTimeout(function () {
1385        if (self.hoverState == 'out') self.hide()
1386      }, self.options.delay.hide)
1387    }
1388  
1389    Tooltip.prototype.show = function () {
1390      var e = $.Event('show.bs.' + this.type)
1391  
1392      if (this.hasContent() && this.enabled) {
1393        this.$element.trigger(e)
1394  
1395        var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
1396        if (e.isDefaultPrevented() || !inDom) return
1397        var that = this
1398  
1399        var $tip = this.tip()
1400  
1401        var tipId = this.getUID(this.type)
1402  
1403        this.setContent()
1404        $tip.attr('id', tipId)
1405        this.$element.attr('aria-describedby', tipId)
1406  
1407        if (this.options.animation) $tip.addClass('fade')
1408  
1409        var placement = typeof this.options.placement == 'function' ?
1410          this.options.placement.call(this, $tip[0], this.$element[0]) :
1411          this.options.placement
1412  
1413        var autoToken = /\s?auto?\s?/i
1414        var autoPlace = autoToken.test(placement)
1415        if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
1416  
1417        $tip
1418          .detach()
1419          .css({ top: 0, left: 0, display: 'block' })
1420          .addClass(placement)
1421          .data('bs.' + this.type, this)
1422  
1423        this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
1424  
1425        var pos          = this.getPosition()
1426        var actualWidth  = $tip[0].offsetWidth
1427        var actualHeight = $tip[0].offsetHeight
1428  
1429        if (autoPlace) {
1430          var orgPlacement = placement
1431          var $container   = this.options.container ? $(this.options.container) : this.$element.parent()
1432          var containerDim = this.getPosition($container)
1433  
1434          placement = placement == 'bottom' && pos.bottom + actualHeight > containerDim.bottom ? 'top'    :
1435                      placement == 'top'    && pos.top    - actualHeight < containerDim.top    ? 'bottom' :
1436                      placement == 'right'  && pos.right  + actualWidth  > containerDim.width  ? 'left'   :
1437                      placement == 'left'   && pos.left   - actualWidth  < containerDim.left   ? 'right'  :
1438                      placement
1439  
1440          $tip
1441            .removeClass(orgPlacement)
1442            .addClass(placement)
1443        }
1444  
1445        var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
1446  
1447        this.applyPlacement(calculatedOffset, placement)
1448  
1449        var complete = function () {
1450          var prevHoverState = that.hoverState
1451          that.$element.trigger('shown.bs.' + that.type)
1452          that.hoverState = null
1453  
1454          if (prevHoverState == 'out') that.leave(that)
1455        }
1456  
1457        $.support.transition && this.$tip.hasClass('fade') ?
1458          $tip
1459            .one('bsTransitionEnd', complete)
1460            .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
1461          complete()
1462      }
1463    }
1464  
1465    Tooltip.prototype.applyPlacement = function (offset, placement) {
1466      var $tip   = this.tip()
1467      var width  = $tip[0].offsetWidth
1468      var height = $tip[0].offsetHeight
1469  
1470      // manually read margins because getBoundingClientRect includes difference
1471      var marginTop = parseInt($tip.css('margin-top'), 10)
1472      var marginLeft = parseInt($tip.css('margin-left'), 10)
1473  
1474      // we must check for NaN for ie 8/9
1475      if (isNaN(marginTop))  marginTop  = 0
1476      if (isNaN(marginLeft)) marginLeft = 0
1477  
1478      offset.top  = offset.top  + marginTop
1479      offset.left = offset.left + marginLeft
1480  
1481      // $.fn.offset doesn't round pixel values
1482      // so we use setOffset directly with our own function B-0
1483      $.offset.setOffset($tip[0], $.extend({
1484        using: function (props) {
1485          $tip.css({
1486            top: Math.round(props.top),
1487            left: Math.round(props.left)
1488          })
1489        }
1490      }, offset), 0)
1491  
1492      $tip.addClass('in')
1493  
1494      // check to see if placing tip in new offset caused the tip to resize itself
1495      var actualWidth  = $tip[0].offsetWidth
1496      var actualHeight = $tip[0].offsetHeight
1497  
1498      if (placement == 'top' && actualHeight != height) {
1499        offset.top = offset.top + height - actualHeight
1500      }
1501  
1502      var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
1503  
1504      if (delta.left) offset.left += delta.left
1505      else offset.top += delta.top
1506  
1507      var isVertical          = /top|bottom/.test(placement)
1508      var arrowDelta          = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
1509      var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
1510  
1511      $tip.offset(offset)
1512      this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
1513    }
1514  
1515    Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
1516      this.arrow()
1517        .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
1518        .css(isVertical ? 'top' : 'left', '')
1519    }
1520  
1521    Tooltip.prototype.setContent = function () {
1522      var $tip  = this.tip()
1523      var title = this.getTitle()
1524  
1525      $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1526      $tip.removeClass('fade in top bottom left right')
1527    }
1528  
1529    Tooltip.prototype.hide = function (callback) {
1530      var that = this
1531      var $tip = $(this.$tip)
1532      var e    = $.Event('hide.bs.' + this.type)
1533  
1534      function complete() {
1535        if (that.hoverState != 'in') $tip.detach()
1536        that.$element
1537          .removeAttr('aria-describedby')
1538          .trigger('hidden.bs.' + that.type)
1539        callback && callback()
1540      }
1541  
1542      this.$element.trigger(e)
1543  
1544      if (e.isDefaultPrevented()) return
1545  
1546      $tip.removeClass('in')
1547  
1548      $.support.transition && $tip.hasClass('fade') ?
1549        $tip
1550          .one('bsTransitionEnd', complete)
1551          .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
1552        complete()
1553  
1554      this.hoverState = null
1555  
1556      return this
1557    }
1558  
1559    Tooltip.prototype.fixTitle = function () {
1560      var $e = this.$element
1561      if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
1562        $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
1563      }
1564    }
1565  
1566    Tooltip.prototype.hasContent = function () {
1567      return this.getTitle()
1568    }
1569  
1570    Tooltip.prototype.getPosition = function ($element) {
1571      $element   = $element || this.$element
1572  
1573      var el     = $element[0]
1574      var isBody = el.tagName == 'BODY'
1575  
1576      var elRect    = el.getBoundingClientRect()
1577      if (elRect.width == null) {
1578        // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
1579        elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
1580      }
1581      var elOffset  = isBody ? { top: 0, left: 0 } : $element.offset()
1582      var scroll    = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
1583      var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
1584  
1585      return $.extend({}, elRect, scroll, outerDims, elOffset)
1586    }
1587  
1588    Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
1589      return placement == 'bottom' ? { top: pos.top + pos.height,   left: pos.left + pos.width / 2 - actualWidth / 2 } :
1590             placement == 'top'    ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
1591             placement == 'left'   ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
1592          /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
1593  
1594    }
1595  
1596    Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
1597      var delta = { top: 0, left: 0 }
1598      if (!this.$viewport) return delta
1599  
1600      var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
1601      var viewportDimensions = this.getPosition(this.$viewport)
1602  
1603      if (/right|left/.test(placement)) {
1604        var topEdgeOffset    = pos.top - viewportPadding - viewportDimensions.scroll
1605        var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
1606        if (topEdgeOffset < viewportDimensions.top) { // top overflow
1607          delta.top = viewportDimensions.top - topEdgeOffset
1608        } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
1609          delta.top = viewportDimensions.top + viewportDimensions.height - bottom
vendor: 2,105 bytes, lines 1609-1682
1609EdgeOffset
1610        }
1611      } else {
1612        var leftEdgeOffset  = pos.left - viewportPadding
1613        var rightEdgeOffset = pos.left + viewportPadding + actualWidth
1614        if (leftEdgeOffset < viewportDimensions.left) { // left overflow
1615          delta.left = viewportDimensions.left - leftEdgeOffset
1616        } else if (rightEdgeOffset > viewportDimensions.width) { // right overflow
1617          delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
1618        }
1619      }
1620  
1621      return delta
1622    }
1623  
1624    Tooltip.prototype.getTitle = function () {
1625      var title
1626      var $e = this.$element
1627      var o  = this.options
1628  
1629      title = $e.attr('data-original-title')
1630        || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
1631  
1632      return title
1633    }
1634  
1635    Tooltip.prototype.getUID = function (prefix) {
1636      do prefix += ~~(Math.random() * 1000000)
1637      while (document.getElementById(prefix))
1638      return prefix
1639    }
1640  
1641    Tooltip.prototype.tip = function () {
1642      return (this.$tip = this.$tip || $(this.options.template))
1643    }
1644  
1645    Tooltip.prototype.arrow = function () {
1646      return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
1647    }
1648  
1649    Tooltip.prototype.enable = function () {
1650      this.enabled = true
1651    }
1652  
1653    Tooltip.prototype.disable = function () {
1654      this.enabled = false
1655    }
1656  
1657    Tooltip.prototype.toggleEnabled = function () {
1658      this.enabled = !this.enabled
1659    }
1660  
1661    Tooltip.prototype.toggle = function (e) {
1662      var self = this
1663      if (e) {
1664        self = $(e.currentTarget).data('bs.' + this.type)
1665        if (!self) {
1666          self = new this.constructor(e.currentTarget, this.getDelegateOptions())
1667          $(e.currentTarget).data('bs.' + this.type, self)
1668        }
1669      }
1670  
1671      self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
1672    }
1673  
1674    Tooltip.prototype.destroy = function () {
1675      var that = this
1676      clearTimeout(this.timeout)
1677      this.hide(function () {
1678        that.$element.off('.' + that.type).removeData('bs.' + that.type)
1679      })
1680    }
1681  
1682  
vendor: 3,382 bytes, lines 1683-1791
1683    // TOOLTIP PLUGIN DEFINITION
1684    // =========================
1685  
1686    function Plugin(option) {
1687      return this.each(function () {
1688        var $this   = $(this)
1689        var data    = $this.data('bs.tooltip')
1690        var options = typeof option == 'object' && option
1691  
1692        if (!data && /destroy|hide/.test(option)) return
1693        if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
1694        if (typeof option == 'string') data[option]()
1695      })
1696    }
1697  
1698    var old = $.fn.tooltip
1699  
1700    $.fn.tooltip             = Plugin
1701    $.fn.tooltip.Constructor = Tooltip
1702  
1703  
1704    // TOOLTIP NO CONFLICT
1705    // ===================
1706  
1707    $.fn.tooltip.noConflict = function () {
1708      $.fn.tooltip = old
1709      return this
1710    }
1711  
1712  }(jQuery);
1713  
1714  /* ========================================================================
1715   * Bootstrap: popover.js v3.3.4
1716   * http://getbootstrap.com/javascript/#popovers
1717   * ========================================================================
1718   * Copyright 2011-2015 Twitter, Inc.
1719   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1720   * ======================================================================== */
1721  
1722  
1723  +function ($) {
1724    'use strict';
1725  
1726    // POPOVER PUBLIC CLASS DEFINITION
1727    // ===============================
1728  
1729    var Popover = function (element, options) {
1730      this.init('popover', element, options)
1731    }
1732  
1733    if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
1734  
1735    Popover.VERSION  = '3.3.4'
1736  
1737    Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
1738      placement: 'right',
1739      trigger: 'click',
1740      content: '',
1741      template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
1742    })
1743  
1744  
1745    // NOTE: POPOVER EXTENDS tooltip.js
1746    // ================================
1747  
1748    Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
1749  
1750    Popover.prototype.constructor = Popover
1751  
1752    Popover.prototype.getDefaults = function () {
1753      return Popover.DEFAULTS
1754    }
1755  
1756    Popover.prototype.setContent = function () {
1757      var $tip    = this.tip()
1758      var title   = this.getTitle()
1759      var content = this.getContent()
1760  
1761      $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1762      $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
1763        this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
1764      ](content)
1765  
1766      $tip.removeClass('fade top bottom left right in')
1767  
1768      // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
1769      // this manually by checking the contents.
1770      if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
1771    }
1772  
1773    Popover.prototype.hasContent = function () {
1774      return this.getTitle() || this.getContent()
1775    }
1776  
1777    Popover.prototype.getContent = function () {
1778      var $e = this.$element
1779      var o  = this.options
1780  
1781      return $e.attr('data-content')
1782        || (typeof o.content == 'function' ?
1783              o.content.call($e[0]) :
1784              o.content)
1785    }
1786  
1787    Popover.prototype.arrow = function () {
1788      return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
1789    }
1790  
1791  
vendor: 13,122 bytes, lines 1792-2235
1792    // POPOVER PLUGIN DEFINITION
1793    // =========================
1794  
1795    function Plugin(option) {
1796      return this.each(function () {
1797        var $this   = $(this)
1798        var data    = $this.data('bs.popover')
1799        var options = typeof option == 'object' && option
1800  
1801        if (!data && /destroy|hide/.test(option)) return
1802        if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
1803        if (typeof option == 'string') data[option]()
1804      })
1805    }
1806  
1807    var old = $.fn.popover
1808  
1809    $.fn.popover             = Plugin
1810    $.fn.popover.Constructor = Popover
1811  
1812  
1813    // POPOVER NO CONFLICT
1814    // ===================
1815  
1816    $.fn.popover.noConflict = function () {
1817      $.fn.popover = old
1818      return this
1819    }
1820  
1821  }(jQuery);
1822  
1823  /* ========================================================================
1824   * Bootstrap: scrollspy.js v3.3.4
1825   * http://getbootstrap.com/javascript/#scrollspy
1826   * ========================================================================
1827   * Copyright 2011-2015 Twitter, Inc.
1828   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1829   * ======================================================================== */
1830  
1831  
1832  +function ($) {
1833    'use strict';
1834  
1835    // SCROLLSPY CLASS DEFINITION
1836    // ==========================
1837  
1838    function ScrollSpy(element, options) {
1839      this.$body          = $(document.body)
1840      this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
1841      this.options        = $.extend({}, ScrollSpy.DEFAULTS, options)
1842      this.selector       = (this.options.target || '') + ' .nav li > a'
1843      this.offsets        = []
1844      this.targets        = []
1845      this.activeTarget   = null
1846      this.scrollHeight   = 0
1847  
1848      this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
1849      this.refresh()
1850      this.process()
1851    }
1852  
1853    ScrollSpy.VERSION  = '3.3.4'
1854  
1855    ScrollSpy.DEFAULTS = {
1856      offset: 10
1857    }
1858  
1859    ScrollSpy.prototype.getScrollHeight = function () {
1860      return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
1861    }
1862  
1863    ScrollSpy.prototype.refresh = function () {
1864      var that          = this
1865      var offsetMethod  = 'offset'
1866      var offsetBase    = 0
1867  
1868      this.offsets      = []
1869      this.targets      = []
1870      this.scrollHeight = this.getScrollHeight()
1871  
1872      if (!$.isWindow(this.$scrollElement[0])) {
1873        offsetMethod = 'position'
1874        offsetBase   = this.$scrollElement.scrollTop()
1875      }
1876  
1877      this.$body
1878        .find(this.selector)
1879        .map(function () {
1880          var $el   = $(this)
1881          var href  = $el.data('target') || $el.attr('href')
1882          var $href = /^#./.test(href) && $(href)
1883  
1884          return ($href
1885            && $href.length
1886            && $href.is(':visible')
1887            && [[$href[offsetMethod]().top + offsetBase, href]]) || null
1888        })
1889        .sort(function (a, b) { return a[0] - b[0] })
1890        .each(function () {
1891          that.offsets.push(this[0])
1892          that.targets.push(this[1])
1893        })
1894    }
1895  
1896    ScrollSpy.prototype.process = function () {
1897      var scrollTop    = this.$scrollElement.scrollTop() + this.options.offset
1898      var scrollHeight = this.getScrollHeight()
1899      var maxScroll    = this.options.offset + scrollHeight - this.$scrollElement.height()
1900      var offsets      = this.offsets
1901      var targets      = this.targets
1902      var activeTarget = this.activeTarget
1903      var i
1904  
1905      if (this.scrollHeight != scrollHeight) {
1906        this.refresh()
1907      }
1908  
1909      if (scrollTop >= maxScroll) {
1910        return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
1911      }
1912  
1913      if (activeTarget && scrollTop < offsets[0]) {
1914        this.activeTarget = null
1915        return this.clear()
1916      }
1917  
1918      for (i = offsets.length; i--;) {
1919        activeTarget != targets[i]
1920          && scrollTop >= offsets[i]
1921          && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
1922          && this.activate(targets[i])
1923      }
1924    }
1925  
1926    ScrollSpy.prototype.activate = function (target) {
1927      this.activeTarget = target
1928  
1929      this.clear()
1930  
1931      var selector = this.selector +
1932        '[data-target="' + target + '"],' +
1933        this.selector + '[href="' + target + '"]'
1934  
1935      var active = $(selector)
1936        .parents('li')
1937        .addClass('active')
1938  
1939      if (active.parent('.dropdown-menu').length) {
1940        active = active
1941          .closest('li.dropdown')
1942          .addClass('active')
1943      }
1944  
1945      active.trigger('activate.bs.scrollspy')
1946    }
1947  
1948    ScrollSpy.prototype.clear = function () {
1949      $(this.selector)
1950        .parentsUntil(this.options.target, '.active')
1951        .removeClass('active')
1952    }
1953  
1954  
1955    // SCROLLSPY PLUGIN DEFINITION
1956    // ===========================
1957  
1958    function Plugin(option) {
1959      return this.each(function () {
1960        var $this   = $(this)
1961        var data    = $this.data('bs.scrollspy')
1962        var options = typeof option == 'object' && option
1963  
1964        if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
1965        if (typeof option == 'string') data[option]()
1966      })
1967    }
1968  
1969    var old = $.fn.scrollspy
1970  
1971    $.fn.scrollspy             = Plugin
1972    $.fn.scrollspy.Constructor = ScrollSpy
1973  
1974  
1975    // SCROLLSPY NO CONFLICT
1976    // =====================
1977  
1978    $.fn.scrollspy.noConflict = function () {
1979      $.fn.scrollspy = old
1980      return this
1981    }
1982  
1983  
1984    // SCROLLSPY DATA-API
1985    // ==================
1986  
1987    $(window).on('load.bs.scrollspy.data-api', function () {
1988      $('[data-spy="scroll"]').each(function () {
1989        var $spy = $(this)
1990        Plugin.call($spy, $spy.data())
1991      })
1992    })
1993  
1994  }(jQuery);
1995  
1996  /* ========================================================================
1997   * Bootstrap: tab.js v3.3.4
1998   * http://getbootstrap.com/javascript/#tabs
1999   * ========================================================================
2000   * Copyright 2011-2015 Twitter, Inc.
2001   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2002   * ======================================================================== */
2003  
2004  
2005  +function ($) {
2006    'use strict';
2007  
2008    // TAB CLASS DEFINITION
2009    // ====================
2010  
2011    var Tab = function (element) {
2012      this.element = $(element)
2013    }
2014  
2015    Tab.VERSION = '3.3.4'
2016  
2017    Tab.TRANSITION_DURATION = 150
2018  
2019    Tab.prototype.show = function () {
2020      var $this    = this.element
2021      var $ul      = $this.closest('ul:not(.dropdown-menu)')
2022      var selector = $this.data('target')
2023  
2024      if (!selector) {
2025        selector = $this.attr('href')
2026        selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
2027      }
2028  
2029      if ($this.parent('li').hasClass('active')) return
2030  
2031      var $previous = $ul.find('.active:last a')
2032      var hideEvent = $.Event('hide.bs.tab', {
2033        relatedTarget: $this[0]
2034      })
2035      var showEvent = $.Event('show.bs.tab', {
2036        relatedTarget: $previous[0]
2037      })
2038  
2039      $previous.trigger(hideEvent)
2040      $this.trigger(showEvent)
2041  
2042      if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
2043  
2044      var $target = $(selector)
2045  
2046      this.activate($this.closest('li'), $ul)
2047      this.activate($target, $target.parent(), function () {
2048        $previous.trigger({
2049          type: 'hidden.bs.tab',
2050          relatedTarget: $this[0]
2051        })
2052        $this.trigger({
2053          type: 'shown.bs.tab',
2054          relatedTarget: $previous[0]
2055        })
2056      })
2057    }
2058  
2059    Tab.prototype.activate = function (element, container, callback) {
2060      var $active    = container.find('> .active')
2061      var transition = callback
2062        && $.support.transition
2063        && (($active.length && $active.hasClass('fade')) || !!container.find('> .fade').length)
2064  
2065      function next() {
2066        $active
2067          .removeClass('active')
2068          .find('> .dropdown-menu > .active')
2069            .removeClass('active')
2070          .end()
2071          .find('[data-toggle="tab"]')
2072            .attr('aria-expanded', false)
2073  
2074        element
2075          .addClass('active')
2076          .find('[data-toggle="tab"]')
2077            .attr('aria-expanded', true)
2078  
2079        if (transition) {
2080          element[0].offsetWidth // reflow for transition
2081          element.addClass('in')
2082        } else {
2083          element.removeClass('fade')
2084        }
2085  
2086        if (element.parent('.dropdown-menu').length) {
2087          element
2088            .closest('li.dropdown')
2089              .addClass('active')
2090            .end()
2091            .find('[data-toggle="tab"]')
2092              .attr('aria-expanded', true)
2093        }
2094  
2095        callback && callback()
2096      }
2097  
2098      $active.length && transition ?
2099        $active
2100          .one('bsTransitionEnd', next)
2101          .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
2102        next()
2103  
2104      $active.removeClass('in')
2105    }
2106  
2107  
2108    // TAB PLUGIN DEFINITION
2109    // =====================
2110  
2111    function Plugin(option) {
2112      return this.each(function () {
2113        var $this = $(this)
2114        var data  = $this.data('bs.tab')
2115  
2116        if (!data) $this.data('bs.tab', (data = new Tab(this)))
2117        if (typeof option == 'string') data[option]()
2118      })
2119    }
2120  
2121    var old = $.fn.tab
2122  
2123    $.fn.tab             = Plugin
2124    $.fn.tab.Constructor = Tab
2125  
2126  
2127    // TAB NO CONFLICT
2128    // ===============
2129  
2130    $.fn.tab.noConflict = function () {
2131      $.fn.tab = old
2132      return this
2133    }
2134  
2135  
2136    // TAB DATA-API
2137    // ============
2138  
2139    var clickHandler = function (e) {
2140      e.preventDefault()
2141      Plugin.call($(this), 'show')
2142    }
2143  
2144    $(document)
2145      .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
2146      .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
2147  
2148  }(jQuery);
2149  
2150  /* ========================================================================
2151   * Bootstrap: affix.js v3.3.4
2152   * http://getbootstrap.com/javascript/#affix
2153   * ========================================================================
2154   * Copyright 2011-2015 Twitter, Inc.
2155   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2156   * ======================================================================== */
2157  
2158  
2159  +function ($) {
2160    'use strict';
2161  
2162    // AFFIX CLASS DEFINITION
2163    // ======================
2164  
2165    var Affix = function (element, options) {
2166      this.options = $.extend({}, Affix.DEFAULTS, options)
2167  
2168      this.$target = $(this.options.target)
2169        .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
2170        .on('click.bs.affix.data-api',  $.proxy(this.checkPositionWithEventLoop, this))
2171  
2172      this.$element     = $(element)
2173      this.affixed      = null
2174      this.unpin        = null
2175      this.pinnedOffset = null
2176  
2177      this.checkPosition()
2178    }
2179  
2180    Affix.VERSION  = '3.3.4'
2181  
2182    Affix.RESET    = 'affix affix-top affix-bottom'
2183  
2184    Affix.DEFAULTS = {
2185      offset: 0,
2186      target: window
2187    }
2188  
2189    Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
2190      var scrollTop    = this.$target.scrollTop()
2191      var position     = this.$element.offset()
2192      var targetHeight = this.$target.height()
2193  
2194      if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
2195  
2196      if (this.affixed == 'bottom') {
2197        if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
2198        return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
2199      }
2200  
2201      var initializing   = this.affixed == null
2202      var colliderTop    = initializing ? scrollTop : position.top
2203      var colliderHeight = initializing ? targetHeight : height
2204  
2205      if (offsetTop != null && scrollTop <= offsetTop) return 'top'
2206      if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
2207  
2208      return false
2209    }
2210  
2211    Affix.prototype.getPinnedOffset = function () {
2212      if (this.pinnedOffset) return this.pinnedOffset
2213      this.$element.removeClass(Affix.RESET).addClass('affix')
2214      var scrollTop = this.$target.scrollTop()
2215      var position  = this.$element.offset()
2216      return (this.pinnedOffset = position.top - scrollTop)
2217    }
2218  
2219    Affix.prototype.checkPositionWithEventLoop = function () {
2220      setTimeout($.proxy(this.checkPosition, this), 1)
2221    }
2222  
2223    Affix.prototype.checkPosition = function () {
2224      if (!this.$element.is(':visible')) return
2225  
2226      var height       = this.$element.height()
2227      var offset       = this.options.offset
2228      var offsetTop    = offset.top
2229      var offsetBottom = offset.bottom
2230      var scrollHeight = $(document.body).height()
2231  
2232      if (typeof offset != 'object')         offsetBottom = offsetTop = offset
2233      if (typeof offsetTop == 'function')    offsetTop    = offset.top(this.$element)
2234      if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
2235  
vendor: 1,474 bytes, lines 2236-2293
2236      var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
2237  
2238      if (this.affixed != affix) {
2239        if (this.unpin != null) this.$element.css('top', '')
2240  
2241        var affixType = 'affix' + (affix ? '-' + affix : '')
2242        var e         = $.Event(affixType + '.bs.affix')
2243  
2244        this.$element.trigger(e)
2245  
2246        if (e.isDefaultPrevented()) return
2247  
2248        this.affixed = affix
2249        this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
2250  
2251        this.$element
2252          .removeClass(Affix.RESET)
2253          .addClass(affixType)
2254          .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
2255      }
2256  
2257      if (affix == 'bottom') {
2258        this.$element.offset({
2259          top: scrollHeight - height - offsetBottom
2260        })
2261      }
2262    }
2263  
2264  
2265    // AFFIX PLUGIN DEFINITION
2266    // =======================
2267  
2268    function Plugin(option) {
2269      return this.each(function () {
2270        var $this   = $(this)
2271        var data    = $this.data('bs.affix')
2272        var options = typeof option == 'object' && option
2273  
2274        if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
2275        if (typeof option == 'string') data[option]()
2276      })
2277    }
2278  
2279    var old = $.fn.affix
2280  
2281    $.fn.affix             = Plugin
2282    $.fn.affix.Constructor = Affix
2283  
2284  
2285    // AFFIX NO CONFLICT
2286    // =================
2287  
2288    $.fn.affix.noConflict = function () {
2289      $.fn.affix = old
2290      return this
2291    }
2292  
2293  
2294    // AFFIX DATA-API
2295    // ==============
2296  
2297    $(window).on('load', function () {
2298      $('[data-spy="affix"]').each(function () {
2299        var $spy = $(this)
2300        var data = $spy.data()
2301  
2302        data.offset = data.offset || {}
2303  
2304        if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
2305        if (data.offsetTop    != null) data.offset.top    = data.offsetTop
2306  
2307        Plugin.call($spy, data)
2308      })
2309    })
2310  
2311  }(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.