- md5
- 7d87b9c16533832ce98ec5e7482a71e3
- sha1
- d6f2adf129d1a21417cf4a33f26de610d36a5347
- sha256
- d5e30c9fcea2e96cedc30d81f92561dad715672454b084f92d04f1f3c7a4c879
/*! This file is auto-generated */
import*as e from"@wordpress/interactivity";var t={d:(e,i)=>{for(var o in i)t.o(i,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:i[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},i={};t.d(i,{o:()=>A,w:()=>x});const o=(e=>{var i={};return t.d(i,e),i})({getConfig:()=>e.getConfig,privateApis:()=>e.privateApis,store:()=>e.store});var n;const{directivePrefix:a,getRegionRootFragment:r,initialVdom:s,toVdom:c,render:l,parseInitialData:d,populateInitialData:g,batch:w}=(0,o.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),u=null!==(n=(0,o.getConfig)("core/router").navigationMode)&&void 0!==n?n:"regionBased",h=new Map,m=(new Map,e=>{const t=new URL(e,window.location.href);return t.pathname+t.search}),f=async(e,{html:t})=>{try{if(!t){const i=new URL(e,window.location.href);if(i.origin!==window.location.origin)return!1;const o=await window.fetch(i.href);if(!(e=>{var t;if(200!==e.status)return!1;try{if(new URL(e.url).origin!==window.location.origin)return!1}catch{return!1}const i=null!==(t=e.headers.get("content-type"))&&void 0!==t?t:"";return!i.includes(",")&&"text/html"===i.split(";")[0].trim().toLowerCase()})(o))return!1;t=await o.text()}const i=(new window.DOMParser).parseFromString(t,"text/html");return p(i)}catch(e){return!1}},p=async(e,{vdom:t}={})=>{const i=Object.assign(Object.create(null),{body:void 0});if("regionBased"===u){const o=`data-${a}-router-region`;e.querySelectorAll(`[${o}]`).forEach((e=>{const n=e.getAttribute(o);i[n]=t?.has(e)?t.get(e):c(e)}))}const o=e.querySelector("title")?.innerText,n=d(e);return{regions:i,head:undefined,title:o,initialData:n}},v=e=>{w((()=>{if("regionBased"===u){g(e.initialData);const t=`data-${a}-router-region`;document.querySelectorAll(`[${t}]`).forEach((i=>{const o=i.getAttribute(t),n=r(i);l(e.regions[o],n)}))}e.title&&(document.title=e.title)}))},y=e=>(window.location.assign(e),new Promise((()=>{})));window.addEventListener("popstate",(async()=>{const e=m(window.location.href),t=h.has(e)&&await h.get(e);t?(v(t),x.url=window.location.href):window.location.reload()})),h.set(m(window.location.href),Promise.resolve(p(document,{vdom:s})));let b="";const{state:x,actions:A}=(0,o.store)("core/router",{state:{url:window.location.href,navigation:{hasStarted:!1,hasFinished:!1,texts:{loading:"",loaded:""},message:""}},actions:{*navigate(e,t={}){t=Object.assign(Object.create(null),t);const{clientNavigationDisabled:i}=(0,o.getConfig)();i&&(yield y(e));const n=m(e),{navigation:a}=x,{loadingAnimation:r=!0,screenReaderAnnouncement:s=!0,timeout:c=1e4}=t;b=e,A.prefetch(n,t);const l=new Promise((e=>setTimeout(e,c))),d=setTimeout((()=>{b===e&&(r&&(a.hasStarted=!0,a.hasFinished=!1),s&&(a.message=a.texts.loading))}),400),g=yield Promise.race([h.get(n),l]);if(clearTimeout(d),b===e)if(g&&!g.initialData?.config?.["core/router"]?.clientNavigationDisabled){yield v(g),window.history[t.replace?"replaceState":"pushState"]({},"",e),x.url=e,r&&(a.hasStarted=!1,a.hasFinished=!0),s&&(a.message=a.texts.loaded+(a.message===a.texts.loaded?" ":""));const{hash:i}=new URL(e,window.location.href);i&&document.querySelector(i)?.scrollIntoView()}else yield y(e)},prefetch(e,t={}){t=Object.assign(Object.create(null),t);const{clientNavigationDisabled:i}=(0,o.getConfig)();if(i)return;const n=m(e);!t.force&&h.has(n)||h.set(n,f(n,{html:t.html}))}}});var O=i.o,P=i.w;export{O as actions,P as state};
The same content is in 2 releases, WordPress 6.6.11 to 6.6.12. See them all, or every version of this file.