(()=>{let t='.wp-block-uicore-a-menu-link[data-menu-link-type="submenu"], .wp-block-uicore-a-menu-submenu-link[data-menu-link-type="submenu"]',r=".uicore-menu-panel > .wp-block-uicore-a-menu-wrapper",o=".wp-block-uicore-toggle-icon",n=".wp-block-uicore-a-menu-submenu",i="data-uicore-submenu-active",u="uicore:slide-submenu-change",c=e=>e.querySelector(o),a=e=>Array.from(e.children).find(e=>e.matches?.(n)),l=e=>e.querySelector(r),m=e=>e.querySelector(":scope > .uicore-menu-link")?.textContent?.replace(/\s+/g," ").trim(),s=e=>{let t=1,r=e.parentElement?.closest(n);for(;r;)t+=1,r=r.parentElement?.closest(n);return t},d=e=>{let r=null,o=0;return e.querySelectorAll(t).forEach(e=>{var t=a(e);e.classList.contains("uicore-is-active")&&"true"===e.getAttribute(i)&&t&&(e=s(t))>o&&(o=e,r=t)}),r},p=(e,t)=>{var r=e.style.getPropertyValue("--uicore-menu-mobile-stage-height"),t=(e.style.removeProperty("--uicore-menu-mobile-stage-height"),t.scrollHeight);return r&&e.style.setProperty("--uicore-menu-mobile-stage-height",r),t},b=e=>{var t,r,o=l(e);o&&(t=(r=d(e))?s(r):0,r=p(e,r||o),e.style.setProperty("--uicore-menu-mobile-active-depth",String(t)),e.style.setProperty("--uicore-menu-mobile-stage-height",r+"px"))},y=e=>{let t=e.ownerDocument?.defaultView||window;t.requestAnimationFrame(()=>{t.requestAnimationFrame(()=>{b(e)})})},g=(e,t)=>{e=(e.dataset.mnBackButtonText||"").trim();return e||m(t)||"Back"},k=(e,t)=>{t=c(t);t?.classList.contains("uicore-is-active")&&(t.click(),y(e))},w=(t,r,e)=>{var o,n=e.querySelector(":scope > .uicore-menu-mobile-back-item"),i=g(t,r);n?(n=n.querySelector(".uicore-menu-mobile-back"))&&n.textContent!==i&&(n.textContent=i):((o=(n=t.ownerDocument||document).createElement("li")).className="uicore-menu-mobile-back-item",(n=n.createElement("button")).type="button",n.className="uicore-menu-mobile-back",n.textContent=i,n.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),k(t,r)}),o.append(n),e.prepend(o))},v=r=>{r.querySelectorAll(t).forEach(e=>{var t=a(e);t&&w(r,e,t)}),b(r)},e=e=>{var t;e&&"true"!==e.dataset.uicoreMobileDropdownSlideReady&&(e.dataset.uicoreMobileDropdownSlideReady="true",v(e),(t=e.querySelector(o+'[data-menu-toggle="true"]'))&&t.addEventListener("click",()=>{y(e)}),e.addEventListener(u,()=>{y(e)}),(e.ownerDocument?.defaultView||window).addEventListener("resize",()=>{v(e)}))};var h=()=>{document.body.classList.contains("block-editor-page")||document.querySelectorAll(".wp-block-uicore-a-menu.uicore-bl-menu-mobile-dropdown-slide").forEach(e)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",h):h()})();