import*asefrom"@wordpress/interactivity";vart={d:(e,o)=>{for(variino)t.o(o,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:o[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},o={};t.d(o,{o:()=>x,w:()=>b});consti=(e=>{varo={};returnt.d(o,e),o})({getConfig:()=>e.getConfig,privateApis:()=>e.privateApis,store:()=>e.store});vara;const{directivePrefix:n,getRegionRootFragment:r,initialVdom:s,toVdom:c,render:l,parseInitialData:d,populateInitialData:g,batch:w}=(0,i.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),h=null!==(a=(0,i.getConfig)("core/router").navigationMode)&&void0!==a?a:"regionBased",u=newMap,m=(newMap,e=>{constt=newURL(e,window.location.href);returnt.pathname+t.search}),f=async(e,{vdom:t}={})=>{consto={body:void0};if("regionBased"===h){consti=`data-${n}-router-region`;e.querySelectorAll(`[${i}]`).forEach((e=>{consta=e.getAttribute(i);o[a]=t?.has(e)?t.get(e):c(e)}))}consti=e.querySelector("title")?.innerText,a=d(e);return{regions:o,head:undefined,title:i,initialData:a}},p=e=>{w((()=>{if("regionBased"===h){g(e.initialData);constt=`data-${n}-router-region`;document.querySelectorAll(`[${t}]`).forEach((o=>{consti=o.getAttribute(t),a=r(o);l(e.regions[i],a)}))}e.title&&(document.title=e.title)}))},v=e=>(window.location.assign(e),newPromise((()=>{})));window.addEventListener("popstate",(async()=>{conste=m(window.location.href),t=u.has(e)&&awaitu.get(e);t?(p(t),b.url=window.location.href):window.location.reload()})),u.set(m(window.location.href),Promise.resolve(f(document,{vdom:s})));lety="";const{state:b,actions:x}=(0,i.store)("core/router",{state:{url:window.location.href,navigation:{hasStarted:!1,hasFinished:!1,texts:{loading:"",loaded:""},message:""}},actions:{*navigate(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();o&&(yieldv(e));consta=m(e),{navigation:n}=b,{loadingAnimation:r=!0,screenReaderAnnouncement:s=!0,timeout:c=1e4}=t;y=e,x.prefetch(a,t);constl=newPromise((e=>setTimeout(e,c))),d=setTimeout((()=>{y===e&&(r&&(n.hasStarted=!0,n.hasFinished=!1),s&&(n.message=n.texts.loading))}),400),g=yieldPromise.race([u.get(a),l]);if(clearTimeout(d),y===e)if(g&&!g.initialData?.config?.["core/router"]?.clientNavigationDisabled){yieldp(g),window.history[t.replace?"replaceState":"pushState"]({},"",e),b.url=e,r&&(n.hasStarted=!1,n.hasFinished=!0),s&&(n.message=n.texts.loaded+(n.message===n.texts.loaded?"":""));const{hash:o}=newURL(e,window.location.href);o&&document.querySelector(o)?.scrollIntoView()}elseyieldv(e)},prefetch(e,t={}){const{clientNavigationDisabled:o}=(0,i.getConfig)();if(o)return;consta=m(e);!t.force&&u.has(a)||u.set(a,(async(e,{html:t})=>{try{if(!t){consto=awaitwindow.fetch(e);if(200!==o.status)return!1;t=awaito.text()}consto=(newwindow.DOMParser).parseFromString(t,"text/html");returnf(o)}catch(e){return!1}})(a,{html:t.html}))}}});varA=o.o,P=o.w;export{Aasactions,Passtate};