/*! Tabby v10.0.5 | (c) 2016 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/tabby */ !function(t,e){"function"==typeof define&&define.amd?define([],e(t)):"object"==typeof exports?module.exports=e(t):t.tabby=e(t)}("undefined"!=typeof global?global:this.window||this.global,function(t){"use strict";var e,n,o={},a="querySelector"in document&&"addEventListener"in t&&"classList"in document.createElement("_")&&"onhashchange"in t,r={selectorToggle:"[data-tab]",selectorToggleGroup:"[data-tabs]",selectorContent:"[data-tabs-pane]",selectorContentGroup:"[data-tabs-content]",toggleActiveClass:"active",contentActiveClass:"active",initClass:"js-tabby",callback:function(){}},c=function(t,e,n){if("[object Object]"===Object.prototype.toString.call(t))for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(n,t[o],o,t);else for(var a=0,r=t.length;r>a;a++)e.call(n,t[a],a,t)},s=function(){var t={},e=!1,n=0,o=arguments.length;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(e=arguments[0],n++);for(var a=function(n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e&&"[object Object]"===Object.prototype.toString.call(n[o])?t[o]=s(!0,t[o],n[o]):t[o]=n[o])};o>n;n++){var r=arguments[n];a(r)}return t},l=function(t,e){var n,o,a=e.charAt(0);for("["===a&&(e=e.substr(1,e.length-2),n=e.split("="),n.length>1&&(o=!0,n[1]=n[1].replace(/"/g,"").replace(/'/g,"")));t&&t!==document;t=t.parentNode){if("."===a&&t.classList.contains(e.substr(1)))return t;if("#"===a&&t.id===e.substr(1))return t;if("["===a&&t.hasAttribute(n[0])){if(!o)return t;if(t.getAttribute(n[0])===n[1])return t}if(t.tagName.toLowerCase()===e)return t}return null},i=function(t,e){if(!t.classList.contains(e)){var n=t.querySelector("iframe"),o=t.querySelector("video");if(n){var a=n.src;n.src=a}o&&o.pause()}},u=function(t,e){var n=l(t,e.selectorToggleGroup);if(n){var o=n.querySelectorAll(e.selectorToggle),a=l(t,"li");c(o,function(t){t.classList.remove(e.toggleActiveClass);var n=l(t,"li");n&&n.classList.remove(e.toggleActiveClass)}),t.classList.add(e.toggleActiveClass),a&&a.classList.add(e.toggleActiveClass)}},d=function(t,e){var n=document.querySelector(t);if(n){var o=l(n,e.selectorContentGroup);if(o){var a=o.querySelectorAll(e.selectorContent);c(a,function(t){i(t),t.classList.remove(e.contentActiveClass)}),n.classList.add(e.contentActiveClass)}}};o.toggleTab=function(t,n,o){var a=s(e||r,o||{});document.querySelectorAll(n);u(t,a),d(n,a),a.callback(t,n)};var f=function(){var e=t.location.hash;if(n&&(n.id=n.getAttribute("data-tab-id"),n=null),e){var a=document.querySelector('[data-tab][href*="'+e+'"]');o.toggleTab(a,e)}},g=function(o){var a=l(o.target,e.selectorToggle);if(a&&a.hash){if(a.hash===t.location.hash)return void o.preventDefault();n=document.querySelector(a.hash),n&&(n.setAttribute("data-tab-id",n.id),n.id="")}};return o.destroy=function(){e&&(document.documentElement.classList.remove(e.initClass),document.removeEventListener("click",g,!1),t.removeEventListener("hashchange",f,!1),e=null,n=null)},o.init=function(n){a&&(o.destroy(),e=s(r,n||{}),document.documentElement.classList.add(e.initClass),document.addEventListener("click",g,!1),t.addEventListener("hashchange",f,!1),f())},o});