!function(){"use strict";var e;e=()=>{document.querySelectorAll(".wp-block-themeisle-blocks-tabs").forEach((e=>{const t=Array.from(e.querySelectorAll(":scope > .wp-block-themeisle-blocks-tabs__content > .wp-block-themeisle-blocks-tabs-item")),s=document.createElement("div");s.classList.add("wp-block-themeisle-blocks-tabs__header"),e.prepend(s);let c=!1;const a=[];t.forEach(((e,l)=>{const o=e.querySelector(":scope > .wp-block-themeisle-blocks-tabs-item__content");o.setAttribute("role","tabpanel");const d=e.querySelector(":scope > .wp-block-themeisle-blocks-tabs-item__header");d.setAttribute("role","tab");const i=document.createElement("div");i.classList.add("wp-block-themeisle-blocks-tabs__header_item"),i.tabIndex=0;const r=d.cloneNode(!0);r.classList.remove("wp-block-themeisle-blocks-tabs-item__header"),i.appendChild(r),"true"!==e.dataset.defaultOpen||c?a.push({headerItem:i,content:o,headerMobile:d}):(i.classList.add("active"),o.classList.add("active"),d.classList.add("active"),c=!0);const n=(e,t)=>{const c=e.querySelector(":scope > .wp-block-themeisle-blocks-tabs-item__content"),a=e.querySelector(":scope > .wp-block-themeisle-blocks-tabs-item__header");c.classList.toggle("active",t===l),c.classList.toggle("hidden",t!==l),a.classList.toggle("active",t===l),a.classList.toggle("hidden",t!==l),a.setAttribute("aria-selected",t===l),Array.from(s.childNodes).forEach(((e,t)=>{e.classList.toggle("active",t===l),e.classList.toggle("hidden",t!==l),e.setAttribute("aria-selected",t===l)}))};i.addEventListener("click",(()=>t.forEach(n))),i.addEventListener("keyup",(e=>{"Enter"===e.code&&(e.preventDefault(),t.forEach(n))})),d.addEventListener("click",(()=>t.forEach(n))),d.addEventListener("keyup",(e=>{"Enter"===e.code&&(e.preventDefault(),t.forEach(n))})),s.appendChild(i)})),c||(a?.[0]?.headerItem.classList.add("active"),a?.[0]?.content.classList.add("active"),a?.[0]?.headerMobile.classList.add("active"))}))},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e):e())}();