(()=>{p={},f=0,m=[],c=null,g=["localAbove","globalAbove","tabset","localBelow","globalBelow"],r=[{key:"startTabElement",regex:/^h[1-6]$/},{key:"stopTabsElement",regex:/^h[1-6]$/},{key:"showStopElement",type:"boolean"},{key:"defaultTab",type:"boolean"},{key:"defaultTabTitle",type:"string"},{key:"showLocalAbove",type:"boolean"},{key:"showGlobalAbove",type:"boolean"},{key:"showTabset",type:"boolean"},{key:"showLocalBelow",type:"boolean"},{key:"showGlobalBelow",type:"boolean"},{key:"layout",type:"string"},{key:"layoutBreakpoint",type:"number"},{key:"deepLinks",type:"boolean"},{key:"allowMultipleOpen",type:"boolean"},{key:"openFirstTab",type:"boolean"},{key:"proTabs",type:"boolean"},{key:"animatePanels",type:"boolean"},{key:"scrollSync",type:"boolean"},{key:"cleanContentLevel",type:"string"},{key:"indicatorType",type:"string"},{key:"indicatorPlacement",type:"string"},{key:"allowedTabElements",type:"array"},{key:"removeEmptyTabs",type:"boolean"},{key:"placementSelector",type:"string"},{key:"placementPosition",type:"string"},{key:"defaultTabTranslations",type:"array"},{key:"lang",type:"string"}];var p,f,m,c,g,r,t={getInstance:getInstance,getTab:getTab,getTabByTitle:function getTabByTitle(t,e){var n,a;return t?"string"!=typeof t?_logError("Invalid title argument for getTabByTitle",{warning:!0}):(e=(e=_extend({},e||{})).instance?[getInstance(e.instance)]:this.instances,n=[],e.forEach(function(t){t.tabs.forEach(function(t){n.push(t)})}),n&&(a=_slugify(t),n.find(function(t){return t.slug===a}))||!1):_logError("Title argument is required for getTabByTitle",{warning:!0})},getTabByHash:function getTabByHash(t){var e;return"string"==typeof t&&(t=getInstance((e=_getHashInfo(t)).instanceId))&&t.tabs.find(function(t){return t.hash===e.hash})||!1},createInstance:function createInstance(t,e){var n=null,a=window.innerWidth,i={_id:"i"+f,_uuid:"u"+function _createUUID(){return Math.random().toString(36).slice(-6)}(),_settings:{},get id(){return this._id},get uuid(){return this._uuid},get settings(){return this._settings},set settings(t){t=_validateOptions(t);this._settings=_extend({},this._settings,t)},get tabs(){return Array.from(this.tabset.children).filter(function(t){return t.matches(".station-tabs-tabpanel")}).map(getTab)}},s=t;if(null==t)return _logError("Reference parameter is required for createInstance",{warning:!0});if("number"==typeof t&&(s=(document.querySelectorAll("div[data-station-tabs]")||[])[t]||null),!_isElement(s="string"==typeof t?document.querySelector(t):s))return _logError("Valid element not found",{warning:!0});if(s.classList.contains("is-initialized"))return _logError("Instance already initialized",{warning:!0});function _getChildren(e,t){t=_extend({element:s},t||{});return Array.from(t.element.children).filter(function(t){return t.matches(e)})}i.node=s,t=JSON.parse(JSON.stringify(s.dataset)),i.settings=_extend({},{defaultTabTitle:"Description",layout:"breakpoint",layoutBreakpoint:750,showLocalAbove:!0,showGlobalAbove:!0,showTabset:!0,showLocalBelow:!0,showGlobalBelow:!0,proTabs:!0,animatePanels:!0,scrollSync:!0,allowedTabElements:["img"]},p,t,"object"==typeof e?e:{}),f++,s.classList.add("station-tabs","rte","is-initialized","is-loading"),s.style.removeProperty("display"),s.dataset.stationTabs=i.id,s.dataset.uuid=i.uuid;var o=["station-tabs-local-above","station-tabs-global-above","station-tabs-tabset","station-tabs-local-below","station-tabs-global-below"];if(_getChildren(o.map(function(t){return"."+t}).join(",")).length){if(!s.parentElement.classList.contains("shopify-app-block"))for(var r=o.length,l=s.childNodes,c=l.length-1;0<=c;c--){var d,u=l[c];u.classList?(d=l[c].classList[0],(d=o.indexOf(d)) "+e.stopTabsElement),u=d.length-1;0<=u;u--){var b=d[u];if(0 "+e.startTabElement),m=0;m{var t=_getHashInfo(window.location.hash)||{};if(i.settings.deepLinks&&t.instanceId===i.id){t=document.querySelector(['[data-station-tabs="'+t.instanceId+'"]',".station-tabs-tabset",".station-tabs-tabtitle",'.station-tabs-tab[data-slug="'+t.slug+'"]'].join(" > "));if(t)return t}return!!(t=i.node.querySelectorAll(".station-tabs-tab:not(.is-hidden)")).length&&!!i.settings.openFirstTab&&t[0]})())&&_setActive(t,_extend({},i.settings,{deepLinks:!1,animatePanels:!1,skipCallbacks:!0})),i.move=function(t,e){var n,a=_extend({position:"beforeend",localAbove:!0,globalAbove:!0,tabset:!0,localBelow:!0,globalBelow:!0},e||{}),e="string"==typeof t?document.querySelector(t):t;return e?((n=document.createElement("div")).classList.add("station-tabs","rte","is-initialized","is-ready"),e.insertAdjacentElement(a.position,n),g.filter(function(t){return a[t]}).forEach(function(t){n.appendChild(i[t])}),i.setLayout(),n):i.node},i.setLayout=function(t){t=t||{};i.settings={layout:t.layout||i.settings.layout,layoutBreakpoint:t.layoutBreakpoint||i.settings.layoutBreakpoint},_setLayout(i)},i.removeEmptyTabs=_removeEmptyTabsFromInstance.bind(this,i),i.setLayout(),i.node.querySelectorAll(".station-tabs.is-ready").forEach(function(t){t=getInstance(t);t&&t.setLayout()}),m.push(i),s.classList.add("is-ready"),s.classList.remove("is-loading"),document.dispatchEvent(new CustomEvent("stationTabsInstanceReady",{detail:i})),s.querySelectorAll("[data-tabs-relocate]").forEach(function(t){_findAndMove(t,t.dataset.tabsRelocate,t.dataset)}),i},fetchElements:function fetchElements(t,i){return new Promise(function(e,n){var a=_extend({queryString:".station-tabs"},i||{});fetch(t).then(function(t){return t.text()}).then(function(t){t=(new DOMParser).parseFromString(t,"text/html").querySelectorAll(a.queryString);e(t)}).catch(function(t){n(t)})})},findInstanceElement:function findInstanceElement(t,e){var n=_extend({verbose:!1,minCharacters:10,minPercent:10,selectors:[".product-single__description",".product__description",".product-description",'[data-name="Tabs By Station"] [data-station-tabs-app]']},e||{});function _isVisible(t){return t.offsetWidth||t.offsetHeight||t.getClientRects().length}function _getText(t){return t?(t.textContent||"").replace(/\s+/g,""):""}for(var a=document.querySelectorAll("div, section, article"),i=((e=document.createElement("span")).innerHTML=t||"",_getText(e)),s={size:0},o=(a=i.length<1?[]:a).length-1;0<=o;o--){var r,l,c=a[o];(function _hasInstance(t){return t.closest(".station-tabs,[data-station-tabs],[data-station-tabs-app]")})(c)||(r=_getText(c)).length<1||!_isVisible(c)||0!==i.indexOf(r)||(r=r.length,l=Math.round(r/i.length*100),ri.length||(s={node:c,size:r,percent:l})}if(s.node)return s.node.setAttribute("data-match-percent",s.percent),s.node;for(o=0;o",i.setAttribute("aria-controls","station-tabs-tabpanel_"+e),n.slug&&(i.dataset.slug=_slugify(t)),a.appendChild(i),a}function _createPanel(t){var e=document.createElement("div");return e.className="station-tabs-tabpanel",e.innerHTML='
',t&&(e.id="station-tabs-tabpanel_"+t,e.setAttribute("aria-labelledby","station-tabs-tab_"+t)),e}function _setHeights(t,e){t&&t.forEach(function(t){t.style.height=e||t.scrollHeight+"px"})}function _scrollSync(e,n){cancelAnimationFrame(c),c=requestAnimationFrame(function tick(){var t=n.getBoundingClientRect().top-e;t<0&&window.scrollBy(0,t),c=requestAnimationFrame(tick)})}function _removeActive(t,e){t&&t.forEach(function(t){t=getTab(t);"station-tabs-tab_"+e!==t.node.id&&(t.node.classList.remove("is-active"),t.node.hasAttribute("aria-selected")&&t.node.setAttribute("aria-selected","false"),t.node.hasAttribute("aria-expanded")&&t.node.setAttribute("aria-expanded","false"),"station-tabs-tabpanel_"+e!==t.tabpanel.id)&&(t.tabpanel.classList.remove("is-active"),t.tabpanel.setAttribute("aria-hidden","true"))})}function _setActive(t,e){var n,a,i,s,o,r,l;t&&!t.hidden&&(n=_extend({animatePanels:!0,deepLink:!1},e||{}),e=getTab(t))&&(t=e.id,a=e.node,i=e.tabpanel,o=a.closest(".station-tabs-tabset"),s=(l=Array.from(o.children).filter(function(t){return t.matches(".station-tabs-tabpanel")})).map(function(t){t=_parseId(t.id);return document.getElementById("station-tabs-tab_"+t.id)}),o=o.classList.contains("mod-vertical"),r=s.filter(function(t){return t.classList.contains("is-active")}),l=l.filter(function(t){return t.classList.contains("is-active")}),n.scrollIntoView&&setTimeout(function(){a.scrollIntoView(n.scrollIntoView)}),a.classList.contains("is-active")?o?(n.animatePanels?(i.classList.add("is-animating"),_setHeights([i]),setTimeout(function(){_removeActive([a])},20)):_removeActive([a]),n.deepLink&&history.replaceState(null,document.title,window.location.pathname+window.location.search)):_removeActive(r,t):(o?n.allowMultipleOpen||(n.animatePanels&&(l.forEach(function(t){t.classList.add("is-animating")}),_setHeights(l),!n.scrollIntoView)&&n.scrollSync&&(_scrollSync(a.getBoundingClientRect().top,a),setTimeout(function(){cancelAnimationFrame(c)},400)),_removeActive(r)):(_removeActive(r),function _switchTabindex(t,e){t.forEach(function(t){t.setAttribute("tabindex",t===e?"0":-1)})}(s,a)),a.setAttribute(o?"aria-expanded":"aria-selected","true"),n.animatePanels&&o&&(_setHeights([i]),i.classList.add("is-animating")),a.classList.add("is-active"),i.classList.add("is-active"),i.setAttribute("aria-hidden","false"),n.deepLinks&&history.replaceState(null,document.title,e.hash),n.skipCallbacks||(document.dispatchEvent(new CustomEvent("stationTabOpen",{detail:e})),o&&n.animatePanels)||document.dispatchEvent(new CustomEvent("stationTabOpened",{detail:e}))))}function _setLayout(t){var e=t.settings,n=t.tabs,a=t.tabset;if(n.length){t=n.filter(function(t){return!t.hidden});if(t.length){var i=t[0],s=t[t.length-1],o=a.classList.contains("mod-vertical"),r=t.filter(function(t){return t.node.classList.contains("is-active")}),l=Array.from(a.children).find(function(t){return t.matches(".station-tabs-tablist")});switch(e.layout){case"vertical":o=!0;break;case"horizontal":o=!1;break;case"breakpoint":o=(e.layoutBreakpoint||750)>window.innerWidth;break;default:a.classList.remove("mod-vertical");var c=i.node.offsetHeight/2,d=i.node.getBoundingClientRect();o=s.node.getBoundingClientRect().top-d.top>c}o?function _setVertical(){a.classList.add("mod-vertical"),a.classList.remove("mod-horizontal"),n.forEach(function(t){t.node.classList.remove("mod-first","mod-last"),t.node.setAttribute("tabindex","0"),t.node.setAttribute("role","button"),t.node.setAttribute("aria-expanded","false"),t.node.removeAttribute("aria-selected"),i&&t.id===i.id&&t.node.classList.add("mod-first"),s&&t.id===s.id&&t.node.classList.add("mod-last"),t.tabpanel.setAttribute("role","region")}),l&&l.remove()}():(function _setHorizontal(){a.classList.add("mod-horizontal"),a.classList.remove("mod-vertical"),l||(l=document.createElement("div"),a.prepend(l));var t=Array.from(n).map(function(t){return t.node.id});l.classList.add("station-tabs-tablist"),l.setAttribute("role","tablist"),l.setAttribute("aria-owns",t.join(" ")),n.forEach(function(t){t.node.classList.remove("mod-first","mod-last"),t.node.setAttribute("role","tab"),t.node.setAttribute("aria-selected","false"),t.node.removeAttribute("aria-expanded"),i&&t.id===i.id&&t.node.classList.add("mod-first"),s&&t.id===s.id&&t.node.classList.add("mod-last"),t.tabpanel.setAttribute("role","tabpanel")})}(),r=[(r=e.deepLinks&&(t=t.filter(function(t){return t.hash===window.location.hash})).length?t:r)[0]||i]),!function _reactivate(){r.length&&(_removeActive(n),r.forEach(function(t){_setActive(t,_extend({},e,{deepLinks:!1,animatePanels:!1,skipCallbacks:!0}))}))}()}}}function _findAndMove(n,a,t){var i=_extend({timeout:1e4,frequency:500,position:"beforeend"},t||{}),s=Number(i.frequency),t=Number(i.timeout);return isNaN(s)||isNaN(t)?_logError("Invalid relocate option",{warning:!0}):s<100?_logError("Relocate frequency must be greater than 100ms",{warning:!0}):"string"!=typeof a||""===a?_logError("Relocate selector is invalid: "+a,{warning:!0}):void function poll(t){if(t>=i.timeout)return done(),_logError("Could not find element with selector "+a,{warning:!0});var e=document.querySelector(a);e?(done(),n.insertAdjacentElement(i.position,e),(e=getTab(n.closest(".station-tabs-tabpanel")))&&e.hidden&&e.show({resetLayout:!0})):(n.classList.add("is-loading"),setTimeout(function(){poll(t+s)},s))}(0);function done(){n.classList.remove("is-loading")}}function _elementHasContents(t,e){var i=_extend({exceptions:["img","video","iframe","svg","div[id]","div[class]"]},e||{}),e=t.childNodes;return Array.from(e).some(function(t){var e,n,a=(t.textContent||"").replace(/\s+/g,"");return _isElement(t)?"none"!==window.getComputedStyle(t).display&&(0(o=o.querySelectorAll(".station-tabs-tab")).length&&(e.after=!0),t=getTab(o[Math.max(0,Math.min(t-1,o.length-1))]),e.after?(t.tabpanel.insertAdjacentElement("afterend",i),i.insertAdjacentElement("afterend",s)):(t.tabtitle.insertAdjacentElement("beforebegin",s),s.insertAdjacentElement("beforebegin",i)),a)&&a.setLayout(),n)},remove:function remove(t){var e=this,t=_extend({resetLayout:!0},t||{});return e.node.removeEventListener("click",_handleTabClick),e.node.removeEventListener("keydown",_handleTabKeydown),e.tabpanel.removeEventListener("transitionend",_handlePanelTransitionend),e.tabpanel.parentNode.removeChild(e.tabpanel),e.node.parentNode.removeChild(e.node),e.tabtitle.parentNode.removeChild(e.tabtitle),t.resetLayout&&(t=getInstance(e.instanceId))&&t.setLayout(),e.id},hide:function _hide(t){var e=this,t=_extend({resetLayout:!0},t||{});return e.close(),e.node.classList.add("is-hidden"),e.tabtitle.classList.add("is-hidden"),e.tabpanel.classList.add("is-hidden"),t.resetLayout&&(t=getInstance(e.instanceId))&&t.setLayout(),e},show:function _show(t){var e=this,t=_extend({resetLayout:!0},t||{});return e.node.classList.remove("is-hidden"),e.tabtitle.classList.remove("is-hidden"),e.tabpanel.classList.remove("is-hidden"),t.resetLayout&&(t=getInstance(e.instanceId))&&t.setLayout(),e},get hidden(){return this.node.classList.contains("is-hidden")}}:_logError(e,{warning:!0})):_logError("Tab reference parameter is required for getTab",{warning:!0})}window.Station=window.Station||{},window.Station.Apps=window.Station.Apps||{},window.Station.Apps.Tabs?window.Station.Apps.Tabs.isLegacy=!0:(window.Station.Apps.Tabs=t,(t=document.createElement("script")).src="https://unpkg.com/focus-visible/dist/focus-visible.min.js",document.head.appendChild(t),document.dispatchEvent(new CustomEvent("stationTabsAPIReady",{detail:window.Station.Apps.Tabs})))})();