')).parent().data('animated', false);
+
+ if ($element.data('animated') !== false)
+ $div.addClass('switch-animate').data('animated', true);
+
+ $div
+ .append($switchLeft)
+ .append($label)
+ .append($switchRight);
+
+ $element.find('>div').addClass(
+ $element.find('input').is(':checked') ? 'switch-on' : 'switch-off'
+ );
+
+ if ($element.find('input').is(':disabled'))
+ $(this).addClass('deactivate');
+
+ var changeStatus = function ($this) {
+ $this.siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
+ };
+
+ $element.on('keydown', function (e) {
+ if (e.keyCode === 32) {
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ changeStatus($(e.target).find('span:first'));
+ }
+ });
+
+ $switchLeft.on('click', function (e) {
+ changeStatus($(this));
+ });
+
+ $switchRight.on('click', function (e) {
+ changeStatus($(this));
+ });
+
+ $element.find('input').on('change', function (e) {
+ var $this = $(this)
+ , $element = $this.parent()
+ , thisState = $this.is(':checked')
+ , state = $element.is('.switch-off');
+
+ e.preventDefault();
+
+ $element.css('left', '');
+
+ if (state === thisState) {
+
+ if (thisState)
+ $element.removeClass('switch-off').addClass('switch-on');
+ else $element.removeClass('switch-on').addClass('switch-off');
+
+ if ($element.data('animated') !== false)
+ $element.addClass("switch-animate");
+
+ $element.parent().trigger('switch-change', {'el': $this, 'value': thisState})
+ }
+ });
+
+ $element.find('label').on('mousedown touchstart', function (e) {
+ var $this = $(this);
+ moving = false;
+
+ e.preventDefault();
+ e.stopImmediatePropagation();
+
+ $this.closest('div').removeClass('switch-animate');
+
+ if ($this.closest('.has-switch').is('.deactivate'))
+ $this.unbind('click');
+ else {
+ $this.on('mousemove touchmove', function (e) {
+ var $element = $(this).closest('.switch')
+ , relativeX = (e.pageX || e.originalEvent.targetTouches[0].pageX) - $element.offset().left
+ , percent = (relativeX / $element.width()) * 100
+ , left = 25
+ , right = 75;
+
+ moving = true;
+
+ if (percent < left)
+ percent = left;
+ else if (percent > right)
+ percent = right;
+
+ $element.find('>div').css('left', (percent - right) + "%")
+ });
+
+ $this.on('click touchend', function (e) {
+ var $this = $(this)
+ , $target = $(e.target)
+ , $myCheckBox = $target.siblings('input');
+
+ e.stopImmediatePropagation();
+ e.preventDefault();
+
+ $this.unbind('mouseleave');
+
+ if (moving)
+ $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25));
+ else $myCheckBox.prop("checked", !$myCheckBox.is(":checked"));
+
+ moving = false;
+ $myCheckBox.trigger('change');
+ });
+
+ $this.on('mouseleave', function (e) {
+ var $this = $(this)
+ , $myCheckBox = $this.siblings('input');
+
+ e.preventDefault();
+ e.stopImmediatePropagation();
+
+ $this.unbind('mouseleave');
+ $this.trigger('mouseup');
+
+ $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25)).trigger('change');
+ });
+
+ $this.on('mouseup', function (e) {
+ e.stopImmediatePropagation();
+ e.preventDefault();
+
+ $(this).unbind('mousemove');
+ });
+ }
+ });
+ }
+ );
+ },
+ toggleActivation: function () {
+ $(this).toggleClass('deactivate');
+ },
+ isActive: function () {
+ return !$(this).hasClass('deactivate');
+ },
+ setActive: function (active) {
+ if (active)
+ $(this).removeClass('deactivate');
+ else $(this).addClass('deactivate');
+ },
+ toggleState: function (skipOnChange) {
+ var $input = $(this).find('input:checkbox');
+ $input.prop('checked', !$input.is(':checked')).trigger('change', skipOnChange);
+ },
+ setState: function (value, skipOnChange) {
+ $(this).find('input:checkbox').prop('checked', value).trigger('change', skipOnChange);
+ },
+ status: function () {
+ return $(this).find('input:checkbox').is(':checked');
+ },
+ destroy: function () {
+ var $div = $(this).find('div')
+ , $checkbox;
+
+ $div.find(':not(input:checkbox)').remove();
+
+ $checkbox = $div.children();
+ $checkbox.unwrap().unwrap();
+
+ $checkbox.unbind('change');
+
+ return $checkbox;
+ }
+ };
+
+ if (methods[method])
+ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
+ else if (typeof method === 'object' || !method)
+ return methods.init.apply(this, arguments);
+ else
+ $.error('Method ' + method + ' does not exist!');
+ };
+}(jQuery);
+
+
diff --git a/assets/js/bootstrap-notify.js b/assets/js/bootstrap-notify.js
new file mode 100644
index 0000000..f2f0c74
--- /dev/null
+++ b/assets/js/bootstrap-notify.js
@@ -0,0 +1,404 @@
+/*
+
+
+
+ Creative Tim Modifications
+
+ Lines: 239, 240 was changed from top: 5px to top: 50% and we added margin-top: -13px. In this way the close button will be aligned vertically
+ Line:242 - modified when the icon is set, we add the class "alert-with-icon", so there will be enough space for the icon.
+
+
+
+
+*/
+
+
+/*
+* Project: Bootstrap Notify = v3.1.5
+* Description: Turns standard Bootstrap alerts into "Growl-like" notifications.
+* Author: Mouse0270 aka Robert McIntosh
+* License: MIT License
+* Website: https://github.com/mouse0270/bootstrap-growl
+*/
+
+/* global define:false, require: false, jQuery:false */
+
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(['jquery'], factory);
+ } else if (typeof exports === 'object') {
+ // Node/CommonJS
+ factory(require('jquery'));
+ } else {
+ // Browser globals
+ factory(jQuery);
+ }
+}(function ($) {
+ // Create the defaults once
+ var defaults = {
+ element: 'body',
+ position: null,
+ type: "info",
+ allow_dismiss: true,
+ allow_duplicates: true,
+ newest_on_top: false,
+ showProgressbar: false,
+ placement: {
+ from: "top",
+ align: "right"
+ },
+ offset: 20,
+ spacing: 10,
+ z_index: 1031,
+ delay: 5000,
+ timer: 1000,
+ url_target: '_blank',
+ mouse_over: null,
+ animate: {
+ enter: 'animated fadeInDown',
+ exit: 'animated fadeOutUp'
+ },
+ onShow: null,
+ onShown: null,
+ onClose: null,
+ onClosed: null,
+ icon_type: 'class',
+ template: '
'
+ };
+
+ String.format = function () {
+ var str = arguments[0];
+ for (var i = 1; i < arguments.length; i++) {
+ str = str.replace(RegExp("\\{" + (i - 1) + "\\}", "gm"), arguments[i]);
+ }
+ return str;
+ };
+
+ function isDuplicateNotification(notification) {
+ var isDupe = false;
+
+ $('[data-notify="container"]').each(function (i, el) {
+ var $el = $(el);
+ var title = $el.find('[data-notify="title"]').text().trim();
+ var message = $el.find('[data-notify="message"]').html().trim();
+
+ // The input string might be different than the actual parsed HTML string!
+ // (
vs
for example)
+ // So we have to force-parse this as HTML here!
+ var isSameTitle = title === $("
" + notification.settings.content.title + "
").html().trim();
+ var isSameMsg = message === $("
" + notification.settings.content.message + "
").html().trim();
+ var isSameType = $el.hasClass('alert-' + notification.settings.type);
+
+ if (isSameTitle && isSameMsg && isSameType) {
+ //we found the dupe. Set the var and stop checking.
+ isDupe = true;
+ }
+ return !isDupe;
+ });
+
+ return isDupe;
+ }
+
+ function Notify(element, content, options) {
+ // Setup Content of Notify
+ var contentObj = {
+ content: {
+ message: typeof content === 'object' ? content.message : content,
+ title: content.title ? content.title : '',
+ icon: content.icon ? content.icon : '',
+ url: content.url ? content.url : '#',
+ target: content.target ? content.target : '-'
+ }
+ };
+
+ options = $.extend(true, {}, contentObj, options);
+ this.settings = $.extend(true, {}, defaults, options);
+ this._defaults = defaults;
+ if (this.settings.content.target === "-") {
+ this.settings.content.target = this.settings.url_target;
+ }
+ this.animations = {
+ start: 'webkitAnimationStart oanimationstart MSAnimationStart animationstart',
+ end: 'webkitAnimationEnd oanimationend MSAnimationEnd animationend'
+ };
+
+ if (typeof this.settings.offset === 'number') {
+ this.settings.offset = {
+ x: this.settings.offset,
+ y: this.settings.offset
+ };
+ }
+
+ //if duplicate messages are not allowed, then only continue if this new message is not a duplicate of one that it already showing
+ if (this.settings.allow_duplicates || (!this.settings.allow_duplicates && !isDuplicateNotification(this))) {
+ this.init();
+ }
+ }
+
+ $.extend(Notify.prototype, {
+ init: function () {
+ var self = this;
+
+ this.buildNotify();
+ if (this.settings.content.icon) {
+ this.setIcon();
+ }
+ if (this.settings.content.url != "#") {
+ this.styleURL();
+ }
+ this.styleDismiss();
+ this.placement();
+ this.bind();
+
+ this.notify = {
+ $ele: this.$ele,
+ update: function (command, update) {
+ var commands = {};
+ if (typeof command === "string") {
+ commands[command] = update;
+ } else {
+ commands = command;
+ }
+ for (var cmd in commands) {
+ switch (cmd) {
+ case "type":
+ this.$ele.removeClass('alert-' + self.settings.type);
+ this.$ele.find('[data-notify="progressbar"] > .progress-bar').removeClass('progress-bar-' + self.settings.type);
+ self.settings.type = commands[cmd];
+ this.$ele.addClass('alert-' + commands[cmd]).find('[data-notify="progressbar"] > .progress-bar').addClass('progress-bar-' + commands[cmd]);
+ break;
+ case "icon":
+ var $icon = this.$ele.find('[data-notify="icon"]');
+ if (self.settings.icon_type.toLowerCase() === 'class') {
+ $icon.removeClass(self.settings.content.icon).addClass(commands[cmd]);
+ } else {
+ if (!$icon.is('img')) {
+ $icon.find('img');
+ }
+ $icon.attr('src', commands[cmd]);
+ }
+ break;
+ case "progress":
+ var newDelay = self.settings.delay - (self.settings.delay * (commands[cmd] / 100));
+ this.$ele.data('notify-delay', newDelay);
+ this.$ele.find('[data-notify="progressbar"] > div').attr('aria-valuenow', commands[cmd]).css('width', commands[cmd] + '%');
+ break;
+ case "url":
+ this.$ele.find('[data-notify="url"]').attr('href', commands[cmd]);
+ break;
+ case "target":
+ this.$ele.find('[data-notify="url"]').attr('target', commands[cmd]);
+ break;
+ default:
+ this.$ele.find('[data-notify="' + cmd + '"]').html(commands[cmd]);
+ }
+ }
+ var posX = this.$ele.outerHeight() + parseInt(self.settings.spacing) + parseInt(self.settings.offset.y);
+ self.reposition(posX);
+ },
+ close: function () {
+ self.close();
+ }
+ };
+
+ },
+ buildNotify: function () {
+ var content = this.settings.content;
+ this.$ele = $(String.format(this.settings.template, this.settings.type, content.title, content.message, content.url, content.target));
+ this.$ele.attr('data-notify-position', this.settings.placement.from + '-' + this.settings.placement.align);
+ if (!this.settings.allow_dismiss) {
+ this.$ele.find('[data-notify="dismiss"]').css('display', 'none');
+ }
+ if ((this.settings.delay <= 0 && !this.settings.showProgressbar) || !this.settings.showProgressbar) {
+ this.$ele.find('[data-notify="progressbar"]').remove();
+ }
+ },
+ setIcon: function () {
+
+ this.$ele.addClass('alert-with-icon');
+
+ if (this.settings.icon_type.toLowerCase() === 'class') {
+ this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon);
+ } else {
+ if (this.$ele.find('[data-notify="icon"]').is('img')) {
+ this.$ele.find('[data-notify="icon"]').attr('src', this.settings.content.icon);
+ } else {
+ this.$ele.find('[data-notify="icon"]').append('
');
+ }
+ }
+ },
+ styleDismiss: function () {
+ this.$ele.find('[data-notify="dismiss"]').css({
+ position: 'absolute',
+ right: '10px',
+ top: '50%',
+ marginTop: '-13px',
+ zIndex: this.settings.z_index + 2
+ });
+ },
+ styleURL: function () {
+ this.$ele.find('[data-notify="url"]').css({
+ backgroundImage: 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)',
+ height: '100%',
+ left: 0,
+ position: 'absolute',
+ top: 0,
+ width: '100%',
+ zIndex: this.settings.z_index + 1
+ });
+ },
+ placement: function () {
+ var self = this,
+ offsetAmt = this.settings.offset.y,
+ css = {
+ display: 'inline-block',
+ margin: '0px auto',
+ position: this.settings.position ? this.settings.position : (this.settings.element === 'body' ? 'fixed' : 'absolute'),
+ transition: 'all .5s ease-in-out',
+ zIndex: this.settings.z_index
+ },
+ hasAnimation = false,
+ settings = this.settings;
+
+ $('[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])').each(function () {
+ offsetAmt = Math.max(offsetAmt, parseInt($(this).css(settings.placement.from)) + parseInt($(this).outerHeight()) + parseInt(settings.spacing));
+ });
+ if (this.settings.newest_on_top === true) {
+ offsetAmt = this.settings.offset.y;
+ }
+ css[this.settings.placement.from] = offsetAmt + 'px';
+
+ switch (this.settings.placement.align) {
+ case "left":
+ case "right":
+ css[this.settings.placement.align] = this.settings.offset.x + 'px';
+ break;
+ case "center":
+ css.left = 0;
+ css.right = 0;
+ break;
+ }
+ this.$ele.css(css).addClass(this.settings.animate.enter);
+ $.each(Array('webkit-', 'moz-', 'o-', 'ms-', ''), function (index, prefix) {
+ self.$ele[0].style[prefix + 'AnimationIterationCount'] = 1;
+ });
+
+ $(this.settings.element).append(this.$ele);
+
+ if (this.settings.newest_on_top === true) {
+ offsetAmt = (parseInt(offsetAmt) + parseInt(this.settings.spacing)) + this.$ele.outerHeight();
+ this.reposition(offsetAmt);
+ }
+
+ if ($.isFunction(self.settings.onShow)) {
+ self.settings.onShow.call(this.$ele);
+ }
+
+ this.$ele.one(this.animations.start, function () {
+ hasAnimation = true;
+ }).one(this.animations.end, function () {
+ if ($.isFunction(self.settings.onShown)) {
+ self.settings.onShown.call(this);
+ }
+ });
+
+ setTimeout(function () {
+ if (!hasAnimation) {
+ if ($.isFunction(self.settings.onShown)) {
+ self.settings.onShown.call(this);
+ }
+ }
+ }, 600);
+ },
+ bind: function () {
+ var self = this;
+
+ this.$ele.find('[data-notify="dismiss"]').on('click', function () {
+ self.close();
+ });
+
+ this.$ele.mouseover(function () {
+ $(this).data('data-hover', "true");
+ }).mouseout(function () {
+ $(this).data('data-hover', "false");
+ });
+ this.$ele.data('data-hover', "false");
+
+ if (this.settings.delay > 0) {
+ self.$ele.data('notify-delay', self.settings.delay);
+ var timer = setInterval(function () {
+ var delay = parseInt(self.$ele.data('notify-delay')) - self.settings.timer;
+ if ((self.$ele.data('data-hover') === 'false' && self.settings.mouse_over === "pause") || self.settings.mouse_over != "pause") {
+ var percent = ((self.settings.delay - delay) / self.settings.delay) * 100;
+ self.$ele.data('notify-delay', delay);
+ self.$ele.find('[data-notify="progressbar"] > div').attr('aria-valuenow', percent).css('width', percent + '%');
+ }
+ if (delay <= -(self.settings.timer)) {
+ clearInterval(timer);
+ self.close();
+ }
+ }, self.settings.timer);
+ }
+ },
+ close: function () {
+ var self = this,
+ posX = parseInt(this.$ele.css(this.settings.placement.from)),
+ hasAnimation = false;
+
+ this.$ele.data('closing', 'true').addClass(this.settings.animate.exit);
+ self.reposition(posX);
+
+ if ($.isFunction(self.settings.onClose)) {
+ self.settings.onClose.call(this.$ele);
+ }
+
+ this.$ele.one(this.animations.start, function () {
+ hasAnimation = true;
+ }).one(this.animations.end, function () {
+ $(this).remove();
+ if ($.isFunction(self.settings.onClosed)) {
+ self.settings.onClosed.call(this);
+ }
+ });
+
+ setTimeout(function () {
+ if (!hasAnimation) {
+ self.$ele.remove();
+ if (self.settings.onClosed) {
+ self.settings.onClosed(self.$ele);
+ }
+ }
+ }, 600);
+ },
+ reposition: function (posX) {
+ var self = this,
+ notifies = '[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])',
+ $elements = this.$ele.nextAll(notifies);
+ if (this.settings.newest_on_top === true) {
+ $elements = this.$ele.prevAll(notifies);
+ }
+ $elements.each(function () {
+ $(this).css(self.settings.placement.from, posX);
+ posX = (parseInt(posX) + parseInt(self.settings.spacing)) + $(this).outerHeight();
+ });
+ }
+ });
+
+ $.notify = function (content, options) {
+ var plugin = new Notify(this, content, options);
+ return plugin.notify;
+ };
+ $.notifyDefaults = function (options) {
+ defaults = $.extend(true, {}, defaults, options);
+ return defaults;
+ };
+ $.notifyClose = function (command) {
+ if (typeof command === "undefined" || command === "all") {
+ $('[data-notify]').find('[data-notify="dismiss"]').trigger('click');
+ } else {
+ $('[data-notify-position="' + command + '"]').find('[data-notify="dismiss"]').trigger('click');
+ }
+ };
+
+}));
diff --git a/assets/js/bootstrap-select.js b/assets/js/bootstrap-select.js
new file mode 100644
index 0000000..a9ee735
--- /dev/null
+++ b/assets/js/bootstrap-select.js
@@ -0,0 +1,438 @@
+!function($) {
+ var Selectpicker = function(element, options, e) {
+ if (e ) {
+ e.stopPropagation();
+ e.preventDefault();
+ }
+ this.$element = $(element);
+ this.$newElement = null;
+ this.button = null;
+
+ //Merge defaults, options and data-attributes to make our options
+ this.options = $.extend({}, $.fn.selectpicker.defaults, this.$element.data(), typeof options == 'object' && options);
+
+ //If we have no title yet, check the attribute 'title' (this is missed by jq as its not a data-attribute
+ if(this.options.title==null)
+ this.options.title = this.$element.attr('title');
+
+ //Expose public methods
+ this.val = Selectpicker.prototype.val;
+ this.render = Selectpicker.prototype.render;
+ this.init();
+ };
+
+ Selectpicker.prototype = {
+
+ constructor: Selectpicker,
+
+ init: function (e) {
+ var _this = this;
+ this.$element.hide();
+ this.multiple = this.$element.prop('multiple');
+
+
+ var classList = this.$element.attr('class') !== undefined ? this.$element.attr('class').split(/\s+/) : '';
+ var id = this.$element.attr('id');
+ this.$element.after( this.createView() );
+ this.$newElement = this.$element.next('.select');
+ var select = this.$newElement;
+ var menu = this.$newElement.find('.dropdown-menu');
+ var menuArrow = this.$newElement.find('.dropdown-arrow');
+ var menuA = menu.find('li > a');
+ var liHeight = select.addClass('open').find('.dropdown-menu li > a').outerHeight();
+ select.removeClass('open');
+ var divHeight = menu.find('li .divider').outerHeight(true);
+ var selectOffset_top = this.$newElement.offset().top;
+ var size = 0;
+ var menuHeight = 0;
+ var selectHeight = this.$newElement.outerHeight();
+ this.button = this.$newElement.find('> button');
+ if (id !== undefined) {
+ this.button.attr('id', id);
+ $('label[for="' + id + '"]').click(function(){ select.find('button#'+id).focus(); })
+ }
+ for (var i = 0; i < classList.length; i++) {
+ if(classList[i] != 'selectpicker') {
+ this.$newElement.addClass(classList[i]);
+ }
+ }
+ //If we are multiple, then add the show-tick class by default
+ if(this.multiple) {
+ this.$newElement.addClass('select-multiple');
+ }
+ this.button.addClass(this.options.style);
+ menu.addClass(this.options.menuStyle);
+ menuArrow.addClass(function() {
+ if (_this.options.menuStyle) {
+ return _this.options.menuStyle.replace('dropdown-', 'dropdown-arrow-');
+ }
+ });
+ this.checkDisabled();
+ this.checkTabIndex();
+ this.clickListener();
+ var menuPadding = parseInt(menu.css('padding-top')) + parseInt(menu.css('padding-bottom')) + parseInt(menu.css('border-top-width')) + parseInt(menu.css('border-bottom-width'));
+ if (this.options.size == 'auto') {
+
+ // Creative Tim Changes: We changed the regular function made in bootstrap-select with this function so the getSize() will not be triggered one million times per second while you scroll.
+
+ var getSize = debounce(function() {
+ var selectOffset_top_scroll = selectOffset_top - $(window).scrollTop();
+ var windowHeight = $(window).innerHeight();
+ var menuExtras = menuPadding + parseInt(menu.css('margin-top')) + parseInt(menu.css('margin-bottom')) + 2;
+ var selectOffset_bot = windowHeight - selectOffset_top_scroll - selectHeight - menuExtras;
+ menuHeight = selectOffset_bot;
+ if (select.hasClass('dropup')) {
+ menuHeight = selectOffset_top_scroll - menuExtras;
+ }
+ //limit menuHeight to 300px to have a smooth transition with cubic bezier on dropdown
+ if(menuHeight >= 300){
+ menuHeight = 300;
+ }
+
+ menu.css({'max-height' : menuHeight + 'px', 'overflow-y' : 'auto', 'min-height' : liHeight * 3 + 'px'});
+
+ }, 50);
+
+ getSize;
+ $(window).on('scroll', getSize);
+ $(window).on('resize', getSize);
+
+ if (window.MutationObserver) {
+ new MutationObserver(getSize).observe(this.$element.get(0), {
+ childList: true
+ });
+ } else {
+ this.$element.bind('DOMNodeInserted', getSize);
+ }
+ } else if (this.options.size && this.options.size != 'auto' && menu.find('li').length > this.options.size) {
+ var optIndex = menu.find("li > *").filter(':not(.divider)').slice(0,this.options.size).last().parent().index();
+ var divLength = menu.find("li").slice(0,optIndex + 1).find('.divider').length;
+ menuHeight = liHeight*this.options.size + divLength*divHeight + menuPadding;
+ menu.css({'max-height' : menuHeight + 'px', 'overflow-y' : 'scroll'});
+ //console.log('sunt in if');
+ }
+
+ // Listen for updates to the DOM and re render... (Use Mutation Observer when availiable)
+ if (window.MutationObserver) {
+ new MutationObserver($.proxy(this.reloadLi, this)).observe(this.$element.get(0), {
+ childList: true
+ });
+ } else {
+ this.$element.bind('DOMNodeInserted', $.proxy(this.reloadLi, this));
+ }
+
+ this.render();
+ },
+
+ createDropdown: function() {
+ var drop =
+ "
" +
+ "" +
+ "" +
+ "" +
+ "
";
+
+ return $(drop);
+ },
+
+
+ createView: function() {
+ var $drop = this.createDropdown();
+ var $li = this.createLi();
+ $drop.find('ul').append($li);
+ return $drop;
+ },
+
+ reloadLi: function() {
+ //Remove all children.
+ this.destroyLi();
+ //Re build
+ $li = this.createLi();
+ this.$newElement.find('ul').append( $li );
+ //render view
+ this.render();
+ },
+
+ destroyLi:function() {
+ this.$newElement.find('li').remove();
+ },
+
+ createLi: function() {
+
+ var _this = this;
+ var _li = [];
+ var _liA = [];
+ var _liHtml = '';
+
+ this.$element.find('option').each(function(){
+ _li.push($(this).text());
+ });
+
+ this.$element.find('option').each(function(index) {
+ //Get the class and text for the option
+ var optionClass = $(this).attr("class") !== undefined ? $(this).attr("class") : '';
+ var text = $(this).text();
+ var subtext = $(this).data('subtext') !== undefined ? '
'+$(this).data('subtext')+'' : '';
+
+ //Append any subtext to the main text.
+ text+=subtext;
+
+ if ($(this).parent().is('optgroup') && $(this).data('divider') != true) {
+ if ($(this).index() == 0) {
+ //Get the opt group label
+ var label = $(this).parent().attr('label');
+ var labelSubtext = $(this).parent().data('subtext') !== undefined ? '
'+$(this).parent().data('subtext')+'' : '';
+ label += labelSubtext;
+
+ if ($(this)[0].index != 0) {
+ _liA.push(
+ '
'+
+ '
'+label+''+
+ _this.createA(text, "opt " + optionClass )
+ );
+ } else {
+ _liA.push(
+ '
'+label+''+
+ _this.createA(text, "opt " + optionClass ));
+ }
+ } else {
+ _liA.push( _this.createA(text, "opt " + optionClass ) );
+ }
+ } else if ($(this).data('divider') == true) {
+ _liA.push('
');
+ } else if ($(this).data('hidden') == true) {
+ _liA.push('');
+ } else {
+ _liA.push( _this.createA(text, optionClass ) );
+ }
+ });
+
+ if (_li.length > 0) {
+ for (var i = 0; i < _li.length; i++) {
+ var $option = this.$element.find('option').eq(i);
+ _liHtml += "
" + _liA[i] + "";
+ }
+ }
+
+ //If we dont have a selected item, and we dont have a title, select the first element so something is set in the button
+ if(this.$element.find('option:selected').length==0 && !_this.options.title) {
+ this.$element.find('option').eq(0).prop('selected', true).attr('selected', 'selected');
+ }
+
+ return $(_liHtml);
+ },
+
+ createA:function(test, classes) {
+ return '
' +
+ '' + test + '' +
+ '';
+
+ },
+
+ render:function() {
+ var _this = this;
+
+ //Set width of select
+ if (this.options.width == 'auto') {
+ var ulWidth = this.$newElement.find('.dropdown-menu').css('width');
+ this.$newElement.css('width',ulWidth);
+ } else if (this.options.width && this.options.width != 'auto') {
+ this.$newElement.css('width',this.options.width);
+ }
+
+ //Update the LI to match the SELECT
+ this.$element.find('option').each(function(index) {
+ _this.setDisabled(index, $(this).is(':disabled') || $(this).parent().is(':disabled') );
+ _this.setSelected(index, $(this).is(':selected') );
+ });
+
+
+
+ var selectedItems = this.$element.find('option:selected').map(function(index,value) {
+ if($(this).attr('title')!=undefined) {
+ return $(this).attr('title');
+ } else {
+ return $(this).text();
+ }
+ }).toArray();
+
+ //Convert all the values into a comma delimited string
+ var title = selectedItems.join(", ");
+
+ //If this is multi select, and the selectText type is count, the show 1 of 2 selected etc..
+ if(_this.multiple && _this.options.selectedTextFormat.indexOf('count') > -1) {
+ var max = _this.options.selectedTextFormat.split(">");
+ if( (max.length>1 && selectedItems.length > max[1]) || (max.length==1 && selectedItems.length>=2)) {
+ title = selectedItems.length +' of ' + this.$element.find('option').length + ' selected';
+ }
+ }
+
+ //If we dont have a title, then use the default, or if nothing is set at all, use the not selected text
+ if(!title) {
+ title = _this.options.title != undefined ? _this.options.title : _this.options.noneSelectedText;
+ }
+
+ this.$element.next('.select').find('.filter-option').html( title );
+ },
+
+
+
+ setSelected:function(index, selected) {
+ if(selected) {
+ this.$newElement.find('li').eq(index).addClass('selected');
+ } else {
+ this.$newElement.find('li').eq(index).removeClass('selected');
+ }
+ },
+
+ setDisabled:function(index, disabled) {
+ if(disabled) {
+ this.$newElement.find('li').eq(index).addClass('disabled');
+ } else {
+ this.$newElement.find('li').eq(index).removeClass('disabled');
+ }
+ },
+
+ checkDisabled: function() {
+ if (this.$element.is(':disabled')) {
+ this.button.addClass('disabled');
+ this.button.click(function(e) {
+ e.preventDefault();
+ });
+ }
+ },
+
+ checkTabIndex: function() {
+ if (this.$element.is('[tabindex]')) {
+ var tabindex = this.$element.attr("tabindex");
+ this.button.attr('tabindex', tabindex);
+ }
+ },
+
+ clickListener: function() {
+ var _this = this;
+
+ $('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation(); });
+
+
+
+ this.$newElement.on('click', 'li a', function(e){
+ var clickedIndex = $(this).parent().index(),
+ $this = $(this).parent(),
+ $select = $this.parents('.select');
+
+
+ //Dont close on multi choice menu
+ if(_this.multiple) {
+ e.stopPropagation();
+ }
+
+ e.preventDefault();
+
+ //Dont run if we have been disabled
+ if ($select.prev('select').not(':disabled') && !$(this).parent().hasClass('disabled')){
+ //Deselect all others if not multi select box
+ if (!_this.multiple) {
+ $select.prev('select').find('option').removeAttr('selected');
+ $select.prev('select').find('option').eq(clickedIndex).prop('selected', true).attr('selected', 'selected');
+ }
+ //Else toggle the one we have chosen if we are multi selet.
+ else {
+ var selected = $select.prev('select').find('option').eq(clickedIndex).prop('selected');
+
+ if(selected) {
+ $select.prev('select').find('option').eq(clickedIndex).removeAttr('selected');
+ } else {
+ $select.prev('select').find('option').eq(clickedIndex).prop('selected', true).attr('selected', 'selected');
+ }
+ }
+
+
+ $select.find('.filter-option').html($this.text());
+ $select.find('button').focus();
+
+ // Trigger select 'change'
+ $select.prev('select').trigger('change');
+ }
+
+ });
+
+ this.$newElement.on('click', 'li.disabled a, li dt, li .divider', function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ $select = $(this).parent().parents('.select');
+ $select.find('button').focus();
+ });
+
+ this.$element.on('change', function(e) {
+ _this.render();
+ });
+ },
+
+ val:function(value) {
+
+ if(value!=undefined) {
+ this.$element.val( value );
+
+ this.$element.trigger('change');
+ return this.$element;
+ } else {
+ return this.$element.val();
+ }
+ }
+
+ };
+
+ $.fn.selectpicker = function(option, event) {
+ //get the args of the outer function..
+ var args = arguments;
+ var value;
+ var chain = this.each(function () {
+ var $this = $(this),
+ data = $this.data('selectpicker'),
+ options = typeof option == 'object' && option;
+
+ if (!data) {
+ $this.data('selectpicker', (data = new Selectpicker(this, options, event)));
+ } else {
+ for(var i in option) {
+ data[i]=option[i];
+ }
+ }
+
+ if (typeof option == 'string') {
+ //Copy the value of option, as once we shift the arguments
+ //it also shifts the value of option.
+ property = option;
+ if(data[property] instanceof Function) {
+ [].shift.apply(args);
+ value = data[property].apply(data, args);
+ } else {
+ value = data[property];
+ }
+ }
+ });
+
+ if(value!=undefined) {
+ return value;
+ } else {
+ return chain;
+ }
+ };
+
+ $.fn.selectpicker.defaults = {
+ style: null,
+ size: 'auto',
+ title: null,
+ selectedTextFormat : 'values',
+ noneSelectedText : 'Nothing selected',
+ width: null,
+ menuStyle: null,
+ toggleSize: null
+ }
+
+}(window.jQuery);
diff --git a/assets/js/bootstrap.min.js b/assets/js/bootstrap.min.js
new file mode 100644
index 0000000..9394eb8
--- /dev/null
+++ b/assets/js/bootstrap.min.js
@@ -0,0 +1,1692 @@
+/*!
+ * Bootstrap v3.3.5 (http://getbootstrap.com)
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under the MIT license
+ */
+if ("undefined" == typeof jQuery)
+ throw new Error("Bootstrap's JavaScript requires jQuery"); +
+(function(a) {
+ "use strict";
+ var b = a.fn.jquery.split(" ")[0].split(".");
+ if ((b[0] < 2 && b[1] < 9) || (1 == b[0] && 9 == b[1] && b[2] < 1))
+ throw new Error(
+ "Bootstrap's JavaScript requires jQuery version 1.9.1 or higher"
+ );
+})(jQuery), +(function(a) {
+ "use strict";
+
+ function b() {
+ var a = document.createElement("bootstrap"),
+ b = {
+ WebkitTransition: "webkitTransitionEnd",
+ MozTransition: "transitionend",
+ OTransition: "oTransitionEnd otransitionend",
+ transition: "transitionend",
+ };
+ for (var c in b)
+ if (void 0 !== a.style[c]) return { end: b[c] };
+ return !1;
+ }
+ (a.fn.emulateTransitionEnd = function(b) {
+ var c = !1,
+ d = this;
+ a(this).one("bsTransitionEnd", function() {
+ c = !0;
+ });
+ var e = function() {
+ c || a(d).trigger(a.support.transition.end);
+ };
+ return setTimeout(e, b), this;
+ }),
+ a(function() {
+ (a.support.transition = b()),
+ a.support.transition &&
+ (a.event.special.bsTransitionEnd = {
+ bindType: a.support.transition.end,
+ delegateType: a.support.transition.end,
+ handle: function(b) {
+ return a(b.target).is(this) ?
+ b.handleObj.handler.apply(this, arguments) :
+ void 0;
+ },
+ });
+ });
+})(jQuery), +(function(a) {
+ "use strict";
+
+ function b(b) {
+ return this.each(function() {
+ var c = a(this),
+ e = c.data("bs.alert");
+ e || c.data("bs.alert", (e = new d(this))),
+ "string" == typeof b && e[b].call(c);
+ });
+ }
+ var c = '[data-dismiss="alert"]',
+ d = function(b) {
+ a(b).on("click", c, this.close);
+ };
+ (d.VERSION = "3.3.5"),
+ (d.TRANSITION_DURATION = 150),
+ (d.prototype.close = function(b) {
+ function c() {
+ g.detach().trigger("closed.bs.alert").remove();
+ }
+ var e = a(this),
+ f = e.attr("data-target");
+ f || ((f = e.attr("href")), (f = f && f.replace(/.*(?=#[^\s]*$)/, "")));
+ var g = a(f);
+ b && b.preventDefault(),
+ g.length || (g = e.closest(".alert")),
+ g.trigger((b = a.Event("close.bs.alert"))),
+ b.isDefaultPrevented() ||
+ (g.removeClass("in"),
+ a.support.transition && g.hasClass("fade") ?
+ g
+ .one("bsTransitionEnd", c)
+ .emulateTransitionEnd(d.TRANSITION_DURATION) :
+ c());
+ });
+ var e = a.fn.alert;
+ (a.fn.alert = b),
+ (a.fn.alert.Constructor = d),
+ (a.fn.alert.noConflict = function() {
+ return (a.fn.alert = e), this;
+ }),
+ a(document).on("click.bs.alert.data-api", c, d.prototype.close);
+})(jQuery), +(function(a) {
+ "use strict";
+
+ function b(b) {
+ return this.each(function() {
+ var d = a(this),
+ e = d.data("bs.button"),
+ f = "object" == typeof b && b;
+ e || d.data("bs.button", (e = new c(this, f))),
+ "toggle" == b ? e.toggle() : b && e.setState(b);
+ });
+ }
+ var c = function(b, d) {
+ (this.$element = a(b)),
+ (this.options = a.extend({}, c.DEFAULTS, d)),
+ (this.isLoading = !1);
+ };
+ (c.VERSION = "3.3.5"),
+ (c.DEFAULTS = { loadingText: "loading..." }),
+ (c.prototype.setState = function(b) {
+ var c = "disabled",
+ d = this.$element,
+ e = d.is("input") ? "val" : "html",
+ f = d.data();
+ (b += "Text"),
+ null == f.resetText && d.data("resetText", d[e]()),
+ setTimeout(
+ a.proxy(function() {
+ d[e](null == f[b] ? this.options[b] : f[b]),
+ "loadingText" == b ?
+ ((this.isLoading = !0), d.addClass(c).attr(c, c)) :
+ this.isLoading &&
+ ((this.isLoading = !1), d.removeClass(c).removeAttr(c));
+ }, this),
+ 0
+ );
+ }),
+ (c.prototype.toggle = function() {
+ var a = !0,
+ b = this.$element.closest('[data-toggle="buttons"]');
+ if (b.length) {
+ var c = this.$element.find("input");
+ "radio" == c.prop("type") ?
+ (c.prop("checked") && (a = !1),
+ b.find(".active").removeClass("active"),
+ this.$element.addClass("active")) :
+ "checkbox" == c.prop("type") &&
+ (c.prop("checked") !== this.$element.hasClass("active") &&
+ (a = !1),
+ this.$element.toggleClass("active")),
+ c.prop("checked", this.$element.hasClass("active")),
+ a && c.trigger("change");
+ } else
+ this.$element.attr("aria-pressed", !this.$element.hasClass("active")),
+ this.$element.toggleClass("active");
+ });
+ var d = a.fn.button;
+ (a.fn.button = b),
+ (a.fn.button.Constructor = c),
+ (a.fn.button.noConflict = function() {
+ return (a.fn.button = d), this;
+ }),
+ a(document)
+ .on(
+ "click.bs.button.data-api",
+ '[data-toggle^="button"]',
+ function(c) {
+ var d = a(c.target);
+ d.hasClass("btn") || (d = d.closest(".btn")),
+ b.call(d, "toggle"),
+ a(c.target).is('input[type="radio"]') ||
+ a(c.target).is('input[type="checkbox"]') ||
+ c.preventDefault();
+ }
+ )
+ .on(
+ "focus.bs.button.data-api blur.bs.button.data-api",
+ '[data-toggle^="button"]',
+ function(b) {
+ a(b.target)
+ .closest(".btn")
+ .toggleClass("focus", /^focus(in)?$/.test(b.type));
+ }
+ );
+})(jQuery), +(function(a) {
+ "use strict";
+
+ function b(b) {
+ return this.each(function() {
+ var d = a(this),
+ e = d.data("bs.carousel"),
+ f = a.extend({}, c.DEFAULTS, d.data(), "object" == typeof b && b),
+ g = "string" == typeof b ? b : f.slide;
+ e || d.data("bs.carousel", (e = new c(this, f))),
+ "number" == typeof b ?
+ e.to(b) :
+ g ?
+ e[g]() :
+ f.interval && e.pause().cycle();
+ });
+ }
+ var c = function(b, c) {
+ (this.$element = a(b)),
+ (this.$indicators = this.$element.find(".carousel-indicators")),
+ (this.options = c),
+ (this.paused = null),
+ (this.sliding = null),
+ (this.interval = null),
+ (this.$active = null),
+ (this.$items = null),
+ this.options.keyboard &&
+ this.$element.on("keydown.bs.carousel", a.proxy(this.keydown, this)),
+ "hover" == this.options.pause &&
+ !("ontouchstart" in document.documentElement) &&
+ this.$element
+ .on("mouseenter.bs.carousel", a.proxy(this.pause, this))
+ .on("mouseleave.bs.carousel", a.proxy(this.cycle, this));
+ };
+ (c.VERSION = "3.3.5"),
+ (c.TRANSITION_DURATION = 600),
+ (c.DEFAULTS = { interval: 5e3, pause: "hover", wrap: !0, keyboard: !0 }),
+ (c.prototype.keydown = function(a) {
+ if (!/input|textarea/i.test(a.target.tagName)) {
+ switch (a.which) {
+ case 37:
+ this.prev();
+ break;
+ case 39:
+ this.next();
+ break;
+ default:
+ return;
+ }
+ a.preventDefault();
+ }
+ }),
+ (c.prototype.cycle = function(b) {
+ return (
+ b || (this.paused = !1),
+ this.interval && clearInterval(this.interval),
+ this.options.interval &&
+ !this.paused &&
+ (this.interval = setInterval(
+ a.proxy(this.next, this),
+ this.options.interval
+ )),
+ this
+ );
+ }),
+ (c.prototype.getItemIndex = function(a) {
+ return (
+ (this.$items = a.parent().children(".item")),
+ this.$items.index(a || this.$active)
+ );
+ }),
+ (c.prototype.getItemForDirection = function(a, b) {
+ var c = this.getItemIndex(b),
+ d =
+ ("prev" == a && 0 === c) ||
+ ("next" == a && c == this.$items.length - 1);
+ if (d && !this.options.wrap) return b;
+ var e = "prev" == a ? -1 : 1,
+ f = (c + e) % this.$items.length;
+ return this.$items.eq(f);
+ }),
+ (c.prototype.to = function(a) {
+ var b = this,
+ c = this.getItemIndex(
+ (this.$active = this.$element.find(".item.active"))
+ );
+ return a > this.$items.length - 1 || 0 > a ?
+ void 0 :
+ this.sliding ?
+ this.$element.one("slid.bs.carousel", function() {
+ b.to(a);
+ }) :
+ c == a ?
+ this.pause().cycle() :
+ this.slide(a > c ? "next" : "prev", this.$items.eq(a));
+ }),
+ (c.prototype.pause = function(b) {
+ return (
+ b || (this.paused = !0),
+ this.$element.find(".next, .prev").length &&
+ a.support.transition &&
+ (this.$element.trigger(a.support.transition.end), this.cycle(!0)),
+ (this.interval = clearInterval(this.interval)),
+ this
+ );
+ }),
+ (c.prototype.next = function() {
+ return this.sliding ? void 0 : this.slide("next");
+ }),
+ (c.prototype.prev = function() {
+ return this.sliding ? void 0 : this.slide("prev");
+ }),
+ (c.prototype.slide = function(b, d) {
+ var e = this.$element.find(".item.active"),
+ f = d || this.getItemForDirection(b, e),
+ g = this.interval,
+ h = "next" == b ? "left" : "right",
+ i = this;
+ if (f.hasClass("active")) return (this.sliding = !1);
+ var j = f[0],
+ k = a.Event("slide.bs.carousel", { relatedTarget: j, direction: h });
+ if ((this.$element.trigger(k), !k.isDefaultPrevented())) {
+ if (
+ ((this.sliding = !0), g && this.pause(), this.$indicators.length)
+ ) {
+ this.$indicators.find(".active").removeClass("active");
+ var l = a(this.$indicators.children()[this.getItemIndex(f)]);
+ l && l.addClass("active");
+ }
+ var m = a.Event("slid.bs.carousel", {
+ relatedTarget: j,
+ direction: h,
+ });
+ return (
+ a.support.transition && this.$element.hasClass("slide") ?
+ (f.addClass(b),
+ f[0].offsetWidth,
+ e.addClass(h),
+ f.addClass(h),
+ e
+ .one("bsTransitionEnd", function() {
+ f.removeClass([b, h].join(" ")).addClass("active"),
+ e.removeClass(["active", h].join(" ")),
+ (i.sliding = !1),
+ setTimeout(function() {
+ i.$element.trigger(m);
+ }, 0);
+ })
+ .emulateTransitionEnd(c.TRANSITION_DURATION)) :
+ (e.removeClass("active"),
+ f.addClass("active"),
+ (this.sliding = !1),
+ this.$element.trigger(m)),
+ g && this.cycle(),
+ this
+ );
+ }
+ });
+ var d = a.fn.carousel;
+ (a.fn.carousel = b),
+ (a.fn.carousel.Constructor = c),
+ (a.fn.carousel.noConflict = function() {
+ return (a.fn.carousel = d), this;
+ });
+ var e = function(c) {
+ var d,
+ e = a(this),
+ f = a(
+ e.attr("data-target") ||
+ ((d = e.attr("href")) && d.replace(/.*(?=#[^\s]+$)/, ""))
+ );
+ if (f.hasClass("carousel")) {
+ var g = a.extend({}, f.data(), e.data()),
+ h = e.attr("data-slide-to");
+ h && (g.interval = !1),
+ b.call(f, g),
+ h && f.data("bs.carousel").to(h),
+ c.preventDefault();
+ }
+ };
+ a(document)
+ .on("click.bs.carousel.data-api", "[data-slide]", e)
+ .on("click.bs.carousel.data-api", "[data-slide-to]", e),
+ a(window).on("load", function() {
+ a('[data-ride="carousel"]').each(function() {
+ var c = a(this);
+ b.call(c, c.data());
+ });
+ });
+})(jQuery), +(function(a) {
+ "use strict";
+
+ function b(b) {
+ var c,
+ d =
+ b.attr("data-target") ||
+ ((c = b.attr("href")) && c.replace(/.*(?=#[^\s]+$)/, ""));
+ return a(d);
+ }
+
+ function c(b) {
+ return this.each(function() {
+ var c = a(this),
+ e = c.data("bs.collapse"),
+ f = a.extend({}, d.DEFAULTS, c.data(), "object" == typeof b && b);
+ !e && f.toggle && /show|hide/.test(b) && (f.toggle = !1),
+ e || c.data("bs.collapse", (e = new d(this, f))),
+ "string" == typeof b && e[b]();
+ });
+ }
+ var d = function(b, c) {
+ (this.$element = a(b)),
+ (this.options = a.extend({}, d.DEFAULTS, c)),
+ (this.$trigger = a(
+ '[data-toggle="collapse"][href="#' +
+ b.id +
+ '"],[data-toggle="collapse"][data-target="#' +
+ b.id +
+ '"]'
+ )),
+ (this.transitioning = null),
+ this.options.parent ?
+ (this.$parent = this.getParent()) :
+ this.addAriaAndCollapsedClass(this.$element, this.$trigger),
+ this.options.toggle && this.toggle();
+ };
+ (d.VERSION = "3.3.5"),
+ (d.TRANSITION_DURATION = 350),
+ (d.DEFAULTS = { toggle: !0 }),
+ (d.prototype.dimension = function() {
+ var a = this.$element.hasClass("width");
+ return a ? "width" : "height";
+ }),
+ (d.prototype.show = function() {
+ if (!this.transitioning && !this.$element.hasClass("in")) {
+ var b,
+ e =
+ this.$parent &&
+ this.$parent.children(".panel").children(".in, .collapsing");
+ if (!(
+ e &&
+ e.length &&
+ ((b = e.data("bs.collapse")), b && b.transitioning)
+ )) {
+ var f = a.Event("show.bs.collapse");
+ if ((this.$element.trigger(f), !f.isDefaultPrevented())) {
+ e &&
+ e.length &&
+ (c.call(e, "hide"), b || e.data("bs.collapse", null));
+ var g = this.dimension();
+ this.$element
+ .removeClass("collapse")
+ .addClass("collapsing")[g](0)
+ .attr("aria-expanded", !0),
+ this.$trigger
+ .removeClass("collapsed")
+ .attr("aria-expanded", !0),
+ (this.transitioning = 1);
+ var h = function() {
+ this.$element
+ .removeClass("collapsing")
+ .addClass("collapse in")[g](""),
+ (this.transitioning = 0),
+ this.$element.trigger("shown.bs.collapse");
+ };
+ if (!a.support.transition) return h.call(this);
+ var i = a.camelCase(["scroll", g].join("-"));
+ this.$element
+ .one("bsTransitionEnd", a.proxy(h, this))
+ .emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i]);
+ }
+ }
+ }
+ }),
+ (d.prototype.hide = function() {
+ if (!this.transitioning && this.$element.hasClass("in")) {
+ var b = a.Event("hide.bs.collapse");
+ if ((this.$element.trigger(b), !b.isDefaultPrevented())) {
+ var c = this.dimension();
+ this.$element[c](this.$element[c]())[0].offsetHeight,
+ this.$element
+ .addClass("collapsing")
+ .removeClass("collapse in")
+ .attr("aria-expanded", !1),
+ this.$trigger.addClass("collapsed").attr("aria-expanded", !1),
+ (this.transitioning = 1);
+ var e = function() {
+ (this.transitioning = 0),
+ this.$element
+ .removeClass("collapsing")
+ .addClass("collapse")
+ .trigger("hidden.bs.collapse");
+ };
+ return a.support.transition ?
+ void this.$element[c](0)
+ .one("bsTransitionEnd", a.proxy(e, this))
+ .emulateTransitionEnd(d.TRANSITION_DURATION) :
+ e.call(this);
+ }
+ }
+ }),
+ (d.prototype.toggle = function() {
+ this[this.$element.hasClass("in") ? "hide" : "show"]();
+ }),
+ (d.prototype.getParent = function() {
+ return a(this.options.parent)
+ .find(
+ '[data-toggle="collapse"][data-parent="' +
+ this.options.parent +
+ '"]'
+ )
+ .each(
+ a.proxy(function(c, d) {
+ var e = a(d);
+ this.addAriaAndCollapsedClass(b(e), e);
+ }, this)
+ )
+ .end();
+ }),
+ (d.prototype.addAriaAndCollapsedClass = function(a, b) {
+ var c = a.hasClass("in");
+ a.attr("aria-expanded", c),
+ b.toggleClass("collapsed", !c).attr("aria-expanded", c);
+ });
+ var e = a.fn.collapse;
+ (a.fn.collapse = c),
+ (a.fn.collapse.Constructor = d),
+ (a.fn.collapse.noConflict = function() {
+ return (a.fn.collapse = e), this;
+ }),
+ a(document).on(
+ "click.bs.collapse.data-api",
+ '[data-toggle="collapse"]',
+ function(d) {
+ var e = a(this);
+ e.attr("data-target") || d.preventDefault();
+ var f = b(e),
+ g = f.data("bs.collapse"),
+ h = g ? "toggle" : e.data();
+ c.call(f, h);
+ }
+ );
+})(jQuery), +(function(a) {
+ "use strict";
+
+ function b(b) {
+ var c = b.attr("data-target");
+ c ||
+ ((c = b.attr("href")),
+ (c = c && /#[A-Za-z]/.test(c) && c.replace(/.*(?=#[^\s]*$)/, "")));
+ var d = c && a(c);
+ return d && d.length ? d : b.parent();
+ }
+
+ function c(c) {
+ (c && 3 === c.which) ||
+ (a(e).remove(),
+ a(f).each(function() {
+ var d = a(this),
+ e = b(d),
+ f = { relatedTarget: this };
+ e.hasClass("open") &&
+ ((c &&
+ "click" == c.type &&
+ /input|textarea/i.test(c.target.tagName) &&
+ a.contains(e[0], c.target)) ||
+ (e.trigger((c = a.Event("hide.bs.dropdown", f))),
+ c.isDefaultPrevented() ||
+ (d.attr("aria-expanded", "false"),
+ e.removeClass("open").trigger("hidden.bs.dropdown", f))));
+ }));
+ }
+
+ function d(b) {
+ return this.each(function() {
+ var c = a(this),
+ d = c.data("bs.dropdown");
+ d || c.data("bs.dropdown", (d = new g(this))),
+ "string" == typeof b && d[b].call(c);
+ });
+ }
+ var e = ".dropdown-backdrop",
+ f = '[data-toggle="dropdown"]',
+ g = function(b) {
+ a(b).on("click.bs.dropdown", this.toggle);
+ };
+ (g.VERSION = "3.3.5"),
+ (g.prototype.toggle = function(d) {
+ var e = a(this);
+ if (!e.is(".disabled, :disabled")) {
+ var f = b(e),
+ g = f.hasClass("open");
+ if ((c(), !g)) {
+ "ontouchstart" in document.documentElement &&
+ !f.closest(".navbar-nav").length &&
+ a(document.createElement("div"))
+ .addClass("dropdown-backdrop")
+ .insertAfter(a(this))
+ .on("click", c);
+ var h = { relatedTarget: this };
+ if (
+ (f.trigger((d = a.Event("show.bs.dropdown", h))),
+ d.isDefaultPrevented())
+ )
+ return;
+ e.trigger("focus").attr("aria-expanded", "true"),
+ f.toggleClass("open").trigger("shown.bs.dropdown", h);
+ }
+ return !1;
+ }
+ }),
+ (g.prototype.keydown = function(c) {
+ if (
+ /(38|40|27|32)/.test(c.which) &&
+ !/input|textarea/i.test(c.target.tagName)
+ ) {
+ var d = a(this);
+ if (
+ (c.preventDefault(),
+ c.stopPropagation(), !d.is(".disabled, :disabled"))
+ ) {
+ var e = b(d),
+ g = e.hasClass("open");
+ if ((!g && 27 != c.which) || (g && 27 == c.which))
+ return (
+ 27 == c.which && e.find(f).trigger("focus"), d.trigger("click")
+ );
+ var h = " li:not(.disabled):visible a",
+ i = e.find(".dropdown-menu" + h);
+ if (i.length) {
+ var j = i.index(c.target);
+ 38 == c.which && j > 0 && j--,
+ 40 == c.which && j < i.length - 1 && j++, ~j || (j = 0),
+ i.eq(j).trigger("focus");
+ }
+ }
+ }
+ });
+ var h = a.fn.dropdown;
+ (a.fn.dropdown = d),
+ (a.fn.dropdown.Constructor = g),
+ (a.fn.dropdown.noConflict = function() {
+ return (a.fn.dropdown = h), this;
+ }),
+ a(document)
+ .on("click.bs.dropdown.data-api", c)
+ .on("click.bs.dropdown.data-api", ".dropdown form", function(a) {
+ a.stopPropagation();
+ })
+ .on("click.bs.dropdown.data-api", f, g.prototype.toggle)
+ .on("keydown.bs.dropdown.data-api", f, g.prototype.keydown)
+ .on(
+ "keydown.bs.dropdown.data-api",
+ ".dropdown-menu",
+ g.prototype.keydown
+ );
+})(jQuery), +(function(a) {
+ "use strict";
+
+ function b(b, d) {
+ return this.each(function() {
+ var e = a(this),
+ f = e.data("bs.modal"),
+ g = a.extend({}, c.DEFAULTS, e.data(), "object" == typeof b && b);
+ f || e.data("bs.modal", (f = new c(this, g))),
+ "string" == typeof b ? f[b](d) : g.show && f.show(d);
+ });
+ }
+ var c = function(b, c) {
+ (this.options = c),
+ (this.$body = a(document.body)),
+ (this.$element = a(b)),
+ (this.$dialog = this.$element.find(".modal-dialog")),
+ (this.$backdrop = null),
+ (this.isShown = null),
+ (this.originalBodyPad = null),
+ (this.scrollbarWidth = 0),
+ (this.ignoreBackdropClick = !1),
+ this.options.remote &&
+ this.$element.find(".modal-content").load(
+ this.options.remote,
+ a.proxy(function() {
+ this.$element.trigger("loaded.bs.modal");
+ }, this)
+ );
+ };
+ (c.VERSION = "3.3.5"),
+ (c.TRANSITION_DURATION = 300),
+ (c.BACKDROP_TRANSITION_DURATION = 150),
+ (c.DEFAULTS = { backdrop: !0, keyboard: !0, show: !0 }),
+ (c.prototype.toggle = function(a) {
+ return this.isShown ? this.hide() : this.show(a);
+ }),
+ (c.prototype.show = function(b) {
+ var d = this,
+ e = a.Event("show.bs.modal", { relatedTarget: b });
+ this.$element.trigger(e),
+ this.isShown ||
+ e.isDefaultPrevented() ||
+ ((this.isShown = !0),
+ this.checkScrollbar(),
+ this.setScrollbar(),
+ this.$body.addClass("modal-open"),
+ this.escape(),
+ this.resize(),
+ this.$element.on(
+ "click.dismiss.bs.modal",
+ '[data-dismiss="modal"]',
+ a.proxy(this.hide, this)
+ ),
+ this.$dialog.on("mousedown.dismiss.bs.modal", function() {
+ d.$element.one("mouseup.dismiss.bs.modal", function(b) {
+ a(b.target).is(d.$element) && (d.ignoreBackdropClick = !0);
+ });
+ }),
+ this.backdrop(function() {
+ var e = a.support.transition && d.$element.hasClass("fade");
+ d.$element.parent().length || d.$element.appendTo(d.$body),
+ d.$element.show().scrollTop(0),
+ d.adjustDialog(),
+ e && d.$element[0].offsetWidth,
+ d.$element.addClass("in"),
+ d.enforceFocus();
+ var f = a.Event("shown.bs.modal", { relatedTarget: b });
+ e
+ ?
+ d.$dialog
+ .one("bsTransitionEnd", function() {
+ d.$element.trigger("focus").trigger(f);
+ })
+ .emulateTransitionEnd(c.TRANSITION_DURATION) :
+ d.$element.trigger("focus").trigger(f);
+ }));
+ }),
+ (c.prototype.hide = function(b) {
+ b && b.preventDefault(),
+ (b = a.Event("hide.bs.modal")),
+ this.$element.trigger(b),
+ this.isShown &&
+ !b.isDefaultPrevented() &&
+ ((this.isShown = !1),
+ this.escape(),
+ this.resize(),
+ a(document).off("focusin.bs.modal"),
+ this.$element
+ .removeClass("in")
+ .off("click.dismiss.bs.modal")
+ .off("mouseup.dismiss.bs.modal"),
+ this.$dialog.off("mousedown.dismiss.bs.modal"),
+ a.support.transition && this.$element.hasClass("fade") ?
+ this.$element
+ .one("bsTransitionEnd", a.proxy(this.hideModal, this))
+ .emulateTransitionEnd(c.TRANSITION_DURATION) :
+ this.hideModal());
+ }),
+ (c.prototype.enforceFocus = function() {
+ a(document)
+ .off("focusin.bs.modal")
+ .on(
+ "focusin.bs.modal",
+ a.proxy(function(a) {
+ this.$element[0] === a.target ||
+ this.$element.has(a.target).length ||
+ this.$element.trigger("focus");
+ }, this)
+ );
+ }),
+ (c.prototype.escape = function() {
+ this.isShown && this.options.keyboard ?
+ this.$element.on(
+ "keydown.dismiss.bs.modal",
+ a.proxy(function(a) {
+ 27 == a.which && this.hide();
+ }, this)
+ ) :
+ this.isShown || this.$element.off("keydown.dismiss.bs.modal");
+ }),
+ (c.prototype.resize = function() {
+ this.isShown ?
+ a(window).on("resize.bs.modal", a.proxy(this.handleUpdate, this)) :
+ a(window).off("resize.bs.modal");
+ }),
+ (c.prototype.hideModal = function() {
+ var a = this;
+ this.$element.hide(),
+ this.backdrop(function() {
+ a.$body.removeClass("modal-open"),
+ a.resetAdjustments(),
+ a.resetScrollbar(),
+ a.$element.trigger("hidden.bs.modal");
+ });
+ }),
+ (c.prototype.removeBackdrop = function() {
+ this.$backdrop && this.$backdrop.remove(), (this.$backdrop = null);
+ }),
+ (c.prototype.backdrop = function(b) {
+ var d = this,
+ e = this.$element.hasClass("fade") ? "fade" : "";
+ if (this.isShown && this.options.backdrop) {
+ var f = a.support.transition && e;
+ if (
+ ((this.$backdrop = a(document.createElement("div"))
+ .addClass("modal-backdrop " + e)
+ .appendTo(this.$body)),
+ this.$element.on(
+ "click.dismiss.bs.modal",
+ a.proxy(function(a) {
+ return this.ignoreBackdropClick ?
+ void(this.ignoreBackdropClick = !1) :
+ void(
+ a.target === a.currentTarget &&
+ ("static" == this.options.backdrop ?
+ this.$element[0].focus() :
+ this.hide())
+ );
+ }, this)
+ ),
+ f && this.$backdrop[0].offsetWidth,
+ this.$backdrop.addClass("in"), !b)
+ )
+ return;
+ f
+ ?
+ this.$backdrop
+ .one("bsTransitionEnd", b)
+ .emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION) :
+ b();
+ } else if (!this.isShown && this.$backdrop) {
+ this.$backdrop.removeClass("in");
+ var g = function() {
+ d.removeBackdrop(), b && b();
+ };
+ a.support.transition && this.$element.hasClass("fade") ?
+ this.$backdrop
+ .one("bsTransitionEnd", g)
+ .emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION) :
+ g();
+ } else b && b();
+ }),
+ (c.prototype.handleUpdate = function() {
+ this.adjustDialog();
+ }),
+ (c.prototype.adjustDialog = function() {
+ var a =
+ this.$element[0].scrollHeight > document.documentElement.clientHeight;
+ this.$element.css({
+ paddingLeft: !this.bodyIsOverflowing && a ? this.scrollbarWidth : "",
+ paddingRight: this.bodyIsOverflowing && !a ? this.scrollbarWidth : "",
+ });
+ }),
+ (c.prototype.resetAdjustments = function() {
+ this.$element.css({ paddingLeft: "", paddingRight: "" });
+ }),
+ (c.prototype.checkScrollbar = function() {
+ var a = window.innerWidth;
+ if (!a) {
+ var b = document.documentElement.getBoundingClientRect();
+ a = b.right - Math.abs(b.left);
+ }
+ (this.bodyIsOverflowing = document.body.clientWidth < a),
+ (this.scrollbarWidth = this.measureScrollbar());
+ }),
+ (c.prototype.setScrollbar = function() {
+ var a = parseInt(this.$body.css("padding-right") || 0, 10);
+ (this.originalBodyPad = document.body.style.paddingRight || ""),
+ this.bodyIsOverflowing &&
+ this.$body.css("padding-right", a + this.scrollbarWidth);
+ }),
+ (c.prototype.resetScrollbar = function() {
+ this.$body.css("padding-right", this.originalBodyPad);
+ }),
+ (c.prototype.measureScrollbar = function() {
+ var a = document.createElement("div");
+ (a.className = "modal-scrollbar-measure"), this.$body.append(a);
+ var b = a.offsetWidth - a.clientWidth;
+ return this.$body[0].removeChild(a), b;
+ });
+ var d = a.fn.modal;
+ (a.fn.modal = b),
+ (a.fn.modal.Constructor = c),
+ (a.fn.modal.noConflict = function() {
+ return (a.fn.modal = d), this;
+ }),
+ a(document).on(
+ "click.bs.modal.data-api",
+ '[data-toggle="modal"]',
+ function(c) {
+ var d = a(this),
+ e = d.attr("href"),
+ f = a(
+ d.attr("data-target") || (e && e.replace(/.*(?=#[^\s]+$)/, ""))
+ ),
+ g = f.data("bs.modal") ?
+ "toggle" :
+ a.extend({ remote: !/#/.test(e) && e }, f.data(), d.data());
+ d.is("a") && c.preventDefault(),
+ f.one("show.bs.modal", function(a) {
+ a.isDefaultPrevented() ||
+ f.one("hidden.bs.modal", function() {
+ d.is(":visible") && d.trigger("focus");
+ });
+ }),
+ b.call(f, g, this);
+ }
+ );
+})(jQuery), +(function(a) {
+ "use strict";
+
+ function b(b) {
+ return this.each(function() {
+ var d = a(this),
+ e = d.data("bs.tooltip"),
+ f = "object" == typeof b && b;
+ (e || !/destroy|hide/.test(b)) &&
+ (e || d.data("bs.tooltip", (e = new c(this, f))),
+ "string" == typeof b && e[b]());
+ });
+ }
+ var c = function(a, b) {
+ (this.type = null),
+ (this.options = null),
+ (this.enabled = null),
+ (this.timeout = null),
+ (this.hoverState = null),
+ (this.$element = null),
+ (this.inState = null),
+ this.init("tooltip", a, b);
+ };
+ (c.VERSION = "3.3.5"),
+ (c.TRANSITION_DURATION = 150),
+ (c.DEFAULTS = {
+ animation: !0,
+ placement: "top",
+ selector: !1,
+ template: '
',
+ trigger: "hover focus",
+ title: "",
+ delay: 0,
+ html: !1,
+ container: !1,
+ viewport: { selector: "body", padding: 0 },
+ }),
+ (c.prototype.init = function(b, c, d) {
+ if (
+ ((this.enabled = !0),
+ (this.type = b),
+ (this.$element = a(c)),
+ (this.options = this.getOptions(d)),
+ (this.$viewport =
+ this.options.viewport &&
+ a(
+ a.isFunction(this.options.viewport) ?
+ this.options.viewport.call(this, this.$element) :
+ this.options.viewport.selector || this.options.viewport
+ )),
+ (this.inState = { click: !1, hover: !1, focus: !1 }),
+ this.$element[0] instanceof document.constructor &&
+ !this.options.selector)
+ )
+ throw new Error(
+ "`selector` option must be specified when initializing " +
+ this.type +
+ " on the window.document object!"
+ );
+ for (var e = this.options.trigger.split(" "), f = e.length; f--;) {
+ var g = e[f];
+ if ("click" == g)
+ this.$element.on(
+ "click." + this.type,
+ this.options.selector,
+ a.proxy(this.toggle, this)
+ );
+ else if ("manual" != g) {
+ var h = "hover" == g ? "mouseenter" : "focusin",
+ i = "hover" == g ? "mouseleave" : "focusout";
+ this.$element.on(
+ h + "." + this.type,
+ this.options.selector,
+ a.proxy(this.enter, this)
+ ),
+ this.$element.on(
+ i + "." + this.type,
+ this.options.selector,
+ a.proxy(this.leave, this)
+ );
+ }
+ }
+ this.options.selector ?
+ (this._options = a.extend({}, this.options, {
+ trigger: "manual",
+ selector: "",
+ })) :
+ this.fixTitle();
+ }),
+ (c.prototype.getDefaults = function() {
+ return c.DEFAULTS;
+ }),
+ (c.prototype.getOptions = function(b) {
+ return (
+ (b = a.extend({}, this.getDefaults(), this.$element.data(), b)),
+ b.delay &&
+ "number" == typeof b.delay &&
+ (b.delay = { show: b.delay, hide: b.delay }),
+ b
+ );
+ }),
+ (c.prototype.getDelegateOptions = function() {
+ var b = {},
+ c = this.getDefaults();
+ return (
+ this._options &&
+ a.each(this._options, function(a, d) {
+ c[a] != d && (b[a] = d);
+ }),
+ b
+ );
+ }),
+ (c.prototype.enter = function(b) {
+ var c =
+ b instanceof this.constructor ?
+ b :
+ a(b.currentTarget).data("bs." + this.type);
+ return (
+ c ||
+ ((c = new this.constructor(
+ b.currentTarget,
+ this.getDelegateOptions()
+ )),
+ a(b.currentTarget).data("bs." + this.type, c)),
+ b instanceof a.Event &&
+ (c.inState["focusin" == b.type ? "focus" : "hover"] = !0),
+ c.tip().hasClass("in") || "in" == c.hoverState ?
+ void(c.hoverState = "in") :
+ (clearTimeout(c.timeout),
+ (c.hoverState = "in"),
+ c.options.delay && c.options.delay.show ?
+ void(c.timeout = setTimeout(function() {
+ "in" == c.hoverState && c.show();
+ }, c.options.delay.show)) :
+ c.show())
+ );
+ }),
+ (c.prototype.isInStateTrue = function() {
+ for (var a in this.inState)
+ if (this.inState[a]) return !0;
+ return !1;
+ }),
+ (c.prototype.leave = function(b) {
+ var c =
+ b instanceof this.constructor ?
+ b :
+ a(b.currentTarget).data("bs." + this.type);
+ return (
+ c ||
+ ((c = new this.constructor(
+ b.currentTarget,
+ this.getDelegateOptions()
+ )),
+ a(b.currentTarget).data("bs." + this.type, c)),
+ b instanceof a.Event &&
+ (c.inState["focusout" == b.type ? "focus" : "hover"] = !1),
+ c.isInStateTrue() ?
+ void 0 :
+ (clearTimeout(c.timeout),
+ (c.hoverState = "out"),
+ c.options.delay && c.options.delay.hide ?
+ void(c.timeout = setTimeout(function() {
+ "out" == c.hoverState && c.hide();
+ }, c.options.delay.hide)) :
+ c.hide())
+ );
+ }),
+ (c.prototype.show = function() {
+ var b = a.Event("show.bs." + this.type);
+ if (this.hasContent() && this.enabled) {
+ this.$element.trigger(b);
+ var d = a.contains(
+ this.$element[0].ownerDocument.documentElement,
+ this.$element[0]
+ );
+ if (b.isDefaultPrevented() || !d) return;
+ var e = this,
+ f = this.tip(),
+ g = this.getUID(this.type);
+ this.setContent(),
+ f.attr("id", g),
+ this.$element.attr("aria-describedby", g),
+ this.options.animation && f.addClass("fade");
+ var h =
+ "function" == typeof this.options.placement ?
+ this.options.placement.call(this, f[0], this.$element[0]) :
+ this.options.placement,
+ i = /\s?auto?\s?/i,
+ j = i.test(h);
+ j && (h = h.replace(i, "") || "top"),
+ f
+ .detach()
+ .css({ top: 0, left: 0, display: "block" })
+ .addClass(h)
+ .data("bs." + this.type, this),
+ this.options.container ?
+ f.appendTo(this.options.container) :
+ f.insertAfter(this.$element),
+ this.$element.trigger("inserted.bs." + this.type);
+ var k = this.getPosition(),
+ l = f[0].offsetWidth,
+ m = f[0].offsetHeight;
+ if (j) {
+ var n = h,
+ o = this.getPosition(this.$viewport);
+ (h =
+ "bottom" == h && k.bottom + m > o.bottom ?
+ "top" :
+ "top" == h && k.top - m < o.top ?
+ "bottom" :
+ "right" == h && k.right + l > o.width ?
+ "left" :
+ "left" == h && k.left - l < o.left ?
+ "right" :
+ h),
+ f.removeClass(n).addClass(h);
+ }
+ var p = this.getCalculatedOffset(h, k, l, m);
+ this.applyPlacement(p, h);
+ var q = function() {
+ var a = e.hoverState;
+ e.$element.trigger("shown.bs." + e.type),
+ (e.hoverState = null),
+ "out" == a && e.leave(e);
+ };
+ a.support.transition && this.$tip.hasClass("fade") ?
+ f
+ .one("bsTransitionEnd", q)
+ .emulateTransitionEnd(c.TRANSITION_DURATION) :
+ q();
+ }
+ }),
+ (c.prototype.applyPlacement = function(b, c) {
+ var d = this.tip(),
+ e = d[0].offsetWidth,
+ f = d[0].offsetHeight,
+ g = parseInt(d.css("margin-top"), 10),
+ h = parseInt(d.css("margin-left"), 10);
+ isNaN(g) && (g = 0),
+ isNaN(h) && (h = 0),
+ (b.top += g),
+ (b.left += h),
+ a.offset.setOffset(
+ d[0],
+ a.extend({
+ using: function(a) {
+ d.css({ top: Math.round(a.top), left: Math.round(a.left) });
+ },
+ },
+ b
+ ),
+ 0
+ ),
+ d.addClass("in");
+ var i = d[0].offsetWidth,
+ j = d[0].offsetHeight;
+ "top" == c && j != f && (b.top = b.top + f - j);
+ var k = this.getViewportAdjustedDelta(c, b, i, j);
+ k.left ? (b.left += k.left) : (b.top += k.top);
+ var l = /top|bottom/.test(c),
+ m = l ? 2 * k.left - e + i : 2 * k.top - f + j,
+ n = l ? "offsetWidth" : "offsetHeight";
+ d.offset(b), this.replaceArrow(m, d[0][n], l);
+ }),
+ (c.prototype.replaceArrow = function(a, b, c) {
+ this.arrow()
+ .css(c ? "left" : "top", 50 * (1 - a / b) + "%")
+ .css(c ? "top" : "left", "");
+ }),
+ (c.prototype.setContent = function() {
+ var a = this.tip(),
+ b = this.getTitle();
+ a.find(".tooltip-inner")[this.options.html ? "html" : "text"](b),
+ a.removeClass("fade in top bottom left right");
+ }),
+ (c.prototype.hide = function(b) {
+ function d() {
+ "in" != e.hoverState && f.detach(),
+ e.$element
+ .removeAttr("aria-describedby")
+ .trigger("hidden.bs." + e.type),
+ b && b();
+ }
+ var e = this,
+ f = a(this.$tip),
+ g = a.Event("hide.bs." + this.type);
+ return (
+ this.$element.trigger(g),
+ g.isDefaultPrevented() ?
+ void 0 :
+ (f.removeClass("in"),
+ a.support.transition && f.hasClass("fade") ?
+ f
+ .one("bsTransitionEnd", d)
+ .emulateTransitionEnd(c.TRANSITION_DURATION) :
+ d(),
+ (this.hoverState = null),
+ this)
+ );
+ }),
+ (c.prototype.fixTitle = function() {
+ var a = this.$element;
+ (a.attr("title") || "string" != typeof a.attr("data-original-title")) &&
+ a
+ .attr("data-original-title", a.attr("title") || "")
+ .attr("title", "");
+ }),
+ (c.prototype.hasContent = function() {
+ return this.getTitle();
+ }),
+ (c.prototype.getPosition = function(b) {
+ b = b || this.$element;
+ var c = b[0],
+ d = "BODY" == c.tagName,
+ e = c.getBoundingClientRect();
+ null == e.width &&
+ (e = a.extend({}, e, {
+ width: e.right - e.left,
+ height: e.bottom - e.top,
+ }));
+ var f = d ? { top: 0, left: 0 } : b.offset(),
+ g = {
+ scroll: d ?
+ document.documentElement.scrollTop || document.body.scrollTop :
+ b.scrollTop(),
+ },
+ h = d ?
+ { width: a(window).width(), height: a(window).height() } :
+ null;
+ return a.extend({}, e, g, h, f);
+ }),
+ (c.prototype.getCalculatedOffset = function(a, b, c, d) {
+ return "bottom" == a ?
+ { top: b.top + b.height, left: b.left + b.width / 2 - c / 2 } :
+ "top" == a ?
+ { top: b.top - d, left: b.left + b.width / 2 - c / 2 } :
+ "left" == a ?
+ { top: b.top + b.height / 2 - d / 2, left: b.left - c } :
+ { top: b.top + b.height / 2 - d / 2, left: b.left + b.width };
+ }),
+ (c.prototype.getViewportAdjustedDelta = function(a, b, c, d) {
+ var e = { top: 0, left: 0 };
+ if (!this.$viewport) return e;
+ var f = (this.options.viewport && this.options.viewport.padding) || 0,
+ g = this.getPosition(this.$viewport);
+ if (/right|left/.test(a)) {
+ var h = b.top - f - g.scroll,
+ i = b.top + f - g.scroll + d;
+ h < g.top ?
+ (e.top = g.top - h) :
+ i > g.top + g.height && (e.top = g.top + g.height - i);
+ } else {
+ var j = b.left - f,
+ k = b.left + f + c;
+ j < g.left ?
+ (e.left = g.left - j) :
+ k > g.right && (e.left = g.left + g.width - k);
+ }
+ return e;
+ }),
+ (c.prototype.getTitle = function() {
+ var a,
+ b = this.$element,
+ c = this.options;
+ return (a =
+ b.attr("data-original-title") ||
+ ("function" == typeof c.title ? c.title.call(b[0]) : c.title));
+ }),
+ (c.prototype.getUID = function(a) {
+ do a += ~~(1e6 * Math.random());
+ while (document.getElementById(a));
+ return a;
+ }),
+ (c.prototype.tip = function() {
+ if (!this.$tip &&
+ ((this.$tip = a(this.options.template)), 1 != this.$tip.length)
+ )
+ throw new Error(
+ this.type +
+ " `template` option must consist of exactly 1 top-level element!"
+ );
+ return this.$tip;
+ }),
+ (c.prototype.arrow = function() {
+ return (this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow"));
+ }),
+ (c.prototype.enable = function() {
+ this.enabled = !0;
+ }),
+ (c.prototype.disable = function() {
+ this.enabled = !1;
+ }),
+ (c.prototype.toggleEnabled = function() {
+ this.enabled = !this.enabled;
+ }),
+ (c.prototype.toggle = function(b) {
+ var c = this;
+ b &&
+ ((c = a(b.currentTarget).data("bs." + this.type)),
+ c ||
+ ((c = new this.constructor(
+ b.currentTarget,
+ this.getDelegateOptions()
+ )),
+ a(b.currentTarget).data("bs." + this.type, c))),
+ b ?
+ ((c.inState.click = !c.inState.click),
+ c.isInStateTrue() ? c.enter(c) : c.leave(c)) :
+ c.tip().hasClass("in") ?
+ c.leave(c) :
+ c.enter(c);
+ }),
+ (c.prototype.destroy = function() {
+ var a = this;
+ clearTimeout(this.timeout),
+ this.hide(function() {
+ a.$element.off("." + a.type).removeData("bs." + a.type),
+ a.$tip && a.$tip.detach(),
+ (a.$tip = null),
+ (a.$arrow = null),
+ (a.$viewport = null);
+ });
+ });
+ var d = a.fn.tooltip;
+ (a.fn.tooltip = b),
+ (a.fn.tooltip.Constructor = c),
+ (a.fn.tooltip.noConflict = function() {
+ return (a.fn.tooltip = d), this;
+ });
+})(jQuery), +(function(a) {
+ "use strict";
+
+ function b(b) {
+ return this.each(function() {
+ var d = a(this),
+ e = d.data("bs.popover"),
+ f = "object" == typeof b && b;
+ (e || !/destroy|hide/.test(b)) &&
+ (e || d.data("bs.popover", (e = new c(this, f))),
+ "string" == typeof b && e[b]());
+ });
+ }
+ var c = function(a, b) {
+ this.init("popover", a, b);
+ };
+ if (!a.fn.tooltip) throw new Error("Popover requires tooltip.js");
+ (c.VERSION = "3.3.5"),
+ (c.DEFAULTS = a.extend({}, a.fn.tooltip.Constructor.DEFAULTS, {
+ placement: "right",
+ trigger: "click",
+ content: "",
+ template: '
',
+ })),
+ (c.prototype = a.extend({}, a.fn.tooltip.Constructor.prototype)),
+ (c.prototype.constructor = c),
+ (c.prototype.getDefaults = function() {
+ return c.DEFAULTS;
+ }),
+ (c.prototype.setContent = function() {
+ var a = this.tip(),
+ b = this.getTitle(),
+ c = this.getContent();
+ a.find(".popover-title")[this.options.html ? "html" : "text"](b),
+ a
+ .find(".popover-content")
+ .children()
+ .detach()
+ .end()[
+ this.options.html ?
+ "string" == typeof c ?
+ "html" :
+ "append" :
+ "text"
+ ](c),
+ a.removeClass("fade top bottom left right in"),
+ a.find(".popover-title").html() || a.find(".popover-title").hide();
+ }),
+ (c.prototype.hasContent = function() {
+ return this.getTitle() || this.getContent();
+ }),
+ (c.prototype.getContent = function() {
+ var a = this.$element,
+ b = this.options;
+ return (
+ a.attr("data-content") ||
+ ("function" == typeof b.content ? b.content.call(a[0]) : b.content)
+ );
+ }),
+ (c.prototype.arrow = function() {
+ return (this.$arrow = this.$arrow || this.tip().find(".arrow"));
+ });
+ var d = a.fn.popover;
+ (a.fn.popover = b),
+ (a.fn.popover.Constructor = c),
+ (a.fn.popover.noConflict = function() {
+ return (a.fn.popover = d), this;
+ });
+})(jQuery), +(function(a) {
+ "use strict";
+
+ function b(c, d) {
+ (this.$body = a(document.body)),
+ (this.$scrollElement = a(a(c).is(document.body) ? window : c)),
+ (this.options = a.extend({}, b.DEFAULTS, d)),
+ (this.selector = (this.options.target || "") + " .nav li > a"),
+ (this.offsets = []),
+ (this.targets = []),
+ (this.activeTarget = null),
+ (this.scrollHeight = 0),
+ this.$scrollElement.on(
+ "scroll.bs.scrollspy",
+ a.proxy(this.process, this)
+ ),
+ this.refresh(),
+ this.process();
+ }
+
+ function c(c) {
+ return this.each(function() {
+ var d = a(this),
+ e = d.data("bs.scrollspy"),
+ f = "object" == typeof c && c;
+ e || d.data("bs.scrollspy", (e = new b(this, f))),
+ "string" == typeof c && e[c]();
+ });
+ }
+ (b.VERSION = "3.3.5"),
+ (b.DEFAULTS = { offset: 10 }),
+ (b.prototype.getScrollHeight = function() {
+ return (
+ this.$scrollElement[0].scrollHeight ||
+ Math.max(
+ this.$body[0].scrollHeight,
+ document.documentElement.scrollHeight
+ )
+ );
+ }),
+ (b.prototype.refresh = function() {
+ var b = this,
+ c = "offset",
+ d = 0;
+ (this.offsets = []),
+ (this.targets = []),
+ (this.scrollHeight = this.getScrollHeight()),
+ a.isWindow(this.$scrollElement[0]) ||
+ ((c = "position"), (d = this.$scrollElement.scrollTop())),
+ this.$body
+ .find(this.selector)
+ .map(function() {
+ var b = a(this),
+ e = b.data("target") || b.attr("href"),
+ f = /^#./.test(e) && a(e);
+ return (
+ (f && f.length && f.is(":visible") && [
+ [f[c]().top + d, e]
+ ]) ||
+ null
+ );
+ })
+ .sort(function(a, b) {
+ return a[0] - b[0];
+ })
+ .each(function() {
+ b.offsets.push(this[0]), b.targets.push(this[1]);
+ });
+ }),
+ (b.prototype.process = function() {
+ var a,
+ b = this.$scrollElement.scrollTop() + this.options.offset,
+ c = this.getScrollHeight(),
+ d = this.options.offset + c - this.$scrollElement.height(),
+ e = this.offsets,
+ f = this.targets,
+ g = this.activeTarget;
+ if ((this.scrollHeight != c && this.refresh(), b >= d))
+ return g != (a = f[f.length - 1]) && this.activate(a);
+ if (g && b < e[0]) return (this.activeTarget = null), this.clear();
+ for (a = e.length; a--;)
+ g != f[a] &&
+ b >= e[a] &&
+ (void 0 === e[a + 1] || b < e[a + 1]) &&
+ this.activate(f[a]);
+ }),
+ (b.prototype.activate = function(b) {
+ (this.activeTarget = b), this.clear();
+ var c =
+ this.selector +
+ '[data-target="' +
+ b +
+ '"],' +
+ this.selector +
+ '[href="' +
+ b +
+ '"]',
+ d = a(c).parents("li").addClass("active");
+ d.parent(".dropdown-menu").length &&
+ (d = d.closest("li.dropdown").addClass("active")),
+ d.trigger("activate.bs.scrollspy");
+ }),
+ (b.prototype.clear = function() {
+ a(this.selector)
+ .parentsUntil(this.options.target, ".active")
+ .removeClass("active");
+ });
+ var d = a.fn.scrollspy;
+ (a.fn.scrollspy = c),
+ (a.fn.scrollspy.Constructor = b),
+ (a.fn.scrollspy.noConflict = function() {
+ return (a.fn.scrollspy = d), this;
+ }),
+ a(window).on("load.bs.scrollspy.data-api", function() {
+ a('[data-spy="scroll"]').each(function() {
+ var b = a(this);
+ c.call(b, b.data());
+ });
+ });
+})(jQuery), +(function(a) {
+ "use strict";
+
+ function b(b) {
+ return this.each(function() {
+ var d = a(this),
+ e = d.data("bs.tab");
+ e || d.data("bs.tab", (e = new c(this))),
+ "string" == typeof b && e[b]();
+ });
+ }
+ var c = function(b) {
+ this.element = a(b);
+ };
+ (c.VERSION = "3.3.5"),
+ (c.TRANSITION_DURATION = 150),
+ (c.prototype.show = function() {
+ var b = this.element,
+ c = b.closest("ul:not(.dropdown-menu)"),
+ d = b.data("target");
+ if (
+ (d ||
+ ((d = b.attr("href")), (d = d && d.replace(/.*(?=#[^\s]*$)/, ""))), !b.parent("li").hasClass("active"))
+ ) {
+ var e = c.find(".active:last a"),
+ f = a.Event("hide.bs.tab", { relatedTarget: b[0] }),
+ g = a.Event("show.bs.tab", { relatedTarget: e[0] });
+ if (
+ (e.trigger(f),
+ b.trigger(g), !g.isDefaultPrevented() && !f.isDefaultPrevented())
+ ) {
+ var h = a(d);
+ this.activate(b.closest("li"), c),
+ this.activate(h, h.parent(), function() {
+ e.trigger({ type: "hidden.bs.tab", relatedTarget: b[0] }),
+ b.trigger({ type: "shown.bs.tab", relatedTarget: e[0] });
+ });
+ }
+ }
+ }),
+ (c.prototype.activate = function(b, d, e) {
+ function f() {
+ g
+ .removeClass("active")
+ .find("> .dropdown-menu > .active")
+ .removeClass("active")
+ .end()
+ .find('[data-toggle="tab"]')
+ .attr("aria-expanded", !1),
+ b
+ .addClass("active")
+ .find('[data-toggle="tab"]')
+ .attr("aria-expanded", !0),
+ h ? (b[0].offsetWidth, b.addClass("in")) : b.removeClass("fade"),
+ b.parent(".dropdown-menu").length &&
+ b
+ .closest("li.dropdown")
+ .addClass("active")
+ .end()
+ .find('[data-toggle="tab"]')
+ .attr("aria-expanded", !0),
+ e && e();
+ }
+ var g = d.find("> .active"),
+ h =
+ e &&
+ a.support.transition &&
+ ((g.length && g.hasClass("fade")) || !!d.find("> .fade").length);
+ g.length && h ?
+ g
+ .one("bsTransitionEnd", f)
+ .emulateTransitionEnd(c.TRANSITION_DURATION) :
+ f(),
+ g.removeClass("in");
+ });
+ var d = a.fn.tab;
+ (a.fn.tab = b),
+ (a.fn.tab.Constructor = c),
+ (a.fn.tab.noConflict = function() {
+ return (a.fn.tab = d), this;
+ });
+ var e = function(c) {
+ c.preventDefault(), b.call(a(this), "show");
+ };
+ a(document)
+ .on("click.bs.tab.data-api", '[data-toggle="tab"]', e)
+ .on("click.bs.tab.data-api", '[data-toggle="pill"]', e);
+})(jQuery), +(function(a) {
+ "use strict";
+
+ function b(b) {
+ return this.each(function() {
+ var d = a(this),
+ e = d.data("bs.affix"),
+ f = "object" == typeof b && b;
+ e || d.data("bs.affix", (e = new c(this, f))),
+ "string" == typeof b && e[b]();
+ });
+ }
+ var c = function(b, d) {
+ (this.options = a.extend({}, c.DEFAULTS, d)),
+ (this.$target = a(this.options.target)
+ .on("scroll.bs.affix.data-api", a.proxy(this.checkPosition, this))
+ .on(
+ "click.bs.affix.data-api",
+ a.proxy(this.checkPositionWithEventLoop, this)
+ )),
+ (this.$element = a(b)),
+ (this.affixed = null),
+ (this.unpin = null),
+ (this.pinnedOffset = null),
+ this.checkPosition();
+ };
+ (c.VERSION = "3.3.5"),
+ (c.RESET = "affix affix-top affix-bottom"),
+ (c.DEFAULTS = { offset: 0, target: window }),
+ (c.prototype.getState = function(a, b, c, d) {
+ var e = this.$target.scrollTop(),
+ f = this.$element.offset(),
+ g = this.$target.height();
+ if (null != c && "top" == this.affixed) return c > e ? "top" : !1;
+ if ("bottom" == this.affixed)
+ return null != c ?
+ e + this.unpin <= f.top ?
+ !1 :
+ "bottom" :
+ a - d >= e + g ?
+ !1 :
+ "bottom";
+ var h = null == this.affixed,
+ i = h ? e : f.top,
+ j = h ? g : b;
+ return null != c && c >= e ?
+ "top" :
+ null != d && i + j >= a - d ?
+ "bottom" :
+ !1;
+ }),
+ (c.prototype.getPinnedOffset = function() {
+ if (this.pinnedOffset) return this.pinnedOffset;
+ this.$element.removeClass(c.RESET).addClass("affix");
+ var a = this.$target.scrollTop(),
+ b = this.$element.offset();
+ return (this.pinnedOffset = b.top - a);
+ }),
+ (c.prototype.checkPositionWithEventLoop = function() {
+ setTimeout(a.proxy(this.checkPosition, this), 1);
+ }),
+ (c.prototype.checkPosition = function() {
+ if (this.$element.is(":visible")) {
+ var b = this.$element.height(),
+ d = this.options.offset,
+ e = d.top,
+ f = d.bottom,
+ g = Math.max(a(document).height(), a(document.body).height());
+ "object" != typeof d && (f = e = d),
+ "function" == typeof e && (e = d.top(this.$element)),
+ "function" == typeof f && (f = d.bottom(this.$element));
+ var h = this.getState(g, b, e, f);
+ if (this.affixed != h) {
+ null != this.unpin && this.$element.css("top", "");
+ var i = "affix" + (h ? "-" + h : ""),
+ j = a.Event(i + ".bs.affix");
+ if ((this.$element.trigger(j), j.isDefaultPrevented())) return;
+ (this.affixed = h),
+ (this.unpin = "bottom" == h ? this.getPinnedOffset() : null),
+ this.$element
+ .removeClass(c.RESET)
+ .addClass(i)
+ .trigger(i.replace("affix", "affixed") + ".bs.affix");
+ }
+ "bottom" == h && this.$element.offset({ top: g - b - f });
+ }
+ });
+ var d = a.fn.affix;
+ (a.fn.affix = b),
+ (a.fn.affix.Constructor = c),
+ (a.fn.affix.noConflict = function() {
+ return (a.fn.affix = d), this;
+ }),
+ a(window).on("load", function() {
+ a('[data-spy="affix"]').each(function() {
+ var c = a(this),
+ d = c.data();
+ (d.offset = d.offset || {}),
+ null != d.offsetBottom && (d.offset.bottom = d.offsetBottom),
+ null != d.offsetTop && (d.offset.top = d.offsetTop),
+ b.call(c, d);
+ });
+ });
+})(jQuery);
\ No newline at end of file
diff --git a/assets/js/chartist.min.js b/assets/js/chartist.min.js
new file mode 100644
index 0000000..d9e4c8f
--- /dev/null
+++ b/assets/js/chartist.min.js
@@ -0,0 +1,2225 @@
+/* Chartist.js 0.9.4
+ * Copyright © 2015 Gion Kunz
+ * Free to use under the WTFPL license.
+ * http://www.wtfpl.net/
+ */
+
+!(function(a, b) {
+ "function" == typeof define && define.amd ?
+ define([], function() {
+ return (a.Chartist = b());
+ }) :
+ "object" == typeof exports ?
+ (module.exports = b()) :
+ (a.Chartist = b());
+})(this, function() {
+ var a = { version: "0.9.4" };
+ return (
+ (function(a, b, c) {
+ "use strict";
+ (c.noop = function(a) {
+ return a;
+ }),
+ (c.alphaNumerate = function(a) {
+ return String.fromCharCode(97 + (a % 26));
+ }),
+ (c.extend = function(a) {
+ a = a || {};
+ var b = Array.prototype.slice.call(arguments, 1);
+ return (
+ b.forEach(function(b) {
+ for (var d in b)
+ "object" != typeof b[d] ||
+ null === b[d] ||
+ b[d] instanceof Array ?
+ (a[d] = b[d]) :
+ (a[d] = c.extend({}, a[d], b[d]));
+ }),
+ a
+ );
+ }),
+ (c.replaceAll = function(a, b, c) {
+ return a.replace(new RegExp(b, "g"), c);
+ }),
+ (c.stripUnit = function(a) {
+ return (
+ "string" == typeof a && (a = a.replace(/[^0-9\+-\.]/g, "")), +a
+ );
+ }),
+ (c.ensureUnit = function(a, b) {
+ return "number" == typeof a && (a += b), a;
+ }),
+ (c.querySelector = function(a) {
+ return a instanceof Node ? a : b.querySelector(a);
+ }),
+ (c.times = function(a) {
+ return Array.apply(null, new Array(a));
+ }),
+ (c.sum = function(a, b) {
+ return a + (b ? b : 0);
+ }),
+ (c.mapMultiply = function(a) {
+ return function(b) {
+ return b * a;
+ };
+ }),
+ (c.mapAdd = function(a) {
+ return function(b) {
+ return b + a;
+ };
+ }),
+ (c.serialMap = function(a, b) {
+ var d = [],
+ e = Math.max.apply(
+ null,
+ a.map(function(a) {
+ return a.length;
+ })
+ );
+ return (
+ c.times(e).forEach(function(c, e) {
+ var f = a.map(function(a) {
+ return a[e];
+ });
+ d[e] = b.apply(null, f);
+ }),
+ d
+ );
+ }),
+ (c.roundWithPrecision = function(a, b) {
+ var d = Math.pow(10, b || c.precision);
+ return Math.round(a * d) / d;
+ }),
+ (c.precision = 8),
+ (c.escapingMap = {
+ "&": "&",
+ "<": "<",
+ ">": ">",
+ '"': """,
+ "'": "'",
+ }),
+ (c.serialize = function(a) {
+ return null === a || void 0 === a ?
+ a :
+ ("number" == typeof a ?
+ (a = "" + a) :
+ "object" == typeof a && (a = JSON.stringify({ data: a })),
+ Object.keys(c.escapingMap).reduce(function(a, b) {
+ return c.replaceAll(a, b, c.escapingMap[b]);
+ }, a));
+ }),
+ (c.deserialize = function(a) {
+ if ("string" != typeof a) return a;
+ a = Object.keys(c.escapingMap).reduce(function(a, b) {
+ return c.replaceAll(a, c.escapingMap[b], b);
+ }, a);
+ try {
+ (a = JSON.parse(a)), (a = void 0 !== a.data ? a.data : a);
+ } catch (b) {}
+ return a;
+ }),
+ (c.createSvg = function(a, b, d, e) {
+ var f;
+ return (
+ (b = b || "100%"),
+ (d = d || "100%"),
+ Array.prototype.slice
+ .call(a.querySelectorAll("svg"))
+ .filter(function(a) {
+ return a.getAttributeNS(
+ "http://www.w3.org/2000/xmlns/",
+ c.xmlNs.prefix
+ );
+ })
+ .forEach(function(b) {
+ a.removeChild(b);
+ }),
+ (f = new c.Svg("svg")
+ .attr({ width: b, height: d })
+ .addClass(e)
+ .attr({ style: "width: " + b + "; height: " + d + ";" })),
+ a.appendChild(f._node),
+ f
+ );
+ }),
+ (c.reverseData = function(a) {
+ a.labels.reverse(), a.series.reverse();
+ for (var b = 0; b < a.series.length; b++)
+ "object" == typeof a.series[b] && void 0 !== a.series[b].data ?
+ a.series[b].data.reverse() :
+ a.series[b] instanceof Array && a.series[b].reverse();
+ }),
+ (c.getDataArray = function(a, b, d) {
+ function e(a) {
+ if (c.isFalseyButZero(a)) return void 0;
+ if ((a.data || a) instanceof Array) return (a.data || a).map(e);
+ if (a.hasOwnProperty("value")) return e(a.value);
+ if (d) {
+ var b = {};
+ return (
+ "string" == typeof d ?
+ (b[d] = c.getNumberOrUndefined(a)) :
+ (b.y = c.getNumberOrUndefined(a)),
+ (b.x = a.hasOwnProperty("x") ?
+ c.getNumberOrUndefined(a.x) :
+ b.x),
+ (b.y = a.hasOwnProperty("y") ?
+ c.getNumberOrUndefined(a.y) :
+ b.y),
+ b
+ );
+ }
+ return c.getNumberOrUndefined(a);
+ }
+ return (
+ ((b && !a.reversed) || (!b && a.reversed)) &&
+ (c.reverseData(a), (a.reversed = !a.reversed)),
+ a.series.map(e)
+ );
+ }),
+ (c.normalizePadding = function(a, b) {
+ return (
+ (b = b || 0),
+ "number" == typeof a ? { top: a, right: a, bottom: a, left: a } : {
+ top: "number" == typeof a.top ? a.top : b,
+ right: "number" == typeof a.right ? a.right : b,
+ bottom: "number" == typeof a.bottom ? a.bottom : b,
+ left: "number" == typeof a.left ? a.left : b,
+ }
+ );
+ }),
+ (c.getMetaData = function(a, b) {
+ var d = a.data ? a.data[b] : a[b];
+ return d ? c.serialize(d.meta) : void 0;
+ }),
+ (c.orderOfMagnitude = function(a) {
+ return Math.floor(Math.log(Math.abs(a)) / Math.LN10);
+ }),
+ (c.projectLength = function(a, b, c) {
+ return (b / c.range) * a;
+ }),
+ (c.getAvailableHeight = function(a, b) {
+ return Math.max(
+ (c.stripUnit(b.height) || a.height()) -
+ (b.chartPadding.top + b.chartPadding.bottom) -
+ b.axisX.offset,
+ 0
+ );
+ }),
+ (c.getHighLow = function(a, b, d) {
+ function e(a) {
+ if (void 0 === a) return void 0;
+ if (a instanceof Array)
+ for (var b = 0; b < a.length; b++) e(a[b]);
+ else {
+ var c = d ? +a[d] : +a;
+ g && c > f.high && (f.high = c), h && c < f.low && (f.low = c);
+ }
+ }
+ b = c.extend({}, b, d ? b["axis" + d.toUpperCase()] : {});
+ var f = {
+ high: void 0 === b.high ? -Number.MAX_VALUE : +b.high,
+ low: void 0 === b.low ? Number.MAX_VALUE : +b.low,
+ },
+ g = void 0 === b.high,
+ h = void 0 === b.low;
+ return (
+ (g || h) && e(a),
+ (b.referenceValue || 0 === b.referenceValue) &&
+ ((f.high = Math.max(b.referenceValue, f.high)),
+ (f.low = Math.min(b.referenceValue, f.low))),
+ f.high <= f.low &&
+ (0 === f.low ?
+ (f.high = 1) :
+ f.low < 0 ?
+ (f.high = 0) :
+ (f.low = 0)),
+ f
+ );
+ }),
+ (c.isNum = function(a) {
+ return !isNaN(a) && isFinite(a);
+ }),
+ (c.isFalseyButZero = function(a) {
+ return !a && 0 !== a;
+ }),
+ (c.getNumberOrUndefined = function(a) {
+ return isNaN(+a) ? void 0 : +a;
+ }),
+ (c.getMultiValue = function(a, b) {
+ return c.isNum(a) ? +a : a ? a[b || "y"] || 0 : 0;
+ }),
+ (c.rho = function(a) {
+ function b(a, c) {
+ return a % c === 0 ? c : b(c, a % c);
+ }
+
+ function c(a) {
+ return a * a + 1;
+ }
+ if (1 === a) return a;
+ var d,
+ e = 2,
+ f = 2;
+ if (a % 2 === 0) return 2;
+ do(e = c(e) % a), (f = c(c(f)) % a), (d = b(Math.abs(e - f), a));
+ while (1 === d);
+ return d;
+ }),
+ (c.getBounds = function(a, b, d, e) {
+ var f,
+ g,
+ h,
+ i = 0,
+ j = { high: b.high, low: b.low };
+ (j.valueRange = j.high - j.low),
+ (j.oom = c.orderOfMagnitude(j.valueRange)),
+ (j.step = Math.pow(10, j.oom)),
+ (j.min = Math.floor(j.low / j.step) * j.step),
+ (j.max = Math.ceil(j.high / j.step) * j.step),
+ (j.range = j.max - j.min),
+ (j.numberOfSteps = Math.round(j.range / j.step));
+ var k = c.projectLength(a, j.step, j),
+ l = d > k,
+ m = e ? c.rho(j.range) : 0;
+ if (e && c.projectLength(a, 1, j) >= d) j.step = 1;
+ else if (e && m < j.step && c.projectLength(a, m, j) >= d) j.step = m;
+ else
+ for (;;) {
+ if (l && c.projectLength(a, j.step, j) <= d) j.step *= 2;
+ else {
+ if (l || !(c.projectLength(a, j.step / 2, j) >= d)) break;
+ if (((j.step /= 2), e && j.step % 1 !== 0)) {
+ j.step *= 2;
+ break;
+ }
+ }
+ if (i++ > 1e3)
+ throw new Error(
+ "Exceeded maximum number of iterations while optimizing scale step!"
+ );
+ }
+ for (g = j.min, h = j.max; g + j.step <= j.low;) g += j.step;
+ for (; h - j.step >= j.high;) h -= j.step;
+ for (
+ j.min = g,
+ j.max = h,
+ j.range = j.max - j.min,
+ j.values = [],
+ f = j.min; f <= j.max; f += j.step
+ )
+ j.values.push(c.roundWithPrecision(f));
+ return j;
+ }),
+ (c.polarToCartesian = function(a, b, c, d) {
+ var e = ((d - 90) * Math.PI) / 180;
+ return { x: a + c * Math.cos(e), y: b + c * Math.sin(e) };
+ }),
+ (c.createChartRect = function(a, b, d) {
+ var e = !(!b.axisX && !b.axisY),
+ f = e ? b.axisY.offset : 0,
+ g = e ? b.axisX.offset : 0,
+ h = a.width() || c.stripUnit(b.width) || 0,
+ i = a.height() || c.stripUnit(b.height) || 0,
+ j = c.normalizePadding(b.chartPadding, d);
+ (h = Math.max(h, f + j.left + j.right)),
+ (i = Math.max(i, g + j.top + j.bottom));
+ var k = {
+ padding: j,
+ width: function() {
+ return this.x2 - this.x1;
+ },
+ height: function() {
+ return this.y1 - this.y2;
+ },
+ };
+ return (
+ e ?
+ ("start" === b.axisX.position ?
+ ((k.y2 = j.top + g),
+ (k.y1 = Math.max(i - j.bottom, k.y2 + 1))) :
+ ((k.y2 = j.top),
+ (k.y1 = Math.max(i - j.bottom - g, k.y2 + 1))),
+ "start" === b.axisY.position ?
+ ((k.x1 = j.left + f),
+ (k.x2 = Math.max(h - j.right, k.x1 + 1))) :
+ ((k.x1 = j.left),
+ (k.x2 = Math.max(h - j.right - f, k.x1 + 1)))) :
+ ((k.x1 = j.left),
+ (k.x2 = Math.max(h - j.right, k.x1 + 1)),
+ (k.y2 = j.top),
+ (k.y1 = Math.max(i - j.bottom, k.y2 + 1))),
+ k
+ );
+ }),
+ (c.createGrid = function(a, b, d, e, f, g, h, i) {
+ var j = {};
+ (j[d.units.pos + "1"] = a),
+ (j[d.units.pos + "2"] = a),
+ (j[d.counterUnits.pos + "1"] = e),
+ (j[d.counterUnits.pos + "2"] = e + f);
+ var k = g.elem("line", j, h.join(" "));
+ i.emit(
+ "draw",
+ c.extend({ type: "grid", axis: d, index: b, group: g, element: k },
+ j
+ )
+ );
+ }),
+ (c.createLabel = function(a, b, d, e, f, g, h, i, j, k, l) {
+ var m,
+ n = {};
+ if (
+ ((n[f.units.pos] = a + h[f.units.pos]),
+ (n[f.counterUnits.pos] = h[f.counterUnits.pos]),
+ (n[f.units.len] = b),
+ (n[f.counterUnits.len] = g - 10),
+ k)
+ ) {
+ var o =
+ '
' +
+ e[d] +
+ "";
+ m = i.foreignObject(
+ o,
+ c.extend({ style: "overflow: visible;" }, n)
+ );
+ } else m = i.elem("text", n, j.join(" ")).text(e[d]);
+ l.emit(
+ "draw",
+ c.extend({
+ type: "label",
+ axis: f,
+ index: d,
+ group: i,
+ element: m,
+ text: e[d],
+ },
+ n
+ )
+ );
+ }),
+ (c.getSeriesOption = function(a, b, c) {
+ if (a.name && b.series && b.series[a.name]) {
+ var d = b.series[a.name];
+ return d.hasOwnProperty(c) ? d[c] : b[c];
+ }
+ return b[c];
+ }),
+ (c.optionsProvider = function(b, d, e) {
+ function f(b) {
+ var f = h;
+ if (((h = c.extend({}, j)), d))
+ for (i = 0; i < d.length; i++) {
+ var g = a.matchMedia(d[i][0]);
+ g.matches && (h = c.extend(h, d[i][1]));
+ }
+ e &&
+ !b &&
+ e.emit("optionsChanged", {
+ previousOptions: f,
+ currentOptions: h,
+ });
+ }
+
+ function g() {
+ k.forEach(function(a) {
+ a.removeListener(f);
+ });
+ }
+ var h,
+ i,
+ j = c.extend({}, b),
+ k = [];
+ if (!a.matchMedia)
+ throw "window.matchMedia not found! Make sure you're using a polyfill.";
+ if (d)
+ for (i = 0; i < d.length; i++) {
+ var l = a.matchMedia(d[i][0]);
+ l.addListener(f), k.push(l);
+ }
+ return (
+ f(!0), {
+ removeMediaQueryListeners: g,
+ getCurrentOptions: function() {
+ return c.extend({}, h);
+ },
+ }
+ );
+ });
+ })(window, document, a),
+ (function(a, b, c) {
+ "use strict";
+ (c.Interpolation = {}),
+ (c.Interpolation.none = function() {
+ return function(a, b) {
+ for (
+ var d = new c.Svg.Path(), e = !0, f = 1; f < a.length; f += 2
+ ) {
+ var g = b[(f - 1) / 2];
+ void 0 === g.value ?
+ (e = !0) :
+ e ?
+ (d.move(a[f - 1], a[f], !1, g), (e = !1)) :
+ d.line(a[f - 1], a[f], !1, g);
+ }
+ return d;
+ };
+ }),
+ (c.Interpolation.simple = function(a) {
+ var b = { divisor: 2 };
+ a = c.extend({}, b, a);
+ var d = 1 / Math.max(1, a.divisor);
+ return function(a, b) {
+ for (
+ var e = new c.Svg.Path(), f = !0, g = 2; g < a.length; g += 2
+ ) {
+ var h = a[g - 2],
+ i = a[g - 1],
+ j = a[g],
+ k = a[g + 1],
+ l = (j - h) * d,
+ m = b[g / 2 - 1],
+ n = b[g / 2];
+ void 0 === m.value ?
+ (f = !0) :
+ (f && e.move(h, i, !1, m),
+ void 0 !== n.value &&
+ (e.curve(h + l, i, j - l, k, j, k, !1, n), (f = !1)));
+ }
+ return e;
+ };
+ }),
+ (c.Interpolation.cardinal = function(a) {
+ function b(a, b) {
+ for (var c = [], d = !0, e = 0; e < a.length; e += 2)
+ void 0 === b[e / 2].value ?
+ (d = !0) :
+ (d &&
+ (c.push({ pathCoordinates: [], valueData: [] }), (d = !1)),
+ c[c.length - 1].pathCoordinates.push(a[e], a[e + 1]),
+ c[c.length - 1].valueData.push(b[e / 2]));
+ return c;
+ }
+ var d = { tension: 1 };
+ a = c.extend({}, d, a);
+ var e = Math.min(1, Math.max(0, a.tension)),
+ f = 1 - e;
+ return function g(a, d) {
+ var h = b(a, d);
+ if (h.length > 1) {
+ var i = [];
+ return (
+ h.forEach(function(a) {
+ i.push(g(a.pathCoordinates, a.valueData));
+ }),
+ c.Svg.Path.join(i)
+ );
+ }
+ if (
+ ((a = h[0].pathCoordinates), (d = h[0].valueData), a.length <= 4)
+ )
+ return c.Interpolation.none()(a, d);
+ for (
+ var j,
+ k = new c.Svg.Path().move(a[0], a[1], !1, d[0]),
+ l = 0,
+ m = a.length; m - 2 * !j > l; l += 2
+ ) {
+ var n = [
+ { x: +a[l - 2], y: +a[l - 1] },
+ { x: +a[l], y: +a[l + 1] },
+ { x: +a[l + 2], y: +a[l + 3] },
+ { x: +a[l + 4], y: +a[l + 5] },
+ ];
+ j
+ ?
+ l ?
+ m - 4 === l ?
+ (n[3] = { x: +a[0], y: +a[1] }) :
+ m - 2 === l &&
+ ((n[2] = { x: +a[0], y: +a[1] }),
+ (n[3] = { x: +a[2], y: +a[3] })) :
+ (n[0] = { x: +a[m - 2], y: +a[m - 1] }) :
+ m - 4 === l ?
+ (n[3] = n[2]) :
+ l || (n[0] = { x: +a[l], y: +a[l + 1] }),
+ k.curve(
+ (e * (-n[0].x + 6 * n[1].x + n[2].x)) / 6 + f * n[2].x,
+ (e * (-n[0].y + 6 * n[1].y + n[2].y)) / 6 + f * n[2].y,
+ (e * (n[1].x + 6 * n[2].x - n[3].x)) / 6 + f * n[2].x,
+ (e * (n[1].y + 6 * n[2].y - n[3].y)) / 6 + f * n[2].y,
+ n[2].x,
+ n[2].y, !1,
+ d[(l + 2) / 2]
+ );
+ }
+ return k;
+ };
+ }),
+ (c.Interpolation.step = function(a) {
+ var b = { postpone: !0 };
+ return (
+ (a = c.extend({}, b, a)),
+ function(b, d) {
+ for (
+ var e = new c.Svg.Path(), f = !0, g = 2; g < b.length; g += 2
+ ) {
+ var h = b[g - 2],
+ i = b[g - 1],
+ j = b[g],
+ k = b[g + 1],
+ l = d[g / 2 - 1],
+ m = d[g / 2];
+ void 0 === l.value ?
+ (f = !0) :
+ (f && e.move(h, i, !1, l),
+ void 0 !== m.value &&
+ (a.postpone ? e.line(j, i, !1, l) : e.line(h, k, !1, m),
+ e.line(j, k, !1, m),
+ (f = !1)));
+ }
+ return e;
+ }
+ );
+ });
+ })(window, document, a),
+ (function(a, b, c) {
+ "use strict";
+ c.EventEmitter = function() {
+ function a(a, b) {
+ (d[a] = d[a] || []), d[a].push(b);
+ }
+
+ function b(a, b) {
+ d[a] &&
+ (b ?
+ (d[a].splice(d[a].indexOf(b), 1),
+ 0 === d[a].length && delete d[a]) :
+ delete d[a]);
+ }
+
+ function c(a, b) {
+ d[a] &&
+ d[a].forEach(function(a) {
+ a(b);
+ }),
+ d["*"] &&
+ d["*"].forEach(function(c) {
+ c(a, b);
+ });
+ }
+ var d = [];
+ return { addEventHandler: a, removeEventHandler: b, emit: c };
+ };
+ })(window, document, a),
+ (function(a, b, c) {
+ "use strict";
+
+ function d(a) {
+ var b = [];
+ if (a.length)
+ for (var c = 0; c < a.length; c++) b.push(a[c]);
+ return b;
+ }
+
+ function e(a, b) {
+ var d = b || this.prototype || c.Class,
+ e = Object.create(d);
+ c.Class.cloneDefinitions(e, a);
+ var f = function() {
+ var a,
+ b = e.constructor || function() {};
+ return (
+ (a = this === c ? Object.create(e) : this),
+ b.apply(a, Array.prototype.slice.call(arguments, 0)),
+ a
+ );
+ };
+ return (f.prototype = e), (f["super"] = d), (f.extend = this.extend), f;
+ }
+
+ function f() {
+ var a = d(arguments),
+ b = a[0];
+ return (
+ a.splice(1, a.length - 1).forEach(function(a) {
+ Object.getOwnPropertyNames(a).forEach(function(c) {
+ delete b[c],
+ Object.defineProperty(
+ b,
+ c,
+ Object.getOwnPropertyDescriptor(a, c)
+ );
+ });
+ }),
+ b
+ );
+ }
+ c.Class = { extend: e, cloneDefinitions: f };
+ })(window, document, a),
+ (function(a, b, c) {
+ "use strict";
+
+ function d(a, b, d) {
+ return (
+ a &&
+ ((this.data = a),
+ this.eventEmitter.emit("data", {
+ type: "update",
+ data: this.data,
+ })),
+ b &&
+ ((this.options = c.extend({},
+ d ? this.options : this.defaultOptions,
+ b
+ )),
+ this.initializeTimeoutId ||
+ (this.optionsProvider.removeMediaQueryListeners(),
+ (this.optionsProvider = c.optionsProvider(
+ this.options,
+ this.responsiveOptions,
+ this.eventEmitter
+ )))),
+ this.initializeTimeoutId ||
+ this.createChart(this.optionsProvider.getCurrentOptions()),
+ this
+ );
+ }
+
+ function e() {
+ return (
+ this.initializeTimeoutId ?
+ a.clearTimeout(this.initializeTimeoutId) :
+ (a.removeEventListener("resize", this.resizeListener),
+ this.optionsProvider.removeMediaQueryListeners()),
+ this
+ );
+ }
+
+ function f(a, b) {
+ return this.eventEmitter.addEventHandler(a, b), this;
+ }
+
+ function g(a, b) {
+ return this.eventEmitter.removeEventHandler(a, b), this;
+ }
+
+ function h() {
+ a.addEventListener("resize", this.resizeListener),
+ (this.optionsProvider = c.optionsProvider(
+ this.options,
+ this.responsiveOptions,
+ this.eventEmitter
+ )),
+ this.eventEmitter.addEventHandler(
+ "optionsChanged",
+ function() {
+ this.update();
+ }.bind(this)
+ ),
+ this.options.plugins &&
+ this.options.plugins.forEach(
+ function(a) {
+ a instanceof Array ? a[0](this, a[1]) : a(this);
+ }.bind(this)
+ ),
+ this.eventEmitter.emit("data", { type: "initial", data: this.data }),
+ this.createChart(this.optionsProvider.getCurrentOptions()),
+ (this.initializeTimeoutId = void 0);
+ }
+
+ function i(a, b, d, e, f) {
+ (this.container = c.querySelector(a)),
+ (this.data = b),
+ (this.defaultOptions = d),
+ (this.options = e),
+ (this.responsiveOptions = f),
+ (this.eventEmitter = c.EventEmitter()),
+ (this.supportsForeignObject = c.Svg.isSupported("Extensibility")),
+ (this.supportsAnimations = c.Svg.isSupported(
+ "AnimationEventsAttribute"
+ )),
+ (this.resizeListener = function() {
+ this.update();
+ }.bind(this)),
+ this.container &&
+ (this.container.__chartist__ &&
+ this.container.__chartist__.detach(),
+ (this.container.__chartist__ = this)),
+ (this.initializeTimeoutId = setTimeout(h.bind(this), 0));
+ }
+ c.Base = c.Class.extend({
+ constructor: i,
+ optionsProvider: void 0,
+ container: void 0,
+ svg: void 0,
+ eventEmitter: void 0,
+ createChart: function() {
+ throw new Error("Base chart type can't be instantiated!");
+ },
+ update: d,
+ detach: e,
+ on: f,
+ off: g,
+ version: c.version,
+ supportsForeignObject: !1,
+ });
+ })(window, document, a),
+ (function(a, b, c) {
+ "use strict";
+
+ function d(a, d, e, f, g) {
+ a instanceof Element
+ ?
+ (this._node = a) :
+ ((this._node = b.createElementNS(z, a)),
+ "svg" === a &&
+ this._node.setAttributeNS(A, c.xmlNs.qualifiedName, c.xmlNs.uri)),
+ d && this.attr(d),
+ e && this.addClass(e),
+ f &&
+ (g && f._node.firstChild ?
+ f._node.insertBefore(this._node, f._node.firstChild) :
+ f._node.appendChild(this._node));
+ }
+
+ function e(a, b) {
+ return "string" == typeof a ?
+ b ?
+ this._node.getAttributeNS(b, a) :
+ this._node.getAttribute(a) :
+ (Object.keys(a).forEach(
+ function(d) {
+ void 0 !== a[d] &&
+ (b ?
+ this._node.setAttributeNS(
+ b, [c.xmlNs.prefix, ":", d].join(""),
+ a[d]
+ ) :
+ this._node.setAttribute(d, a[d]));
+ }.bind(this)
+ ),
+ this);
+ }
+
+ function f(a, b, d, e) {
+ return new c.Svg(a, b, d, this, e);
+ }
+
+ function g() {
+ return this._node.parentNode instanceof SVGElement ?
+ new c.Svg(this._node.parentNode) :
+ null;
+ }
+
+ function h() {
+ for (var a = this._node;
+ "svg" !== a.nodeName;) a = a.parentNode;
+ return new c.Svg(a);
+ }
+
+ function i(a) {
+ var b = this._node.querySelector(a);
+ return b ? new c.Svg(b) : null;
+ }
+
+ function j(a) {
+ var b = this._node.querySelectorAll(a);
+ return b.length ? new c.Svg.List(b) : null;
+ }
+
+ function k(a, c, d, e) {
+ if ("string" == typeof a) {
+ var f = b.createElement("div");
+ (f.innerHTML = a), (a = f.firstChild);
+ }
+ a.setAttribute("xmlns", B);
+ var g = this.elem("foreignObject", c, d, e);
+ return g._node.appendChild(a), g;
+ }
+
+ function l(a) {
+ return this._node.appendChild(b.createTextNode(a)), this;
+ }
+
+ function m() {
+ for (; this._node.firstChild;)
+ this._node.removeChild(this._node.firstChild);
+ return this;
+ }
+
+ function n() {
+ return this._node.parentNode.removeChild(this._node), this.parent();
+ }
+
+ function o(a) {
+ return this._node.parentNode.replaceChild(a._node, this._node), a;
+ }
+
+ function p(a, b) {
+ return (
+ b && this._node.firstChild ?
+ this._node.insertBefore(a._node, this._node.firstChild) :
+ this._node.appendChild(a._node),
+ this
+ );
+ }
+
+ function q() {
+ return this._node.getAttribute("class") ?
+ this._node.getAttribute("class").trim().split(/\s+/) : [];
+ }
+
+ function r(a) {
+ return (
+ this._node.setAttribute(
+ "class",
+ this.classes(this._node)
+ .concat(a.trim().split(/\s+/))
+ .filter(function(a, b, c) {
+ return c.indexOf(a) === b;
+ })
+ .join(" ")
+ ),
+ this
+ );
+ }
+
+ function s(a) {
+ var b = a.trim().split(/\s+/);
+ return (
+ this._node.setAttribute(
+ "class",
+ this.classes(this._node)
+ .filter(function(a) {
+ return -1 === b.indexOf(a);
+ })
+ .join(" ")
+ ),
+ this
+ );
+ }
+
+ function t() {
+ return this._node.setAttribute("class", ""), this;
+ }
+
+ function u(a, b) {
+ try {
+ return a.getBBox()[b];
+ } catch (c) {}
+ return 0;
+ }
+
+ function v() {
+ return (
+ this._node.clientHeight ||
+ Math.round(u(this._node, "height")) ||
+ this._node.parentNode.clientHeight
+ );
+ }
+
+ function w() {
+ return (
+ this._node.clientWidth ||
+ Math.round(u(this._node, "width")) ||
+ this._node.parentNode.clientWidth
+ );
+ }
+
+ function x(a, b, d) {
+ return (
+ void 0 === b && (b = !0),
+ Object.keys(a).forEach(
+ function(e) {
+ function f(a, b) {
+ var f,
+ g,
+ h,
+ i = {};
+ a.easing &&
+ ((h =
+ a.easing instanceof Array ?
+ a.easing :
+ c.Svg.Easing[a.easing]),
+ delete a.easing),
+ (a.begin = c.ensureUnit(a.begin, "ms")),
+ (a.dur = c.ensureUnit(a.dur, "ms")),
+ h &&
+ ((a.calcMode = "spline"),
+ (a.keySplines = h.join(" ")),
+ (a.keyTimes = "0;1")),
+ b &&
+ ((a.fill = "freeze"),
+ (i[e] = a.from),
+ this.attr(i),
+ (g = c.stripUnit(a.begin || 0)),
+ (a.begin = "indefinite")),
+ (f = this.elem("animate", c.extend({ attributeName: e }, a))),
+ b &&
+ setTimeout(
+ function() {
+ try {
+ f._node.beginElement();
+ } catch (b) {
+ (i[e] = a.to), this.attr(i), f.remove();
+ }
+ }.bind(this),
+ g
+ ),
+ d &&
+ f._node.addEventListener(
+ "beginEvent",
+ function() {
+ d.emit("animationBegin", {
+ element: this,
+ animate: f._node,
+ params: a,
+ });
+ }.bind(this)
+ ),
+ f._node.addEventListener(
+ "endEvent",
+ function() {
+ d &&
+ d.emit("animationEnd", {
+ element: this,
+ animate: f._node,
+ params: a,
+ }),
+ b && ((i[e] = a.to), this.attr(i), f.remove());
+ }.bind(this)
+ );
+ }
+ a[e] instanceof Array ?
+ a[e].forEach(
+ function(a) {
+ f.bind(this)(a, !1);
+ }.bind(this)
+ ) :
+ f.bind(this)(a[e], b);
+ }.bind(this)
+ ),
+ this
+ );
+ }
+
+ function y(a) {
+ var b = this;
+ this.svgElements = [];
+ for (var d = 0; d < a.length; d++)
+ this.svgElements.push(new c.Svg(a[d]));
+ Object.keys(c.Svg.prototype)
+ .filter(function(a) {
+ return (-1 === [
+ "constructor",
+ "parent",
+ "querySelector",
+ "querySelectorAll",
+ "replace",
+ "append",
+ "classes",
+ "height",
+ "width",
+ ].indexOf(a));
+ })
+ .forEach(function(a) {
+ b[a] = function() {
+ var d = Array.prototype.slice.call(arguments, 0);
+ return (
+ b.svgElements.forEach(function(b) {
+ c.Svg.prototype[a].apply(b, d);
+ }),
+ b
+ );
+ };
+ });
+ }
+ var z = "http://www.w3.org/2000/svg",
+ A = "http://www.w3.org/2000/xmlns/",
+ B = "http://www.w3.org/1999/xhtml";
+ (c.xmlNs = {
+ qualifiedName: "xmlns:ct",
+ prefix: "ct",
+ uri: "http://gionkunz.github.com/chartist-js/ct",
+ }),
+ (c.Svg = c.Class.extend({
+ constructor: d,
+ attr: e,
+ elem: f,
+ parent: g,
+ root: h,
+ querySelector: i,
+ querySelectorAll: j,
+ foreignObject: k,
+ text: l,
+ empty: m,
+ remove: n,
+ replace: o,
+ append: p,
+ classes: q,
+ addClass: r,
+ removeClass: s,
+ removeAllClasses: t,
+ height: v,
+ width: w,
+ animate: x,
+ })),
+ (c.Svg.isSupported = function(a) {
+ return b.implementation.hasFeature(
+ "http://www.w3.org/TR/SVG11/feature#" + a,
+ "1.1"
+ );
+ });
+ var C = {
+ easeInSine: [0.47, 0, 0.745, 0.715],
+ easeOutSine: [0.39, 0.575, 0.565, 1],
+ easeInOutSine: [0.445, 0.05, 0.55, 0.95],
+ easeInQuad: [0.55, 0.085, 0.68, 0.53],
+ easeOutQuad: [0.25, 0.46, 0.45, 0.94],
+ easeInOutQuad: [0.455, 0.03, 0.515, 0.955],
+ easeInCubic: [0.55, 0.055, 0.675, 0.19],
+ easeOutCubic: [0.215, 0.61, 0.355, 1],
+ easeInOutCubic: [0.645, 0.045, 0.355, 1],
+ easeInQuart: [0.895, 0.03, 0.685, 0.22],
+ easeOutQuart: [0.165, 0.84, 0.44, 1],
+ easeInOutQuart: [0.77, 0, 0.175, 1],
+ easeInQuint: [0.755, 0.05, 0.855, 0.06],
+ easeOutQuint: [0.23, 1, 0.32, 1],
+ easeInOutQuint: [0.86, 0, 0.07, 1],
+ easeInExpo: [0.95, 0.05, 0.795, 0.035],
+ easeOutExpo: [0.19, 1, 0.22, 1],
+ easeInOutExpo: [1, 0, 0, 1],
+ easeInCirc: [0.6, 0.04, 0.98, 0.335],
+ easeOutCirc: [0.075, 0.82, 0.165, 1],
+ easeInOutCirc: [0.785, 0.135, 0.15, 0.86],
+ easeInBack: [0.6, -0.28, 0.735, 0.045],
+ easeOutBack: [0.175, 0.885, 0.32, 1.275],
+ easeInOutBack: [0.68, -0.55, 0.265, 1.55],
+ };
+ (c.Svg.Easing = C), (c.Svg.List = c.Class.extend({ constructor: y }));
+ })(window, document, a),
+ (function(a, b, c) {
+ "use strict";
+
+ function d(a, b, d, e, f, g) {
+ var h = c.extend({ command: f ? a.toLowerCase() : a.toUpperCase() },
+ b,
+ g ? { data: g } : {}
+ );
+ d.splice(e, 0, h);
+ }
+
+ function e(a, b) {
+ a.forEach(function(c, d) {
+ u[c.command.toLowerCase()].forEach(function(e, f) {
+ b(c, e, d, f, a);
+ });
+ });
+ }
+
+ function f(a, b) {
+ (this.pathElements = []),
+ (this.pos = 0),
+ (this.close = a),
+ (this.options = c.extend({}, v, b));
+ }
+
+ function g(a) {
+ return void 0 !== a ?
+ ((this.pos = Math.max(0, Math.min(this.pathElements.length, a))),
+ this) :
+ this.pos;
+ }
+
+ function h(a) {
+ return this.pathElements.splice(this.pos, a), this;
+ }
+
+ function i(a, b, c, e) {
+ return (
+ d("M", { x: +a, y: +b }, this.pathElements, this.pos++, c, e), this
+ );
+ }
+
+ function j(a, b, c, e) {
+ return (
+ d("L", { x: +a, y: +b }, this.pathElements, this.pos++, c, e), this
+ );
+ }
+
+ function k(a, b, c, e, f, g, h, i) {
+ return (
+ d(
+ "C", { x1: +a, y1: +b, x2: +c, y2: +e, x: +f, y: +g },
+ this.pathElements,
+ this.pos++,
+ h,
+ i
+ ),
+ this
+ );
+ }
+
+ function l(a, b, c, e, f, g, h, i, j) {
+ return (
+ d(
+ "A", { rx: +a, ry: +b, xAr: +c, lAf: +e, sf: +f, x: +g, y: +h },
+ this.pathElements,
+ this.pos++,
+ i,
+ j
+ ),
+ this
+ );
+ }
+
+ function m(a) {
+ var b = a
+ .replace(/([A-Za-z])([0-9])/g, "$1 $2")
+ .replace(/([0-9])([A-Za-z])/g, "$1 $2")
+ .split(/[\s,]+/)
+ .reduce(function(a, b) {
+ return (
+ b.match(/[A-Za-z]/) && a.push([]), a[a.length - 1].push(b), a
+ );
+ }, []);
+ "Z" === b[b.length - 1][0].toUpperCase() && b.pop();
+ var d = b.map(function(a) {
+ var b = a.shift(),
+ d = u[b.toLowerCase()];
+ return c.extend({ command: b },
+ d.reduce(function(b, c, d) {
+ return (b[c] = +a[d]), b;
+ }, {})
+ );
+ }),
+ e = [this.pos, 0];
+ return (
+ Array.prototype.push.apply(e, d),
+ Array.prototype.splice.apply(this.pathElements, e),
+ (this.pos += d.length),
+ this
+ );
+ }
+
+ function n() {
+ var a = Math.pow(10, this.options.accuracy);
+ return (
+ this.pathElements.reduce(
+ function(b, c) {
+ var d = u[c.command.toLowerCase()].map(
+ function(b) {
+ return this.options.accuracy ?
+ Math.round(c[b] * a) / a :
+ c[b];
+ }.bind(this)
+ );
+ return b + c.command + d.join(",");
+ }.bind(this),
+ ""
+ ) + (this.close ? "Z" : "")
+ );
+ }
+
+ function o(a, b) {
+ return (
+ e(this.pathElements, function(c, d) {
+ c[d] *= "x" === d[0] ? a : b;
+ }),
+ this
+ );
+ }
+
+ function p(a, b) {
+ return (
+ e(this.pathElements, function(c, d) {
+ c[d] += "x" === d[0] ? a : b;
+ }),
+ this
+ );
+ }
+
+ function q(a) {
+ return (
+ e(this.pathElements, function(b, c, d, e, f) {
+ var g = a(b, c, d, e, f);
+ (g || 0 === g) && (b[c] = g);
+ }),
+ this
+ );
+ }
+
+ function r(a) {
+ var b = new c.Svg.Path(a || this.close);
+ return (
+ (b.pos = this.pos),
+ (b.pathElements = this.pathElements.slice().map(function(a) {
+ return c.extend({}, a);
+ })),
+ (b.options = c.extend({}, this.options)),
+ b
+ );
+ }
+
+ function s(a) {
+ var b = [new c.Svg.Path()];
+ return (
+ this.pathElements.forEach(function(d) {
+ d.command === a.toUpperCase() &&
+ 0 !== b[b.length - 1].pathElements.length &&
+ b.push(new c.Svg.Path()),
+ b[b.length - 1].pathElements.push(d);
+ }),
+ b
+ );
+ }
+
+ function t(a, b, d) {
+ for (var e = new c.Svg.Path(b, d), f = 0; f < a.length; f++)
+ for (var g = a[f], h = 0; h < g.pathElements.length; h++)
+ e.pathElements.push(g.pathElements[h]);
+ return e;
+ }
+ var u = {
+ m: ["x", "y"],
+ l: ["x", "y"],
+ c: ["x1", "y1", "x2", "y2", "x", "y"],
+ a: ["rx", "ry", "xAr", "lAf", "sf", "x", "y"],
+ },
+ v = { accuracy: 3 };
+ (c.Svg.Path = c.Class.extend({
+ constructor: f,
+ position: g,
+ remove: h,
+ move: i,
+ line: j,
+ curve: k,
+ arc: l,
+ scale: o,
+ translate: p,
+ transform: q,
+ parse: m,
+ stringify: n,
+ clone: r,
+ splitByCommand: s,
+ })),
+ (c.Svg.Path.elementDescriptions = u),
+ (c.Svg.Path.join = t);
+ })(window, document, a),
+ (function(a, b, c) {
+ "use strict";
+
+ function d(a, b, c, d) {
+ (this.units = a),
+ (this.counterUnits = a === f.x ? f.y : f.x),
+ (this.chartRect = b),
+ (this.axisLength = b[a.rectEnd] - b[a.rectStart]),
+ (this.gridOffset = b[a.rectOffset]),
+ (this.ticks = c),
+ (this.options = d);
+ }
+
+ function e(a, b, d, e, f) {
+ var g = e["axis" + this.units.pos.toUpperCase()],
+ h = this.ticks.map(this.projectValue.bind(this)),
+ i = this.ticks.map(g.labelInterpolationFnc);
+ h.forEach(
+ function(j, k) {
+ var l,
+ m = { x: 0, y: 0 };
+ (l = h[k + 1] ? h[k + 1] - j : Math.max(this.axisLength - j, 30)),
+ (i[k] || 0 === i[k]) &&
+ ("x" === this.units.pos ?
+ ((j = this.chartRect.x1 + j),
+ (m.x = e.axisX.labelOffset.x),
+ "start" === e.axisX.position ?
+ (m.y =
+ this.chartRect.padding.top +
+ e.axisX.labelOffset.y +
+ (d ? 5 : 20)) :
+ (m.y =
+ this.chartRect.y1 +
+ e.axisX.labelOffset.y +
+ (d ? 5 : 20))) :
+ ((j = this.chartRect.y1 - j),
+ (m.y = e.axisY.labelOffset.y - (d ? l : 0)),
+ "start" === e.axisY.position ?
+ (m.x = d ?
+ this.chartRect.padding.left + e.axisY.labelOffset.x :
+ this.chartRect.x1 - 10) :
+ (m.x = this.chartRect.x2 + e.axisY.labelOffset.x + 10)),
+ g.showGrid &&
+ c.createGrid(
+ j,
+ k,
+ this,
+ this.gridOffset,
+ this.chartRect[this.counterUnits.len](),
+ a, [e.classNames.grid, e.classNames[this.units.dir]],
+ f
+ ),
+ g.showLabel &&
+ c.createLabel(
+ j,
+ l,
+ k,
+ i,
+ this,
+ g.offset,
+ m,
+ b, [
+ e.classNames.label,
+ e.classNames[this.units.dir],
+ e.classNames[g.position],
+ ],
+ d,
+ f
+ ));
+ }.bind(this)
+ );
+ }
+ var f = {
+ x: {
+ pos: "x",
+ len: "width",
+ dir: "horizontal",
+ rectStart: "x1",
+ rectEnd: "x2",
+ rectOffset: "y2",
+ },
+ y: {
+ pos: "y",
+ len: "height",
+ dir: "vertical",
+ rectStart: "y2",
+ rectEnd: "y1",
+ rectOffset: "x1",
+ },
+ };
+ (c.Axis = c.Class.extend({
+ constructor: d,
+ createGridAndLabels: e,
+ projectValue: function(a, b, c) {
+ throw new Error("Base axis can't be instantiated!");
+ },
+ })),
+ (c.Axis.units = f);
+ })(window, document, a),
+ (function(a, b, c) {
+ "use strict";
+
+ function d(a, b, d, e) {
+ var f = e.highLow || c.getHighLow(b.normalized, e, a.pos);
+ (this.bounds = c.getBounds(
+ d[a.rectEnd] - d[a.rectStart],
+ f,
+ e.scaleMinSpace || 20,
+ e.onlyInteger
+ )),
+ (this.range = { min: this.bounds.min, max: this.bounds.max }),
+ c.AutoScaleAxis["super"].constructor.call(
+ this,
+ a,
+ d,
+ this.bounds.values,
+ e
+ );
+ }
+
+ function e(a) {
+ return (
+ (this.axisLength *
+ (+c.getMultiValue(a, this.units.pos) - this.bounds.min)) /
+ this.bounds.range
+ );
+ }
+ c.AutoScaleAxis = c.Axis.extend({ constructor: d, projectValue: e });
+ })(window, document, a),
+ (function(a, b, c) {
+ "use strict";
+
+ function d(a, b, d, e) {
+ var f = e.highLow || c.getHighLow(b.normalized, e, a.pos);
+ (this.divisor = e.divisor || 1),
+ (this.ticks =
+ e.ticks ||
+ c.times(this.divisor).map(
+ function(a, b) {
+ return f.low + ((f.high - f.low) / this.divisor) * b;
+ }.bind(this)
+ )),
+ (this.range = { min: f.low, max: f.high }),
+ c.FixedScaleAxis["super"].constructor.call(this, a, d, this.ticks, e),
+ (this.stepLength = this.axisLength / this.divisor);
+ }
+
+ function e(a) {
+ return (
+ (this.axisLength *
+ (+c.getMultiValue(a, this.units.pos) - this.range.min)) /
+ (this.range.max - this.range.min)
+ );
+ }
+ c.FixedScaleAxis = c.Axis.extend({ constructor: d, projectValue: e });
+ })(window, document, a),
+ (function(a, b, c) {
+ "use strict";
+
+ function d(a, b, d, e) {
+ c.StepAxis["super"].constructor.call(this, a, d, e.ticks, e),
+ (this.stepLength =
+ this.axisLength / (e.ticks.length - (e.stretch ? 1 : 0)));
+ }
+
+ function e(a, b) {
+ return this.stepLength * b;
+ }
+ c.StepAxis = c.Axis.extend({ constructor: d, projectValue: e });
+ })(window, document, a),
+ (function(a, b, c) {
+ "use strict";
+
+ function d(a) {
+ var b = {
+ raw: this.data,
+ normalized: c.getDataArray(this.data, a.reverseData, !0),
+ };
+ this.svg = c.createSvg(
+ this.container,
+ a.width,
+ a.height,
+ a.classNames.chart
+ );
+ var d,
+ e,
+ g = this.svg.elem("g").addClass(a.classNames.gridGroup),
+ h = this.svg.elem("g"),
+ i = this.svg.elem("g").addClass(a.classNames.labelGroup),
+ j = c.createChartRect(this.svg, a, f.padding);
+ (d =
+ void 0 === a.axisX.type ?
+ new c.StepAxis(
+ c.Axis.units.x,
+ b,
+ j,
+ c.extend({}, a.axisX, {
+ ticks: b.raw.labels,
+ stretch: a.fullWidth,
+ })
+ ) :
+ a.axisX.type.call(c, c.Axis.units.x, b, j, a.axisX)),
+ (e =
+ void 0 === a.axisY.type ?
+ new c.AutoScaleAxis(
+ c.Axis.units.y,
+ b,
+ j,
+ c.extend({}, a.axisY, {
+ high: c.isNum(a.high) ? a.high : a.axisY.high,
+ low: c.isNum(a.low) ? a.low : a.axisY.low,
+ })
+ ) :
+ a.axisY.type.call(c, c.Axis.units.y, b, j, a.axisY)),
+ d.createGridAndLabels(
+ g,
+ i,
+ this.supportsForeignObject,
+ a,
+ this.eventEmitter
+ ),
+ e.createGridAndLabels(
+ g,
+ i,
+ this.supportsForeignObject,
+ a,
+ this.eventEmitter
+ ),
+ b.raw.series.forEach(
+ function(f, g) {
+ var i = h.elem("g");
+ i.attr({ "series-name": f.name, meta: c.serialize(f.meta) },
+ c.xmlNs.uri
+ ),
+ i.addClass(
+ [
+ a.classNames.series,
+ f.className ||
+ a.classNames.series + "-" + c.alphaNumerate(g),
+ ].join(" ")
+ );
+ var k = [],
+ l = [];
+ b.normalized[g].forEach(
+ function(a, h) {
+ var i = {
+ x: j.x1 + d.projectValue(a, h, b.normalized[g]),
+ y: j.y1 - e.projectValue(a, h, b.normalized[g]),
+ };
+ k.push(i.x, i.y),
+ l.push({
+ value: a,
+ valueIndex: h,
+ meta: c.getMetaData(f, h),
+ });
+ }.bind(this)
+ );
+ var m = {
+ lineSmooth: c.getSeriesOption(f, a, "lineSmooth"),
+ showPoint: c.getSeriesOption(f, a, "showPoint"),
+ showLine: c.getSeriesOption(f, a, "showLine"),
+ showArea: c.getSeriesOption(f, a, "showArea"),
+ areaBase: c.getSeriesOption(f, a, "areaBase"),
+ },
+ n =
+ "function" == typeof m.lineSmooth ?
+ m.lineSmooth :
+ m.lineSmooth ?
+ c.Interpolation.cardinal() :
+ c.Interpolation.none(),
+ o = n(k, l);
+ if (
+ (m.showPoint &&
+ o.pathElements.forEach(
+ function(b) {
+ var h = i
+ .elem(
+ "line", { x1: b.x, y1: b.y, x2: b.x + 0.01, y2: b.y },
+ a.classNames.point
+ )
+ .attr({
+ value: [b.data.value.x, b.data.value.y]
+ .filter(function(a) {
+ return a;
+ })
+ .join(","),
+ meta: b.data.meta,
+ },
+ c.xmlNs.uri
+ );
+ this.eventEmitter.emit("draw", {
+ type: "point",
+ value: b.data.value,
+ index: b.data.valueIndex,
+ meta: b.data.meta,
+ series: f,
+ seriesIndex: g,
+ axisX: d,
+ axisY: e,
+ group: i,
+ element: h,
+ x: b.x,
+ y: b.y,
+ });
+ }.bind(this)
+ ),
+ m.showLine)
+ ) {
+ var p = i.elem(
+ "path", { d: o.stringify() },
+ a.classNames.line, !0
+ );
+ this.eventEmitter.emit("draw", {
+ type: "line",
+ values: b.normalized[g],
+ path: o.clone(),
+ chartRect: j,
+ index: g,
+ series: f,
+ seriesIndex: g,
+ axisX: d,
+ axisY: e,
+ group: i,
+ element: p,
+ });
+ }
+ if (m.showArea && e.range) {
+ var q = Math.max(
+ Math.min(m.areaBase, e.range.max),
+ e.range.min
+ ),
+ r = j.y1 - e.projectValue(q);
+ o.splitByCommand("M")
+ .filter(function(a) {
+ return a.pathElements.length > 1;
+ })
+ .map(function(a) {
+ var b = a.pathElements[0],
+ c = a.pathElements[a.pathElements.length - 1];
+ return a
+ .clone(!0)
+ .position(0)
+ .remove(1)
+ .move(b.x, r)
+ .line(b.x, b.y)
+ .position(a.pathElements.length + 1)
+ .line(c.x, r);
+ })
+ .forEach(
+ function(h) {
+ var k = i
+ .elem(
+ "path", { d: h.stringify() },
+ a.classNames.area, !0
+ )
+ .attr({ values: b.normalized[g] }, c.xmlNs.uri);
+ this.eventEmitter.emit("draw", {
+ type: "area",
+ values: b.normalized[g],
+ path: h.clone(),
+ series: f,
+ seriesIndex: g,
+ axisX: d,
+ axisY: e,
+ chartRect: j,
+ index: g,
+ group: i,
+ element: k,
+ });
+ }.bind(this)
+ );
+ }
+ }.bind(this)
+ ),
+ this.eventEmitter.emit("created", {
+ bounds: e.bounds,
+ chartRect: j,
+ axisX: d,
+ axisY: e,
+ svg: this.svg,
+ options: a,
+ });
+ }
+
+ function e(a, b, d, e) {
+ c.Line["super"].constructor.call(this, a, b, f, c.extend({}, f, d), e);
+ }
+ var f = {
+ axisX: {
+ offset: 30,
+ position: "end",
+ labelOffset: { x: 0, y: 0 },
+ showLabel: !0,
+ showGrid: !0,
+ labelInterpolationFnc: c.noop,
+ type: void 0,
+ },
+ axisY: {
+ offset: 40,
+ position: "start",
+ labelOffset: { x: 0, y: 0 },
+ showLabel: !0,
+ showGrid: !0,
+ labelInterpolationFnc: c.noop,
+ type: void 0,
+ scaleMinSpace: 20,
+ onlyInteger: !1,
+ },
+ width: void 0,
+ height: void 0,
+ showLine: !0,
+ showPoint: !0,
+ showArea: !1,
+ areaBase: 0,
+ lineSmooth: !0,
+ low: void 0,
+ high: void 0,
+ chartPadding: { top: 15, right: 15, bottom: 5, left: 10 },
+ fullWidth: !1,
+ reverseData: !1,
+ classNames: {
+ chart: "ct-chart-line",
+ label: "ct-label",
+ labelGroup: "ct-labels",
+ series: "ct-series",
+ line: "ct-line",
+ point: "ct-point",
+ area: "ct-area",
+ grid: "ct-grid",
+ gridGroup: "ct-grids",
+ vertical: "ct-vertical",
+ horizontal: "ct-horizontal",
+ start: "ct-start",
+ end: "ct-end",
+ },
+ };
+ c.Line = c.Base.extend({ constructor: e, createChart: d });
+ })(window, document, a),
+ (function(a, b, c) {
+ "use strict";
+
+ function d(a) {
+ var b,
+ d = {
+ raw: this.data,
+ normalized: a.distributeSeries ?
+ c
+ .getDataArray(
+ this.data,
+ a.reverseData,
+ a.horizontalBars ? "x" : "y"
+ )
+ .map(function(a) {
+ return [a];
+ }) : c.getDataArray(
+ this.data,
+ a.reverseData,
+ a.horizontalBars ? "x" : "y"
+ ),
+ };
+ this.svg = c.createSvg(
+ this.container,
+ a.width,
+ a.height,
+ a.classNames.chart +
+ (a.horizontalBars ? " " + a.classNames.horizontalBars : "")
+ );
+ var e = this.svg.elem("g").addClass(a.classNames.gridGroup),
+ g = this.svg.elem("g"),
+ h = this.svg.elem("g").addClass(a.classNames.labelGroup);
+ if (a.stackBars) {
+ var i = c.serialMap(d.normalized, function() {
+ return Array.prototype.slice
+ .call(arguments)
+ .map(function(a) {
+ return a;
+ })
+ .reduce(
+ function(a, b) {
+ return { x: a.x + b.x || 0, y: a.y + b.y || 0 };
+ }, { x: 0, y: 0 }
+ );
+ });
+ b = c.getHighLow(
+ [i],
+ c.extend({}, a, { referenceValue: 0 }),
+ a.horizontalBars ? "x" : "y"
+ );
+ } else
+ b = c.getHighLow(
+ d.normalized,
+ c.extend({}, a, { referenceValue: 0 }),
+ a.horizontalBars ? "x" : "y"
+ );
+ (b.high = +a.high || (0 === a.high ? 0 : b.high)),
+ (b.low = +a.low || (0 === a.low ? 0 : b.low));
+ var j,
+ k,
+ l,
+ m,
+ n,
+ o = c.createChartRect(this.svg, a, f.padding);
+ (k =
+ a.distributeSeries && a.stackBars ?
+ d.raw.labels.slice(0, 1) :
+ d.raw.labels),
+ a.horizontalBars ?
+ ((j = m =
+ void 0 === a.axisX.type ?
+ new c.AutoScaleAxis(
+ c.Axis.units.x,
+ d,
+ o,
+ c.extend({}, a.axisX, { highLow: b, referenceValue: 0 })
+ ) :
+ a.axisX.type.call(
+ c,
+ c.Axis.units.x,
+ d,
+ o,
+ c.extend({}, a.axisX, { highLow: b, referenceValue: 0 })
+ )),
+ (l = n =
+ void 0 === a.axisY.type ?
+ new c.StepAxis(c.Axis.units.y, d, o, { ticks: k }) :
+ a.axisY.type.call(c, c.Axis.units.y, d, o, a.axisY))) :
+ ((l = m =
+ void 0 === a.axisX.type ?
+ new c.StepAxis(c.Axis.units.x, d, o, { ticks: k }) :
+ a.axisX.type.call(c, c.Axis.units.x, d, o, a.axisX)),
+ (j = n =
+ void 0 === a.axisY.type ?
+ new c.AutoScaleAxis(
+ c.Axis.units.y,
+ d,
+ o,
+ c.extend({}, a.axisY, { highLow: b, referenceValue: 0 })
+ ) :
+ a.axisY.type.call(
+ c,
+ c.Axis.units.y,
+ d,
+ o,
+ c.extend({}, a.axisY, { highLow: b, referenceValue: 0 })
+ )));
+ var p = a.horizontalBars ?
+ o.x1 + j.projectValue(0) :
+ o.y1 - j.projectValue(0),
+ q = [];
+ l.createGridAndLabels(
+ e,
+ h,
+ this.supportsForeignObject,
+ a,
+ this.eventEmitter
+ ),
+ j.createGridAndLabels(
+ e,
+ h,
+ this.supportsForeignObject,
+ a,
+ this.eventEmitter
+ ),
+ d.raw.series.forEach(
+ function(b, e) {
+ var f,
+ h,
+ i = e - (d.raw.series.length - 1) / 2;
+ (f =
+ a.distributeSeries && !a.stackBars ?
+ l.axisLength / d.normalized.length / 2 :
+ a.distributeSeries && a.stackBars ?
+ l.axisLength / 2 :
+ l.axisLength / d.normalized[e].length / 2),
+ (h = g.elem("g")),
+ h.attr({ "series-name": b.name, meta: c.serialize(b.meta) },
+ c.xmlNs.uri
+ ),
+ h.addClass(
+ [
+ a.classNames.series,
+ b.className ||
+ a.classNames.series + "-" + c.alphaNumerate(e),
+ ].join(" ")
+ ),
+ d.normalized[e].forEach(
+ function(g, k) {
+ var r, s, t, u;
+ if (
+ ((u =
+ a.distributeSeries && !a.stackBars ?
+ e :
+ a.distributeSeries && a.stackBars ?
+ 0 :
+ k),
+ (r = a.horizontalBars ? {
+ x: o.x1 +
+ j.projectValue(
+ g && g.x ? g.x : 0,
+ k,
+ d.normalized[e]
+ ),
+ y: o.y1 -
+ l.projectValue(
+ g && g.y ? g.y : 0,
+ u,
+ d.normalized[e]
+ ),
+ } : {
+ x: o.x1 +
+ l.projectValue(
+ g && g.x ? g.x : 0,
+ u,
+ d.normalized[e]
+ ),
+ y: o.y1 -
+ j.projectValue(
+ g && g.y ? g.y : 0,
+ k,
+ d.normalized[e]
+ ),
+ }),
+ l instanceof c.StepAxis &&
+ (l.options.stretch ||
+ (r[l.units.pos] += f * (a.horizontalBars ? -1 : 1)),
+ (r[l.units.pos] +=
+ a.stackBars || a.distributeSeries ?
+ 0 :
+ i *
+ a.seriesBarDistance *
+ (a.horizontalBars ? -1 : 1))),
+ (t = q[k] || p),
+ (q[k] = t - (p - r[l.counterUnits.pos])),
+ void 0 !== g)
+ ) {
+ var v = {};
+ (v[l.units.pos + "1"] = r[l.units.pos]),
+ (v[l.units.pos + "2"] = r[l.units.pos]),
+ (v[l.counterUnits.pos + "1"] = a.stackBars ? t : p),
+ (v[l.counterUnits.pos + "2"] = a.stackBars ?
+ q[k] :
+ r[l.counterUnits.pos]),
+ (v.x1 = Math.min(Math.max(v.x1, o.x1), o.x2)),
+ (v.x2 = Math.min(Math.max(v.x2, o.x1), o.x2)),
+ (v.y1 = Math.min(Math.max(v.y1, o.y2), o.y1)),
+ (v.y2 = Math.min(Math.max(v.y2, o.y2), o.y1)),
+ (s = h.elem("line", v, a.classNames.bar).attr({
+ value: [g.x, g.y]
+ .filter(function(a) {
+ return a;
+ })
+ .join(","),
+ meta: c.getMetaData(b, k),
+ },
+ c.xmlNs.uri
+ )),
+ this.eventEmitter.emit(
+ "draw",
+ c.extend({
+ type: "bar",
+ value: g,
+ index: k,
+ meta: c.getMetaData(b, k),
+ series: b,
+ seriesIndex: e,
+ axisX: m,
+ axisY: n,
+ chartRect: o,
+ group: h,
+ element: s,
+ },
+ v
+ )
+ );
+ }
+ }.bind(this)
+ );
+ }.bind(this)
+ ),
+ this.eventEmitter.emit("created", {
+ bounds: j.bounds,
+ chartRect: o,
+ axisX: m,
+ axisY: n,
+ svg: this.svg,
+ options: a,
+ });
+ }
+
+ function e(a, b, d, e) {
+ c.Bar["super"].constructor.call(this, a, b, f, c.extend({}, f, d), e);
+ }
+ var f = {
+ axisX: {
+ offset: 30,
+ position: "end",
+ labelOffset: { x: 0, y: 0 },
+ showLabel: !0,
+ showGrid: !0,
+ labelInterpolationFnc: c.noop,
+ scaleMinSpace: 30,
+ onlyInteger: !1,
+ },
+ axisY: {
+ offset: 40,
+ position: "start",
+ labelOffset: { x: 0, y: 0 },
+ showLabel: !0,
+ showGrid: !0,
+ labelInterpolationFnc: c.noop,
+ scaleMinSpace: 20,
+ onlyInteger: !1,
+ },
+ width: void 0,
+ height: void 0,
+ high: void 0,
+ low: void 0,
+ onlyInteger: !1,
+ chartPadding: { top: 15, right: 15, bottom: 5, left: 10 },
+ seriesBarDistance: 15,
+ stackBars: !1,
+ horizontalBars: !1,
+ distributeSeries: !1,
+ reverseData: !1,
+ classNames: {
+ chart: "ct-chart-bar",
+ horizontalBars: "ct-horizontal-bars",
+ label: "ct-label",
+ labelGroup: "ct-labels",
+ series: "ct-series",
+ bar: "ct-bar",
+ grid: "ct-grid",
+ gridGroup: "ct-grids",
+ vertical: "ct-vertical",
+ horizontal: "ct-horizontal",
+ start: "ct-start",
+ end: "ct-end",
+ },
+ };
+ c.Bar = c.Base.extend({ constructor: e, createChart: d });
+ })(window, document, a),
+ (function(a, b, c) {
+ "use strict";
+
+ function d(a, b, c) {
+ var d = b.x > a.x;
+ return (d && "explode" === c) || (!d && "implode" === c) ?
+ "start" :
+ (d && "implode" === c) || (!d && "explode" === c) ?
+ "end" :
+ "middle";
+ }
+
+ function e(a) {
+ var b,
+ e,
+ f,
+ h,
+ i,
+ j = [],
+ k = a.startAngle,
+ l = c.getDataArray(this.data, a.reverseData);
+ (this.svg = c.createSvg(
+ this.container,
+ a.width,
+ a.height,
+ a.donut ? a.classNames.chartDonut : a.classNames.chartPie
+ )),
+ (e = c.createChartRect(this.svg, a, g.padding)),
+ (f = Math.min(e.width() / 2, e.height() / 2)),
+ (i =
+ a.total ||
+ l.reduce(function(a, b) {
+ return a + b;
+ }, 0)),
+ (f -= a.donut ? a.donutWidth / 2 : 0),
+ (h =
+ "outside" === a.labelPosition || a.donut ?
+ f :
+ "center" === a.labelPosition ?
+ 0 :
+ f / 2),
+ (h += a.labelOffset);
+ var m = { x: e.x1 + e.width() / 2, y: e.y2 + e.height() / 2 },
+ n =
+ 1 ===
+ this.data.series.filter(function(a) {
+ return a.hasOwnProperty("value") ? 0 !== a.value : 0 !== a;
+ }).length;
+ a.showLabel && (b = this.svg.elem("g", null, null, !0));
+ for (var o = 0; o < this.data.series.length; o++) {
+ var p = this.data.series[o];
+ (j[o] = this.svg.elem("g", null, null, !0)),
+ j[o].attr({ "series-name": p.name }, c.xmlNs.uri),
+ j[o].addClass(
+ [
+ a.classNames.series,
+ p.className || a.classNames.series + "-" + c.alphaNumerate(o),
+ ].join(" ")
+ );
+ var q = k + (l[o] / i) * 360;
+ q - k === 360 && (q -= 0.01);
+ var r = c.polarToCartesian(m.x, m.y, f, k - (0 === o || n ? 0 : 0.2)),
+ s = c.polarToCartesian(m.x, m.y, f, q),
+ t = new c.Svg.Path(!a.donut)
+ .move(s.x, s.y)
+ .arc(f, f, 0, q - k > 180, 0, r.x, r.y);
+ a.donut || t.line(m.x, m.y);
+ var u = j[o].elem(
+ "path", { d: t.stringify() },
+ a.donut ? a.classNames.sliceDonut : a.classNames.slicePie
+ );
+ if (
+ (u.attr({ value: l[o], meta: c.serialize(p.meta) }, c.xmlNs.uri),
+ a.donut &&
+ u.attr({ style: "stroke-width: " + +a.donutWidth + "px" }),
+ this.eventEmitter.emit("draw", {
+ type: "slice",
+ value: l[o],
+ totalDataSum: i,
+ index: o,
+ meta: p.meta,
+ series: p,
+ group: j[o],
+ element: u,
+ path: t.clone(),
+ center: m,
+ radius: f,
+ startAngle: k,
+ endAngle: q,
+ }),
+ a.showLabel)
+ ) {
+ var v = c.polarToCartesian(m.x, m.y, h, k + (q - k) / 2),
+ w = a.labelInterpolationFnc(
+ this.data.labels ? this.data.labels[o] : l[o],
+ o
+ );
+ if (w || 0 === w) {
+ var x = b
+ .elem(
+ "text", {
+ dx: v.x,
+ dy: v.y,
+ "text-anchor": d(m, v, a.labelDirection),
+ },
+ a.classNames.label
+ )
+ .text("" + w);
+ this.eventEmitter.emit("draw", {
+ type: "label",
+ index: o,
+ group: b,
+ element: x,
+ text: "" + w,
+ x: v.x,
+ y: v.y,
+ });
+ }
+ }
+ k = q;
+ }
+ this.eventEmitter.emit("created", {
+ chartRect: e,
+ svg: this.svg,
+ options: a,
+ });
+ }
+
+ function f(a, b, d, e) {
+ c.Pie["super"].constructor.call(this, a, b, g, c.extend({}, g, d), e);
+ }
+ var g = {
+ width: void 0,
+ height: void 0,
+ chartPadding: 5,
+ classNames: {
+ chartPie: "ct-chart-pie",
+ chartDonut: "ct-chart-donut",
+ series: "ct-series",
+ slicePie: "ct-slice-pie",
+ sliceDonut: "ct-slice-donut",
+ label: "ct-label",
+ },
+ startAngle: 0,
+ total: void 0,
+ donut: !1,
+ donutWidth: 60,
+ showLabel: !0,
+ labelOffset: 0,
+ labelPosition: "inside",
+ labelInterpolationFnc: c.noop,
+ labelDirection: "neutral",
+ reverseData: !1,
+ };
+ c.Pie = c.Base.extend({
+ constructor: f,
+ createChart: e,
+ determineAnchorPosition: d,
+ });
+ })(window, document, a),
+ a
+ );
+});
+//# sourceMappingURL=chartist.min.js.map
\ No newline at end of file
diff --git a/assets/js/demo.js b/assets/js/demo.js
new file mode 100644
index 0000000..98a9913
--- /dev/null
+++ b/assets/js/demo.js
@@ -0,0 +1,152 @@
+type = ['', 'info', 'success', 'warning', 'danger'];
+
+
+demo = {
+ initPickColor: function() {
+ $('.pick-class-label').click(function() {
+ var new_class = $(this).attr('new-class');
+ var old_class = $('#display-buttons').attr('data-class');
+ var display_div = $('#display-buttons');
+ if (display_div.length) {
+ var display_buttons = display_div.find('.btn');
+ display_buttons.removeClass(old_class);
+ display_buttons.addClass(new_class);
+ display_div.attr('data-class', new_class);
+ }
+ });
+ },
+
+ initChartist: function() {
+
+ var dataSales = {
+ labels: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+ series: [
+ [287, 385, 490, 492, 554, 586, 698, 695, 752, 788],
+ [67, 152, 143, 240, 287, 335, 435, 437, 539, 542],
+ [23, 113, 67, 108, 190, 239, 307, 308, 439, 410]
+ ]
+ };
+
+ var optionsSales = {
+ lineSmooth: false,
+ low: 0,
+ high: 800,
+ showArea: true,
+ height: "245px",
+ axisX: {
+ showGrid: false,
+ },
+ lineSmooth: Chartist.Interpolation.simple({
+ divisor: 3
+ }),
+ showLine: false,
+ showPoint: false,
+ };
+
+ var responsiveSales = [
+ ['screen and (max-width: 640px)', {
+ axisX: {
+ labelInterpolationFnc: function(value) {
+ return value[0];
+ }
+ }
+ }]
+ ];
+
+ Chartist.Line('#chartHours', dataSales, optionsSales, responsiveSales);
+
+
+ var data = {
+ labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+ series: [
+ [542, 443, 320, 780, 553, 453, 326, 434, 568, 610, 756, 895],
+ [412, 243, 280, 580, 453, 353, 300, 364, 368, 410, 636, 695],
+ [279, 143, 274, 269, 152, 253, 300, 305, 333, 400, 524, 540]
+ ]
+ };
+
+ var options = {
+ seriesBarDistance: 10,
+ axisX: {
+ showGrid: false
+ },
+ height: "245px"
+ };
+
+ var responsiveOptions = [
+ ['screen and (max-width: 640px)', {
+ seriesBarDistance: 5,
+ axisX: {
+ labelInterpolationFnc: function(value) {
+ return value[0];
+ }
+ }
+ }]
+ ];
+
+ Chartist.Bar('#chartActivity', data, options, responsiveOptions);
+
+ var dataPreferences = {
+ series: [
+ [25, 30, 20, 25]
+ ]
+ };
+
+ var optionsPreferences = {
+ donut: true,
+ donutWidth: 40,
+ startAngle: 0,
+ total: 100,
+ showLabel: false,
+ axisX: {
+ showGrid: false
+ }
+ };
+
+ Chartist.Pie('#chartPreferences', dataPreferences, optionsPreferences);
+
+ Chartist.Pie('#chartPreferences', {
+ labels: ['52%', '32%', '10%', '6 % '],
+ series: [52, 32, 10, 6]
+ });
+ },
+
+ initGoogleMaps: function() {
+ var myLatlng = new google.maps.LatLng(40.748817, -73.985428);
+ var mapOptions = {
+ zoom: 13,
+ center: myLatlng,
+ scrollwheel: false, //we disable de scroll over the map, it is a really annoing when you scroll through page
+ styles: [{ "featureType": "water", "stylers": [{ "saturation": 43 }, { "lightness": -11 }, { "hue": "#0088ff" }] }, { "featureType": "road", "elementType": "geometry.fill", "stylers": [{ "hue": "#ff0000" }, { "saturation": -100 }, { "lightness": 99 }] }, { "featureType": "road", "elementType": "geometry.stroke", "stylers": [{ "color": "#808080" }, { "lightness": 54 }] }, { "featureType": "landscape.man_made", "elementType": "geometry.fill", "stylers": [{ "color": "#ece2d9" }] }, { "featureType": "poi.park", "elementType": "geometry.fill", "stylers": [{ "color": "#ccdca1" }] }, { "featureType": "road", "elementType": "labels.text.fill", "stylers": [{ "color": "#767676" }] }, { "featureType": "road", "elementType": "labels.text.stroke", "stylers": [{ "color": "#ffffff" }] }, { "featureType": "poi", "stylers": [{ "visibility": "off" }] }, { "featureType": "landscape.natural", "elementType": "geometry.fill", "stylers": [{ "visibility": "on" }, { "color": "#b8cb93" }] }, { "featureType": "poi.park", "stylers": [{ "visibility": "on" }] }, { "featureType": "poi.sports_complex", "stylers": [{ "visibility": "on" }] }, { "featureType": "poi.medical", "stylers": [{ "visibility": "on" }] }, { "featureType": "poi.business", "stylers": [{ "visibility": "simplified" }] }]
+
+ }
+ var map = new google.maps.Map(document.getElementById("map"), mapOptions);
+
+ var marker = new google.maps.Marker({
+ position: myLatlng,
+ title: "Hello World!"
+ });
+
+ // To add the marker to the map, call setMap();
+ marker.setMap(map);
+ },
+
+ showNotification: function(from, align) {
+ color = Math.floor((Math.random() * 4) + 1);
+
+ $.notify({
+ icon: "pe-7s-gift",
+ message: "Welcome to
Light Bootstrap Dashboard - a beautiful freebie for every web developer."
+
+ }, {
+ type: type[color],
+ timer: 4000,
+ placement: {
+ from: from,
+ align: align
+ }
+ });
+ }
+
+
+}
\ No newline at end of file
diff --git a/assets/js/jquery-1.10.2.js b/assets/js/jquery-1.10.2.js
new file mode 100644
index 0000000..d6f6ac8
--- /dev/null
+++ b/assets/js/jquery-1.10.2.js
@@ -0,0 +1,9789 @@
+/*!
+ * jQuery JavaScript Library v1.10.2
+ * http://jquery.com/
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ *
+ * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2013-07-03T13:48Z
+ */
+(function( window, undefined ) {
+
+// Can't do this because several apps including ASP.NET trace
+// the stack via arguments.caller.callee and Firefox dies if
+// you try to trace through "use strict" call chains. (#13335)
+// Support: Firefox 18+
+//"use strict";
+var
+ // The deferred used on DOM ready
+ readyList,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // Support: IE<10
+ // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`
+ core_strundefined = typeof undefined,
+
+ // Use the correct document accordingly with window argument (sandbox)
+ location = window.location,
+ document = window.document,
+ docElem = document.documentElement,
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // [[Class]] -> type pairs
+ class2type = {},
+
+ // List of deleted data cache ids, so we can reuse them
+ core_deletedIds = [],
+
+ core_version = "1.10.2",
+
+ // Save a reference to some core methods
+ core_concat = core_deletedIds.concat,
+ core_push = core_deletedIds.push,
+ core_slice = core_deletedIds.slice,
+ core_indexOf = core_deletedIds.indexOf,
+ core_toString = class2type.toString,
+ core_hasOwn = class2type.hasOwnProperty,
+ core_trim = core_version.trim,
+
+ // Define a local copy of jQuery
+ jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context, rootjQuery );
+ },
+
+ // Used for matching numbers
+ core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
+
+ // Used for splitting on whitespace
+ core_rnotwhite = /\S+/g,
+
+ // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+ // A simple way to check for HTML strings
+ // Prioritize #id over
to avoid XSS via location.hash (#9521)
+ // Strict HTML recognition (#11290: must start with <)
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
+
+ // JSON RegExp
+ rvalidchars = /^[\],:{}\s]*$/,
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
+ rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
+
+ // Matches dashed string for camelizing
+ rmsPrefix = /^-ms-/,
+ rdashAlpha = /-([\da-z])/gi,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ },
+
+ // The ready event handler
+ completed = function( event ) {
+
+ // readyState === "complete" is good enough for us to call the dom ready in oldIE
+ if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
+ detach();
+ jQuery.ready();
+ }
+ },
+ // Clean-up method for dom ready events
+ detach = function() {
+ if ( document.addEventListener ) {
+ document.removeEventListener( "DOMContentLoaded", completed, false );
+ window.removeEventListener( "load", completed, false );
+
+ } else {
+ document.detachEvent( "onreadystatechange", completed );
+ window.detachEvent( "onload", completed );
+ }
+ };
+
+jQuery.fn = jQuery.prototype = {
+ // The current version of jQuery being used
+ jquery: core_version,
+
+ constructor: jQuery,
+ init: function( selector, context, rootjQuery ) {
+ var match, elem;
+
+ // HANDLE: $(""), $(null), $(undefined), $(false)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = rquickExpr.exec( selector );
+ }
+
+ // Match html or make sure no context is specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+
+ // scripts is true for back-compat
+ jQuery.merge( this, jQuery.parseHTML(
+ match[1],
+ context && context.nodeType ? context.ownerDocument || context : document,
+ true
+ ) );
+
+ // HANDLE: $(html, props)
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
+ for ( match in context ) {
+ // Properties of context are called as methods if possible
+ if ( jQuery.isFunction( this[ match ] ) ) {
+ this[ match ]( context[ match ] );
+
+ // ...and otherwise set as attributes
+ } else {
+ this.attr( match, context[ match ] );
+ }
+ }
+ }
+
+ return this;
+
+ // HANDLE: $(#id)
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || rootjQuery ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(DOMElement)
+ } else if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if ( selector.selector !== undefined ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ toArray: function() {
+ return core_slice.call( this );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems ) {
+
+ // Build a new jQuery matched element set
+ var ret = jQuery.merge( this.constructor(), elems );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+ ret.context = this.context;
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Add the callback
+ jQuery.ready.promise().done( fn );
+
+ return this;
+ },
+
+ slice: function() {
+ return this.pushStack( core_slice.apply( this, arguments ) );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ eq: function( i ) {
+ var len = this.length,
+ j = +i + ( i < 0 ? len : 0 );
+ return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: core_push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var src, copyIsArray, copy, name, options, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ // Unique for each copy of jQuery on the page
+ // Non-digits removed to match rinlinejQuery
+ expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
+
+ noConflict: function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+
+ // Abort if there are pending holds or we're already ready
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+ return;
+ }
+
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger("ready").off("ready");
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ isWindow: function( obj ) {
+ /* jshint eqeqeq: false */
+ return obj != null && obj == obj.window;
+ },
+
+ isNumeric: function( obj ) {
+ return !isNaN( parseFloat(obj) ) && isFinite( obj );
+ },
+
+ type: function( obj ) {
+ if ( obj == null ) {
+ return String( obj );
+ }
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[ core_toString.call(obj) ] || "object" :
+ typeof obj;
+ },
+
+ isPlainObject: function( obj ) {
+ var key;
+
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ try {
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !core_hasOwn.call(obj, "constructor") &&
+ !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+ } catch ( e ) {
+ // IE8,9 Will throw exceptions on certain host objects #9897
+ return false;
+ }
+
+ // Support: IE<9
+ // Handle iteration over inherited properties before own properties.
+ if ( jQuery.support.ownLast ) {
+ for ( key in obj ) {
+ return core_hasOwn.call( obj, key );
+ }
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+ for ( key in obj ) {}
+
+ return key === undefined || core_hasOwn.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ var name;
+ for ( name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw new Error( msg );
+ },
+
+ // data: string of html
+ // context (optional): If specified, the fragment will be created in this context, defaults to document
+ // keepScripts (optional): If true, will include scripts passed in the html string
+ parseHTML: function( data, context, keepScripts ) {
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ if ( typeof context === "boolean" ) {
+ keepScripts = context;
+ context = false;
+ }
+ context = context || document;
+
+ var parsed = rsingleTag.exec( data ),
+ scripts = !keepScripts && [];
+
+ // Single tag
+ if ( parsed ) {
+ return [ context.createElement( parsed[1] ) ];
+ }
+
+ parsed = jQuery.buildFragment( [ data ], context, scripts );
+ if ( scripts ) {
+ jQuery( scripts ).remove();
+ }
+ return jQuery.merge( [], parsed.childNodes );
+ },
+
+ parseJSON: function( data ) {
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ return window.JSON.parse( data );
+ }
+
+ if ( data === null ) {
+ return data;
+ }
+
+ if ( typeof data === "string" ) {
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ if ( data ) {
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
+ .replace( rvalidtokens, "]" )
+ .replace( rvalidbraces, "")) ) {
+
+ return ( new Function( "return " + data ) )();
+ }
+ }
+ }
+
+ jQuery.error( "Invalid JSON: " + data );
+ },
+
+ // Cross-browser xml parsing
+ parseXML: function( data ) {
+ var xml, tmp;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ try {
+ if ( window.DOMParser ) { // Standard
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data , "text/xml" );
+ } else { // IE
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+ } catch( e ) {
+ xml = undefined;
+ }
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+ },
+
+ noop: function() {},
+
+ // Evaluates a script in a global context
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && jQuery.trim( data ) ) {
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data );
+ } )( data );
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+ },
+
+ // args is for internal usage only
+ each: function( obj, callback, args ) {
+ var value,
+ i = 0,
+ length = obj.length,
+ isArray = isArraylike( obj );
+
+ if ( args ) {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return obj;
+ },
+
+ // Use native String.trim function wherever possible
+ trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
+ function( text ) {
+ return text == null ?
+ "" :
+ core_trim.call( text );
+ } :
+
+ // Otherwise use our own trimming functionality
+ function( text ) {
+ return text == null ?
+ "" :
+ ( text + "" ).replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( arr, results ) {
+ var ret = results || [];
+
+ if ( arr != null ) {
+ if ( isArraylike( Object(arr) ) ) {
+ jQuery.merge( ret,
+ typeof arr === "string" ?
+ [ arr ] : arr
+ );
+ } else {
+ core_push.call( ret, arr );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, arr, i ) {
+ var len;
+
+ if ( arr ) {
+ if ( core_indexOf ) {
+ return core_indexOf.call( arr, elem, i );
+ }
+
+ len = arr.length;
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
+
+ for ( ; i < len; i++ ) {
+ // Skip accessing in sparse arrays
+ if ( i in arr && arr[ i ] === elem ) {
+ return i;
+ }
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var l = second.length,
+ i = first.length,
+ j = 0;
+
+ if ( typeof l === "number" ) {
+ for ( ; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var retVal,
+ ret = [],
+ i = 0,
+ length = elems.length;
+ inv = !!inv;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( ; i < length; i++ ) {
+ retVal = !!callback( elems[ i ], i );
+ if ( inv !== retVal ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value,
+ i = 0,
+ length = elems.length,
+ isArray = isArraylike( elems ),
+ ret = [];
+
+ // Go through the array, translating each of the items to their
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( i in elems ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return core_concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ var args, proxy, tmp;
+
+ if ( typeof context === "string" ) {
+ tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ args = core_slice.call( arguments, 2 );
+ proxy = function() {
+ return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ // Multifunctional method to get and set values of a collection
+ // The value/s can optionally be executed if it's a function
+ access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
+ var i = 0,
+ length = elems.length,
+ bulk = key == null;
+
+ // Sets many values
+ if ( jQuery.type( key ) === "object" ) {
+ chainable = true;
+ for ( i in key ) {
+ jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
+ }
+
+ // Sets one value
+ } else if ( value !== undefined ) {
+ chainable = true;
+
+ if ( !jQuery.isFunction( value ) ) {
+ raw = true;
+ }
+
+ if ( bulk ) {
+ // Bulk operations run against the entire set
+ if ( raw ) {
+ fn.call( elems, value );
+ fn = null;
+
+ // ...except when executing function values
+ } else {
+ bulk = fn;
+ fn = function( elem, key, value ) {
+ return bulk.call( jQuery( elem ), value );
+ };
+ }
+ }
+
+ if ( fn ) {
+ for ( ; i < length; i++ ) {
+ fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
+ }
+ }
+ }
+
+ return chainable ?
+ elems :
+
+ // Gets
+ bulk ?
+ fn.call( elems ) :
+ length ? fn( elems[0], key ) : emptyGet;
+ },
+
+ now: function() {
+ return ( new Date() ).getTime();
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations.
+ // Note: this method belongs to the css module but it's needed here for the support module.
+ // If support gets modularized, this method should be moved back to the css module.
+ swap: function( elem, options, callback, args ) {
+ var ret, name,
+ old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ ret = callback.apply( elem, args || [] );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+
+ return ret;
+ }
+});
+
+jQuery.ready.promise = function( obj ) {
+ if ( !readyList ) {
+
+ readyList = jQuery.Deferred();
+
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
+ // we once tried to use readyState "interactive" here, but it caused issues like the one
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ setTimeout( jQuery.ready );
+
+ // Standards-based browsers support DOMContentLoaded
+ } else if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", completed, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", completed, false );
+
+ // If IE event model is used
+ } else {
+ // Ensure firing before onload, maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", completed );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", completed );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var top = false;
+
+ try {
+ top = window.frameElement == null && document.documentElement;
+ } catch(e) {}
+
+ if ( top && top.doScroll ) {
+ (function doScrollCheck() {
+ if ( !jQuery.isReady ) {
+
+ try {
+ // Use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ top.doScroll("left");
+ } catch(e) {
+ return setTimeout( doScrollCheck, 50 );
+ }
+
+ // detach all dom ready events
+ detach();
+
+ // and execute any waiting functions
+ jQuery.ready();
+ }
+ })();
+ }
+ }
+ }
+ return readyList.promise( obj );
+};
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+function isArraylike( obj ) {
+ var length = obj.length,
+ type = jQuery.type( obj );
+
+ if ( jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ if ( obj.nodeType === 1 && length ) {
+ return true;
+ }
+
+ return type === "array" || type !== "function" &&
+ ( length === 0 ||
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj );
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+/*!
+ * Sizzle CSS Selector Engine v1.10.2
+ * http://sizzlejs.com/
+ *
+ * Copyright 2013 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2013-07-03
+ */
+(function( window, undefined ) {
+
+var i,
+ support,
+ cachedruns,
+ Expr,
+ getText,
+ isXML,
+ compile,
+ outermostContext,
+ sortInput,
+
+ // Local document vars
+ setDocument,
+ document,
+ docElem,
+ documentIsHTML,
+ rbuggyQSA,
+ rbuggyMatches,
+ matches,
+ contains,
+
+ // Instance-specific data
+ expando = "sizzle" + -(new Date()),
+ preferredDoc = window.document,
+ dirruns = 0,
+ done = 0,
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+ hasDuplicate = false,
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+ return 0;
+ },
+
+ // General-purpose constants
+ strundefined = typeof undefined,
+ MAX_NEGATIVE = 1 << 31,
+
+ // Instance methods
+ hasOwn = ({}).hasOwnProperty,
+ arr = [],
+ pop = arr.pop,
+ push_native = arr.push,
+ push = arr.push,
+ slice = arr.slice,
+ // Use a stripped-down indexOf if we can't use a native one
+ indexOf = arr.indexOf || function( elem ) {
+ var i = 0,
+ len = this.length;
+ for ( ; i < len; i++ ) {
+ if ( this[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+
+ // Regular expressions
+
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+ // http://www.w3.org/TR/css3-syntax/#characters
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
+
+ // Loosely modeled on CSS identifier characters
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = characterEncoding.replace( "w", "w#" ),
+
+ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
+ "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
+
+ // Prefer arguments quoted,
+ // then not containing pseudos/brackets,
+ // then attribute selectors/non-parenthetical expressions,
+ // then anything else
+ // These preferences are here to reduce the number of selectors
+ // needing tokenize in the PSEUDO preFilter
+ pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
+
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
+
+ rsibling = new RegExp( whitespace + "*[+~]" ),
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ),
+
+ rpseudo = new RegExp( pseudos ),
+ ridentifier = new RegExp( "^" + identifier + "$" ),
+
+ matchExpr = {
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+ // For use in libraries implementing .is()
+ // We use this for POS matching in `select`
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+ },
+
+ rnative = /^[^{]+\{\s*\[native \w/,
+
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+ rinputs = /^(?:input|select|textarea|button)$/i,
+ rheader = /^h\d$/i,
+
+ rescape = /'|\\/g,
+
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+ funescape = function( _, escaped, escapedWhitespace ) {
+ var high = "0x" + escaped - 0x10000;
+ // NaN means non-codepoint
+ // Support: Firefox
+ // Workaround erroneous numeric interpretation of +"0x"
+ return high !== high || escapedWhitespace ?
+ escaped :
+ // BMP codepoint
+ high < 0 ?
+ String.fromCharCode( high + 0x10000 ) :
+ // Supplemental Plane codepoint (surrogate pair)
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+ };
+
+// Optimize for push.apply( _, NodeList )
+try {
+ push.apply(
+ (arr = slice.call( preferredDoc.childNodes )),
+ preferredDoc.childNodes
+ );
+ // Support: Android<4.0
+ // Detect silently failing push.apply
+ arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+ push = { apply: arr.length ?
+
+ // Leverage slice if possible
+ function( target, els ) {
+ push_native.apply( target, slice.call(els) );
+ } :
+
+ // Support: IE<9
+ // Otherwise append directly
+ function( target, els ) {
+ var j = target.length,
+ i = 0;
+ // Can't trust NodeList.length
+ while ( (target[j++] = els[i++]) ) {}
+ target.length = j - 1;
+ }
+ };
+}
+
+function Sizzle( selector, context, results, seed ) {
+ var match, elem, m, nodeType,
+ // QSA vars
+ i, groups, old, nid, newContext, newSelector;
+
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+ setDocument( context );
+ }
+
+ context = context || document;
+ results = results || [];
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( documentIsHTML && !seed ) {
+
+ // Shortcuts
+ if ( (match = rquickExpr.exec( selector )) ) {
+ // Speed-up: Sizzle("#ID")
+ if ( (m = match[1]) ) {
+ if ( nodeType === 9 ) {
+ elem = context.getElementById( m );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE, Opera, and Webkit return items
+ // by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+ } else {
+ // Context is not a document
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+ contains( context, elem ) && elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ }
+
+ // Speed-up: Sizzle("TAG")
+ } else if ( match[2] ) {
+ push.apply( results, context.getElementsByTagName( selector ) );
+ return results;
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
+ push.apply( results, context.getElementsByClassName( m ) );
+ return results;
+ }
+ }
+
+ // QSA path
+ if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+ nid = old = expando;
+ newContext = context;
+ newSelector = nodeType === 9 && selector;
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ groups = tokenize( selector );
+
+ if ( (old = context.getAttribute("id")) ) {
+ nid = old.replace( rescape, "\\$&" );
+ } else {
+ context.setAttribute( "id", nid );
+ }
+ nid = "[id='" + nid + "'] ";
+
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = nid + toSelector( groups[i] );
+ }
+ newContext = rsibling.test( selector ) && context.parentNode || context;
+ newSelector = groups.join(",");
+ }
+
+ if ( newSelector ) {
+ try {
+ push.apply( results,
+ newContext.querySelectorAll( newSelector )
+ );
+ return results;
+ } catch(qsaError) {
+ } finally {
+ if ( !old ) {
+ context.removeAttribute("id");
+ }
+ }
+ }
+ }
+ }
+
+ // All others
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ * deleting the oldest entry
+ */
+function createCache() {
+ var keys = [];
+
+ function cache( key, value ) {
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+ if ( keys.push( key += " " ) > Expr.cacheLength ) {
+ // Only keep the most recent entries
+ delete cache[ keys.shift() ];
+ }
+ return (cache[ key ] = value);
+ }
+ return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+ fn[ expando ] = true;
+ return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+ var div = document.createElement("div");
+
+ try {
+ return !!fn( div );
+ } catch (e) {
+ return false;
+ } finally {
+ // Remove from its parent by default
+ if ( div.parentNode ) {
+ div.parentNode.removeChild( div );
+ }
+ // release memory in IE
+ div = null;
+ }
+}
+
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+ var arr = attrs.split("|"),
+ i = attrs.length;
+
+ while ( i-- ) {
+ Expr.attrHandle[ arr[i] ] = handler;
+ }
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+ var cur = b && a,
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+ ( ~b.sourceIndex || MAX_NEGATIVE ) -
+ ( ~a.sourceIndex || MAX_NEGATIVE );
+
+ // Use IE sourceIndex if available on both nodes
+ if ( diff ) {
+ return diff;
+ }
+
+ // Check if b follows a
+ if ( cur ) {
+ while ( (cur = cur.nextSibling) ) {
+ if ( cur === b ) {
+ return -1;
+ }
+ }
+ }
+
+ return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
+/**
+ * Detect xml
+ * @param {Element|Object} elem An element or a document
+ */
+isXML = Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+ var doc = node ? node.ownerDocument || node : preferredDoc,
+ parent = doc.defaultView;
+
+ // If no document and documentElement is available, return
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+ return document;
+ }
+
+ // Set our document
+ document = doc;
+ docElem = doc.documentElement;
+
+ // Support tests
+ documentIsHTML = !isXML( doc );
+
+ // Support: IE>8
+ // If iframe document is assigned to "document" variable and if iframe has been reloaded,
+ // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
+ // IE6-8 do not support the defaultView property so parent will be undefined
+ if ( parent && parent.attachEvent && parent !== parent.top ) {
+ parent.attachEvent( "onbeforeunload", function() {
+ setDocument();
+ });
+ }
+
+ /* Attributes
+ ---------------------------------------------------------------------- */
+
+ // Support: IE<8
+ // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
+ support.attributes = assert(function( div ) {
+ div.className = "i";
+ return !div.getAttribute("className");
+ });
+
+ /* getElement(s)By*
+ ---------------------------------------------------------------------- */
+
+ // Check if getElementsByTagName("*") returns only elements
+ support.getElementsByTagName = assert(function( div ) {
+ div.appendChild( doc.createComment("") );
+ return !div.getElementsByTagName("*").length;
+ });
+
+ // Check if getElementsByClassName can be trusted
+ support.getElementsByClassName = assert(function( div ) {
+ div.innerHTML = "";
+
+ // Support: Safari<4
+ // Catch class over-caching
+ div.firstChild.className = "i";
+ // Support: Opera<10
+ // Catch gEBCN failure to find non-leading classes
+ return div.getElementsByClassName("i").length === 2;
+ });
+
+ // Support: IE<10
+ // Check if getElementById returns elements by name
+ // The broken getElementById methods don't pick up programatically-set names,
+ // so use a roundabout getElementsByName test
+ support.getById = assert(function( div ) {
+ docElem.appendChild( div ).id = expando;
+ return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
+ });
+
+ // ID find and filter
+ if ( support.getById ) {
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
+ var m = context.getElementById( id );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ };
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ return elem.getAttribute("id") === attrId;
+ };
+ };
+ } else {
+ // Support: IE6/7
+ // getElementById is not reliable as a find shortcut
+ delete Expr.find["ID"];
+
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+ return node && node.value === attrId;
+ };
+ };
+ }
+
+ // Tag
+ Expr.find["TAG"] = support.getElementsByTagName ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== strundefined ) {
+ return context.getElementsByTagName( tag );
+ }
+ } :
+ function( tag, context ) {
+ var elem,
+ tmp = [],
+ i = 0,
+ results = context.getElementsByTagName( tag );
+
+ // Filter out possible comments
+ if ( tag === "*" ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
+ }
+
+ return tmp;
+ }
+ return results;
+ };
+
+ // Class
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+ if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
+ return context.getElementsByClassName( className );
+ }
+ };
+
+ /* QSA/matchesSelector
+ ---------------------------------------------------------------------- */
+
+ // QSA and matchesSelector support
+
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+ rbuggyMatches = [];
+
+ // qSa(:focus) reports false when true (Chrome 21)
+ // We allow this because of a bug in IE8/9 that throws an error
+ // whenever `document.activeElement` is accessed on an iframe
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
+ // See http://bugs.jquery.com/ticket/13378
+ rbuggyQSA = [];
+
+ if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert(function( div ) {
+ // Select is set to empty string on purpose
+ // This is to test IE's treatment of not explicitly
+ // setting a boolean content attribute,
+ // since its presence should be enough
+ // http://bugs.jquery.com/ticket/12359
+ div.innerHTML = "";
+
+ // Support: IE8
+ // Boolean attributes and "value" are not treated correctly
+ if ( !div.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+ }
+
+ // Webkit/Opera - :checked should return selected option elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+ });
+
+ assert(function( div ) {
+
+ // Support: Opera 10-12/IE8
+ // ^= $= *= and empty values
+ // Should not select anything
+ // Support: Windows 8 Native Apps
+ // The type attribute is restricted during .innerHTML assignment
+ var input = doc.createElement("input");
+ input.setAttribute( "type", "hidden" );
+ div.appendChild( input ).setAttribute( "t", "" );
+
+ if ( div.querySelectorAll("[t^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+ }
+
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":enabled").length ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Opera 10-11 does not throw on post-comma invalid pseudos
+ div.querySelectorAll("*,:x");
+ rbuggyQSA.push(",.*:");
+ });
+ }
+
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector) )) ) {
+
+ assert(function( div ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9)
+ support.disconnectedMatch = matches.call( div, "div" );
+
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( div, "[s!='']:x" );
+ rbuggyMatches.push( "!=", pseudos );
+ });
+ }
+
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+ /* Contains
+ ---------------------------------------------------------------------- */
+
+ // Element contains another
+ // Purposefully does not implement inclusive descendent
+ // As in, an element does not contain itself
+ contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && (
+ adown.contains ?
+ adown.contains( bup ) :
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+ ));
+ } :
+ function( a, b ) {
+ if ( b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ /* Sorting
+ ---------------------------------------------------------------------- */
+
+ // Document order sorting
+ sortOrder = docElem.compareDocumentPosition ?
+ function( a, b ) {
+
+ // Flag for duplicate removal
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );
+
+ if ( compare ) {
+ // Disconnected nodes
+ if ( compare & 1 ||
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+ // Choose the first element that is related to our preferred document
+ if ( a === doc || contains(preferredDoc, a) ) {
+ return -1;
+ }
+ if ( b === doc || contains(preferredDoc, b) ) {
+ return 1;
+ }
+
+ // Maintain original order
+ return sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+ }
+
+ return compare & 4 ? -1 : 1;
+ }
+
+ // Not directly comparable, sort on existence of method
+ return a.compareDocumentPosition ? -1 : 1;
+ } :
+ function( a, b ) {
+ var cur,
+ i = 0,
+ aup = a.parentNode,
+ bup = b.parentNode,
+ ap = [ a ],
+ bp = [ b ];
+
+ // Exit early if the nodes are identical
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // Parentless nodes are either documents or disconnected
+ } else if ( !aup || !bup ) {
+ return a === doc ? -1 :
+ b === doc ? 1 :
+ aup ? -1 :
+ bup ? 1 :
+ sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+
+ // If the nodes are siblings, we can do a quick check
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+ }
+
+ // Otherwise we need full lists of their ancestors for comparison
+ cur = a;
+ while ( (cur = cur.parentNode) ) {
+ ap.unshift( cur );
+ }
+ cur = b;
+ while ( (cur = cur.parentNode) ) {
+ bp.unshift( cur );
+ }
+
+ // Walk down the tree looking for a discrepancy
+ while ( ap[i] === bp[i] ) {
+ i++;
+ }
+
+ return i ?
+ // Do a sibling check if the nodes have a common ancestor
+ siblingCheck( ap[i], bp[i] ) :
+
+ // Otherwise nodes in our document sort first
+ ap[i] === preferredDoc ? -1 :
+ bp[i] === preferredDoc ? 1 :
+ 0;
+ };
+
+ return doc;
+};
+
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
+ if ( support.matchesSelector && documentIsHTML &&
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
+
+ try {
+ var ret = matches.call( elem, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || support.disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle( expr, document, null, [elem] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+ // Set document vars if needed
+ if ( ( context.ownerDocument || context ) !== document ) {
+ setDocument( context );
+ }
+ return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+ fn( elem, name, !documentIsHTML ) :
+ undefined;
+
+ return val === undefined ?
+ support.attributes || !documentIsHTML ?
+ elem.getAttribute( name ) :
+ (val = elem.getAttributeNode(name)) && val.specified ?
+ val.value :
+ null :
+ val;
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ duplicates = [],
+ j = 0,
+ i = 0;
+
+ // Unless we *know* we can detect duplicates, assume their presence
+ hasDuplicate = !support.detectDuplicates;
+ sortInput = !support.sortStable && results.slice( 0 );
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem === results[ i ] ) {
+ j = duplicates.push( i );
+ }
+ }
+ while ( j-- ) {
+ results.splice( duplicates[ j ], 1 );
+ }
+ }
+
+ return results;
+};
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( !nodeType ) {
+ // If no nodeType, this is expected to be an array
+ for ( ; (node = elem[i]); i++ ) {
+ // Do not traverse comment nodes
+ ret += getText( node );
+ }
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent for elements
+ // innerText usage removed for consistency of new lines (see #11153)
+ if ( typeof elem.textContent === "string" ) {
+ return elem.textContent;
+ } else {
+ // Traverse its children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ // Do not include comment or processing instruction nodes
+
+ return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+ // Can be adjusted by the user
+ cacheLength: 50,
+
+ createPseudo: markFunction,
+
+ match: matchExpr,
+
+ attrHandle: {},
+
+ find: {},
+
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
+ },
+
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( runescape, funescape );
+
+ // Move the given value to match[3] whether quoted or unquoted
+ match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
+
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
+ }
+
+ return match.slice( 0, 4 );
+ },
+
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 what (child|of-type)
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
+ 5 sign of xn-component
+ 6 x of xn-component
+ 7 sign of y-component
+ 8 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
+
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
+ // nth-* requires argument
+ if ( !match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // numeric x and y parameters for Expr.filter.CHILD
+ // remember that false/true cast respectively to 0/1
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+ // other types prohibit arguments
+ } else if ( match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ return match;
+ },
+
+ "PSEUDO": function( match ) {
+ var excess,
+ unquoted = !match[5] && match[2];
+
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
+ }
+
+ // Accept quoted arguments as-is
+ if ( match[3] && match[4] !== undefined ) {
+ match[2] = match[4];
+
+ // Strip excess characters from unquoted arguments
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
+ // Get excess from tokenize (recursively)
+ (excess = tokenize( unquoted, true )) &&
+ // advance to the next closing parenthesis
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+ // excess is a negative index
+ match[0] = match[0].slice( 0, excess );
+ match[2] = unquoted.slice( 0, excess );
+ }
+
+ // Return only captures needed by the pseudo filter method (type and argument)
+ return match.slice( 0, 3 );
+ }
+ },
+
+ filter: {
+
+ "TAG": function( nodeNameSelector ) {
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+ return nodeNameSelector === "*" ?
+ function() { return true; } :
+ function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+
+ "CLASS": function( className ) {
+ var pattern = classCache[ className + " " ];
+
+ return pattern ||
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+ classCache( className, function( elem ) {
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
+ });
+ },
+
+ "ATTR": function( name, operator, check ) {
+ return function( elem ) {
+ var result = Sizzle.attr( elem, name );
+
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
+
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.slice( -check.length ) === check :
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
+ },
+
+ "CHILD": function( type, what, argument, first, last ) {
+ var simple = type.slice( 0, 3 ) !== "nth",
+ forward = type.slice( -4 ) !== "last",
+ ofType = what === "of-type";
+
+ return first === 1 && last === 0 ?
+
+ // Shortcut for :nth-*(n)
+ function( elem ) {
+ return !!elem.parentNode;
+ } :
+
+ function( elem, context, xml ) {
+ var cache, outerCache, node, diff, nodeIndex, start,
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
+ parent = elem.parentNode,
+ name = ofType && elem.nodeName.toLowerCase(),
+ useCache = !xml && !ofType;
+
+ if ( parent ) {
+
+ // :(first|last|only)-(child|of-type)
+ if ( simple ) {
+ while ( dir ) {
+ node = elem;
+ while ( (node = node[ dir ]) ) {
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ // Reverse direction for :only-* (if we haven't yet done so)
+ start = dir = type === "only" && !start && "nextSibling";
+ }
+ return true;
+ }
+
+ start = [ forward ? parent.firstChild : parent.lastChild ];
+
+ // non-xml :nth-child(...) stores cache data on `parent`
+ if ( forward && useCache ) {
+ // Seek `elem` from a previously-cached index
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
+ cache = outerCache[ type ] || [];
+ nodeIndex = cache[0] === dirruns && cache[1];
+ diff = cache[0] === dirruns && cache[2];
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+ // Fallback to seeking `elem` from the start
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ // When found, cache indexes on `parent` and break
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
+ break;
+ }
+ }
+
+ // Use previously-cached element index if available
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
+ diff = cache[1];
+
+ // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
+ } else {
+ // Use the same loop as above to seek `elem` from the start
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
+ // Cache the index of each encountered element
+ if ( useCache ) {
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
+ }
+
+ if ( node === elem ) {
+ break;
+ }
+ }
+ }
+ }
+
+ // Incorporate the offset, then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ }
+ };
+ },
+
+ "PSEUDO": function( pseudo, argument ) {
+ // pseudo-class names are case-insensitive
+ // http://www.w3.org/TR/selectors/#pseudo-classes
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ // The user may use createPseudo to indicate that
+ // arguments are needed to create the filter function
+ // just as Sizzle does
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf.call( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
+
+ return fn;
+ }
+ },
+
+ pseudos: {
+ // Potentially complex pseudos
+ "not": markFunction(function( selector ) {
+ // Trim the selector passed to compile
+ // to avoid treating leading and trailing
+ // spaces as combinators
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
+
+ "contains": markFunction(function( text ) {
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ // "Whether an element is represented by a :lang() selector
+ // is based solely on the element's language value
+ // being equal to the identifier C,
+ // or beginning with the identifier C immediately followed by "-".
+ // The matching of C against the element's language value is performed case-insensitively.
+ // The identifier C does not have to be a valid language name."
+ // http://www.w3.org/TR/selectors/#lang-pseudo
+ "lang": markFunction( function( lang ) {
+ // lang value must be a valid identifier
+ if ( !ridentifier.test(lang || "") ) {
+ Sizzle.error( "unsupported lang: " + lang );
+ }
+ lang = lang.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ var elemLang;
+ do {
+ if ( (elemLang = documentIsHTML ?
+ elem.lang :
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+ }
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+ return false;
+ };
+ }),
+
+ // Miscellaneous
+ "target": function( elem ) {
+ var hash = window.location && window.location.hash;
+ return hash && hash.slice( 1 ) === elem.id;
+ },
+
+ "root": function( elem ) {
+ return elem === docElem;
+ },
+
+ "focus": function( elem ) {
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+ },
+
+ // Boolean properties
+ "enabled": function( elem ) {
+ return elem.disabled === false;
+ },
+
+ "disabled": function( elem ) {
+ return elem.disabled === true;
+ },
+
+ "checked": function( elem ) {
+ // In CSS3, :checked should return both checked and selected elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ // Contents
+ "empty": function( elem ) {
+ // http://www.w3.org/TR/selectors/#empty-pseudo
+ // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
+ // not comment, processing instructions, or others
+ // Thanks to Diego Perini for the nodeName shortcut
+ // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
+
+ // Element/input types
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
+
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
+ },
+
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
+ },
+
+ "text": function( elem ) {
+ var attr;
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+ // use getAttribute instead to test this case
+ return elem.nodeName.toLowerCase() === "input" &&
+ elem.type === "text" &&
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
+ },
+
+ // Position-in-collection
+ "first": createPositionalPseudo(function() {
+ return [ 0 ];
+ }),
+
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 0;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 1;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
+ }
+};
+
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+ Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+ Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+// Easy API for creating new setFilters
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+function tokenize( selector, parseOnly ) {
+ var matched, match, tokens, type,
+ soFar, groups, preFilters,
+ cached = tokenCache[ selector + " " ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ // Comma and first run
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ // Don't consume trailing commas as valid
+ soFar = soFar.slice( match[0].length ) || soFar;
+ }
+ groups.push( tokens = [] );
+ }
+
+ matched = false;
+
+ // Combinators
+ if ( (match = rcombinators.exec( soFar )) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ // Cast descendant combinators to space
+ type: match[0].replace( rtrim, " " )
+ });
+ soFar = soFar.slice( matched.length );
+ }
+
+ // Filters
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ (match = preFilters[ type ]( match ))) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ type: type,
+ matches: match
+ });
+ soFar = soFar.slice( matched.length );
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ // Return the length of the invalid excess
+ // if we're just parsing
+ // Otherwise, throw an error or return tokens
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+}
+
+function toSelector( tokens ) {
+ var i = 0,
+ len = tokens.length,
+ selector = "";
+ for ( ; i < len; i++ ) {
+ selector += tokens[i].value;
+ }
+ return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ checkNonElements = base && dir === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ } :
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ var data, cache, outerCache,
+ dirkey = dirruns + " " + doneName;
+
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+ if ( xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ if ( matcher( elem, context, xml ) ) {
+ return true;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
+ if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
+ if ( (data = cache[1]) === true || data === cachedruns ) {
+ return data === true;
+ }
+ } else {
+ cache = outerCache[ dir ] = [ dirkey ];
+ cache[1] = matcher( elem, context, xml ) || cachedruns;
+ if ( cache[1] === true ) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
+
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
+ }
+ }
+
+ return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ var temp, i, elem,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
+
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
+
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+ // ...intermediate processing is necessary
+ [] :
+
+ // ...otherwise use results directly
+ results :
+ matcherIn;
+
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ // Apply postFilter
+ if ( postFilter ) {
+ temp = condense( matcherOut, postMap );
+ postFilter( temp, [], context, xml );
+
+ // Un-match failing elements by moving them back to matcherIn
+ i = temp.length;
+ while ( i-- ) {
+ if ( (elem = temp[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ if ( seed ) {
+ if ( postFinder || preFilter ) {
+ if ( postFinder ) {
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
+ temp = [];
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ // Restore matcherIn since elem is not yet a final match
+ temp.push( (matcherIn[i] = elem) );
+ }
+ }
+ postFinder( null, (matcherOut = []), temp, xml );
+ }
+
+ // Move matched elements from seed to results to keep them synchronized
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) &&
+ (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
+
+ seed[temp] = !(results[temp] = elem);
+ }
+ }
+ }
+
+ // Add elements to results, through postFinder if defined
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
+
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf.call( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+ } else {
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && toSelector(
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+ ).replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && toSelector( tokens )
+ );
+ }
+ matchers.push( matcher );
+ }
+ }
+
+ return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ // A counter to specify which element is currently being matched
+ var matcherCachedRuns = 0,
+ bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, expandContext ) {
+ var elem, j, matcher,
+ setMatched = [],
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ outermost = expandContext != null,
+ contextBackup = outermostContext,
+ // We must always have either seed elements or context
+ elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
+ // Use integer dirruns iff this is the outermost matcher
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
+
+ if ( outermost ) {
+ outermostContext = context !== document && context;
+ cachedruns = matcherCachedRuns;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ j = 0;
+ while ( (matcher = elementMatchers[j++]) ) {
+ if ( matcher( elem, context, xml ) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ cachedruns = ++matcherCachedRuns;
+ }
+ }
+
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
+ }
+
+ // Apply set filters to unmatched elements
+ matchedCount += i;
+ if ( bySet && i !== matchedCount ) {
+ j = 0;
+ while ( (matcher = setMatchers[j++]) ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
+
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
+
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
+
+ // Add matches to results
+ push.apply( results, setMatched );
+
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
+ }
+ }
+
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
+ }
+
+ return unmatched;
+ };
+
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ selector + " " ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !group ) {
+ group = tokenize( selector );
+ }
+ i = group.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( group[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
+
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+ }
+ return cached;
+};
+
+function multipleContexts( selector, contexts, results ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results );
+ }
+ return results;
+}
+
+function select( selector, context, results, seed ) {
+ var i, tokens, token, type, find,
+ match = tokenize( selector );
+
+ if ( !seed ) {
+ // Try to minimize operations if there is only one group
+ if ( match.length === 1 ) {
+
+ // Take a shortcut and set the context if the root selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ support.getById && context.nodeType === 9 && documentIsHTML &&
+ Expr.relative[ tokens[1].type ] ) {
+
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+ if ( !context ) {
+ return results;
+ }
+ selector = selector.slice( tokens.shift().value.length );
+ }
+
+ // Fetch a seed set for right-to-left matching
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+ while ( i-- ) {
+ token = tokens[i];
+
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( runescape, funescape ),
+ rsibling.test( tokens[0].type ) && context.parentNode || context
+ )) ) {
+
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && toSelector( tokens );
+ if ( !selector ) {
+ push.apply( results, seed );
+ return results;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Compile and execute a filtering function
+ // Provide `match` to avoid retokenization if we modified the selector above
+ compile( selector, match )(
+ seed,
+ context,
+ !documentIsHTML,
+ results,
+ rsibling.test( selector )
+ );
+ return results;
+}
+
+// One-time assignments
+
+// Sort stability
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+// Support: Chrome<14
+// Always assume duplicates if they aren't passed to the comparison function
+support.detectDuplicates = hasDuplicate;
+
+// Initialize against the default document
+setDocument();
+
+// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Detached nodes confoundingly follow *each other*
+support.sortDetached = assert(function( div1 ) {
+ // Should return 1, but returns 4 (following)
+ return div1.compareDocumentPosition( document.createElement("div") ) & 1;
+});
+
+// Support: IE<8
+// Prevent attribute/property "interpolation"
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !assert(function( div ) {
+ div.innerHTML = "";
+ return div.firstChild.getAttribute("href") === "#" ;
+}) ) {
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
+ }
+ });
+}
+
+// Support: IE<9
+// Use defaultValue in place of getAttribute("value")
+if ( !support.attributes || !assert(function( div ) {
+ div.innerHTML = "";
+ div.firstChild.setAttribute( "value", "" );
+ return div.firstChild.getAttribute( "value" ) === "";
+}) ) {
+ addHandle( "value", function( elem, name, isXML ) {
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
+ return elem.defaultValue;
+ }
+ });
+}
+
+// Support: IE<9
+// Use getAttributeNode to fetch booleans when getAttribute lies
+if ( !assert(function( div ) {
+ return div.getAttribute("disabled") == null;
+}) ) {
+ addHandle( booleans, function( elem, name, isXML ) {
+ var val;
+ if ( !isXML ) {
+ return (val = elem.getAttributeNode( name )) && val.specified ?
+ val.value :
+ elem[ name ] === true ? name.toLowerCase() : null;
+ }
+ });
+}
+
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.pseudos;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+})( window );
+// String to Object options format cache
+var optionsCache = {};
+
+// Convert String-formatted options into Object-formatted ones and store in cache
+function createOptions( options ) {
+ var object = optionsCache[ options ] = {};
+ jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
+ object[ flag ] = true;
+ });
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * options: an optional list of space-separated options that will change how
+ * the callback list behaves or a more traditional option object
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible options:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( options ) {
+
+ // Convert options from String-formatted to Object-formatted if needed
+ // (we check in cache first)
+ options = typeof options === "string" ?
+ ( optionsCache[ options ] || createOptions( options ) ) :
+ jQuery.extend( {}, options );
+
+ var // Flag to know if list is currently firing
+ firing,
+ // Last fire value (for non-forgettable lists)
+ memory,
+ // Flag to know if list was already fired
+ fired,
+ // End of the loop when firing
+ firingLength,
+ // Index of currently firing callback (modified by remove if needed)
+ firingIndex,
+ // First callback to fire (used internally by add and fireWith)
+ firingStart,
+ // Actual callback list
+ list = [],
+ // Stack of fire calls for repeatable lists
+ stack = !options.once && [],
+ // Fire callbacks
+ fire = function( data ) {
+ memory = options.memory && data;
+ fired = true;
+ firingIndex = firingStart || 0;
+ firingStart = 0;
+ firingLength = list.length;
+ firing = true;
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
+ memory = false; // To prevent further calls using add
+ break;
+ }
+ }
+ firing = false;
+ if ( list ) {
+ if ( stack ) {
+ if ( stack.length ) {
+ fire( stack.shift() );
+ }
+ } else if ( memory ) {
+ list = [];
+ } else {
+ self.disable();
+ }
+ }
+ },
+ // Actual Callbacks object
+ self = {
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+ // First, we save the current length
+ var start = list.length;
+ (function add( args ) {
+ jQuery.each( args, function( _, arg ) {
+ var type = jQuery.type( arg );
+ if ( type === "function" ) {
+ if ( !options.unique || !self.has( arg ) ) {
+ list.push( arg );
+ }
+ } else if ( arg && arg.length && type !== "string" ) {
+ // Inspect recursively
+ add( arg );
+ }
+ });
+ })( arguments );
+ // Do we need to add the callbacks to the
+ // current firing batch?
+ if ( firing ) {
+ firingLength = list.length;
+ // With memory, if we're not firing then
+ // we should call right away
+ } else if ( memory ) {
+ firingStart = start;
+ fire( memory );
+ }
+ }
+ return this;
+ },
+ // Remove a callback from the list
+ remove: function() {
+ if ( list ) {
+ jQuery.each( arguments, function( _, arg ) {
+ var index;
+ while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+ list.splice( index, 1 );
+ // Handle firing indexes
+ if ( firing ) {
+ if ( index <= firingLength ) {
+ firingLength--;
+ }
+ if ( index <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ }
+ });
+ }
+ return this;
+ },
+ // Check if a given callback is in the list.
+ // If no argument is given, return whether or not list has callbacks attached.
+ has: function( fn ) {
+ return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
+ },
+ // Remove all callbacks from the list
+ empty: function() {
+ list = [];
+ firingLength = 0;
+ return this;
+ },
+ // Have the list do nothing anymore
+ disable: function() {
+ list = stack = memory = undefined;
+ return this;
+ },
+ // Is it disabled?
+ disabled: function() {
+ return !list;
+ },
+ // Lock the list in its current state
+ lock: function() {
+ stack = undefined;
+ if ( !memory ) {
+ self.disable();
+ }
+ return this;
+ },
+ // Is it locked?
+ locked: function() {
+ return !stack;
+ },
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ if ( list && ( !fired || stack ) ) {
+ args = args || [];
+ args = [ context, args.slice ? args.slice() : args ];
+ if ( firing ) {
+ stack.push( args );
+ } else {
+ fire( args );
+ }
+ }
+ return this;
+ },
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!fired;
+ }
+ };
+
+ return self;
+};
+jQuery.extend({
+
+ Deferred: function( func ) {
+ var tuples = [
+ // action, add listener, listener list, final state
+ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
+ [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
+ [ "notify", "progress", jQuery.Callbacks("memory") ]
+ ],
+ state = "pending",
+ promise = {
+ state: function() {
+ return state;
+ },
+ always: function() {
+ deferred.done( arguments ).fail( arguments );
+ return this;
+ },
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
+ var fns = arguments;
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( tuples, function( i, tuple ) {
+ var action = tuple[ 0 ],
+ fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
+ deferred[ tuple[1] ](function() {
+ var returned = fn && fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise()
+ .done( newDefer.resolve )
+ .fail( newDefer.reject )
+ .progress( newDefer.notify );
+ } else {
+ newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
+ }
+ });
+ });
+ fns = null;
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
+ }
+ },
+ deferred = {};
+
+ // Keep pipe for back-compat
+ promise.pipe = promise.then;
+
+ // Add list-specific methods
+ jQuery.each( tuples, function( i, tuple ) {
+ var list = tuple[ 2 ],
+ stateString = tuple[ 3 ];
+
+ // promise[ done | fail | progress ] = list.add
+ promise[ tuple[1] ] = list.add;
+
+ // Handle state
+ if ( stateString ) {
+ list.add(function() {
+ // state = [ resolved | rejected ]
+ state = stateString;
+
+ // [ reject_list | resolve_list ].disable; progress_list.lock
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
+ }
+
+ // deferred[ resolve | reject | notify ]
+ deferred[ tuple[0] ] = function() {
+ deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
+ return this;
+ };
+ deferred[ tuple[0] + "With" ] = list.fireWith;
+ });
+
+ // Make the deferred a promise
+ promise.promise( deferred );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( subordinate /* , ..., subordinateN */ ) {
+ var i = 0,
+ resolveValues = core_slice.call( arguments ),
+ length = resolveValues.length,
+
+ // the count of uncompleted subordinates
+ remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+
+ // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+
+ // Update function for both resolve and progress values
+ updateFunc = function( i, contexts, values ) {
+ return function( value ) {
+ contexts[ i ] = this;
+ values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
+ if( values === progressValues ) {
+ deferred.notifyWith( contexts, values );
+ } else if ( !( --remaining ) ) {
+ deferred.resolveWith( contexts, values );
+ }
+ };
+ },
+
+ progressValues, progressContexts, resolveContexts;
+
+ // add listeners to Deferred subordinates; treat others as resolved
+ if ( length > 1 ) {
+ progressValues = new Array( length );
+ progressContexts = new Array( length );
+ resolveContexts = new Array( length );
+ for ( ; i < length; i++ ) {
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
+ resolveValues[ i ].promise()
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
+ .fail( deferred.reject )
+ .progress( updateFunc( i, progressContexts, progressValues ) );
+ } else {
+ --remaining;
+ }
+ }
+ }
+
+ // if we're not waiting on anything, resolve the master
+ if ( !remaining ) {
+ deferred.resolveWith( resolveContexts, resolveValues );
+ }
+
+ return deferred.promise();
+ }
+});
+jQuery.support = (function( support ) {
+
+ var all, a, input, select, fragment, opt, eventName, isSupported, i,
+ div = document.createElement("div");
+
+ // Setup
+ div.setAttribute( "className", "t" );
+ div.innerHTML = " a";
+
+ // Finish early in limited (non-browser) environments
+ all = div.getElementsByTagName("*") || [];
+ a = div.getElementsByTagName("a")[ 0 ];
+ if ( !a || !a.style || !all.length ) {
+ return support;
+ }
+
+ // First batch of tests
+ select = document.createElement("select");
+ opt = select.appendChild( document.createElement("option") );
+ input = div.getElementsByTagName("input")[ 0 ];
+
+ a.style.cssText = "top:1px;float:left;opacity:.5";
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ support.getSetAttribute = div.className !== "t";
+
+ // IE strips leading whitespace when .innerHTML is used
+ support.leadingWhitespace = div.firstChild.nodeType === 3;
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ support.tbody = !div.getElementsByTagName("tbody").length;
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ support.htmlSerialize = !!div.getElementsByTagName("link").length;
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ support.style = /top/.test( a.getAttribute("style") );
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ support.hrefNormalized = a.getAttribute("href") === "/a";
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ support.opacity = /^0.5/.test( a.style.opacity );
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ support.cssFloat = !!a.style.cssFloat;
+
+ // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
+ support.checkOn = !!input.value;
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ support.optSelected = opt.selected;
+
+ // Tests for enctype support on a form (#6743)
+ support.enctype = !!document.createElement("form").enctype;
+
+ // Makes sure cloning an html5 element does not cause problems
+ // Where outerHTML is undefined, this still works
+ support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>";
+
+ // Will be defined later
+ support.inlineBlockNeedsLayout = false;
+ support.shrinkWrapBlocks = false;
+ support.pixelPosition = false;
+ support.deleteExpando = true;
+ support.noCloneEvent = true;
+ support.reliableMarginRight = true;
+ support.boxSizingReliable = true;
+
+ // Make sure checked status is properly cloned
+ input.checked = true;
+ support.noCloneChecked = input.cloneNode( true ).checked;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Support: IE<9
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+
+ // Check if we can trust getAttribute("value")
+ input = document.createElement("input");
+ input.setAttribute( "value", "" );
+ support.input = input.getAttribute( "value" ) === "";
+
+ // Check if an input maintains its value after becoming a radio
+ input.value = "t";
+ input.setAttribute( "type", "radio" );
+ support.radioValue = input.value === "t";
+
+ // #11217 - WebKit loses check when the name is after the checked attribute
+ input.setAttribute( "checked", "t" );
+ input.setAttribute( "name", "t" );
+
+ fragment = document.createDocumentFragment();
+ fragment.appendChild( input );
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ support.appendChecked = input.checked;
+
+ // WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Support: IE<9
+ // Opera does not clone events (and typeof div.attachEvent === undefined).
+ // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
+ if ( div.attachEvent ) {
+ div.attachEvent( "onclick", function() {
+ support.noCloneEvent = false;
+ });
+
+ div.cloneNode( true ).click();
+ }
+
+ // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
+ // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
+ for ( i in { submit: true, change: true, focusin: true }) {
+ div.setAttribute( eventName = "on" + i, "t" );
+
+ support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
+ }
+
+ div.style.backgroundClip = "content-box";
+ div.cloneNode( true ).style.backgroundClip = "";
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
+
+ // Support: IE<9
+ // Iteration over object's inherited properties before its own.
+ for ( i in jQuery( support ) ) {
+ break;
+ }
+ support.ownLast = i !== "0";
+
+ // Run tests that need a body at doc ready
+ jQuery(function() {
+ var container, marginDiv, tds,
+ divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
+ body = document.getElementsByTagName("body")[0];
+
+ if ( !body ) {
+ // Return for frameset docs that don't have a body
+ return;
+ }
+
+ container = document.createElement("div");
+ container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
+
+ body.appendChild( container ).appendChild( div );
+
+ // Support: IE8
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ div.innerHTML = "";
+ tds = div.getElementsByTagName("td");
+ tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+ tds[ 0 ].style.display = "";
+ tds[ 1 ].style.display = "none";
+
+ // Support: IE8
+ // Check if empty table cells still have offsetWidth/Height
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+
+ // Check box-sizing and margin behavior.
+ div.innerHTML = "";
+ div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
+
+ // Workaround failing boxSizing test due to offsetWidth returning wrong value
+ // with some non-1 values of body zoom, ticket #13543
+ jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
+ support.boxSizing = div.offsetWidth === 4;
+ });
+
+ // Use window.getComputedStyle because jsdom on node.js will break without it.
+ if ( window.getComputedStyle ) {
+ support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
+ support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
+
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. (#3333)
+ // Fails in WebKit before Feb 2011 nightlies
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ marginDiv = div.appendChild( document.createElement("div") );
+ marginDiv.style.cssText = div.style.cssText = divReset;
+ marginDiv.style.marginRight = marginDiv.style.width = "0";
+ div.style.width = "1px";
+
+ support.reliableMarginRight =
+ !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
+ }
+
+ if ( typeof div.style.zoom !== core_strundefined ) {
+ // Support: IE<8
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ div.innerHTML = "";
+ div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
+
+ // Support: IE6
+ // Check if elements with layout shrink-wrap their children
+ div.style.display = "block";
+ div.innerHTML = "";
+ div.firstChild.style.width = "5px";
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
+
+ if ( support.inlineBlockNeedsLayout ) {
+ // Prevent IE 6 from affecting layout for positioned elements #11048
+ // Prevent IE from shrinking the body in IE 7 mode #12869
+ // Support: IE<8
+ body.style.zoom = 1;
+ }
+ }
+
+ body.removeChild( container );
+
+ // Null elements to avoid leaks in IE
+ container = div = tds = marginDiv = null;
+ });
+
+ // Null elements to avoid leaks in IE
+ all = select = fragment = opt = a = input = null;
+
+ return support;
+})({});
+
+var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
+ rmultiDash = /([A-Z])/g;
+
+function internalData( elem, name, data, pvt /* Internal Use Only */ ){
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var ret, thisCache,
+ internalKey = jQuery.expando,
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
+ return;
+ }
+
+ if ( !id ) {
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++;
+ } else {
+ id = internalKey;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+ // Avoid exposing jQuery metadata on plain JS objects when the object
+ // is serialized using JSON.stringify
+ cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ] = jQuery.extend( cache[ id ], name );
+ } else {
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
+ }
+ }
+
+ thisCache = cache[ id ];
+
+ // jQuery data() is stored in a separate object inside the object's internal data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data.
+ if ( !pvt ) {
+ if ( !thisCache.data ) {
+ thisCache.data = {};
+ }
+
+ thisCache = thisCache.data;
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ jQuery.camelCase( name ) ] = data;
+ }
+
+ // Check for both converted-to-camel and non-converted data property names
+ // If a data property was specified
+ if ( typeof name === "string" ) {
+
+ // First Try to find as-is property data
+ ret = thisCache[ name ];
+
+ // Test for null|undefined property data
+ if ( ret == null ) {
+
+ // Try to find the camelCased property
+ ret = thisCache[ jQuery.camelCase( name ) ];
+ }
+ } else {
+ ret = thisCache;
+ }
+
+ return ret;
+}
+
+function internalRemoveData( elem, name, pvt ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache, i,
+ isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
+
+ if ( thisCache ) {
+
+ // Support array or space separated string names for data keys
+ if ( !jQuery.isArray( name ) ) {
+
+ // try the string as a key before any manipulation
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+
+ // split the camel cased version by spaces unless a key with the spaces exists
+ name = jQuery.camelCase( name );
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+ name = name.split(" ");
+ }
+ }
+ } else {
+ // If "name" is an array of keys...
+ // When data is initially created, via ("key", "val") signature,
+ // keys will be converted to camelCase.
+ // Since there is no way to tell _how_ a key was added, remove
+ // both plain key and camelCase key. #12786
+ // This will only penalize the array argument path.
+ name = name.concat( jQuery.map( name, jQuery.camelCase ) );
+ }
+
+ i = name.length;
+ while ( i-- ) {
+ delete thisCache[ name[i] ];
+ }
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( !pvt ) {
+ delete cache[ id ].data;
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject( cache[ id ] ) ) {
+ return;
+ }
+ }
+
+ // Destroy the cache
+ if ( isNode ) {
+ jQuery.cleanData( [ elem ], true );
+
+ // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
+ /* jshint eqeqeq: false */
+ } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
+ /* jshint eqeqeq: true */
+ delete cache[ id ];
+
+ // When all else fails, null
+ } else {
+ cache[ id ] = null;
+ }
+}
+
+jQuery.extend({
+ cache: {},
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "applet": true,
+ "embed": true,
+ // Ban all objects except for Flash (which handle expandos)
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data ) {
+ return internalData( elem, name, data );
+ },
+
+ removeData: function( elem, name ) {
+ return internalRemoveData( elem, name );
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return internalData( elem, name, data, true );
+ },
+
+ _removeData: function( elem, name ) {
+ return internalRemoveData( elem, name, true );
+ },
+
+ // A method for determining if a DOM node can handle the data expando
+ acceptData: function( elem ) {
+ // Do not set data on non-element because it will not be cleared (#8335).
+ if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
+ return false;
+ }
+
+ var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+ // nodes accept data unless otherwise specified; rejection can be conditional
+ return !noData || noData !== true && elem.getAttribute("classid") === noData;
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var attrs, name,
+ data = null,
+ i = 0,
+ elem = this[0];
+
+ // Special expections of .data basically thwart jQuery.access,
+ // so implement the relevant behavior ourselves
+
+ // Gets all values
+ if ( key === undefined ) {
+ if ( this.length ) {
+ data = jQuery.data( elem );
+
+ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
+ attrs = elem.attributes;
+ for ( ; i < attrs.length; i++ ) {
+ name = attrs[i].name;
+
+ if ( name.indexOf("data-") === 0 ) {
+ name = jQuery.camelCase( name.slice(5) );
+
+ dataAttr( elem, name, data[ name ] );
+ }
+ }
+ jQuery._data( elem, "parsedAttrs", true );
+ }
+ }
+
+ return data;
+ }
+
+ // Sets multiple values
+ if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ return arguments.length > 1 ?
+
+ // Sets one value
+ this.each(function() {
+ jQuery.data( this, key, value );
+ }) :
+
+ // Gets one value
+ // Try to fetch any internally stored data first
+ elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+function dataAttr( elem, key, data ) {
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ // Only convert to a number if it doesn't change the string
+ +data + "" === data ? +data :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// checks a cache object for emptiness
+function isEmptyDataObject( obj ) {
+ var name;
+ for ( name in obj ) {
+
+ // if the public data object is empty, the private is still empty
+ if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
+ continue;
+ }
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+jQuery.extend({
+ queue: function( elem, type, data ) {
+ var queue;
+
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ queue = jQuery._data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !queue || jQuery.isArray(data) ) {
+ queue = jQuery._data( elem, type, jQuery.makeArray(data) );
+ } else {
+ queue.push( data );
+ }
+ }
+ return queue || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ startLength = queue.length,
+ fn = queue.shift(),
+ hooks = jQuery._queueHooks( elem, type ),
+ next = function() {
+ jQuery.dequeue( elem, type );
+ };
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ startLength--;
+ }
+
+ if ( fn ) {
+
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ // clear up the last queue stop function
+ delete hooks.stop;
+ fn.call( elem, next, hooks );
+ }
+
+ if ( !startLength && hooks ) {
+ hooks.empty.fire();
+ }
+ },
+
+ // not intended for public consumption - generates a queueHooks object, or returns the current one
+ _queueHooks: function( elem, type ) {
+ var key = type + "queueHooks";
+ return jQuery._data( elem, key ) || jQuery._data( elem, key, {
+ empty: jQuery.Callbacks("once memory").add(function() {
+ jQuery._removeData( elem, type + "queue" );
+ jQuery._removeData( elem, key );
+ })
+ });
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ var setter = 2;
+
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ setter--;
+ }
+
+ if ( arguments.length < setter ) {
+ return jQuery.queue( this[0], type );
+ }
+
+ return data === undefined ?
+ this :
+ this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ // ensure a hooks for this queue
+ jQuery._queueHooks( this, type );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function( next, hooks ) {
+ var timeout = setTimeout( next, time );
+ hooks.stop = function() {
+ clearTimeout( timeout );
+ };
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, obj ) {
+ var tmp,
+ count = 1,
+ defer = jQuery.Deferred(),
+ elements = this,
+ i = this.length,
+ resolve = function() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ };
+
+ if ( typeof type !== "string" ) {
+ obj = type;
+ type = undefined;
+ }
+ type = type || "fx";
+
+ while( i-- ) {
+ tmp = jQuery._data( elements[ i ], type + "queueHooks" );
+ if ( tmp && tmp.empty ) {
+ count++;
+ tmp.empty.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise( obj );
+ }
+});
+var nodeHook, boolHook,
+ rclass = /[\t\r\n\f]/g,
+ rreturn = /\r/g,
+ rfocusable = /^(?:input|select|textarea|button|object)$/i,
+ rclickable = /^(?:a|area)$/i,
+ ruseDefault = /^(?:checked|selected)$/i,
+ getSetAttribute = jQuery.support.getSetAttribute,
+ getSetInput = jQuery.support.input;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ },
+
+ prop: function( name, value ) {
+ return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
+ },
+
+ removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
+ return this.each(function() {
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch( e ) {}
+ });
+ },
+
+ addClass: function( value ) {
+ var classes, elem, cur, clazz, j,
+ i = 0,
+ len = this.length,
+ proceed = typeof value === "string" && value;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call( this, j, this.className ) );
+ });
+ }
+
+ if ( proceed ) {
+ // The disjunction here is for better compressibility (see removeClass)
+ classes = ( value || "" ).match( core_rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ " "
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
+ cur += clazz + " ";
+ }
+ }
+ elem.className = jQuery.trim( cur );
+
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classes, elem, cur, clazz, j,
+ i = 0,
+ len = this.length,
+ proceed = arguments.length === 0 || typeof value === "string" && value;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call( this, j, this.className ) );
+ });
+ }
+ if ( proceed ) {
+ classes = ( value || "" ).match( core_rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ // This expression is here for better compressibility (see addClass)
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ ""
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ // Remove *all* instances
+ while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
+ cur = cur.replace( " " + clazz + " ", " " );
+ }
+ }
+ elem.className = value ? jQuery.trim( cur ) : "";
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value;
+
+ if ( typeof stateVal === "boolean" && type === "string" ) {
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
+ }
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ classNames = value.match( core_rnotwhite ) || [];
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space separated list
+ if ( self.hasClass( className ) ) {
+ self.removeClass( className );
+ } else {
+ self.addClass( className );
+ }
+ }
+
+ // Toggle whole class name
+ } else if ( type === core_strundefined || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery._data( this, "__className__", this.className );
+ }
+
+ // If the element has a class name or if we're passed "false",
+ // then remove the whole classname (if there was one, the above saved it).
+ // Otherwise bring back whatever was previously saved (if anything),
+ // falling back to the empty string if nothing was stored.
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ",
+ i = 0,
+ l = this.length;
+ for ( ; i < l; i++ ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ var ret, hooks, isFunction,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return;
+ }
+
+ isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, jQuery( this ).val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map(val, function ( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ // Use proper attribute retrieval(#6932, #12072)
+ var val = jQuery.find.attr( elem, "value" );
+ return val != null ?
+ val :
+ elem.text;
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value, option,
+ options = elem.options,
+ index = elem.selectedIndex,
+ one = elem.type === "select-one" || index < 0,
+ values = one ? null : [],
+ max = one ? index + 1 : options.length,
+ i = index < 0 ?
+ max :
+ one ? index : 0;
+
+ // Loop through all the selected options
+ for ( ; i < max; i++ ) {
+ option = options[ i ];
+
+ // oldIE doesn't update selected after form reset (#2551)
+ if ( ( option.selected || i === index ) &&
+ // Don't return options that are disabled or in a disabled optgroup
+ ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
+ ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var optionSet, option,
+ options = elem.options,
+ values = jQuery.makeArray( value ),
+ i = options.length;
+
+ while ( i-- ) {
+ option = options[ i ];
+ if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {
+ optionSet = true;
+ }
+ }
+
+ // force browsers to behave consistently when non-matching value is set
+ if ( !optionSet ) {
+ elem.selectedIndex = -1;
+ }
+ return values;
+ }
+ }
+ },
+
+ attr: function( elem, name, value ) {
+ var hooks, ret,
+ nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( typeof elem.getAttribute === core_strundefined ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ // All attributes are lowercase
+ // Grab necessary hook if one is defined
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
+ name = name.toLowerCase();
+ hooks = jQuery.attrHooks[ name ] ||
+ ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+
+ } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, value + "" );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+ ret = jQuery.find.attr( elem, name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret == null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, value ) {
+ var name, propName,
+ i = 0,
+ attrNames = value && value.match( core_rnotwhite );
+
+ if ( attrNames && elem.nodeType === 1 ) {
+ while ( (name = attrNames[i++]) ) {
+ propName = jQuery.propFix[ name ] || name;
+
+ // Boolean attributes get special treatment (#10870)
+ if ( jQuery.expr.match.bool.test( name ) ) {
+ // Set corresponding property to false
+ if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+ elem[ propName ] = false;
+ // Support: IE<9
+ // Also clear defaultChecked/defaultSelected (if appropriate)
+ } else {
+ elem[ jQuery.camelCase( "default-" + name ) ] =
+ elem[ propName ] = false;
+ }
+
+ // See #9699 for explanation of this approach (setting first, then removal)
+ } else {
+ jQuery.attr( elem, name, "" );
+ }
+
+ elem.removeAttribute( getSetAttribute ? name : propName );
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to default in case type is set after value during creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ }
+ },
+
+ propFix: {
+ "for": "htmlFor",
+ "class": "className"
+ },
+
+ prop: function( elem, name, value ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
+ ret :
+ ( elem[ name ] = value );
+
+ } else {
+ return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
+ ret :
+ elem[ name ];
+ }
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ // Use proper attribute retrieval(#12072)
+ var tabindex = jQuery.find.attr( elem, "tabindex" );
+
+ return tabindex ?
+ parseInt( tabindex, 10 ) :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ -1;
+ }
+ }
+ }
+});
+
+// Hooks for boolean attributes
+boolHook = {
+ set: function( elem, value, name ) {
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+ // IE<8 needs the *property* name
+ elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
+
+ // Use defaultChecked and defaultSelected for oldIE
+ } else {
+ elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
+ }
+
+ return name;
+ }
+};
+jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
+ var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr;
+
+ jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
+ function( elem, name, isXML ) {
+ var fn = jQuery.expr.attrHandle[ name ],
+ ret = isXML ?
+ undefined :
+ /* jshint eqeqeq: false */
+ (jQuery.expr.attrHandle[ name ] = undefined) !=
+ getter( elem, name, isXML ) ?
+
+ name.toLowerCase() :
+ null;
+ jQuery.expr.attrHandle[ name ] = fn;
+ return ret;
+ } :
+ function( elem, name, isXML ) {
+ return isXML ?
+ undefined :
+ elem[ jQuery.camelCase( "default-" + name ) ] ?
+ name.toLowerCase() :
+ null;
+ };
+});
+
+// fix oldIE attroperties
+if ( !getSetInput || !getSetAttribute ) {
+ jQuery.attrHooks.value = {
+ set: function( elem, value, name ) {
+ if ( jQuery.nodeName( elem, "input" ) ) {
+ // Does not return so that setAttribute is also used
+ elem.defaultValue = value;
+ } else {
+ // Use nodeHook if defined (#1954); otherwise setAttribute is fine
+ return nodeHook && nodeHook.set( elem, value, name );
+ }
+ }
+ };
+}
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !getSetAttribute ) {
+
+ // Use this for any attribute in IE6/7
+ // This fixes almost every IE6/7 issue
+ nodeHook = {
+ set: function( elem, value, name ) {
+ // Set the existing or create a new attribute node
+ var ret = elem.getAttributeNode( name );
+ if ( !ret ) {
+ elem.setAttributeNode(
+ (ret = elem.ownerDocument.createAttribute( name ))
+ );
+ }
+
+ ret.value = value += "";
+
+ // Break association with cloned elements by also using setAttribute (#9646)
+ return name === "value" || value === elem.getAttribute( name ) ?
+ value :
+ undefined;
+ }
+ };
+ jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords =
+ // Some attributes are constructed with empty-string values when not defined
+ function( elem, name, isXML ) {
+ var ret;
+ return isXML ?
+ undefined :
+ (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
+ ret.value :
+ null;
+ };
+ jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret = elem.getAttributeNode( name );
+ return ret && ret.specified ?
+ ret.value :
+ undefined;
+ },
+ set: nodeHook.set
+ };
+
+ // Set contenteditable to false on removals(#10429)
+ // Setting to empty string throws an error as an invalid value
+ jQuery.attrHooks.contenteditable = {
+ set: function( elem, value, name ) {
+ nodeHook.set( elem, value === "" ? false : value, name );
+ }
+ };
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each([ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ };
+ });
+}
+
+
+// Some attributes require a special call on IE
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !jQuery.support.hrefNormalized ) {
+ // href/src property should get the full normalized URL (#10299/#12915)
+ jQuery.each([ "href", "src" ], function( i, name ) {
+ jQuery.propHooks[ name ] = {
+ get: function( elem ) {
+ return elem.getAttribute( name, 4 );
+ }
+ };
+ });
+}
+
+if ( !jQuery.support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+ // Return undefined in the case of empty string
+ // Note: IE uppercases css property names, but if we were to .toLowerCase()
+ // .cssText, that would destroy case senstitivity in URL's, like in "background"
+ return elem.style.cssText || undefined;
+ },
+ set: function( elem, value ) {
+ return ( elem.style.cssText = value + "" );
+ }
+ };
+}
+
+// Safari mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !jQuery.support.optSelected ) {
+ jQuery.propHooks.selected = {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ return null;
+ }
+ };
+}
+
+jQuery.each([
+ "tabIndex",
+ "readOnly",
+ "maxLength",
+ "cellSpacing",
+ "cellPadding",
+ "rowSpan",
+ "colSpan",
+ "useMap",
+ "frameBorder",
+ "contentEditable"
+], function() {
+ jQuery.propFix[ this.toLowerCase() ] = this;
+});
+
+// IE6/7 call enctype encoding
+if ( !jQuery.support.enctype ) {
+ jQuery.propFix.enctype = "encoding";
+}
+
+// Radios and checkboxes getter/setter
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+ }
+ }
+ };
+ if ( !jQuery.support.checkOn ) {
+ jQuery.valHooks[ this ].get = function( elem ) {
+ // Support: Webkit
+ // "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ };
+ }
+});
+var rformElems = /^(?:input|select|textarea)$/i,
+ rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|contextmenu)|click/,
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
+
+function returnTrue() {
+ return true;
+}
+
+function returnFalse() {
+ return false;
+}
+
+function safeActiveElement() {
+ try {
+ return document.activeElement;
+ } catch ( err ) { }
+}
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ global: {},
+
+ add: function( elem, types, handler, data, selector ) {
+ var tmp, events, t, handleObjIn,
+ special, eventHandle, handleObj,
+ handlers, type, namespaces, origType,
+ elemData = jQuery._data( elem );
+
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
+ if ( !elemData ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ selector = handleObjIn.selector;
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ if ( !(events = elemData.events) ) {
+ events = elemData.events = {};
+ }
+ if ( !(eventHandle = elemData.handle) ) {
+ eventHandle = elemData.handle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
+ eventHandle.elem = elem;
+ }
+
+ // Handle multiple events separated by a space
+ types = ( types || "" ).match( core_rnotwhite ) || [""];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // There *must* be a type, no attaching namespace-only handlers
+ if ( !type ) {
+ continue;
+ }
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend({
+ type: type,
+ origType: origType,
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
+ namespace: namespaces.join(".")
+ }, handleObjIn );
+
+ // Init the event handler queue if we're the first
+ if ( !(handlers = events[ type ]) ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener/attachEvent if the special events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector, mappedTypes ) {
+ var j, handleObj, tmp,
+ origCount, t, events,
+ special, handlers, type,
+ namespaces, origType,
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem );
+
+ if ( !elemData || !(events = elemData.events) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = ( types || "" ).match( core_rnotwhite ) || [""];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+ }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+ handlers = events[ type ] || [];
+ tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
+
+ // Remove matching events
+ origCount = j = handlers.length;
+ while ( j-- ) {
+ handleObj = handlers[ j ];
+
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
+ ( !handler || handler.guid === handleObj.guid ) &&
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
+ handlers.splice( j, 1 );
+
+ if ( handleObj.selector ) {
+ handlers.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( origCount && !handlers.length ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ delete elemData.handle;
+
+ // removeData also checks for emptiness and clears the expando if empty
+ // so use it instead of delete
+ jQuery._removeData( elem, "events" );
+ }
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ var handle, ontype, cur,
+ bubbleType, special, tmp, i,
+ eventPath = [ elem || document ],
+ type = core_hasOwn.call( event, "type" ) ? event.type : event,
+ namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
+
+ cur = tmp = elem = elem || document;
+
+ // Don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+ return;
+ }
+
+ if ( type.indexOf(".") >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+ ontype = type.indexOf(":") < 0 && "on" + type;
+
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string
+ event = event[ jQuery.expando ] ?
+ event :
+ new jQuery.Event( type, typeof event === "object" && event );
+
+ // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
+ event.isTrigger = onlyHandlers ? 2 : 3;
+ event.namespace = namespaces.join(".");
+ event.namespace_re = event.namespace ?
+ new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
+ null;
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ if ( !event.target ) {
+ event.target = elem;
+ }
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data == null ?
+ [ event ] :
+ jQuery.makeArray( data, [ event ] );
+
+ // Allow special events to draw outside the lines
+ special = jQuery.event.special[ type ] || {};
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
+ return;
+ }
+
+ // Determine event propagation path in advance, per W3C events spec (#9951)
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+
+ bubbleType = special.delegateType || type;
+ if ( !rfocusMorph.test( bubbleType + type ) ) {
+ cur = cur.parentNode;
+ }
+ for ( ; cur; cur = cur.parentNode ) {
+ eventPath.push( cur );
+ tmp = cur;
+ }
+
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
+ if ( tmp === (elem.ownerDocument || document) ) {
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );
+ }
+ }
+
+ // Fire handlers on the event path
+ i = 0;
+ while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
+
+ event.type = i > 1 ?
+ bubbleType :
+ special.bindType || type;
+
+ // jQuery handler
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+
+ // Native handler
+ handle = ontype && cur[ ontype ];
+ if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
+ event.preventDefault();
+ }
+ }
+ event.type = type;
+
+ // If nobody prevented the default action, do it now
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
+
+ if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
+ jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
+ // Don't do default actions on window, that's where global variables be (#6170)
+ if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
+
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ tmp = elem[ ontype ];
+
+ if ( tmp ) {
+ elem[ ontype ] = null;
+ }
+
+ // Prevent re-triggering of the same event, since we already bubbled it above
+ jQuery.event.triggered = type;
+ try {
+ elem[ type ]();
+ } catch ( e ) {
+ // IE<9 dies on focus/blur to hidden element (#1486,#12518)
+ // only reproducible on winXP IE8 native, not IE9 in IE8 mode
+ }
+ jQuery.event.triggered = undefined;
+
+ if ( tmp ) {
+ elem[ ontype ] = tmp;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ dispatch: function( event ) {
+
+ // Make a writable jQuery.Event from the native event object
+ event = jQuery.event.fix( event );
+
+ var i, ret, handleObj, matched, j,
+ handlerQueue = [],
+ args = core_slice.call( arguments ),
+ handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
+ special = jQuery.event.special[ event.type ] || {};
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[0] = event;
+ event.delegateTarget = this;
+
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+ return;
+ }
+
+ // Determine handlers
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
+
+ // Run delegates first; they may want to stop propagation beneath us
+ i = 0;
+ while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
+ event.currentTarget = matched.elem;
+
+ j = 0;
+ while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
+
+ // Triggered event must either 1) have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
+ if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
+
+ event.handleObj = handleObj;
+ event.data = handleObj.data;
+
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
+ .apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ if ( (event.result = ret) === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ // Call the postDispatch hook for the mapped type
+ if ( special.postDispatch ) {
+ special.postDispatch.call( this, event );
+ }
+
+ return event.result;
+ },
+
+ handlers: function( event, handlers ) {
+ var sel, handleObj, matches, i,
+ handlerQueue = [],
+ delegateCount = handlers.delegateCount,
+ cur = event.target;
+
+ // Find delegate handlers
+ // Black-hole SVG