"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function XM_Tab(t){var c={container:".tab-wrap",tabItems:".tab-body",tabControls:".tab-header",selectedClass:"selected",startIndex:1,animation:{type:"static",ease:"ease-in-out",speed:.3,translateOffset:100}},d={},e=function(){a()},n=function(){if(d.tabElements=document.querySelectorAll(c.container),!d.tabElements.length)throw new Error("Couldn't find ".concat(d.container," in the DOM"));var t=!0,e=!(d.tabs=[]),n=void 0;try{for(var o,a=d.tabElements[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var r=o.value,l={},s=(l.tabContainer=r).querySelector(c.tabControls),i=r.querySelector(c.tabItems);if(!s)throw new Error("Couldn't find ".concat(c.tabControls," inside ").concat(c.container));if(!i)throw new Error("Couldn't find ".concat(c.tabItems," inside ").concat(c.container));l.tabControls=s.children,l.tabItems=i.children,l.selectedIndex=c.startIndex-1,f(l),d.tabs.push(l)}}catch(t){e=!0,n=t}finally{try{t||null==a.return||a.return()}finally{if(e)throw n}}},f=function(t){t.selectedIndex=t.selectedIndex>=t.tabItems.length||t.selectedIndex<0?0:t.selectedIndex},o=function(){var t=!0,e=!1,n=void 0;try{for(var o,a=d.tabs[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var r=o.value;r.tabControls[r.selectedIndex].classList.add(c.selectedClass);for(var l=0;l<r.tabItems.length;l++)l!==r.selectedIndex&&"static"===c.animation.type&&(r.tabItems[l].style.display="none")}}catch(t){e=!0,n=t}finally{try{t||null==a.return||a.return()}finally{if(e)throw n}}s()},s=function(){},a=function(){},l=function(t,e){var n;t.selectedIndex!==e&&((n=t).tabControls[n.selectedIndex].classList.remove(c.selectedClass),"static"===c.animation.type&&(n.tabItems[n.selectedIndex].style.display="none"),t.selectedIndex=e,t.tabControls[t.selectedIndex].classList.add(c.selectedClass),"static"===c.animation.type&&(t.tabItems[t.selectedIndex].style.display="block"))},r=function(){var t=!0,e=!1,n=void 0;try{for(var o,a=function(){for(var e=o.value,t=function(t){e.tabControls[t].addEventListener("click",function(){l(e,t)})},n=0;n<e.tabControls.length;n++)t(n)},r=d.tabs[Symbol.iterator]();!(t=(o=r.next()).done);t=!0)a()}catch(t){e=!0,n=t}finally{try{t||null==r.return||r.return()}finally{if(e)throw n}}};return function t(e,n){var o;for(var a in n)"object"!==_typeof(n[a])||n[a]instanceof Date?n[a]instanceof Date?e[a]=new Date(n[a].getTime()):e[a]=n[a]:(o=n[a]instanceof Array?[]:{},void 0===e[a]&&(e[a]=o),t(e[a],n[a]))}(c,t),n(),o(),r(),window.addEventListener("resize",e),d}