document.addEventListener("DOMContentLoaded",(function(){const c=document.querySelectorAll(".nexa-accordion");c&&c.length>0&&c.forEach((function(c){const e=c.querySelectorAll(".wp-block-nexa-accordion-item");let o=0;e.forEach((function(c){if(o++,1===o){const e=c.querySelector(".accordion-collapse");e.style.maxHeight=e.scrollHeight+"px",e.classList.add("active"),c.querySelector(".accordion-button").classList.add("active"),c.children[0].classList.add("active")}})),c.querySelectorAll(".accordion-button").forEach((function(c){c.addEventListener("click",(function(){var e=c.closest(".wp-block-nexa-accordion-item").querySelector(".accordion-collapse"),o=c.closest(".wp-block-nexa-accordion").querySelector(".nexa-accordion"),t=o.querySelectorAll(".wp-block-nexa-accordion-item"),l=o.querySelectorAll(".accordion-collapse"),a=o.querySelectorAll(".accordion-button");t.forEach((function(c){c.classList.remove("active")})),l.forEach((function(c){c!==e&&(c.style.maxHeight=null,c.classList.remove("active"),c.closest(".wp-block-nexa-accordion-item").children[0].classList.remove("active"))})),a.forEach((function(e){e!==c&&e.classList.remove("active")})),e.classList.contains("active")?e.style.maxHeight=null:e.style.maxHeight=e.scrollHeight+"px",e.classList.toggle("active"),c.classList.toggle("active"),c.closest(".wp-block-nexa-accordion-item").children[0].classList.toggle("active")}))}))}))}));