@wordpress/interactivity-router 2.32.1-next.b8c8708f3.0 → 2.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.33.0 (2025-10-17)
6
+
5
7
  ## 2.32.0 (2025-10-01)
6
8
 
7
9
  - Update router regions inside elements with `data-wp-interactive`. ([#71635](https://github.com/WordPress/gutenberg/pull/71635))
@@ -37,9 +37,18 @@ const preloadScriptModules = (doc) => {
37
37
  }
38
38
  const moduleUrls = [
39
39
  ...doc.querySelectorAll(
40
- "script[type=module][src]"
40
+ "script[type=module][src][data-wp-router-options]"
41
41
  )
42
- ].map((s) => s.src);
42
+ ].filter((script) => {
43
+ try {
44
+ const parsed = JSON.parse(
45
+ script.getAttribute("data-wp-router-options")
46
+ );
47
+ return parsed?.loadOnClientNavigation === true;
48
+ } catch {
49
+ return false;
50
+ }
51
+ }).map((script) => script.src);
43
52
  return moduleUrls.filter((url) => !resolvedScriptModules.has(url)).map((url) => (0, import_dynamic_importmap.preloadWithMap)(url, importMap));
44
53
  };
45
54
  const importScriptModules = (modules) => Promise.all(modules.map((m) => (0, import_dynamic_importmap.importPreloadedModule)(m)));
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/assets/script-modules.ts"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport {\n\tinitialImportMap,\n\timportPreloadedModule,\n\tpreloadWithMap,\n\ttype ModuleLoad,\n} from './dynamic-importmap';\n\n/**\n * IDs of modules that should be resolved by the browser rather than\n * processed internally.\n */\nconst resolvedScriptModules = new Set< string >();\n\n/**\n * Marks the specified module as natively resolved.\n * @param url Script module URL.\n */\nexport const markScriptModuleAsResolved = ( url: string ) => {\n\tresolvedScriptModules.add( url );\n};\n\n/**\n * Resolves and fetches modules present in the passed document, using the\n * document's import map to resolve them.\n *\n * @param doc Document containing the modules to preload.\n * @return Array of promises that resolve to a `ScriptModuleLoad` instance.\n */\nexport const preloadScriptModules = ( doc: Document ) => {\n\t// Extract the import map from the document.\n\tconst importMapElement = doc.querySelector< HTMLScriptElement >(\n\t\t'script#wp-importmap[type=importmap]'\n\t);\n\tconst importMap = importMapElement\n\t\t? JSON.parse( importMapElement.text )\n\t\t: { imports: {}, scopes: {} };\n\n\t// Remove imports also in the initial page's import map.\n\t// Those should be handled natively.\n\tfor ( const key in initialImportMap.imports ) {\n\t\tdelete importMap.imports[ key ];\n\t}\n\n\t// Get the URL of all modules contained in the document.\n\tconst moduleUrls = [\n\t\t...doc.querySelectorAll< HTMLScriptElement >(\n\t\t\t'script[type=module][src]'\n\t\t),\n\t].map( ( s ) => s.src );\n\n\t// Resolve and fetch those not resolved natively.\n\treturn moduleUrls\n\t\t.filter( ( url ) => ! resolvedScriptModules.has( url ) )\n\t\t.map( ( url ) => preloadWithMap( url, importMap ) );\n};\n\n/**\n * Imports modules respresented by the passed `ScriptModuleLoad` instances.\n *\n * @param modules Array of `MoudleLoad` instances.\n * @return Promise that resolves once all modules are imported.\n */\nexport const importScriptModules = ( modules: ScriptModuleLoad[] ) =>\n\tPromise.all( modules.map( ( m ) => importPreloadedModule( m ) ) );\n\nexport type ScriptModuleLoad = ModuleLoad;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,+BAKO;AAMP,MAAM,wBAAwB,oBAAI,IAAc;AAMzC,MAAM,6BAA6B,CAAE,QAAiB;AAC5D,wBAAsB,IAAK,GAAI;AAChC;AASO,MAAM,uBAAuB,CAAE,QAAmB;AAExD,QAAM,mBAAmB,IAAI;AAAA,IAC5B;AAAA,EACD;AACA,QAAM,YAAY,mBACf,KAAK,MAAO,iBAAiB,IAAK,IAClC,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE;AAI7B,aAAY,OAAO,0CAAiB,SAAU;AAC7C,WAAO,UAAU,QAAS,GAAI;AAAA,EAC/B;AAGA,QAAM,aAAa;AAAA,IAClB,GAAG,IAAI;AAAA,MACN;AAAA,IACD;AAAA,EACD,EAAE,IAAK,CAAE,MAAO,EAAE,GAAI;AAGtB,SAAO,WACL,OAAQ,CAAE,QAAS,CAAE,sBAAsB,IAAK,GAAI,CAAE,EACtD,IAAK,CAAE,YAAS,yCAAgB,KAAK,SAAU,CAAE;AACpD;AAQO,MAAM,sBAAsB,CAAE,YACpC,QAAQ,IAAK,QAAQ,IAAK,CAAE,UAAO,gDAAuB,CAAE,CAAE,CAAE;",
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport {\n\tinitialImportMap,\n\timportPreloadedModule,\n\tpreloadWithMap,\n\ttype ModuleLoad,\n} from './dynamic-importmap';\n\n/**\n * IDs of modules that should be resolved by the browser rather than\n * processed internally.\n */\nconst resolvedScriptModules = new Set< string >();\n\n/**\n * Marks the specified module as natively resolved.\n * @param url Script module URL.\n */\nexport const markScriptModuleAsResolved = ( url: string ) => {\n\tresolvedScriptModules.add( url );\n};\n\n/**\n * Resolves and fetches modules present in the passed document, using the\n * document's import map to resolve them.\n *\n * @param doc Document containing the modules to preload.\n * @return Array of promises that resolve to a `ScriptModuleLoad` instance.\n */\nexport const preloadScriptModules = ( doc: Document ) => {\n\t// Extract the import map from the document.\n\tconst importMapElement = doc.querySelector< HTMLScriptElement >(\n\t\t'script#wp-importmap[type=importmap]'\n\t);\n\tconst importMap = importMapElement\n\t\t? JSON.parse( importMapElement.text )\n\t\t: { imports: {}, scopes: {} };\n\n\t// Remove imports also in the initial page's import map.\n\t// Those should be handled natively.\n\tfor ( const key in initialImportMap.imports ) {\n\t\tdelete importMap.imports[ key ];\n\t}\n\n\t// Get the URL of all modules contained in the document.\n\tconst moduleUrls = [\n\t\t...doc.querySelectorAll< HTMLScriptElement >(\n\t\t\t'script[type=module][src][data-wp-router-options]'\n\t\t),\n\t]\n\t\t.filter( ( script ) => {\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(\n\t\t\t\t\tscript.getAttribute( 'data-wp-router-options' )\n\t\t\t\t);\n\t\t\t\treturn parsed?.loadOnClientNavigation === true;\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} )\n\t\t.map( ( script ) => script.src );\n\n\t// Resolve and fetch those not resolved natively.\n\treturn moduleUrls\n\t\t.filter( ( url ) => ! resolvedScriptModules.has( url ) )\n\t\t.map( ( url ) => preloadWithMap( url, importMap ) );\n};\n\n/**\n * Imports modules respresented by the passed `ScriptModuleLoad` instances.\n *\n * @param modules Array of `MoudleLoad` instances.\n * @return Promise that resolves once all modules are imported.\n */\nexport const importScriptModules = ( modules: ScriptModuleLoad[] ) =>\n\tPromise.all( modules.map( ( m ) => importPreloadedModule( m ) ) );\n\nexport type ScriptModuleLoad = ModuleLoad;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,+BAKO;AAMP,MAAM,wBAAwB,oBAAI,IAAc;AAMzC,MAAM,6BAA6B,CAAE,QAAiB;AAC5D,wBAAsB,IAAK,GAAI;AAChC;AASO,MAAM,uBAAuB,CAAE,QAAmB;AAExD,QAAM,mBAAmB,IAAI;AAAA,IAC5B;AAAA,EACD;AACA,QAAM,YAAY,mBACf,KAAK,MAAO,iBAAiB,IAAK,IAClC,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE;AAI7B,aAAY,OAAO,0CAAiB,SAAU;AAC7C,WAAO,UAAU,QAAS,GAAI;AAAA,EAC/B;AAGA,QAAM,aAAa;AAAA,IAClB,GAAG,IAAI;AAAA,MACN;AAAA,IACD;AAAA,EACD,EACE,OAAQ,CAAE,WAAY;AACtB,QAAI;AACH,YAAM,SAAS,KAAK;AAAA,QACnB,OAAO,aAAc,wBAAyB;AAAA,MAC/C;AACA,aAAO,QAAQ,2BAA2B;AAAA,IAC3C,QAAQ;AACP,aAAO;AAAA,IACR;AAAA,EACD,CAAE,EACD,IAAK,CAAE,WAAY,OAAO,GAAI;AAGhC,SAAO,WACL,OAAQ,CAAE,QAAS,CAAE,sBAAsB,IAAK,GAAI,CAAE,EACtD,IAAK,CAAE,YAAS,yCAAgB,KAAK,SAAU,CAAE;AACpD;AAQO,MAAM,sBAAsB,CAAE,YACpC,QAAQ,IAAK,QAAQ,IAAK,CAAE,UAAO,gDAAuB,CAAE,CAAE,CAAE;",
6
6
  "names": []
7
7
  }
package/build/index.js CHANGED
@@ -43,7 +43,8 @@ const {
43
43
  populateServerData,
44
44
  batch,
45
45
  routerRegions,
46
- cloneElement
46
+ cloneElement,
47
+ navigationSignal
47
48
  } = (0, import_interactivity.privateApis)(
48
49
  "I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."
49
50
  );
@@ -131,6 +132,7 @@ const renderPage = (page) => {
131
132
  const regionsToAttach = { ...page.regionsToAttach };
132
133
  batch(() => {
133
134
  populateServerData(page.initialData);
135
+ navigationSignal.value += 1;
134
136
  routerRegions.forEach((signal) => {
135
137
  signal.value = null;
136
138
  });
@@ -185,8 +187,10 @@ window.addEventListener("popstate", async () => {
185
187
  const pagePath = getPagePath(window.location.href);
186
188
  const page = pages.has(pagePath) && await pages.get(pagePath);
187
189
  if (page) {
188
- renderPage(page);
189
- state.url = window.location.href;
190
+ batch(() => {
191
+ state.url = window.location.href;
192
+ renderPage(page);
193
+ });
190
194
  } else {
191
195
  window.location.reload();
192
196
  }
@@ -272,13 +276,15 @@ const { state, actions } = (0, import_interactivity.store)("core/router", {
272
276
  }
273
277
  if (page && !page.initialData?.config?.["core/router"]?.clientNavigationDisabled) {
274
278
  yield (0, import_script_modules.importScriptModules)(page.scriptModules);
275
- renderPage(page);
279
+ batch(() => {
280
+ state.url = href;
281
+ if (loadingAnimation) {
282
+ navigation.hasStarted = false;
283
+ navigation.hasFinished = true;
284
+ }
285
+ renderPage(page);
286
+ });
276
287
  window.history[options.replace ? "replaceState" : "pushState"]({}, "", href);
277
- state.url = href;
278
- if (loadingAnimation) {
279
- navigation.hasStarted = false;
280
- navigation.hasFinished = true;
281
- }
282
288
  if (screenReaderAnnouncement) {
283
289
  a11ySpeak("loaded");
284
290
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store, privateApis, getConfig } from '@wordpress/interactivity';\n\n/**\n * Internal dependencies\n */\nimport { preloadStyles, applyStyles, type StyleElement } from './assets/styles';\nimport {\n\tpreloadScriptModules,\n\timportScriptModules,\n\tmarkScriptModuleAsResolved,\n\ttype ScriptModuleLoad,\n} from './assets/script-modules';\n\nconst {\n\tgetRegionRootFragment,\n\tinitialVdom,\n\ttoVdom,\n\trender,\n\tparseServerData,\n\tpopulateServerData,\n\tbatch,\n\trouterRegions,\n\tcloneElement,\n} = privateApis(\n\t'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.'\n);\n\nconst regionAttr = `data-wp-router-region`;\nconst interactiveAttr = `data-wp-interactive`;\nconst regionsSelector = `[${ interactiveAttr }][${ regionAttr }], [${ interactiveAttr }] [${ interactiveAttr }][${ regionAttr }]`;\n\nexport interface NavigateOptions {\n\tforce?: boolean;\n\thtml?: string;\n\treplace?: boolean;\n\ttimeout?: number;\n\tloadingAnimation?: boolean;\n\tscreenReaderAnnouncement?: boolean;\n}\n\nexport interface PrefetchOptions {\n\tforce?: boolean;\n\thtml?: string;\n}\n\ninterface VdomParams {\n\tvdom?: typeof initialVdom;\n}\n\ninterface Page {\n\turl: string;\n\tregions: Record< string, any >;\n\tregionsToAttach: Record< string, string >;\n\tstyles: StyleElement[];\n\tscriptModules: ScriptModuleLoad[];\n\ttitle: string;\n\tinitialData: any;\n}\n\ntype PreparePage = (\n\turl: string,\n\tdom: Document,\n\tparams?: VdomParams\n) => Promise< Page >;\n\n// The cache of visited and prefetched pages, stylesheets and scripts.\nconst pages = new Map< string, Promise< Page | false > >();\n\n// Helper to remove domain and hash from the URL. We are only interesting in\n// caching the path and the query.\nconst getPagePath = ( url: string ) => {\n\tconst u = new URL( url, window.location.href );\n\treturn u.pathname + u.search;\n};\n\n/**\n * Parses the given region's directive.\n *\n * @param region Region element.\n * @return Data contained in the region directive value.\n */\nconst parseRegionAttribute = ( region: Element ) => {\n\tconst value = region.getAttribute( regionAttr );\n\ttry {\n\t\tconst { id, attachTo } = JSON.parse( value );\n\t\treturn { id, attachTo };\n\t} catch ( e ) {\n\t\treturn { id: value };\n\t}\n};\n\n/**\n * Clones the content of the router region vDOM passed as argument.\n *\n * The function creates a new VNode instance removing all priority levels up to\n * the one containing the router-region directive, which should have evaluated\n * in advance.\n *\n * @param vdom A router region's VNode.\n * @return The VNode for the passed router region's content.\n */\nconst cloneRouterRegionContent = ( vdom: any ) => {\n\tif ( ! vdom ) {\n\t\treturn vdom;\n\t}\n\tconst allPriorityLevels: string[][] = vdom.props.priorityLevels;\n\tconst routerRegionLevel = allPriorityLevels.findIndex( ( level ) =>\n\t\tlevel.includes( 'router-region' )\n\t);\n\tconst priorityLevels =\n\t\trouterRegionLevel !== -1\n\t\t\t? allPriorityLevels.slice( routerRegionLevel + 1 )\n\t\t\t: allPriorityLevels;\n\n\treturn priorityLevels.length > 0\n\t\t? cloneElement( vdom, {\n\t\t\t\t...vdom.props,\n\t\t\t\tpriorityLevels,\n\t\t } )\n\t\t: vdom.props.element;\n};\n\n/**\n * IDs of router regions with an `attachTo` property pointing to the same parent\n * element.\n */\nconst regionsToAttachByParent = new WeakMap< Element, string[] >();\n\n/**\n * Map of root fragments by parent element, used to render router regions with\n * the `attachTo` property. Those elements with the same parent are rendered\n * together in the corresponding root fragment.\n */\nconst rootFragmentsByParent = new WeakMap< Element, any >();\n\n/**\n * Fetches and prepares a page from a given URL.\n *\n * @param url The URL of the page to fetch.\n * @param options Options for the fetch operation.\n * @param options.html Optional HTML content. If provided, the function will use\n * this instead of fetching from the URL.\n * @return A Promise that resolves to the prepared page, or false if\n * there was an error during fetching or preparation.\n */\nconst fetchPage = async ( url: string, { html }: { html: string } ) => {\n\ttry {\n\t\tif ( ! html ) {\n\t\t\tconst res = await window.fetch( url );\n\t\t\tif ( res.status !== 200 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\thtml = await res.text();\n\t\t}\n\t\tconst dom = new window.DOMParser().parseFromString( html, 'text/html' );\n\t\treturn await preparePage( url, dom );\n\t} catch ( e ) {\n\t\treturn false;\n\t}\n};\n\n/**\n * Processes a DOM document to extract router regions and related resources.\n *\n * This function analyzes the provided DOM document and creates a virtual DOM\n * representation of all HTML regions marked with a `router-region` directive.\n * It also extracts and preloads associated styles and scripts to prepare for\n * rendering the page.\n *\n * @param url The URL associated with the page, used for asset\n * loading and caching.\n * @param dom The DOM document to process.\n * @param vdomParams Optional parameters for virtual DOM processing.\n * @param vdomParams.vdom An optional existing virtual DOM cache to check for\n * regions. If a region exists in this cache, it will be\n * reused instead of creating a new vDOM representation.\n * @return A Promise that resolves to a {@link Page} object\n * containing the virtual DOM for all router regions,\n * preloaded styles and scripts, page title, and initial\n * server-rendered data.\n */\nconst preparePage: PreparePage = async ( url, dom, { vdom } = {} ) => {\n\t// Remove all noscript elements as they're irrelevant when request is served via router.\n\t// This prevents browsers from extracting styles from noscript tags.\n\tdom.querySelectorAll( 'noscript' ).forEach( ( el ) => el.remove() );\n\n\tconst regions = {};\n\tconst regionsToAttach = {};\n\tdom.querySelectorAll( regionsSelector ).forEach( ( region ) => {\n\t\tconst { id, attachTo } = parseRegionAttribute( region );\n\n\t\tif ( region.parentElement.closest( `[${ regionAttr }]` ) ) {\n\t\t\tregions[ id ] = undefined;\n\t\t} else {\n\t\t\tregions[ id ] = vdom?.has( region )\n\t\t\t\t? vdom.get( region )\n\t\t\t\t: toVdom( region );\n\t\t}\n\n\t\tif ( attachTo ) {\n\t\t\tregionsToAttach[ id ] = attachTo;\n\t\t}\n\t} );\n\n\tconst title = dom.querySelector( 'title' )?.innerText;\n\tconst initialData = parseServerData( dom );\n\n\t// Wait for styles and modules to be ready.\n\tconst [ styles, scriptModules ] = await Promise.all( [\n\t\tPromise.all( preloadStyles( dom, url ) ),\n\t\tPromise.all( preloadScriptModules( dom ) ),\n\t] );\n\n\treturn {\n\t\tregions,\n\t\tregionsToAttach,\n\t\tstyles,\n\t\tscriptModules,\n\t\ttitle,\n\t\tinitialData,\n\t\turl,\n\t};\n};\n\n/**\n * Renders a page by applying styles, populating server data, rendering regions,\n * and updating the document title.\n *\n * @param page The {@link Page} object to render.\n */\nconst renderPage = ( page: Page ) => {\n\tapplyStyles( page.styles );\n\n\t// Clone regionsToAttach.\n\tconst regionsToAttach = { ...page.regionsToAttach };\n\n\tbatch( () => {\n\t\t// Update server data.\n\t\tpopulateServerData( page.initialData );\n\n\t\t// Reset all router regions before setting the actual values.\n\t\t( routerRegions as Map< string, any > ).forEach( ( signal ) => {\n\t\t\tsignal.value = null;\n\t\t} );\n\n\t\t//Init regions with attachTo that don't exist yet.\n\t\tconst parentsToUpdate = new Set< Element >();\n\t\tfor ( const id in regionsToAttach ) {\n\t\t\tconst parent = document.querySelector( regionsToAttach[ id ] );\n\t\t\tif ( ! regionsToAttachByParent.has( parent ) ) {\n\t\t\t\tregionsToAttachByParent.set( parent, [] );\n\t\t\t}\n\t\t\tconst regions = regionsToAttachByParent.get( parent );\n\t\t\tif ( ! regions.includes( id ) ) {\n\t\t\t\tregions.push( id );\n\t\t\t\tparentsToUpdate.add( parent );\n\t\t\t}\n\t\t}\n\n\t\t//Update all existing regions.\n\t\tfor ( const id in page.regions ) {\n\t\t\tif ( routerRegions.has( id ) ) {\n\t\t\t\trouterRegions.get( id ).value = cloneRouterRegionContent(\n\t\t\t\t\tpage.regions[ id ]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Render regions attached to the same parent in the same fragment.\n\t\tparentsToUpdate.forEach( ( parent ) => {\n\t\t\tconst ids = regionsToAttachByParent.get( parent );\n\t\t\tconst vdoms = ids.map( ( id ) => page.regions[ id ] );\n\n\t\t\tif ( ! rootFragmentsByParent.has( parent ) ) {\n\t\t\t\tconst regions = vdoms.map( ( { props, type } ) => {\n\t\t\t\t\tconst elementType =\n\t\t\t\t\t\ttypeof type === 'function' ? props.type : type;\n\n\t\t\t\t\t// Create an element with the obtained type where the region will be\n\t\t\t\t\t// rendered. The type should match the one of the root vnode.\n\t\t\t\t\tconst region = document.createElement( elementType );\n\t\t\t\t\tparent.appendChild( region );\n\t\t\t\t\treturn region;\n\t\t\t\t} );\n\t\t\t\trootFragmentsByParent.set(\n\t\t\t\t\tparent,\n\t\t\t\t\tgetRegionRootFragment( regions )\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst fragment = rootFragmentsByParent.get( parent );\n\t\t\trender( vdoms, fragment );\n\t\t} );\n\t} );\n\n\tif ( page.title ) {\n\t\tdocument.title = page.title;\n\t}\n};\n\n/**\n * Loads the given page forcing a full page reload.\n *\n * The function returns a promise that won't resolve, useful to prevent any\n * potential feedback indicating that the navigation has finished while the new\n * page is being loaded.\n *\n * @param href The page href.\n * @return Promise that never resolves.\n */\nconst forcePageReload = ( href: string ) => {\n\twindow.location.assign( href );\n\treturn new Promise( () => {} );\n};\n\n// Listen to the back and forward buttons and restore the page if it's in the\n// cache.\nwindow.addEventListener( 'popstate', async () => {\n\tconst pagePath = getPagePath( window.location.href ); // Remove hash.\n\tconst page = pages.has( pagePath ) && ( await pages.get( pagePath ) );\n\tif ( page ) {\n\t\trenderPage( page );\n\t\t// Update the URL in the state.\n\t\tstate.url = window.location.href;\n\t} else {\n\t\twindow.location.reload();\n\t}\n} );\n\n// Initialize the router and cache the initial page using the initial vDOM.\nwindow.document\n\t.querySelectorAll< HTMLScriptElement >( 'script[type=module][src]' )\n\t.forEach( ( { src } ) => markScriptModuleAsResolved( src ) );\npages.set(\n\tgetPagePath( window.location.href ),\n\tPromise.resolve(\n\t\tpreparePage( getPagePath( window.location.href ), document, {\n\t\t\tvdom: initialVdom,\n\t\t} )\n\t)\n);\n\n// Variable to store the current navigation.\nlet navigatingTo = '';\n\nlet hasLoadedNavigationTextsData = false;\nconst navigationTexts = {\n\tloading: 'Loading page, please wait.',\n\tloaded: 'Page Loaded.',\n};\n\ninterface Store {\n\tstate: {\n\t\turl: string;\n\t\tnavigation: {\n\t\t\thasStarted: boolean;\n\t\t\thasFinished: boolean;\n\t\t};\n\t};\n\tactions: {\n\t\tnavigate: (\n\t\t\thref: string,\n\t\t\toptions?: NavigateOptions\n\t\t) => Promise< void >;\n\t\tprefetch: ( url: string, options?: PrefetchOptions ) => Promise< void >;\n\t};\n}\n\nexport const { state, actions } = store< Store >( 'core/router', {\n\tstate: {\n\t\turl: window.location.href,\n\t\tnavigation: {\n\t\t\thasStarted: false,\n\t\t\thasFinished: false,\n\t\t},\n\t},\n\tactions: {\n\t\t/**\n\t\t * Navigates to the specified page.\n\t\t *\n\t\t * This function normalizes the passed href, fetches the page HTML if\n\t\t * needed, and updates any interactive regions whose contents have\n\t\t * changed. It also creates a new entry in the browser session history.\n\t\t *\n\t\t * @param href The page href.\n\t\t * @param [options] Options object.\n\t\t * @param [options.force] If true, it forces re-fetching the URL.\n\t\t * @param [options.html] HTML string to be used instead of fetching the requested URL.\n\t\t * @param [options.replace] If true, it replaces the current entry in the browser session history.\n\t\t * @param [options.timeout] Time until the navigation is aborted, in milliseconds. Default is 10000.\n\t\t * @param [options.loadingAnimation] Whether an animation should be shown while navigating. Default to `true`.\n\t\t * @param [options.screenReaderAnnouncement] Whether a message for screen readers should be announced while navigating. Default to `true`.\n\t\t *\n\t\t * @return Promise that resolves once the navigation is completed or aborted.\n\t\t */\n\t\t*navigate( href: string, options: NavigateOptions = {} ) {\n\t\t\tconst { clientNavigationDisabled } = getConfig();\n\t\t\tif ( clientNavigationDisabled ) {\n\t\t\t\tyield forcePageReload( href );\n\t\t\t}\n\n\t\t\tconst pagePath = getPagePath( href );\n\t\t\tconst { navigation } = state;\n\t\t\tconst {\n\t\t\t\tloadingAnimation = true,\n\t\t\t\tscreenReaderAnnouncement = true,\n\t\t\t\ttimeout = 10000,\n\t\t\t} = options;\n\n\t\t\tnavigatingTo = href;\n\t\t\tactions.prefetch( pagePath, options );\n\n\t\t\t// Create a promise that resolves when the specified timeout ends.\n\t\t\t// The timeout value is 10 seconds by default.\n\t\t\tconst timeoutPromise = new Promise< void >( ( resolve ) =>\n\t\t\t\tsetTimeout( resolve, timeout )\n\t\t\t);\n\n\t\t\t// Don't update the navigation status immediately, wait 400 ms.\n\t\t\tconst loadingTimeout = setTimeout( () => {\n\t\t\t\tif ( navigatingTo !== href ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( loadingAnimation ) {\n\t\t\t\t\tnavigation.hasStarted = true;\n\t\t\t\t\tnavigation.hasFinished = false;\n\t\t\t\t}\n\t\t\t\tif ( screenReaderAnnouncement ) {\n\t\t\t\t\ta11ySpeak( 'loading' );\n\t\t\t\t}\n\t\t\t}, 400 );\n\n\t\t\tconst page = yield Promise.race( [\n\t\t\t\tpages.get( pagePath ),\n\t\t\t\ttimeoutPromise,\n\t\t\t] );\n\n\t\t\t// Dismiss loading message if it hasn't been added yet.\n\t\t\tclearTimeout( loadingTimeout );\n\n\t\t\t// Once the page is fetched, the destination URL could have changed\n\t\t\t// (e.g., by clicking another link in the meantime). If so, bail\n\t\t\t// out, and let the newer execution to update the HTML.\n\t\t\tif ( navigatingTo !== href ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tpage &&\n\t\t\t\t! page.initialData?.config?.[ 'core/router' ]\n\t\t\t\t\t?.clientNavigationDisabled\n\t\t\t) {\n\t\t\t\tyield importScriptModules( page.scriptModules );\n\t\t\t\trenderPage( page );\n\t\t\t\twindow.history[\n\t\t\t\t\toptions.replace ? 'replaceState' : 'pushState'\n\t\t\t\t]( {}, '', href );\n\n\t\t\t\t// Update the URL in the state.\n\t\t\t\tstate.url = href;\n\n\t\t\t\t// Update the navigation status once the the new page rendering\n\t\t\t\t// has been completed.\n\t\t\t\tif ( loadingAnimation ) {\n\t\t\t\t\tnavigation.hasStarted = false;\n\t\t\t\t\tnavigation.hasFinished = true;\n\t\t\t\t}\n\n\t\t\t\tif ( screenReaderAnnouncement ) {\n\t\t\t\t\ta11ySpeak( 'loaded' );\n\t\t\t\t}\n\n\t\t\t\t// Scroll to the anchor if exits in the link.\n\t\t\t\tconst { hash } = new URL( href, window.location.href );\n\t\t\t\tif ( hash ) {\n\t\t\t\t\tdocument.querySelector( hash )?.scrollIntoView();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tyield forcePageReload( href );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Prefetches the page with the passed URL.\n\t\t *\n\t\t * The function normalizes the URL and stores internally the fetch\n\t\t * promise, to avoid triggering a second fetch for an ongoing request.\n\t\t *\n\t\t * @param url The page URL.\n\t\t * @param [options] Options object.\n\t\t * @param [options.force] Force fetching the URL again.\n\t\t * @param [options.html] HTML string to be used instead of fetching the requested URL.\n\t\t *\n\t\t * @return Promise that resolves once the page has been fetched.\n\t\t */\n\t\t*prefetch( url: string, options: PrefetchOptions = {} ) {\n\t\t\tconst { clientNavigationDisabled } = getConfig();\n\t\t\tif ( clientNavigationDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst pagePath = getPagePath( url );\n\t\t\tif ( options.force || ! pages.has( pagePath ) ) {\n\t\t\t\tpages.set(\n\t\t\t\t\tpagePath,\n\t\t\t\t\tfetchPage( pagePath, { html: options.html } )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tyield pages.get( pagePath );\n\t\t},\n\t},\n} );\n\n/**\n * Announces a message to screen readers.\n *\n * This is a wrapper around the `@wordpress/a11y` package's `speak` function. It handles importing\n * the package on demand and should be used instead of calling `a11y.speak` directly.\n *\n * @param messageKey The message to be announced by assistive technologies.\n */\nfunction a11ySpeak( messageKey: keyof typeof navigationTexts ) {\n\tif ( ! hasLoadedNavigationTextsData ) {\n\t\thasLoadedNavigationTextsData = true;\n\t\tconst content = document.getElementById(\n\t\t\t'wp-script-module-data-@wordpress/interactivity-router'\n\t\t)?.textContent;\n\t\tif ( content ) {\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse( content );\n\t\t\t\tif ( typeof parsed?.i18n?.loading === 'string' ) {\n\t\t\t\t\tnavigationTexts.loading = parsed.i18n.loading;\n\t\t\t\t}\n\t\t\t\tif ( typeof parsed?.i18n?.loaded === 'string' ) {\n\t\t\t\t\tnavigationTexts.loaded = parsed.i18n.loaded;\n\t\t\t\t}\n\t\t\t} catch {}\n\t\t} else {\n\t\t\t// Fallback to localized strings from Interactivity API state.\n\t\t\t// @todo This block is for Core < 6.7.0. Remove when support is dropped.\n\n\t\t\t// @ts-expect-error\n\t\t\tif ( state.navigation.texts?.loading ) {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnavigationTexts.loading = state.navigation.texts.loading;\n\t\t\t}\n\t\t\t// @ts-expect-error\n\t\t\tif ( state.navigation.texts?.loaded ) {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnavigationTexts.loaded = state.navigation.texts.loaded;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst message = navigationTexts[ messageKey ];\n\n\timport( '@wordpress/a11y' ).then(\n\t\t( { speak } ) => speak( message ),\n\t\t// Ignore failures to load the a11y module.\n\t\t() => {}\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,2BAA8C;AAK9C,oBAA8D;AAC9D,4BAKO;AAEP,MAAM;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,QAAI;AAAA,EACH;AACD;AAEA,MAAM,aAAa;AACnB,MAAM,kBAAkB;AACxB,MAAM,kBAAkB,IAAK,eAAgB,KAAM,UAAW,OAAQ,eAAgB,M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AA,MACD;AAEA,YAAM,WAAW,YAAa,GAAI;AAClC,UAAK,QAAQ,SAAS,CAAE,MAAM,IAAK,QAAS,GAAI;AAC/C,cAAM;AAAA,UACL;AAAA,UACA,UAAW,UAAU,EAAE,MAAM,QAAQ,KAAK,CAAE;AAAA,QAC7C;AAAA,MACD;AAEA,YAAM,MAAM,IAAK,QAAS;AAAA,IAC3B;AAAA,EACD;AACD,CAAE;AAUF,SAAS,UAAW,YAA2C;AAC9D,MAAK,CAAE,8BAA+B;AACrC,mCAA+B;AAC/B,UAAM,UAAU,SAAS;AAAA,MACxB;AAAA,IACD,GAAG;AACH,QAAK,SAAU;AACd,UAAI;AACH,cAAM,SAAS,KAAK,MAAO,OAAQ;AACnC,YAAK,OAAO,QAAQ,MAAM,YAAY,UAAW;AAChD,0BAAgB,UAAU,OAAO,KAAK;AAAA,QACvC;AACA,YAAK,OAAO,QAAQ,MAAM,WAAW,UAAW;AAC/C,0BAAgB,SAAS,OAAO,KAAK;AAAA,QACtC;AAAA,MACD,QAAQ;AAAA,MAAC;AAAA,IACV,OAAO;AAKN,UAAK,MAAM,WAAW,OAAO,SAAU;AAEtC,wBAAgB,UAAU,MAAM,WAAW,MAAM;AAAA,MAClD;AAEA,UAAK,MAAM,WAAW,OAAO,QAAS;AAErC,wBAAgB,SAAS,MAAM,WAAW,MAAM;AAAA,MACjD;AAAA,IACD;AAAA,EACD;AAEA,QAAM,UAAU,gBAAiB,UAAW;AAE5C,SAAQ,iBAAkB,EAAE;AAAA,IAC3B,CAAE,EAAE,MAAM,MAAO,MAAO,OAAQ;AAAA;AAAA,IAEhC,MAAM;AAAA,IAAC;AAAA,EACR;AACD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store, privateApis, getConfig } from '@wordpress/interactivity';\n\n/**\n * Internal dependencies\n */\nimport { preloadStyles, applyStyles, type StyleElement } from './assets/styles';\nimport {\n\tpreloadScriptModules,\n\timportScriptModules,\n\tmarkScriptModuleAsResolved,\n\ttype ScriptModuleLoad,\n} from './assets/script-modules';\n\nconst {\n\tgetRegionRootFragment,\n\tinitialVdom,\n\ttoVdom,\n\trender,\n\tparseServerData,\n\tpopulateServerData,\n\tbatch,\n\trouterRegions,\n\tcloneElement,\n\tnavigationSignal,\n} = privateApis(\n\t'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.'\n);\n\nconst regionAttr = `data-wp-router-region`;\nconst interactiveAttr = `data-wp-interactive`;\nconst regionsSelector = `[${ interactiveAttr }][${ regionAttr }], [${ interactiveAttr }] [${ interactiveAttr }][${ regionAttr }]`;\n\nexport interface NavigateOptions {\n\tforce?: boolean;\n\thtml?: string;\n\treplace?: boolean;\n\ttimeout?: number;\n\tloadingAnimation?: boolean;\n\tscreenReaderAnnouncement?: boolean;\n}\n\nexport interface PrefetchOptions {\n\tforce?: boolean;\n\thtml?: string;\n}\n\ninterface VdomParams {\n\tvdom?: typeof initialVdom;\n}\n\ninterface Page {\n\turl: string;\n\tregions: Record< string, any >;\n\tregionsToAttach: Record< string, string >;\n\tstyles: StyleElement[];\n\tscriptModules: ScriptModuleLoad[];\n\ttitle: string;\n\tinitialData: any;\n}\n\ntype PreparePage = (\n\turl: string,\n\tdom: Document,\n\tparams?: VdomParams\n) => Promise< Page >;\n\n// The cache of visited and prefetched pages, stylesheets and scripts.\nconst pages = new Map< string, Promise< Page | false > >();\n\n// Helper to remove domain and hash from the URL. We are only interesting in\n// caching the path and the query.\nconst getPagePath = ( url: string ) => {\n\tconst u = new URL( url, window.location.href );\n\treturn u.pathname + u.search;\n};\n\n/**\n * Parses the given region's directive.\n *\n * @param region Region element.\n * @return Data contained in the region directive value.\n */\nconst parseRegionAttribute = ( region: Element ) => {\n\tconst value = region.getAttribute( regionAttr );\n\ttry {\n\t\tconst { id, attachTo } = JSON.parse( value );\n\t\treturn { id, attachTo };\n\t} catch ( e ) {\n\t\treturn { id: value };\n\t}\n};\n\n/**\n * Clones the content of the router region vDOM passed as argument.\n *\n * The function creates a new VNode instance removing all priority levels up to\n * the one containing the router-region directive, which should have evaluated\n * in advance.\n *\n * @param vdom A router region's VNode.\n * @return The VNode for the passed router region's content.\n */\nconst cloneRouterRegionContent = ( vdom: any ) => {\n\tif ( ! vdom ) {\n\t\treturn vdom;\n\t}\n\tconst allPriorityLevels: string[][] = vdom.props.priorityLevels;\n\tconst routerRegionLevel = allPriorityLevels.findIndex( ( level ) =>\n\t\tlevel.includes( 'router-region' )\n\t);\n\tconst priorityLevels =\n\t\trouterRegionLevel !== -1\n\t\t\t? allPriorityLevels.slice( routerRegionLevel + 1 )\n\t\t\t: allPriorityLevels;\n\n\treturn priorityLevels.length > 0\n\t\t? cloneElement( vdom, {\n\t\t\t\t...vdom.props,\n\t\t\t\tpriorityLevels,\n\t\t } )\n\t\t: vdom.props.element;\n};\n\n/**\n * IDs of router regions with an `attachTo` property pointing to the same parent\n * element.\n */\nconst regionsToAttachByParent = new WeakMap< Element, string[] >();\n\n/**\n * Map of root fragments by parent element, used to render router regions with\n * the `attachTo` property. Those elements with the same parent are rendered\n * together in the corresponding root fragment.\n */\nconst rootFragmentsByParent = new WeakMap< Element, any >();\n\n/**\n * Fetches and prepares a page from a given URL.\n *\n * @param url The URL of the page to fetch.\n * @param options Options for the fetch operation.\n * @param options.html Optional HTML content. If provided, the function will use\n * this instead of fetching from the URL.\n * @return A Promise that resolves to the prepared page, or false if\n * there was an error during fetching or preparation.\n */\nconst fetchPage = async ( url: string, { html }: { html: string } ) => {\n\ttry {\n\t\tif ( ! html ) {\n\t\t\tconst res = await window.fetch( url );\n\t\t\tif ( res.status !== 200 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\thtml = await res.text();\n\t\t}\n\t\tconst dom = new window.DOMParser().parseFromString( html, 'text/html' );\n\t\treturn await preparePage( url, dom );\n\t} catch ( e ) {\n\t\treturn false;\n\t}\n};\n\n/**\n * Processes a DOM document to extract router regions and related resources.\n *\n * This function analyzes the provided DOM document and creates a virtual DOM\n * representation of all HTML regions marked with a `router-region` directive.\n * It also extracts and preloads associated styles and scripts to prepare for\n * rendering the page.\n *\n * @param url The URL associated with the page, used for asset\n * loading and caching.\n * @param dom The DOM document to process.\n * @param vdomParams Optional parameters for virtual DOM processing.\n * @param vdomParams.vdom An optional existing virtual DOM cache to check for\n * regions. If a region exists in this cache, it will be\n * reused instead of creating a new vDOM representation.\n * @return A Promise that resolves to a {@link Page} object\n * containing the virtual DOM for all router regions,\n * preloaded styles and scripts, page title, and initial\n * server-rendered data.\n */\nconst preparePage: PreparePage = async ( url, dom, { vdom } = {} ) => {\n\t// Remove all noscript elements as they're irrelevant when request is served via router.\n\t// This prevents browsers from extracting styles from noscript tags.\n\tdom.querySelectorAll( 'noscript' ).forEach( ( el ) => el.remove() );\n\n\tconst regions = {};\n\tconst regionsToAttach = {};\n\tdom.querySelectorAll( regionsSelector ).forEach( ( region ) => {\n\t\tconst { id, attachTo } = parseRegionAttribute( region );\n\n\t\tif ( region.parentElement.closest( `[${ regionAttr }]` ) ) {\n\t\t\tregions[ id ] = undefined;\n\t\t} else {\n\t\t\tregions[ id ] = vdom?.has( region )\n\t\t\t\t? vdom.get( region )\n\t\t\t\t: toVdom( region );\n\t\t}\n\n\t\tif ( attachTo ) {\n\t\t\tregionsToAttach[ id ] = attachTo;\n\t\t}\n\t} );\n\n\tconst title = dom.querySelector( 'title' )?.innerText;\n\tconst initialData = parseServerData( dom );\n\n\t// Wait for styles and modules to be ready.\n\tconst [ styles, scriptModules ] = await Promise.all( [\n\t\tPromise.all( preloadStyles( dom, url ) ),\n\t\tPromise.all( preloadScriptModules( dom ) ),\n\t] );\n\n\treturn {\n\t\tregions,\n\t\tregionsToAttach,\n\t\tstyles,\n\t\tscriptModules,\n\t\ttitle,\n\t\tinitialData,\n\t\turl,\n\t};\n};\n\n/**\n * Renders a page by applying styles, populating server data, rendering regions,\n * and updating the document title.\n *\n * @param page The {@link Page} object to render.\n */\nconst renderPage = ( page: Page ) => {\n\tapplyStyles( page.styles );\n\n\t// Clone regionsToAttach.\n\tconst regionsToAttach = { ...page.regionsToAttach };\n\n\tbatch( () => {\n\t\t// Updates the server data.\n\t\tpopulateServerData( page.initialData );\n\n\t\t// Triggers navigation invalidations (`getServerState` and\n\t\t// `getServerContext`).\n\t\tnavigationSignal.value += 1;\n\n\t\t// Resets all router regions before setting the actual values.\n\t\t( routerRegions as Map< string, any > ).forEach( ( signal ) => {\n\t\t\tsignal.value = null;\n\t\t} );\n\n\t\t// Inits regions with attachTo that don't exist yet.\n\t\tconst parentsToUpdate = new Set< Element >();\n\t\tfor ( const id in regionsToAttach ) {\n\t\t\tconst parent = document.querySelector( regionsToAttach[ id ] );\n\t\t\tif ( ! regionsToAttachByParent.has( parent ) ) {\n\t\t\t\tregionsToAttachByParent.set( parent, [] );\n\t\t\t}\n\t\t\tconst regions = regionsToAttachByParent.get( parent );\n\t\t\tif ( ! regions.includes( id ) ) {\n\t\t\t\tregions.push( id );\n\t\t\t\tparentsToUpdate.add( parent );\n\t\t\t}\n\t\t}\n\n\t\t// Updates all existing regions.\n\t\tfor ( const id in page.regions ) {\n\t\t\tif ( routerRegions.has( id ) ) {\n\t\t\t\trouterRegions.get( id ).value = cloneRouterRegionContent(\n\t\t\t\t\tpage.regions[ id ]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Renders regions attached to the same parent in the same fragment.\n\t\tparentsToUpdate.forEach( ( parent ) => {\n\t\t\tconst ids = regionsToAttachByParent.get( parent );\n\t\t\tconst vdoms = ids.map( ( id ) => page.regions[ id ] );\n\n\t\t\tif ( ! rootFragmentsByParent.has( parent ) ) {\n\t\t\t\tconst regions = vdoms.map( ( { props, type } ) => {\n\t\t\t\t\tconst elementType =\n\t\t\t\t\t\ttypeof type === 'function' ? props.type : type;\n\n\t\t\t\t\t// Creates an element with the obtained type where the\n\t\t\t\t\t// region will be rendered. The type should match the one of\n\t\t\t\t\t// the root vnode.\n\t\t\t\t\tconst region = document.createElement( elementType );\n\t\t\t\t\tparent.appendChild( region );\n\t\t\t\t\treturn region;\n\t\t\t\t} );\n\t\t\t\trootFragmentsByParent.set(\n\t\t\t\t\tparent,\n\t\t\t\t\tgetRegionRootFragment( regions )\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst fragment = rootFragmentsByParent.get( parent );\n\t\t\trender( vdoms, fragment );\n\t\t} );\n\t} );\n\n\tif ( page.title ) {\n\t\tdocument.title = page.title;\n\t}\n};\n\n/**\n * Loads the given page forcing a full page reload.\n *\n * The function returns a promise that won't resolve, useful to prevent any\n * potential feedback indicating that the navigation has finished while the new\n * page is being loaded.\n *\n * @param href The page href.\n * @return Promise that never resolves.\n */\nconst forcePageReload = ( href: string ) => {\n\twindow.location.assign( href );\n\treturn new Promise( () => {} );\n};\n\n// Listen to the back and forward buttons and restore the page if it's in the\n// cache.\nwindow.addEventListener( 'popstate', async () => {\n\tconst pagePath = getPagePath( window.location.href ); // Remove hash.\n\tconst page = pages.has( pagePath ) && ( await pages.get( pagePath ) );\n\tif ( page ) {\n\t\tbatch( () => {\n\t\t\tstate.url = window.location.href;\n\t\t\trenderPage( page );\n\t\t} );\n\t} else {\n\t\twindow.location.reload();\n\t}\n} );\n\n// Initialize the router and cache the initial page using the initial vDOM.\nwindow.document\n\t.querySelectorAll< HTMLScriptElement >( 'script[type=module][src]' )\n\t.forEach( ( { src } ) => markScriptModuleAsResolved( src ) );\npages.set(\n\tgetPagePath( window.location.href ),\n\tPromise.resolve(\n\t\tpreparePage( getPagePath( window.location.href ), document, {\n\t\t\tvdom: initialVdom,\n\t\t} )\n\t)\n);\n\n// Variable to store the current navigation.\nlet navigatingTo = '';\n\nlet hasLoadedNavigationTextsData = false;\nconst navigationTexts = {\n\tloading: 'Loading page, please wait.',\n\tloaded: 'Page Loaded.',\n};\n\ninterface Store {\n\tstate: {\n\t\turl: string;\n\t\tnavigation: {\n\t\t\thasStarted: boolean;\n\t\t\thasFinished: boolean;\n\t\t};\n\t};\n\tactions: {\n\t\tnavigate: (\n\t\t\thref: string,\n\t\t\toptions?: NavigateOptions\n\t\t) => Promise< void >;\n\t\tprefetch: ( url: string, options?: PrefetchOptions ) => Promise< void >;\n\t};\n}\n\nexport const { state, actions } = store< Store >( 'core/router', {\n\tstate: {\n\t\turl: window.location.href,\n\t\tnavigation: {\n\t\t\thasStarted: false,\n\t\t\thasFinished: false,\n\t\t},\n\t},\n\tactions: {\n\t\t/**\n\t\t * Navigates to the specified page.\n\t\t *\n\t\t * This function normalizes the passed href, fetches the page HTML if\n\t\t * needed, and updates any interactive regions whose contents have\n\t\t * changed. It also creates a new entry in the browser session history.\n\t\t *\n\t\t * @param href The page href.\n\t\t * @param [options] Options object.\n\t\t * @param [options.force] If true, it forces re-fetching the URL.\n\t\t * @param [options.html] HTML string to be used instead of fetching the requested URL.\n\t\t * @param [options.replace] If true, it replaces the current entry in the browser session history.\n\t\t * @param [options.timeout] Time until the navigation is aborted, in milliseconds. Default is 10000.\n\t\t * @param [options.loadingAnimation] Whether an animation should be shown while navigating. Default to `true`.\n\t\t * @param [options.screenReaderAnnouncement] Whether a message for screen readers should be announced while navigating. Default to `true`.\n\t\t *\n\t\t * @return Promise that resolves once the navigation is completed or aborted.\n\t\t */\n\t\t*navigate( href: string, options: NavigateOptions = {} ) {\n\t\t\tconst { clientNavigationDisabled } = getConfig();\n\t\t\tif ( clientNavigationDisabled ) {\n\t\t\t\tyield forcePageReload( href );\n\t\t\t}\n\n\t\t\tconst pagePath = getPagePath( href );\n\t\t\tconst { navigation } = state;\n\t\t\tconst {\n\t\t\t\tloadingAnimation = true,\n\t\t\t\tscreenReaderAnnouncement = true,\n\t\t\t\ttimeout = 10000,\n\t\t\t} = options;\n\n\t\t\tnavigatingTo = href;\n\t\t\tactions.prefetch( pagePath, options );\n\n\t\t\t// Creates a promise that resolves when the specified timeout ends.\n\t\t\t// The timeout value is 10 seconds by default.\n\t\t\tconst timeoutPromise = new Promise< void >( ( resolve ) =>\n\t\t\t\tsetTimeout( resolve, timeout )\n\t\t\t);\n\n\t\t\t// Doesn't update the navigation status immediately, wait 400 ms.\n\t\t\tconst loadingTimeout = setTimeout( () => {\n\t\t\t\tif ( navigatingTo !== href ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( loadingAnimation ) {\n\t\t\t\t\tnavigation.hasStarted = true;\n\t\t\t\t\tnavigation.hasFinished = false;\n\t\t\t\t}\n\t\t\t\tif ( screenReaderAnnouncement ) {\n\t\t\t\t\ta11ySpeak( 'loading' );\n\t\t\t\t}\n\t\t\t}, 400 );\n\n\t\t\tconst page = yield Promise.race( [\n\t\t\t\tpages.get( pagePath ),\n\t\t\t\ttimeoutPromise,\n\t\t\t] );\n\n\t\t\t// Dismisses loading message if it hasn't been added yet.\n\t\t\tclearTimeout( loadingTimeout );\n\n\t\t\t// Once the page is fetched, the destination URL could have changed\n\t\t\t// (e.g., by clicking another link in the meantime). If so, bail\n\t\t\t// out, and let the newer execution to update the HTML.\n\t\t\tif ( navigatingTo !== href ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tpage &&\n\t\t\t\t! page.initialData?.config?.[ 'core/router' ]\n\t\t\t\t\t?.clientNavigationDisabled\n\t\t\t) {\n\t\t\t\tyield importScriptModules( page.scriptModules );\n\n\t\t\t\tbatch( () => {\n\t\t\t\t\t// Updates the URL in the state.\n\t\t\t\t\tstate.url = href;\n\n\t\t\t\t\t// Updates the navigation status once the the new page rendering\n\t\t\t\t\t// has been completed.\n\t\t\t\t\tif ( loadingAnimation ) {\n\t\t\t\t\t\tnavigation.hasStarted = false;\n\t\t\t\t\t\tnavigation.hasFinished = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Renders the new page.\n\t\t\t\t\trenderPage( page );\n\t\t\t\t} );\n\n\t\t\t\twindow.history[\n\t\t\t\t\toptions.replace ? 'replaceState' : 'pushState'\n\t\t\t\t]( {}, '', href );\n\n\t\t\t\tif ( screenReaderAnnouncement ) {\n\t\t\t\t\ta11ySpeak( 'loaded' );\n\t\t\t\t}\n\n\t\t\t\t// Scroll to the anchor if exits in the link.\n\t\t\t\tconst { hash } = new URL( href, window.location.href );\n\t\t\t\tif ( hash ) {\n\t\t\t\t\tdocument.querySelector( hash )?.scrollIntoView();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tyield forcePageReload( href );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Prefetches the page with the passed URL.\n\t\t *\n\t\t * The function normalizes the URL and stores internally the fetch\n\t\t * promise, to avoid triggering a second fetch for an ongoing request.\n\t\t *\n\t\t * @param url The page URL.\n\t\t * @param [options] Options object.\n\t\t * @param [options.force] Force fetching the URL again.\n\t\t * @param [options.html] HTML string to be used instead of fetching the requested URL.\n\t\t *\n\t\t * @return Promise that resolves once the page has been fetched.\n\t\t */\n\t\t*prefetch( url: string, options: PrefetchOptions = {} ) {\n\t\t\tconst { clientNavigationDisabled } = getConfig();\n\t\t\tif ( clientNavigationDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst pagePath = getPagePath( url );\n\t\t\tif ( options.force || ! pages.has( pagePath ) ) {\n\t\t\t\tpages.set(\n\t\t\t\t\tpagePath,\n\t\t\t\t\tfetchPage( pagePath, { html: options.html } )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tyield pages.get( pagePath );\n\t\t},\n\t},\n} );\n\n/**\n * Announces a message to screen readers.\n *\n * This is a wrapper around the `@wordpress/a11y` package's `speak` function. It handles importing\n * the package on demand and should be used instead of calling `a11y.speak` directly.\n *\n * @param messageKey The message to be announced by assistive technologies.\n */\nfunction a11ySpeak( messageKey: keyof typeof navigationTexts ) {\n\tif ( ! hasLoadedNavigationTextsData ) {\n\t\thasLoadedNavigationTextsData = true;\n\t\tconst content = document.getElementById(\n\t\t\t'wp-script-module-data-@wordpress/interactivity-router'\n\t\t)?.textContent;\n\t\tif ( content ) {\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse( content );\n\t\t\t\tif ( typeof parsed?.i18n?.loading === 'string' ) {\n\t\t\t\t\tnavigationTexts.loading = parsed.i18n.loading;\n\t\t\t\t}\n\t\t\t\tif ( typeof parsed?.i18n?.loaded === 'string' ) {\n\t\t\t\t\tnavigationTexts.loaded = parsed.i18n.loaded;\n\t\t\t\t}\n\t\t\t} catch {}\n\t\t} else {\n\t\t\t// Fallback to localized strings from Interactivity API state.\n\t\t\t// @todo This block is for Core < 6.7.0. Remove when support is dropped.\n\n\t\t\t// @ts-expect-error\n\t\t\tif ( state.navigation.texts?.loading ) {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnavigationTexts.loading = state.navigation.texts.loading;\n\t\t\t}\n\t\t\t// @ts-expect-error\n\t\t\tif ( state.navigation.texts?.loaded ) {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnavigationTexts.loaded = state.navigation.texts.loaded;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst message = navigationTexts[ messageKey ];\n\n\timport( '@wordpress/a11y' ).then(\n\t\t( { speak } ) => speak( message ),\n\t\t// Ignore failures to load the a11y module.\n\t\t() => {}\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,2BAA8C;AAK9C,oBAA8D;AAC9D,4BAKO;AAEP,MAAM;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,QAAI;AAAA,EACH;AACD;AAEA,MAAM,aAAa;AACnB,MAAM,kBAAkB;AACxB,MAAM,kBAAkB,IAAK,eAAgB,KAAM,UAAW,OAAQ,eAAgB,MAAO,eAAgB,KAAM,UAAW;AAqC9H,MAAM,QAAQ,oBAAI,IAAuC;AAIzD,MAAM,cAAc,CAAE,QAAiB;AACtC,QAAM,IAAI,IAAI,IAAK,KAAK,OAAO,SAAS,IAAK;AAC7C,SAAO,EAAE,WAAW,EAAE;AACvB;AAQA,M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C/C,cAAM;AAAA,UACL;AAAA,UACA,UAAW,UAAU,EAAE,MAAM,QAAQ,KAAK,CAAE;AAAA,QAC7C;AAAA,MACD;AAEA,YAAM,MAAM,IAAK,QAAS;AAAA,IAC3B;AAAA,EACD;AACD,CAAE;AAUF,SAAS,UAAW,YAA2C;AAC9D,MAAK,CAAE,8BAA+B;AACrC,mCAA+B;AAC/B,UAAM,UAAU,SAAS;AAAA,MACxB;AAAA,IACD,GAAG;AACH,QAAK,SAAU;AACd,UAAI;AACH,cAAM,SAAS,KAAK,MAAO,OAAQ;AACnC,YAAK,OAAO,QAAQ,MAAM,YAAY,UAAW;AAChD,0BAAgB,UAAU,OAAO,KAAK;AAAA,QACvC;AACA,YAAK,OAAO,QAAQ,MAAM,WAAW,UAAW;AAC/C,0BAAgB,SAAS,OAAO,KAAK;AAAA,QACtC;AAAA,MACD,QAAQ;AAAA,MAAC;AAAA,IACV,OAAO;AAKN,UAAK,MAAM,WAAW,OAAO,SAAU;AAEtC,wBAAgB,UAAU,MAAM,WAAW,MAAM;AAAA,MAClD;AAEA,UAAK,MAAM,WAAW,OAAO,QAAS;AAErC,wBAAgB,SAAS,MAAM,WAAW,MAAM;AAAA,MACjD;AAAA,IACD;AAAA,EACD;AAEA,QAAM,UAAU,gBAAiB,UAAW;AAE5C,SAAQ,iBAAkB,EAAE;AAAA,IAC3B,CAAE,EAAE,MAAM,MAAO,MAAO,OAAQ;AAAA;AAAA,IAEhC,MAAM;AAAA,IAAC;AAAA,EACR;AACD;",
6
6
  "names": []
7
7
  }
@@ -17,9 +17,18 @@ const preloadScriptModules = (doc) => {
17
17
  }
18
18
  const moduleUrls = [
19
19
  ...doc.querySelectorAll(
20
- "script[type=module][src]"
20
+ "script[type=module][src][data-wp-router-options]"
21
21
  )
22
- ].map((s) => s.src);
22
+ ].filter((script) => {
23
+ try {
24
+ const parsed = JSON.parse(
25
+ script.getAttribute("data-wp-router-options")
26
+ );
27
+ return parsed?.loadOnClientNavigation === true;
28
+ } catch {
29
+ return false;
30
+ }
31
+ }).map((script) => script.src);
23
32
  return moduleUrls.filter((url) => !resolvedScriptModules.has(url)).map((url) => preloadWithMap(url, importMap));
24
33
  };
25
34
  const importScriptModules = (modules) => Promise.all(modules.map((m) => importPreloadedModule(m)));
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/assets/script-modules.ts"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport {\n\tinitialImportMap,\n\timportPreloadedModule,\n\tpreloadWithMap,\n\ttype ModuleLoad,\n} from './dynamic-importmap';\n\n/**\n * IDs of modules that should be resolved by the browser rather than\n * processed internally.\n */\nconst resolvedScriptModules = new Set< string >();\n\n/**\n * Marks the specified module as natively resolved.\n * @param url Script module URL.\n */\nexport const markScriptModuleAsResolved = ( url: string ) => {\n\tresolvedScriptModules.add( url );\n};\n\n/**\n * Resolves and fetches modules present in the passed document, using the\n * document's import map to resolve them.\n *\n * @param doc Document containing the modules to preload.\n * @return Array of promises that resolve to a `ScriptModuleLoad` instance.\n */\nexport const preloadScriptModules = ( doc: Document ) => {\n\t// Extract the import map from the document.\n\tconst importMapElement = doc.querySelector< HTMLScriptElement >(\n\t\t'script#wp-importmap[type=importmap]'\n\t);\n\tconst importMap = importMapElement\n\t\t? JSON.parse( importMapElement.text )\n\t\t: { imports: {}, scopes: {} };\n\n\t// Remove imports also in the initial page's import map.\n\t// Those should be handled natively.\n\tfor ( const key in initialImportMap.imports ) {\n\t\tdelete importMap.imports[ key ];\n\t}\n\n\t// Get the URL of all modules contained in the document.\n\tconst moduleUrls = [\n\t\t...doc.querySelectorAll< HTMLScriptElement >(\n\t\t\t'script[type=module][src]'\n\t\t),\n\t].map( ( s ) => s.src );\n\n\t// Resolve and fetch those not resolved natively.\n\treturn moduleUrls\n\t\t.filter( ( url ) => ! resolvedScriptModules.has( url ) )\n\t\t.map( ( url ) => preloadWithMap( url, importMap ) );\n};\n\n/**\n * Imports modules respresented by the passed `ScriptModuleLoad` instances.\n *\n * @param modules Array of `MoudleLoad` instances.\n * @return Promise that resolves once all modules are imported.\n */\nexport const importScriptModules = ( modules: ScriptModuleLoad[] ) =>\n\tPromise.all( modules.map( ( m ) => importPreloadedModule( m ) ) );\n\nexport type ScriptModuleLoad = ModuleLoad;\n"],
5
- "mappings": "AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OAEM;AAMP,MAAM,wBAAwB,oBAAI,IAAc;AAMzC,MAAM,6BAA6B,CAAE,QAAiB;AAC5D,wBAAsB,IAAK,GAAI;AAChC;AASO,MAAM,uBAAuB,CAAE,QAAmB;AAExD,QAAM,mBAAmB,IAAI;AAAA,IAC5B;AAAA,EACD;AACA,QAAM,YAAY,mBACf,KAAK,MAAO,iBAAiB,IAAK,IAClC,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE;AAI7B,aAAY,OAAO,iBAAiB,SAAU;AAC7C,WAAO,UAAU,QAAS,GAAI;AAAA,EAC/B;AAGA,QAAM,aAAa;AAAA,IAClB,GAAG,IAAI;AAAA,MACN;AAAA,IACD;AAAA,EACD,EAAE,IAAK,CAAE,MAAO,EAAE,GAAI;AAGtB,SAAO,WACL,OAAQ,CAAE,QAAS,CAAE,sBAAsB,IAAK,GAAI,CAAE,EACtD,IAAK,CAAE,QAAS,eAAgB,KAAK,SAAU,CAAE;AACpD;AAQO,MAAM,sBAAsB,CAAE,YACpC,QAAQ,IAAK,QAAQ,IAAK,CAAE,MAAO,sBAAuB,CAAE,CAAE,CAAE;",
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport {\n\tinitialImportMap,\n\timportPreloadedModule,\n\tpreloadWithMap,\n\ttype ModuleLoad,\n} from './dynamic-importmap';\n\n/**\n * IDs of modules that should be resolved by the browser rather than\n * processed internally.\n */\nconst resolvedScriptModules = new Set< string >();\n\n/**\n * Marks the specified module as natively resolved.\n * @param url Script module URL.\n */\nexport const markScriptModuleAsResolved = ( url: string ) => {\n\tresolvedScriptModules.add( url );\n};\n\n/**\n * Resolves and fetches modules present in the passed document, using the\n * document's import map to resolve them.\n *\n * @param doc Document containing the modules to preload.\n * @return Array of promises that resolve to a `ScriptModuleLoad` instance.\n */\nexport const preloadScriptModules = ( doc: Document ) => {\n\t// Extract the import map from the document.\n\tconst importMapElement = doc.querySelector< HTMLScriptElement >(\n\t\t'script#wp-importmap[type=importmap]'\n\t);\n\tconst importMap = importMapElement\n\t\t? JSON.parse( importMapElement.text )\n\t\t: { imports: {}, scopes: {} };\n\n\t// Remove imports also in the initial page's import map.\n\t// Those should be handled natively.\n\tfor ( const key in initialImportMap.imports ) {\n\t\tdelete importMap.imports[ key ];\n\t}\n\n\t// Get the URL of all modules contained in the document.\n\tconst moduleUrls = [\n\t\t...doc.querySelectorAll< HTMLScriptElement >(\n\t\t\t'script[type=module][src][data-wp-router-options]'\n\t\t),\n\t]\n\t\t.filter( ( script ) => {\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(\n\t\t\t\t\tscript.getAttribute( 'data-wp-router-options' )\n\t\t\t\t);\n\t\t\t\treturn parsed?.loadOnClientNavigation === true;\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} )\n\t\t.map( ( script ) => script.src );\n\n\t// Resolve and fetch those not resolved natively.\n\treturn moduleUrls\n\t\t.filter( ( url ) => ! resolvedScriptModules.has( url ) )\n\t\t.map( ( url ) => preloadWithMap( url, importMap ) );\n};\n\n/**\n * Imports modules respresented by the passed `ScriptModuleLoad` instances.\n *\n * @param modules Array of `MoudleLoad` instances.\n * @return Promise that resolves once all modules are imported.\n */\nexport const importScriptModules = ( modules: ScriptModuleLoad[] ) =>\n\tPromise.all( modules.map( ( m ) => importPreloadedModule( m ) ) );\n\nexport type ScriptModuleLoad = ModuleLoad;\n"],
5
+ "mappings": "AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OAEM;AAMP,MAAM,wBAAwB,oBAAI,IAAc;AAMzC,MAAM,6BAA6B,CAAE,QAAiB;AAC5D,wBAAsB,IAAK,GAAI;AAChC;AASO,MAAM,uBAAuB,CAAE,QAAmB;AAExD,QAAM,mBAAmB,IAAI;AAAA,IAC5B;AAAA,EACD;AACA,QAAM,YAAY,mBACf,KAAK,MAAO,iBAAiB,IAAK,IAClC,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE;AAI7B,aAAY,OAAO,iBAAiB,SAAU;AAC7C,WAAO,UAAU,QAAS,GAAI;AAAA,EAC/B;AAGA,QAAM,aAAa;AAAA,IAClB,GAAG,IAAI;AAAA,MACN;AAAA,IACD;AAAA,EACD,EACE,OAAQ,CAAE,WAAY;AACtB,QAAI;AACH,YAAM,SAAS,KAAK;AAAA,QACnB,OAAO,aAAc,wBAAyB;AAAA,MAC/C;AACA,aAAO,QAAQ,2BAA2B;AAAA,IAC3C,QAAQ;AACP,aAAO;AAAA,IACR;AAAA,EACD,CAAE,EACD,IAAK,CAAE,WAAY,OAAO,GAAI;AAGhC,SAAO,WACL,OAAQ,CAAE,QAAS,CAAE,sBAAsB,IAAK,GAAI,CAAE,EACtD,IAAK,CAAE,QAAS,eAAgB,KAAK,SAAU,CAAE;AACpD;AAQO,MAAM,sBAAsB,CAAE,YACpC,QAAQ,IAAK,QAAQ,IAAK,CAAE,MAAO,sBAAuB,CAAE,CAAE,CAAE;",
6
6
  "names": []
7
7
  }
@@ -14,7 +14,8 @@ const {
14
14
  populateServerData,
15
15
  batch,
16
16
  routerRegions,
17
- cloneElement
17
+ cloneElement,
18
+ navigationSignal
18
19
  } = privateApis(
19
20
  "I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."
20
21
  );
@@ -102,6 +103,7 @@ const renderPage = (page) => {
102
103
  const regionsToAttach = { ...page.regionsToAttach };
103
104
  batch(() => {
104
105
  populateServerData(page.initialData);
106
+ navigationSignal.value += 1;
105
107
  routerRegions.forEach((signal) => {
106
108
  signal.value = null;
107
109
  });
@@ -156,8 +158,10 @@ window.addEventListener("popstate", async () => {
156
158
  const pagePath = getPagePath(window.location.href);
157
159
  const page = pages.has(pagePath) && await pages.get(pagePath);
158
160
  if (page) {
159
- renderPage(page);
160
- state.url = window.location.href;
161
+ batch(() => {
162
+ state.url = window.location.href;
163
+ renderPage(page);
164
+ });
161
165
  } else {
162
166
  window.location.reload();
163
167
  }
@@ -243,13 +247,15 @@ const { state, actions } = store("core/router", {
243
247
  }
244
248
  if (page && !page.initialData?.config?.["core/router"]?.clientNavigationDisabled) {
245
249
  yield importScriptModules(page.scriptModules);
246
- renderPage(page);
250
+ batch(() => {
251
+ state.url = href;
252
+ if (loadingAnimation) {
253
+ navigation.hasStarted = false;
254
+ navigation.hasFinished = true;
255
+ }
256
+ renderPage(page);
257
+ });
247
258
  window.history[options.replace ? "replaceState" : "pushState"]({}, "", href);
248
- state.url = href;
249
- if (loadingAnimation) {
250
- navigation.hasStarted = false;
251
- navigation.hasFinished = true;
252
- }
253
259
  if (screenReaderAnnouncement) {
254
260
  a11ySpeak("loaded");
255
261
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store, privateApis, getConfig } from '@wordpress/interactivity';\n\n/**\n * Internal dependencies\n */\nimport { preloadStyles, applyStyles, type StyleElement } from './assets/styles';\nimport {\n\tpreloadScriptModules,\n\timportScriptModules,\n\tmarkScriptModuleAsResolved,\n\ttype ScriptModuleLoad,\n} from './assets/script-modules';\n\nconst {\n\tgetRegionRootFragment,\n\tinitialVdom,\n\ttoVdom,\n\trender,\n\tparseServerData,\n\tpopulateServerData,\n\tbatch,\n\trouterRegions,\n\tcloneElement,\n} = privateApis(\n\t'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.'\n);\n\nconst regionAttr = `data-wp-router-region`;\nconst interactiveAttr = `data-wp-interactive`;\nconst regionsSelector = `[${ interactiveAttr }][${ regionAttr }], [${ interactiveAttr }] [${ interactiveAttr }][${ regionAttr }]`;\n\nexport interface NavigateOptions {\n\tforce?: boolean;\n\thtml?: string;\n\treplace?: boolean;\n\ttimeout?: number;\n\tloadingAnimation?: boolean;\n\tscreenReaderAnnouncement?: boolean;\n}\n\nexport interface PrefetchOptions {\n\tforce?: boolean;\n\thtml?: string;\n}\n\ninterface VdomParams {\n\tvdom?: typeof initialVdom;\n}\n\ninterface Page {\n\turl: string;\n\tregions: Record< string, any >;\n\tregionsToAttach: Record< string, string >;\n\tstyles: StyleElement[];\n\tscriptModules: ScriptModuleLoad[];\n\ttitle: string;\n\tinitialData: any;\n}\n\ntype PreparePage = (\n\turl: string,\n\tdom: Document,\n\tparams?: VdomParams\n) => Promise< Page >;\n\n// The cache of visited and prefetched pages, stylesheets and scripts.\nconst pages = new Map< string, Promise< Page | false > >();\n\n// Helper to remove domain and hash from the URL. We are only interesting in\n// caching the path and the query.\nconst getPagePath = ( url: string ) => {\n\tconst u = new URL( url, window.location.href );\n\treturn u.pathname + u.search;\n};\n\n/**\n * Parses the given region's directive.\n *\n * @param region Region element.\n * @return Data contained in the region directive value.\n */\nconst parseRegionAttribute = ( region: Element ) => {\n\tconst value = region.getAttribute( regionAttr );\n\ttry {\n\t\tconst { id, attachTo } = JSON.parse( value );\n\t\treturn { id, attachTo };\n\t} catch ( e ) {\n\t\treturn { id: value };\n\t}\n};\n\n/**\n * Clones the content of the router region vDOM passed as argument.\n *\n * The function creates a new VNode instance removing all priority levels up to\n * the one containing the router-region directive, which should have evaluated\n * in advance.\n *\n * @param vdom A router region's VNode.\n * @return The VNode for the passed router region's content.\n */\nconst cloneRouterRegionContent = ( vdom: any ) => {\n\tif ( ! vdom ) {\n\t\treturn vdom;\n\t}\n\tconst allPriorityLevels: string[][] = vdom.props.priorityLevels;\n\tconst routerRegionLevel = allPriorityLevels.findIndex( ( level ) =>\n\t\tlevel.includes( 'router-region' )\n\t);\n\tconst priorityLevels =\n\t\trouterRegionLevel !== -1\n\t\t\t? allPriorityLevels.slice( routerRegionLevel + 1 )\n\t\t\t: allPriorityLevels;\n\n\treturn priorityLevels.length > 0\n\t\t? cloneElement( vdom, {\n\t\t\t\t...vdom.props,\n\t\t\t\tpriorityLevels,\n\t\t } )\n\t\t: vdom.props.element;\n};\n\n/**\n * IDs of router regions with an `attachTo` property pointing to the same parent\n * element.\n */\nconst regionsToAttachByParent = new WeakMap< Element, string[] >();\n\n/**\n * Map of root fragments by parent element, used to render router regions with\n * the `attachTo` property. Those elements with the same parent are rendered\n * together in the corresponding root fragment.\n */\nconst rootFragmentsByParent = new WeakMap< Element, any >();\n\n/**\n * Fetches and prepares a page from a given URL.\n *\n * @param url The URL of the page to fetch.\n * @param options Options for the fetch operation.\n * @param options.html Optional HTML content. If provided, the function will use\n * this instead of fetching from the URL.\n * @return A Promise that resolves to the prepared page, or false if\n * there was an error during fetching or preparation.\n */\nconst fetchPage = async ( url: string, { html }: { html: string } ) => {\n\ttry {\n\t\tif ( ! html ) {\n\t\t\tconst res = await window.fetch( url );\n\t\t\tif ( res.status !== 200 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\thtml = await res.text();\n\t\t}\n\t\tconst dom = new window.DOMParser().parseFromString( html, 'text/html' );\n\t\treturn await preparePage( url, dom );\n\t} catch ( e ) {\n\t\treturn false;\n\t}\n};\n\n/**\n * Processes a DOM document to extract router regions and related resources.\n *\n * This function analyzes the provided DOM document and creates a virtual DOM\n * representation of all HTML regions marked with a `router-region` directive.\n * It also extracts and preloads associated styles and scripts to prepare for\n * rendering the page.\n *\n * @param url The URL associated with the page, used for asset\n * loading and caching.\n * @param dom The DOM document to process.\n * @param vdomParams Optional parameters for virtual DOM processing.\n * @param vdomParams.vdom An optional existing virtual DOM cache to check for\n * regions. If a region exists in this cache, it will be\n * reused instead of creating a new vDOM representation.\n * @return A Promise that resolves to a {@link Page} object\n * containing the virtual DOM for all router regions,\n * preloaded styles and scripts, page title, and initial\n * server-rendered data.\n */\nconst preparePage: PreparePage = async ( url, dom, { vdom } = {} ) => {\n\t// Remove all noscript elements as they're irrelevant when request is served via router.\n\t// This prevents browsers from extracting styles from noscript tags.\n\tdom.querySelectorAll( 'noscript' ).forEach( ( el ) => el.remove() );\n\n\tconst regions = {};\n\tconst regionsToAttach = {};\n\tdom.querySelectorAll( regionsSelector ).forEach( ( region ) => {\n\t\tconst { id, attachTo } = parseRegionAttribute( region );\n\n\t\tif ( region.parentElement.closest( `[${ regionAttr }]` ) ) {\n\t\t\tregions[ id ] = undefined;\n\t\t} else {\n\t\t\tregions[ id ] = vdom?.has( region )\n\t\t\t\t? vdom.get( region )\n\t\t\t\t: toVdom( region );\n\t\t}\n\n\t\tif ( attachTo ) {\n\t\t\tregionsToAttach[ id ] = attachTo;\n\t\t}\n\t} );\n\n\tconst title = dom.querySelector( 'title' )?.innerText;\n\tconst initialData = parseServerData( dom );\n\n\t// Wait for styles and modules to be ready.\n\tconst [ styles, scriptModules ] = await Promise.all( [\n\t\tPromise.all( preloadStyles( dom, url ) ),\n\t\tPromise.all( preloadScriptModules( dom ) ),\n\t] );\n\n\treturn {\n\t\tregions,\n\t\tregionsToAttach,\n\t\tstyles,\n\t\tscriptModules,\n\t\ttitle,\n\t\tinitialData,\n\t\turl,\n\t};\n};\n\n/**\n * Renders a page by applying styles, populating server data, rendering regions,\n * and updating the document title.\n *\n * @param page The {@link Page} object to render.\n */\nconst renderPage = ( page: Page ) => {\n\tapplyStyles( page.styles );\n\n\t// Clone regionsToAttach.\n\tconst regionsToAttach = { ...page.regionsToAttach };\n\n\tbatch( () => {\n\t\t// Update server data.\n\t\tpopulateServerData( page.initialData );\n\n\t\t// Reset all router regions before setting the actual values.\n\t\t( routerRegions as Map< string, any > ).forEach( ( signal ) => {\n\t\t\tsignal.value = null;\n\t\t} );\n\n\t\t//Init regions with attachTo that don't exist yet.\n\t\tconst parentsToUpdate = new Set< Element >();\n\t\tfor ( const id in regionsToAttach ) {\n\t\t\tconst parent = document.querySelector( regionsToAttach[ id ] );\n\t\t\tif ( ! regionsToAttachByParent.has( parent ) ) {\n\t\t\t\tregionsToAttachByParent.set( parent, [] );\n\t\t\t}\n\t\t\tconst regions = regionsToAttachByParent.get( parent );\n\t\t\tif ( ! regions.includes( id ) ) {\n\t\t\t\tregions.push( id );\n\t\t\t\tparentsToUpdate.add( parent );\n\t\t\t}\n\t\t}\n\n\t\t//Update all existing regions.\n\t\tfor ( const id in page.regions ) {\n\t\t\tif ( routerRegions.has( id ) ) {\n\t\t\t\trouterRegions.get( id ).value = cloneRouterRegionContent(\n\t\t\t\t\tpage.regions[ id ]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Render regions attached to the same parent in the same fragment.\n\t\tparentsToUpdate.forEach( ( parent ) => {\n\t\t\tconst ids = regionsToAttachByParent.get( parent );\n\t\t\tconst vdoms = ids.map( ( id ) => page.regions[ id ] );\n\n\t\t\tif ( ! rootFragmentsByParent.has( parent ) ) {\n\t\t\t\tconst regions = vdoms.map( ( { props, type } ) => {\n\t\t\t\t\tconst elementType =\n\t\t\t\t\t\ttypeof type === 'function' ? props.type : type;\n\n\t\t\t\t\t// Create an element with the obtained type where the region will be\n\t\t\t\t\t// rendered. The type should match the one of the root vnode.\n\t\t\t\t\tconst region = document.createElement( elementType );\n\t\t\t\t\tparent.appendChild( region );\n\t\t\t\t\treturn region;\n\t\t\t\t} );\n\t\t\t\trootFragmentsByParent.set(\n\t\t\t\t\tparent,\n\t\t\t\t\tgetRegionRootFragment( regions )\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst fragment = rootFragmentsByParent.get( parent );\n\t\t\trender( vdoms, fragment );\n\t\t} );\n\t} );\n\n\tif ( page.title ) {\n\t\tdocument.title = page.title;\n\t}\n};\n\n/**\n * Loads the given page forcing a full page reload.\n *\n * The function returns a promise that won't resolve, useful to prevent any\n * potential feedback indicating that the navigation has finished while the new\n * page is being loaded.\n *\n * @param href The page href.\n * @return Promise that never resolves.\n */\nconst forcePageReload = ( href: string ) => {\n\twindow.location.assign( href );\n\treturn new Promise( () => {} );\n};\n\n// Listen to the back and forward buttons and restore the page if it's in the\n// cache.\nwindow.addEventListener( 'popstate', async () => {\n\tconst pagePath = getPagePath( window.location.href ); // Remove hash.\n\tconst page = pages.has( pagePath ) && ( await pages.get( pagePath ) );\n\tif ( page ) {\n\t\trenderPage( page );\n\t\t// Update the URL in the state.\n\t\tstate.url = window.location.href;\n\t} else {\n\t\twindow.location.reload();\n\t}\n} );\n\n// Initialize the router and cache the initial page using the initial vDOM.\nwindow.document\n\t.querySelectorAll< HTMLScriptElement >( 'script[type=module][src]' )\n\t.forEach( ( { src } ) => markScriptModuleAsResolved( src ) );\npages.set(\n\tgetPagePath( window.location.href ),\n\tPromise.resolve(\n\t\tpreparePage( getPagePath( window.location.href ), document, {\n\t\t\tvdom: initialVdom,\n\t\t} )\n\t)\n);\n\n// Variable to store the current navigation.\nlet navigatingTo = '';\n\nlet hasLoadedNavigationTextsData = false;\nconst navigationTexts = {\n\tloading: 'Loading page, please wait.',\n\tloaded: 'Page Loaded.',\n};\n\ninterface Store {\n\tstate: {\n\t\turl: string;\n\t\tnavigation: {\n\t\t\thasStarted: boolean;\n\t\t\thasFinished: boolean;\n\t\t};\n\t};\n\tactions: {\n\t\tnavigate: (\n\t\t\thref: string,\n\t\t\toptions?: NavigateOptions\n\t\t) => Promise< void >;\n\t\tprefetch: ( url: string, options?: PrefetchOptions ) => Promise< void >;\n\t};\n}\n\nexport const { state, actions } = store< Store >( 'core/router', {\n\tstate: {\n\t\turl: window.location.href,\n\t\tnavigation: {\n\t\t\thasStarted: false,\n\t\t\thasFinished: false,\n\t\t},\n\t},\n\tactions: {\n\t\t/**\n\t\t * Navigates to the specified page.\n\t\t *\n\t\t * This function normalizes the passed href, fetches the page HTML if\n\t\t * needed, and updates any interactive regions whose contents have\n\t\t * changed. It also creates a new entry in the browser session history.\n\t\t *\n\t\t * @param href The page href.\n\t\t * @param [options] Options object.\n\t\t * @param [options.force] If true, it forces re-fetching the URL.\n\t\t * @param [options.html] HTML string to be used instead of fetching the requested URL.\n\t\t * @param [options.replace] If true, it replaces the current entry in the browser session history.\n\t\t * @param [options.timeout] Time until the navigation is aborted, in milliseconds. Default is 10000.\n\t\t * @param [options.loadingAnimation] Whether an animation should be shown while navigating. Default to `true`.\n\t\t * @param [options.screenReaderAnnouncement] Whether a message for screen readers should be announced while navigating. Default to `true`.\n\t\t *\n\t\t * @return Promise that resolves once the navigation is completed or aborted.\n\t\t */\n\t\t*navigate( href: string, options: NavigateOptions = {} ) {\n\t\t\tconst { clientNavigationDisabled } = getConfig();\n\t\t\tif ( clientNavigationDisabled ) {\n\t\t\t\tyield forcePageReload( href );\n\t\t\t}\n\n\t\t\tconst pagePath = getPagePath( href );\n\t\t\tconst { navigation } = state;\n\t\t\tconst {\n\t\t\t\tloadingAnimation = true,\n\t\t\t\tscreenReaderAnnouncement = true,\n\t\t\t\ttimeout = 10000,\n\t\t\t} = options;\n\n\t\t\tnavigatingTo = href;\n\t\t\tactions.prefetch( pagePath, options );\n\n\t\t\t// Create a promise that resolves when the specified timeout ends.\n\t\t\t// The timeout value is 10 seconds by default.\n\t\t\tconst timeoutPromise = new Promise< void >( ( resolve ) =>\n\t\t\t\tsetTimeout( resolve, timeout )\n\t\t\t);\n\n\t\t\t// Don't update the navigation status immediately, wait 400 ms.\n\t\t\tconst loadingTimeout = setTimeout( () => {\n\t\t\t\tif ( navigatingTo !== href ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( loadingAnimation ) {\n\t\t\t\t\tnavigation.hasStarted = true;\n\t\t\t\t\tnavigation.hasFinished = false;\n\t\t\t\t}\n\t\t\t\tif ( screenReaderAnnouncement ) {\n\t\t\t\t\ta11ySpeak( 'loading' );\n\t\t\t\t}\n\t\t\t}, 400 );\n\n\t\t\tconst page = yield Promise.race( [\n\t\t\t\tpages.get( pagePath ),\n\t\t\t\ttimeoutPromise,\n\t\t\t] );\n\n\t\t\t// Dismiss loading message if it hasn't been added yet.\n\t\t\tclearTimeout( loadingTimeout );\n\n\t\t\t// Once the page is fetched, the destination URL could have changed\n\t\t\t// (e.g., by clicking another link in the meantime). If so, bail\n\t\t\t// out, and let the newer execution to update the HTML.\n\t\t\tif ( navigatingTo !== href ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tpage &&\n\t\t\t\t! page.initialData?.config?.[ 'core/router' ]\n\t\t\t\t\t?.clientNavigationDisabled\n\t\t\t) {\n\t\t\t\tyield importScriptModules( page.scriptModules );\n\t\t\t\trenderPage( page );\n\t\t\t\twindow.history[\n\t\t\t\t\toptions.replace ? 'replaceState' : 'pushState'\n\t\t\t\t]( {}, '', href );\n\n\t\t\t\t// Update the URL in the state.\n\t\t\t\tstate.url = href;\n\n\t\t\t\t// Update the navigation status once the the new page rendering\n\t\t\t\t// has been completed.\n\t\t\t\tif ( loadingAnimation ) {\n\t\t\t\t\tnavigation.hasStarted = false;\n\t\t\t\t\tnavigation.hasFinished = true;\n\t\t\t\t}\n\n\t\t\t\tif ( screenReaderAnnouncement ) {\n\t\t\t\t\ta11ySpeak( 'loaded' );\n\t\t\t\t}\n\n\t\t\t\t// Scroll to the anchor if exits in the link.\n\t\t\t\tconst { hash } = new URL( href, window.location.href );\n\t\t\t\tif ( hash ) {\n\t\t\t\t\tdocument.querySelector( hash )?.scrollIntoView();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tyield forcePageReload( href );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Prefetches the page with the passed URL.\n\t\t *\n\t\t * The function normalizes the URL and stores internally the fetch\n\t\t * promise, to avoid triggering a second fetch for an ongoing request.\n\t\t *\n\t\t * @param url The page URL.\n\t\t * @param [options] Options object.\n\t\t * @param [options.force] Force fetching the URL again.\n\t\t * @param [options.html] HTML string to be used instead of fetching the requested URL.\n\t\t *\n\t\t * @return Promise that resolves once the page has been fetched.\n\t\t */\n\t\t*prefetch( url: string, options: PrefetchOptions = {} ) {\n\t\t\tconst { clientNavigationDisabled } = getConfig();\n\t\t\tif ( clientNavigationDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst pagePath = getPagePath( url );\n\t\t\tif ( options.force || ! pages.has( pagePath ) ) {\n\t\t\t\tpages.set(\n\t\t\t\t\tpagePath,\n\t\t\t\t\tfetchPage( pagePath, { html: options.html } )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tyield pages.get( pagePath );\n\t\t},\n\t},\n} );\n\n/**\n * Announces a message to screen readers.\n *\n * This is a wrapper around the `@wordpress/a11y` package's `speak` function. It handles importing\n * the package on demand and should be used instead of calling `a11y.speak` directly.\n *\n * @param messageKey The message to be announced by assistive technologies.\n */\nfunction a11ySpeak( messageKey: keyof typeof navigationTexts ) {\n\tif ( ! hasLoadedNavigationTextsData ) {\n\t\thasLoadedNavigationTextsData = true;\n\t\tconst content = document.getElementById(\n\t\t\t'wp-script-module-data-@wordpress/interactivity-router'\n\t\t)?.textContent;\n\t\tif ( content ) {\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse( content );\n\t\t\t\tif ( typeof parsed?.i18n?.loading === 'string' ) {\n\t\t\t\t\tnavigationTexts.loading = parsed.i18n.loading;\n\t\t\t\t}\n\t\t\t\tif ( typeof parsed?.i18n?.loaded === 'string' ) {\n\t\t\t\t\tnavigationTexts.loaded = parsed.i18n.loaded;\n\t\t\t\t}\n\t\t\t} catch {}\n\t\t} else {\n\t\t\t// Fallback to localized strings from Interactivity API state.\n\t\t\t// @todo This block is for Core < 6.7.0. Remove when support is dropped.\n\n\t\t\t// @ts-expect-error\n\t\t\tif ( state.navigation.texts?.loading ) {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnavigationTexts.loading = state.navigation.texts.loading;\n\t\t\t}\n\t\t\t// @ts-expect-error\n\t\t\tif ( state.navigation.texts?.loaded ) {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnavigationTexts.loaded = state.navigation.texts.loaded;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst message = navigationTexts[ messageKey ];\n\n\timport( '@wordpress/a11y' ).then(\n\t\t( { speak } ) => speak( message ),\n\t\t// Ignore failures to load the a11y module.\n\t\t() => {}\n\t);\n}\n"],
5
- "mappings": "AAGA,SAAS,OAAO,aAAa,iBAAiB;AAK9C,SAAS,eAAe,mBAAsC;AAC9D;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OAEM;AAEP,MAAM;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,IAAI;AAAA,EACH;AACD;AAEA,MAAM,aAAa;AACnB,MAAM,kBAAkB;AACxB,MAAM,kBAAkB,IAAK,eAAgB,KAAM,UAAW,OAAQ,eAAgB,MAAO,eAAgB,KAAM,UAAW;AAqC9H,MAAM,QAAQ,oBAAI,IAAuC;AAIzD,MAAM,cAAc,CAAE,QAAiB;AACtC,QAAM,IAAI,IAAI,IAAK,KAAK,OAAO,SAAS,IAAK;AAC7C,SAAO,EAAE,WAAW,EAAE;AACvB;AAQA,MAAM,uBAAuB,CAAE,WAAqB;AACnD,QAAM,QAAQ,OAAO,aAAc,UAAW;AAC9C,MAAI;AACH,UAAM,EAAE,IAAI,SAAS,IAAI,KAAK,MAAO,KAAM;AAC3C,WAAO,EAAE,IAAI,SAAS;AAAA,EACvB,SAAU,GAAI;AACb,WAAO,EAAE,IAAI,MAAM;AAAA,EACpB;AACD;AAYA,MAAM,2BAA2B,CAAE,SAAe;AACjD,MAAK,CAAE,MAAO;AACb,WAAO;AAAA,EACR;AACA,QAAM,oBAAgC,KAAK,MAAM;AACjD,QAAM,oBAAoB,kBAAkB;AAAA,IAAW,CAAE,UACxD,MAAM,SAAU,eAAgB;AAAA,EACjC;AACA,QAAM,iBACL,sBAAsB,KACnB,kBAAkB,MAAO,oBAAoB,CAAE,IAC/C;AAEJ,SAAO,eAAe,SAAS,IAC5B,aAAc,MAAM;AAAA,IACpB,GAAG,KAAK;AAA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UAAK,MAAM,WAAW,OAAO,QAAS;AAErC,wBAAgB,SAAS,MAAM,WAAW,MAAM;AAAA,MACjD;AAAA,IACD;AAAA,EACD;AAEA,QAAM,UAAU,gBAAiB,UAAW;AAE5C,SAAQ,iBAAkB,EAAE;AAAA,IAC3B,CAAE,EAAE,MAAM,MAAO,MAAO,OAAQ;AAAA;AAAA,IAEhC,MAAM;AAAA,IAAC;AAAA,EACR;AACD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store, privateApis, getConfig } from '@wordpress/interactivity';\n\n/**\n * Internal dependencies\n */\nimport { preloadStyles, applyStyles, type StyleElement } from './assets/styles';\nimport {\n\tpreloadScriptModules,\n\timportScriptModules,\n\tmarkScriptModuleAsResolved,\n\ttype ScriptModuleLoad,\n} from './assets/script-modules';\n\nconst {\n\tgetRegionRootFragment,\n\tinitialVdom,\n\ttoVdom,\n\trender,\n\tparseServerData,\n\tpopulateServerData,\n\tbatch,\n\trouterRegions,\n\tcloneElement,\n\tnavigationSignal,\n} = privateApis(\n\t'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.'\n);\n\nconst regionAttr = `data-wp-router-region`;\nconst interactiveAttr = `data-wp-interactive`;\nconst regionsSelector = `[${ interactiveAttr }][${ regionAttr }], [${ interactiveAttr }] [${ interactiveAttr }][${ regionAttr }]`;\n\nexport interface NavigateOptions {\n\tforce?: boolean;\n\thtml?: string;\n\treplace?: boolean;\n\ttimeout?: number;\n\tloadingAnimation?: boolean;\n\tscreenReaderAnnouncement?: boolean;\n}\n\nexport interface PrefetchOptions {\n\tforce?: boolean;\n\thtml?: string;\n}\n\ninterface VdomParams {\n\tvdom?: typeof initialVdom;\n}\n\ninterface Page {\n\turl: string;\n\tregions: Record< string, any >;\n\tregionsToAttach: Record< string, string >;\n\tstyles: StyleElement[];\n\tscriptModules: ScriptModuleLoad[];\n\ttitle: string;\n\tinitialData: any;\n}\n\ntype PreparePage = (\n\turl: string,\n\tdom: Document,\n\tparams?: VdomParams\n) => Promise< Page >;\n\n// The cache of visited and prefetched pages, stylesheets and scripts.\nconst pages = new Map< string, Promise< Page | false > >();\n\n// Helper to remove domain and hash from the URL. We are only interesting in\n// caching the path and the query.\nconst getPagePath = ( url: string ) => {\n\tconst u = new URL( url, window.location.href );\n\treturn u.pathname + u.search;\n};\n\n/**\n * Parses the given region's directive.\n *\n * @param region Region element.\n * @return Data contained in the region directive value.\n */\nconst parseRegionAttribute = ( region: Element ) => {\n\tconst value = region.getAttribute( regionAttr );\n\ttry {\n\t\tconst { id, attachTo } = JSON.parse( value );\n\t\treturn { id, attachTo };\n\t} catch ( e ) {\n\t\treturn { id: value };\n\t}\n};\n\n/**\n * Clones the content of the router region vDOM passed as argument.\n *\n * The function creates a new VNode instance removing all priority levels up to\n * the one containing the router-region directive, which should have evaluated\n * in advance.\n *\n * @param vdom A router region's VNode.\n * @return The VNode for the passed router region's content.\n */\nconst cloneRouterRegionContent = ( vdom: any ) => {\n\tif ( ! vdom ) {\n\t\treturn vdom;\n\t}\n\tconst allPriorityLevels: string[][] = vdom.props.priorityLevels;\n\tconst routerRegionLevel = allPriorityLevels.findIndex( ( level ) =>\n\t\tlevel.includes( 'router-region' )\n\t);\n\tconst priorityLevels =\n\t\trouterRegionLevel !== -1\n\t\t\t? allPriorityLevels.slice( routerRegionLevel + 1 )\n\t\t\t: allPriorityLevels;\n\n\treturn priorityLevels.length > 0\n\t\t? cloneElement( vdom, {\n\t\t\t\t...vdom.props,\n\t\t\t\tpriorityLevels,\n\t\t } )\n\t\t: vdom.props.element;\n};\n\n/**\n * IDs of router regions with an `attachTo` property pointing to the same parent\n * element.\n */\nconst regionsToAttachByParent = new WeakMap< Element, string[] >();\n\n/**\n * Map of root fragments by parent element, used to render router regions with\n * the `attachTo` property. Those elements with the same parent are rendered\n * together in the corresponding root fragment.\n */\nconst rootFragmentsByParent = new WeakMap< Element, any >();\n\n/**\n * Fetches and prepares a page from a given URL.\n *\n * @param url The URL of the page to fetch.\n * @param options Options for the fetch operation.\n * @param options.html Optional HTML content. If provided, the function will use\n * this instead of fetching from the URL.\n * @return A Promise that resolves to the prepared page, or false if\n * there was an error during fetching or preparation.\n */\nconst fetchPage = async ( url: string, { html }: { html: string } ) => {\n\ttry {\n\t\tif ( ! html ) {\n\t\t\tconst res = await window.fetch( url );\n\t\t\tif ( res.status !== 200 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\thtml = await res.text();\n\t\t}\n\t\tconst dom = new window.DOMParser().parseFromString( html, 'text/html' );\n\t\treturn await preparePage( url, dom );\n\t} catch ( e ) {\n\t\treturn false;\n\t}\n};\n\n/**\n * Processes a DOM document to extract router regions and related resources.\n *\n * This function analyzes the provided DOM document and creates a virtual DOM\n * representation of all HTML regions marked with a `router-region` directive.\n * It also extracts and preloads associated styles and scripts to prepare for\n * rendering the page.\n *\n * @param url The URL associated with the page, used for asset\n * loading and caching.\n * @param dom The DOM document to process.\n * @param vdomParams Optional parameters for virtual DOM processing.\n * @param vdomParams.vdom An optional existing virtual DOM cache to check for\n * regions. If a region exists in this cache, it will be\n * reused instead of creating a new vDOM representation.\n * @return A Promise that resolves to a {@link Page} object\n * containing the virtual DOM for all router regions,\n * preloaded styles and scripts, page title, and initial\n * server-rendered data.\n */\nconst preparePage: PreparePage = async ( url, dom, { vdom } = {} ) => {\n\t// Remove all noscript elements as they're irrelevant when request is served via router.\n\t// This prevents browsers from extracting styles from noscript tags.\n\tdom.querySelectorAll( 'noscript' ).forEach( ( el ) => el.remove() );\n\n\tconst regions = {};\n\tconst regionsToAttach = {};\n\tdom.querySelectorAll( regionsSelector ).forEach( ( region ) => {\n\t\tconst { id, attachTo } = parseRegionAttribute( region );\n\n\t\tif ( region.parentElement.closest( `[${ regionAttr }]` ) ) {\n\t\t\tregions[ id ] = undefined;\n\t\t} else {\n\t\t\tregions[ id ] = vdom?.has( region )\n\t\t\t\t? vdom.get( region )\n\t\t\t\t: toVdom( region );\n\t\t}\n\n\t\tif ( attachTo ) {\n\t\t\tregionsToAttach[ id ] = attachTo;\n\t\t}\n\t} );\n\n\tconst title = dom.querySelector( 'title' )?.innerText;\n\tconst initialData = parseServerData( dom );\n\n\t// Wait for styles and modules to be ready.\n\tconst [ styles, scriptModules ] = await Promise.all( [\n\t\tPromise.all( preloadStyles( dom, url ) ),\n\t\tPromise.all( preloadScriptModules( dom ) ),\n\t] );\n\n\treturn {\n\t\tregions,\n\t\tregionsToAttach,\n\t\tstyles,\n\t\tscriptModules,\n\t\ttitle,\n\t\tinitialData,\n\t\turl,\n\t};\n};\n\n/**\n * Renders a page by applying styles, populating server data, rendering regions,\n * and updating the document title.\n *\n * @param page The {@link Page} object to render.\n */\nconst renderPage = ( page: Page ) => {\n\tapplyStyles( page.styles );\n\n\t// Clone regionsToAttach.\n\tconst regionsToAttach = { ...page.regionsToAttach };\n\n\tbatch( () => {\n\t\t// Updates the server data.\n\t\tpopulateServerData( page.initialData );\n\n\t\t// Triggers navigation invalidations (`getServerState` and\n\t\t// `getServerContext`).\n\t\tnavigationSignal.value += 1;\n\n\t\t// Resets all router regions before setting the actual values.\n\t\t( routerRegions as Map< string, any > ).forEach( ( signal ) => {\n\t\t\tsignal.value = null;\n\t\t} );\n\n\t\t// Inits regions with attachTo that don't exist yet.\n\t\tconst parentsToUpdate = new Set< Element >();\n\t\tfor ( const id in regionsToAttach ) {\n\t\t\tconst parent = document.querySelector( regionsToAttach[ id ] );\n\t\t\tif ( ! regionsToAttachByParent.has( parent ) ) {\n\t\t\t\tregionsToAttachByParent.set( parent, [] );\n\t\t\t}\n\t\t\tconst regions = regionsToAttachByParent.get( parent );\n\t\t\tif ( ! regions.includes( id ) ) {\n\t\t\t\tregions.push( id );\n\t\t\t\tparentsToUpdate.add( parent );\n\t\t\t}\n\t\t}\n\n\t\t// Updates all existing regions.\n\t\tfor ( const id in page.regions ) {\n\t\t\tif ( routerRegions.has( id ) ) {\n\t\t\t\trouterRegions.get( id ).value = cloneRouterRegionContent(\n\t\t\t\t\tpage.regions[ id ]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Renders regions attached to the same parent in the same fragment.\n\t\tparentsToUpdate.forEach( ( parent ) => {\n\t\t\tconst ids = regionsToAttachByParent.get( parent );\n\t\t\tconst vdoms = ids.map( ( id ) => page.regions[ id ] );\n\n\t\t\tif ( ! rootFragmentsByParent.has( parent ) ) {\n\t\t\t\tconst regions = vdoms.map( ( { props, type } ) => {\n\t\t\t\t\tconst elementType =\n\t\t\t\t\t\ttypeof type === 'function' ? props.type : type;\n\n\t\t\t\t\t// Creates an element with the obtained type where the\n\t\t\t\t\t// region will be rendered. The type should match the one of\n\t\t\t\t\t// the root vnode.\n\t\t\t\t\tconst region = document.createElement( elementType );\n\t\t\t\t\tparent.appendChild( region );\n\t\t\t\t\treturn region;\n\t\t\t\t} );\n\t\t\t\trootFragmentsByParent.set(\n\t\t\t\t\tparent,\n\t\t\t\t\tgetRegionRootFragment( regions )\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst fragment = rootFragmentsByParent.get( parent );\n\t\t\trender( vdoms, fragment );\n\t\t} );\n\t} );\n\n\tif ( page.title ) {\n\t\tdocument.title = page.title;\n\t}\n};\n\n/**\n * Loads the given page forcing a full page reload.\n *\n * The function returns a promise that won't resolve, useful to prevent any\n * potential feedback indicating that the navigation has finished while the new\n * page is being loaded.\n *\n * @param href The page href.\n * @return Promise that never resolves.\n */\nconst forcePageReload = ( href: string ) => {\n\twindow.location.assign( href );\n\treturn new Promise( () => {} );\n};\n\n// Listen to the back and forward buttons and restore the page if it's in the\n// cache.\nwindow.addEventListener( 'popstate', async () => {\n\tconst pagePath = getPagePath( window.location.href ); // Remove hash.\n\tconst page = pages.has( pagePath ) && ( await pages.get( pagePath ) );\n\tif ( page ) {\n\t\tbatch( () => {\n\t\t\tstate.url = window.location.href;\n\t\t\trenderPage( page );\n\t\t} );\n\t} else {\n\t\twindow.location.reload();\n\t}\n} );\n\n// Initialize the router and cache the initial page using the initial vDOM.\nwindow.document\n\t.querySelectorAll< HTMLScriptElement >( 'script[type=module][src]' )\n\t.forEach( ( { src } ) => markScriptModuleAsResolved( src ) );\npages.set(\n\tgetPagePath( window.location.href ),\n\tPromise.resolve(\n\t\tpreparePage( getPagePath( window.location.href ), document, {\n\t\t\tvdom: initialVdom,\n\t\t} )\n\t)\n);\n\n// Variable to store the current navigation.\nlet navigatingTo = '';\n\nlet hasLoadedNavigationTextsData = false;\nconst navigationTexts = {\n\tloading: 'Loading page, please wait.',\n\tloaded: 'Page Loaded.',\n};\n\ninterface Store {\n\tstate: {\n\t\turl: string;\n\t\tnavigation: {\n\t\t\thasStarted: boolean;\n\t\t\thasFinished: boolean;\n\t\t};\n\t};\n\tactions: {\n\t\tnavigate: (\n\t\t\thref: string,\n\t\t\toptions?: NavigateOptions\n\t\t) => Promise< void >;\n\t\tprefetch: ( url: string, options?: PrefetchOptions ) => Promise< void >;\n\t};\n}\n\nexport const { state, actions } = store< Store >( 'core/router', {\n\tstate: {\n\t\turl: window.location.href,\n\t\tnavigation: {\n\t\t\thasStarted: false,\n\t\t\thasFinished: false,\n\t\t},\n\t},\n\tactions: {\n\t\t/**\n\t\t * Navigates to the specified page.\n\t\t *\n\t\t * This function normalizes the passed href, fetches the page HTML if\n\t\t * needed, and updates any interactive regions whose contents have\n\t\t * changed. It also creates a new entry in the browser session history.\n\t\t *\n\t\t * @param href The page href.\n\t\t * @param [options] Options object.\n\t\t * @param [options.force] If true, it forces re-fetching the URL.\n\t\t * @param [options.html] HTML string to be used instead of fetching the requested URL.\n\t\t * @param [options.replace] If true, it replaces the current entry in the browser session history.\n\t\t * @param [options.timeout] Time until the navigation is aborted, in milliseconds. Default is 10000.\n\t\t * @param [options.loadingAnimation] Whether an animation should be shown while navigating. Default to `true`.\n\t\t * @param [options.screenReaderAnnouncement] Whether a message for screen readers should be announced while navigating. Default to `true`.\n\t\t *\n\t\t * @return Promise that resolves once the navigation is completed or aborted.\n\t\t */\n\t\t*navigate( href: string, options: NavigateOptions = {} ) {\n\t\t\tconst { clientNavigationDisabled } = getConfig();\n\t\t\tif ( clientNavigationDisabled ) {\n\t\t\t\tyield forcePageReload( href );\n\t\t\t}\n\n\t\t\tconst pagePath = getPagePath( href );\n\t\t\tconst { navigation } = state;\n\t\t\tconst {\n\t\t\t\tloadingAnimation = true,\n\t\t\t\tscreenReaderAnnouncement = true,\n\t\t\t\ttimeout = 10000,\n\t\t\t} = options;\n\n\t\t\tnavigatingTo = href;\n\t\t\tactions.prefetch( pagePath, options );\n\n\t\t\t// Creates a promise that resolves when the specified timeout ends.\n\t\t\t// The timeout value is 10 seconds by default.\n\t\t\tconst timeoutPromise = new Promise< void >( ( resolve ) =>\n\t\t\t\tsetTimeout( resolve, timeout )\n\t\t\t);\n\n\t\t\t// Doesn't update the navigation status immediately, wait 400 ms.\n\t\t\tconst loadingTimeout = setTimeout( () => {\n\t\t\t\tif ( navigatingTo !== href ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( loadingAnimation ) {\n\t\t\t\t\tnavigation.hasStarted = true;\n\t\t\t\t\tnavigation.hasFinished = false;\n\t\t\t\t}\n\t\t\t\tif ( screenReaderAnnouncement ) {\n\t\t\t\t\ta11ySpeak( 'loading' );\n\t\t\t\t}\n\t\t\t}, 400 );\n\n\t\t\tconst page = yield Promise.race( [\n\t\t\t\tpages.get( pagePath ),\n\t\t\t\ttimeoutPromise,\n\t\t\t] );\n\n\t\t\t// Dismisses loading message if it hasn't been added yet.\n\t\t\tclearTimeout( loadingTimeout );\n\n\t\t\t// Once the page is fetched, the destination URL could have changed\n\t\t\t// (e.g., by clicking another link in the meantime). If so, bail\n\t\t\t// out, and let the newer execution to update the HTML.\n\t\t\tif ( navigatingTo !== href ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tpage &&\n\t\t\t\t! page.initialData?.config?.[ 'core/router' ]\n\t\t\t\t\t?.clientNavigationDisabled\n\t\t\t) {\n\t\t\t\tyield importScriptModules( page.scriptModules );\n\n\t\t\t\tbatch( () => {\n\t\t\t\t\t// Updates the URL in the state.\n\t\t\t\t\tstate.url = href;\n\n\t\t\t\t\t// Updates the navigation status once the the new page rendering\n\t\t\t\t\t// has been completed.\n\t\t\t\t\tif ( loadingAnimation ) {\n\t\t\t\t\t\tnavigation.hasStarted = false;\n\t\t\t\t\t\tnavigation.hasFinished = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Renders the new page.\n\t\t\t\t\trenderPage( page );\n\t\t\t\t} );\n\n\t\t\t\twindow.history[\n\t\t\t\t\toptions.replace ? 'replaceState' : 'pushState'\n\t\t\t\t]( {}, '', href );\n\n\t\t\t\tif ( screenReaderAnnouncement ) {\n\t\t\t\t\ta11ySpeak( 'loaded' );\n\t\t\t\t}\n\n\t\t\t\t// Scroll to the anchor if exits in the link.\n\t\t\t\tconst { hash } = new URL( href, window.location.href );\n\t\t\t\tif ( hash ) {\n\t\t\t\t\tdocument.querySelector( hash )?.scrollIntoView();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tyield forcePageReload( href );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Prefetches the page with the passed URL.\n\t\t *\n\t\t * The function normalizes the URL and stores internally the fetch\n\t\t * promise, to avoid triggering a second fetch for an ongoing request.\n\t\t *\n\t\t * @param url The page URL.\n\t\t * @param [options] Options object.\n\t\t * @param [options.force] Force fetching the URL again.\n\t\t * @param [options.html] HTML string to be used instead of fetching the requested URL.\n\t\t *\n\t\t * @return Promise that resolves once the page has been fetched.\n\t\t */\n\t\t*prefetch( url: string, options: PrefetchOptions = {} ) {\n\t\t\tconst { clientNavigationDisabled } = getConfig();\n\t\t\tif ( clientNavigationDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst pagePath = getPagePath( url );\n\t\t\tif ( options.force || ! pages.has( pagePath ) ) {\n\t\t\t\tpages.set(\n\t\t\t\t\tpagePath,\n\t\t\t\t\tfetchPage( pagePath, { html: options.html } )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tyield pages.get( pagePath );\n\t\t},\n\t},\n} );\n\n/**\n * Announces a message to screen readers.\n *\n * This is a wrapper around the `@wordpress/a11y` package's `speak` function. It handles importing\n * the package on demand and should be used instead of calling `a11y.speak` directly.\n *\n * @param messageKey The message to be announced by assistive technologies.\n */\nfunction a11ySpeak( messageKey: keyof typeof navigationTexts ) {\n\tif ( ! hasLoadedNavigationTextsData ) {\n\t\thasLoadedNavigationTextsData = true;\n\t\tconst content = document.getElementById(\n\t\t\t'wp-script-module-data-@wordpress/interactivity-router'\n\t\t)?.textContent;\n\t\tif ( content ) {\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse( content );\n\t\t\t\tif ( typeof parsed?.i18n?.loading === 'string' ) {\n\t\t\t\t\tnavigationTexts.loading = parsed.i18n.loading;\n\t\t\t\t}\n\t\t\t\tif ( typeof parsed?.i18n?.loaded === 'string' ) {\n\t\t\t\t\tnavigationTexts.loaded = parsed.i18n.loaded;\n\t\t\t\t}\n\t\t\t} catch {}\n\t\t} else {\n\t\t\t// Fallback to localized strings from Interactivity API state.\n\t\t\t// @todo This block is for Core < 6.7.0. Remove when support is dropped.\n\n\t\t\t// @ts-expect-error\n\t\t\tif ( state.navigation.texts?.loading ) {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnavigationTexts.loading = state.navigation.texts.loading;\n\t\t\t}\n\t\t\t// @ts-expect-error\n\t\t\tif ( state.navigation.texts?.loaded ) {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnavigationTexts.loaded = state.navigation.texts.loaded;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst message = navigationTexts[ messageKey ];\n\n\timport( '@wordpress/a11y' ).then(\n\t\t( { speak } ) => speak( message ),\n\t\t// Ignore failures to load the a11y module.\n\t\t() => {}\n\t);\n}\n"],
5
+ "mappings": "AAGA,SAAS,OAAO,aAAa,iBAAiB;AAK9C,SAAS,eAAe,mBAAsC;AAC9D;AAAA,EACC;AAA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EA,QAAM,UAAU,gBAAiB,UAAW;AAE5C,SAAQ,iBAAkB,EAAE;AAAA,IAC3B,CAAE,EAAE,MAAM,MAAO,MAAO,OAAQ;AAAA;AAAA,IAEhC,MAAM;AAAA,IAAC;AAAA,EACR;AACD;",
6
6
  "names": []
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"script-modules.d.ts","sourceRoot":"","sources":["../../src/assets/script-modules.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAIN,KAAK,UAAU,EACf,MAAM,qBAAqB,CAAC;AAQ7B;;;GAGG;AACH,eAAO,MAAM,0BAA0B,QAAU,MAAM,SAEtD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAU,QAAQ,0BA0BlD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,YAAc,gBAAgB,EAAE,uBACE,CAAC;AAEnE,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC"}
1
+ {"version":3,"file":"script-modules.d.ts","sourceRoot":"","sources":["../../src/assets/script-modules.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAIN,KAAK,UAAU,EACf,MAAM,qBAAqB,CAAC;AAQ7B;;;GAGG;AACH,eAAO,MAAM,0BAA0B,QAAU,MAAM,SAEtD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAU,QAAQ,0BAqClD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,YAAc,gBAAgB,EAAE,uBACE,CAAC;AAEnE,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkCA,MAAM,WAAW,eAAe;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAA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ordpress/interactivity-router",
3
- "version": "2.32.1-next.b8c8708f3.0",
3
+ "version": "2.33.0",
4
4
  "description": "Package that exposes state and actions from the `core/router` store, part of the Interactivity API.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -39,12 +39,12 @@
39
39
  },
40
40
  "types": "build-types",
41
41
  "dependencies": {
42
- "@wordpress/a11y": "^4.32.1-next.b8c8708f3.0",
43
- "@wordpress/interactivity": "^6.33.1-next.b8c8708f3.0",
42
+ "@wordpress/a11y": "^4.33.0",
43
+ "@wordpress/interactivity": "^6.33.0",
44
44
  "es-module-lexer": "^1.5.4"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "67cfd7e661931aeb0d06bec894599d287a4f8d0f"
49
+ "gitHead": "2bbe0d34ab65458468758c48826296d7a753428b"
50
50
  }
@@ -47,9 +47,20 @@ export const preloadScriptModules = ( doc: Document ) => {
47
47
  // Get the URL of all modules contained in the document.
48
48
  const moduleUrls = [
49
49
  ...doc.querySelectorAll< HTMLScriptElement >(
50
- 'script[type=module][src]'
50
+ 'script[type=module][src][data-wp-router-options]'
51
51
  ),
52
- ].map( ( s ) => s.src );
52
+ ]
53
+ .filter( ( script ) => {
54
+ try {
55
+ const parsed = JSON.parse(
56
+ script.getAttribute( 'data-wp-router-options' )
57
+ );
58
+ return parsed?.loadOnClientNavigation === true;
59
+ } catch {
60
+ return false;
61
+ }
62
+ } )
63
+ .map( ( script ) => script.src );
53
64
 
54
65
  // Resolve and fetch those not resolved natively.
55
66
  return moduleUrls
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { preloadScriptModules } from '../script-modules';
5
+
6
+ jest.mock( '../dynamic-importmap', () => ( {
7
+ ...jest.requireActual( '../dynamic-importmap' ),
8
+ preloadWithMap: jest.fn( () => Promise.resolve( {} ) ),
9
+ } ) );
10
+
11
+ describe( 'preloadScriptModules', () => {
12
+ it( 'should only preload modules with data-wp-router-options containing loadOnClientNavigation: true', () => {
13
+ const doc = document.implementation.createHTMLDocument();
14
+
15
+ // Module with loadOnClientNavigation: true
16
+ const module1 = doc.createElement( 'script' );
17
+ module1.type = 'module';
18
+ module1.src = 'https://example.com/module1.js';
19
+ module1.setAttribute(
20
+ 'data-wp-router-options',
21
+ JSON.stringify( { loadOnClientNavigation: true } )
22
+ );
23
+
24
+ // Module with loadOnClientNavigation: false
25
+ const module2 = doc.createElement( 'script' );
26
+ module2.type = 'module';
27
+ module2.src = 'https://example.com/module2.js';
28
+ module2.setAttribute(
29
+ 'data-wp-router-options',
30
+ JSON.stringify( { loadOnClientNavigation: false } )
31
+ );
32
+
33
+ // Module without data-wp-router-options
34
+ const module3 = doc.createElement( 'script' );
35
+ module3.type = 'module';
36
+ module3.src = 'https://example.com/module3.js';
37
+
38
+ // Module with data-wp-router-options but without loadOnClientNavigation
39
+ const module4 = doc.createElement( 'script' );
40
+ module4.type = 'module';
41
+ module4.src = 'https://example.com/module4.js';
42
+ module4.setAttribute(
43
+ 'data-wp-router-options',
44
+ JSON.stringify( { otherOption: true } )
45
+ );
46
+
47
+ doc.head.appendChild( module1 );
48
+ doc.head.appendChild( module2 );
49
+ doc.head.appendChild( module3 );
50
+ doc.head.appendChild( module4 );
51
+
52
+ const result = preloadScriptModules( doc );
53
+
54
+ // Only module1 should be preloaded
55
+ expect( result.length ).toBe( 1 );
56
+ } );
57
+
58
+ it( 'should handle invalid JSON in data-wp-router-options gracefully', () => {
59
+ const doc = document.implementation.createHTMLDocument();
60
+
61
+ const module = doc.createElement( 'script' );
62
+ module.type = 'module';
63
+ module.src = 'https://example.com/module.js';
64
+ module.setAttribute( 'data-wp-router-options', 'invalid json' );
65
+
66
+ doc.head.appendChild( module );
67
+
68
+ const result = preloadScriptModules( doc );
69
+
70
+ // Should not throw and should return empty array
71
+ expect( result.length ).toBe( 0 );
72
+ } );
73
+ } );
package/src/index.ts CHANGED
@@ -24,6 +24,7 @@ const {
24
24
  batch,
25
25
  routerRegions,
26
26
  cloneElement,
27
+ navigationSignal,
27
28
  } = privateApis(
28
29
  'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.'
29
30
  );
@@ -238,15 +239,19 @@ const renderPage = ( page: Page ) => {
238
239
  const regionsToAttach = { ...page.regionsToAttach };
239
240
 
240
241
  batch( () => {
241
- // Update server data.
242
+ // Updates the server data.
242
243
  populateServerData( page.initialData );
243
244
 
244
- // Reset all router regions before setting the actual values.
245
+ // Triggers navigation invalidations (`getServerState` and
246
+ // `getServerContext`).
247
+ navigationSignal.value += 1;
248
+
249
+ // Resets all router regions before setting the actual values.
245
250
  ( routerRegions as Map< string, any > ).forEach( ( signal ) => {
246
251
  signal.value = null;
247
252
  } );
248
253
 
249
- //Init regions with attachTo that don't exist yet.
254
+ // Inits regions with attachTo that don't exist yet.
250
255
  const parentsToUpdate = new Set< Element >();
251
256
  for ( const id in regionsToAttach ) {
252
257
  const parent = document.querySelector( regionsToAttach[ id ] );
@@ -260,7 +265,7 @@ const renderPage = ( page: Page ) => {
260
265
  }
261
266
  }
262
267
 
263
- //Update all existing regions.
268
+ // Updates all existing regions.
264
269
  for ( const id in page.regions ) {
265
270
  if ( routerRegions.has( id ) ) {
266
271
  routerRegions.get( id ).value = cloneRouterRegionContent(
@@ -269,7 +274,7 @@ const renderPage = ( page: Page ) => {
269
274
  }
270
275
  }
271
276
 
272
- // Render regions attached to the same parent in the same fragment.
277
+ // Renders regions attached to the same parent in the same fragment.
273
278
  parentsToUpdate.forEach( ( parent ) => {
274
279
  const ids = regionsToAttachByParent.get( parent );
275
280
  const vdoms = ids.map( ( id ) => page.regions[ id ] );
@@ -279,8 +284,9 @@ const renderPage = ( page: Page ) => {
279
284
  const elementType =
280
285
  typeof type === 'function' ? props.type : type;
281
286
 
282
- // Create an element with the obtained type where the region will be
283
- // rendered. The type should match the one of the root vnode.
287
+ // Creates an element with the obtained type where the
288
+ // region will be rendered. The type should match the one of
289
+ // the root vnode.
284
290
  const region = document.createElement( elementType );
285
291
  parent.appendChild( region );
286
292
  return region;
@@ -321,9 +327,10 @@ window.addEventListener( 'popstate', async () => {
321
327
  const pagePath = getPagePath( window.location.href ); // Remove hash.
322
328
  const page = pages.has( pagePath ) && ( await pages.get( pagePath ) );
323
329
  if ( page ) {
324
- renderPage( page );
325
- // Update the URL in the state.
326
- state.url = window.location.href;
330
+ batch( () => {
331
+ state.url = window.location.href;
332
+ renderPage( page );
333
+ } );
327
334
  } else {
328
335
  window.location.reload();
329
336
  }
@@ -412,13 +419,13 @@ export const { state, actions } = store< Store >( 'core/router', {
412
419
  navigatingTo = href;
413
420
  actions.prefetch( pagePath, options );
414
421
 
415
- // Create a promise that resolves when the specified timeout ends.
422
+ // Creates a promise that resolves when the specified timeout ends.
416
423
  // The timeout value is 10 seconds by default.
417
424
  const timeoutPromise = new Promise< void >( ( resolve ) =>
418
425
  setTimeout( resolve, timeout )
419
426
  );
420
427
 
421
- // Don't update the navigation status immediately, wait 400 ms.
428
+ // Doesn't update the navigation status immediately, wait 400 ms.
422
429
  const loadingTimeout = setTimeout( () => {
423
430
  if ( navigatingTo !== href ) {
424
431
  return;
@@ -438,7 +445,7 @@ export const { state, actions } = store< Store >( 'core/router', {
438
445
  timeoutPromise,
439
446
  ] );
440
447
 
441
- // Dismiss loading message if it hasn't been added yet.
448
+ // Dismisses loading message if it hasn't been added yet.
442
449
  clearTimeout( loadingTimeout );
443
450
 
444
451
  // Once the page is fetched, the destination URL could have changed
@@ -454,21 +461,26 @@ export const { state, actions } = store< Store >( 'core/router', {
454
461
  ?.clientNavigationDisabled
455
462
  ) {
456
463
  yield importScriptModules( page.scriptModules );
457
- renderPage( page );
464
+
465
+ batch( () => {
466
+ // Updates the URL in the state.
467
+ state.url = href;
468
+
469
+ // Updates the navigation status once the the new page rendering
470
+ // has been completed.
471
+ if ( loadingAnimation ) {
472
+ navigation.hasStarted = false;
473
+ navigation.hasFinished = true;
474
+ }
475
+
476
+ // Renders the new page.
477
+ renderPage( page );
478
+ } );
479
+
458
480
  window.history[
459
481
  options.replace ? 'replaceState' : 'pushState'
460
482
  ]( {}, '', href );
461
483
 
462
- // Update the URL in the state.
463
- state.url = href;
464
-
465
- // Update the navigation status once the the new page rendering
466
- // has been completed.
467
- if ( loadingAnimation ) {
468
- navigation.hasStarted = false;
469
- navigation.hasFinished = true;
470
- }
471
-
472
484
  if ( screenReaderAnnouncement ) {
473
485
  a11ySpeak( 'loaded' );
474
486
  }
@@ -1 +1 @@
1
- {"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../interactivity/build-types/store.d.ts","../../node_modules/preact/src/jsx.d.ts","../../node_modules/preact/src/index.d.ts","../interactivity/build-types/hooks.d.ts","../interactivity/build-types/scopes.d.ts","../../node_modules/preact/hooks/src/index.d.ts","../interactivity/build-types/utils.d.ts","../interactivity/build-types/index.d.ts","./src/assets/scs.ts","./src/assets/styles.ts","./src/assets/dynamic-importmap/resolver.ts","../../node_modules/es-module-lexer/types/lexer.d.ts","./src/assets/dynamic-importmap/fetch.ts","./src/assets/dynamic-importmap/loader.ts","./src/assets/dynamic-importmap/index.ts","./src/assets/script-modules.ts","../a11y/build-types/shared/index.d.ts","../a11y/build-types/index.d.ts","./src/index.ts"],"fileIdsList":[[81],[80],[95],[92],[89,92],[89,90,91],[93],[87],[86,88,94,96],[81,83],[79,83,84,85],[81,82],[84]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"e12a46ce14b817d4c9e6b2b478956452330bf00c9801b79de46f7a1815b5bd40","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"69e65d976bf166ce4a9e6f6c18f94d2424bf116e90837ace179610dbccad9b42","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"bab26767638ab3557de12c900f0b91f710c7dc40ee9793d5a27d32c04f0bf646","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"61d6a2092f48af66dbfb220e31eea8b10bc02b6932d6e529005fd2d7b3281290","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},"579a322d61b0b1ab5b653c027f0a7d8b2ee061d65061170d0777c7abbdaa3abb",{"version":"fd40c454d56e1d14e60ce13f3bc60c7fdb9bc70c6ef9c7bfafec1f0eb5d8075b","impliedFormat":1},{"version":"155ced96d70533d95c481061e2691802fae7cfb96869d7c85ac8622f53b51cb7","impliedFormat":1},"a4ad90e38edc1c6ed84409f8dc7843dce857e9e9f9c8161c2708106af28ab57b","4b77de664157c408100eece72ad45f86ce995ea97c6d2165659a26eb558e2668",{"version":"fbc22df38ad21e518d0362b71669e8cc46b77018b096be6d26de1403b5c3f7c6","impliedFormat":1},{"version":"362b54116b2b1892e98077d33d513f004f254409618a98a2acfd9243df8eaefb","affectsGlobalScope":true},"9af8e2b70df19f05dd26d8d2337cd7e4f78fef0c0a837da362a77bda0b328ca1",{"version":"d0961db9cf06c923e4a85175322caf57d12f408207af22cd264dd41ff1844c3f","signature":"4d622752e952dfc53e0b38cabe010cb742ebd9b36e21413e78351a1a0cc8aa63"},{"version":"96c927027f88989a0530da7ececce5ad197d9a1dde48790f9380f33e896153c1","signature":"42dc2a448de4c0fcff923afe6792f84bc2ecfc522f36b123598b2fea12cc1a80"},{"version":"8cfee2ec5e47adee6939f200526066e2db206eccd3ddc4e7624e24b8d969f6c5","signature":"4729d607979da7c88951bc23f8030f27121cb7363424b797162dde45c9df7182"},{"version":"aac44a1794c0eae7920783dfdc3e9487c91803149316cd74f19ee359a2f72bf5","impliedFormat":99},{"version":"59446a866f615c634d443d77db07164a16a2e39f9db5f6ee4ad439386b609852","signature":"83a4fb7704bf62b9e0ec1c2bc9c8693301312cf43345f844679d2a74ea120909"},{"version":"5fb8f06cb73dd59003ce08eadbdd3d4326af12b5f5b2945d4ba086096c19741f","signature":"1451b9b28e4cda6be090c94aef4681ba548b0ed8c46a10c954b575441c160753"},{"version":"b5eaa97a50280489c8fea843459d399d1964b70d1f19f9e9b434342a9b25fde9","signature":"daded167cd234a760ad74721f90f1d934e29b74716c8191205d0beb9e4ba16db"},{"version":"8a41fe3d376d703cafe365677b291ce7f1e8da6bf53a69e2fef1bcf6c87e91b3","signature":"341cdae4ab3c39b6620af36120d83c78d9f2e744dbd5978561d8f1d258ad3337"},"40cfbc59eaef297a6cbc6f871853e4b8bba4cdc2d12c3d8e73e21a28d8280162","3d7a81d5202f0ecb42a07bc4973e2094e291aefd583413f98b1cfdbb1d4e0816",{"version":"19e05fa57866125dc2909ab3e5e7e2f414182f3f1e2c714fd2c1cf4bc801651f","signature":"0380d928bdca55fd1a10a03a5bcf460030c77319df8f6af96f087d2e35143a13"}],"root":[[87,89],[91,94],97],"options":{"allowJs":false,"allowSyntheticDefaultImports":true,"checkJs":false,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"rootDir":"./src","skipDefaultLibCheck":true,"strict":false,"target":99},"referencedMap":[[84,1],[81,2],[80,1],[96,3],[91,4],[93,5],[92,6],[94,7],[88,8],[97,9],[82,10],[86,11],[83,12],[85,13]],"latestChangedDtsFile":"./build-types/index.d.ts","version":"5.7.2"}
1
+ {"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/preact/src/jsx.d.ts","../../node_modules/preact/src/index.d.ts","../../node_modules/preact/hooks/src/index.d.ts","../../node_modules/@preact/signals-core/dist/signals-core.d.ts","../interactivity/build-types/utils.d.ts","../interactivity/build-types/store.d.ts","../interactivity/build-types/hooks.d.ts","../interactivity/build-types/scopes.d.ts","../interactivity/build-types/index.d.ts","./src/assets/scs.ts","./src/assets/styles.ts","./src/assets/dynamic-importmap/resolver.ts","../../node_modules/es-module-lexer/types/lexer.d.ts","./src/assets/dynamic-importmap/fetch.ts","./src/assets/dynamic-importmap/loader.ts","./src/assets/dynamic-importmap/index.ts","./src/assets/script-modules.ts","../a11y/build-types/shared/index.d.ts","../a11y/build-types/index.d.ts","./src/index.ts"],"fileIdsList":[[80],[79],[96],[93],[90,93],[90,91,92],[94],[88],[87,89,95,97],[80,86],[81,83,84,86],[80,83,85],[83],[81,82]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"e12a46ce14b817d4c9e6b2b478956452330bf00c9801b79de46f7a1815b5bd40","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"69e65d976bf166ce4a9e6f6c18f94d2424bf116e90837ace179610dbccad9b42","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"bab26767638ab3557de12c900f0b91f710c7dc40ee9793d5a27d32c04f0bf646","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"61d6a2092f48af66dbfb220e31eea8b10bc02b6932d6e529005fd2d7b3281290","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"fd40c454d56e1d14e60ce13f3bc60c7fdb9bc70c6ef9c7bfafec1f0eb5d8075b","impliedFormat":1},{"version":"155ced96d70533d95c481061e2691802fae7cfb96869d7c85ac8622f53b51cb7","impliedFormat":1},{"version":"fbc22df38ad21e518d0362b71669e8cc46b77018b096be6d26de1403b5c3f7c6","impliedFormat":1},{"version":"ae576b4a68f96cd1c6e423ff41f4169ecdc7c70dad07fc41d535444a294c7e26","impliedFormat":1},{"version":"de561059d9d17c7a5b8446fdbbd585517a87115ea1a3c94e7b0b8e48a0e8ab73","affectsGlobalScope":true},"ffa2e8ebb7bcb74efabb97f730b02bee7575a05d6e49091cf4a76437ae33d8eb","a4ad90e38edc1c6ed84409f8dc7843dce857e9e9f9c8161c2708106af28ab57b","c4a118f6284f822e945eccef3cb9dcee06b704c1b99809e3b42f09328e3be3b0","d2dcf62cdb0b1d7ac11b5d0b32df7d12565261d250e4c96de1096598f3e48905",{"version":"d0961db9cf06c923e4a85175322caf57d12f408207af22cd264dd41ff1844c3f","signature":"4d622752e952dfc53e0b38cabe010cb742ebd9b36e21413e78351a1a0cc8aa63"},{"version":"96c927027f88989a0530da7ececce5ad197d9a1dde48790f9380f33e896153c1","signature":"42dc2a448de4c0fcff923afe6792f84bc2ecfc522f36b123598b2fea12cc1a80"},{"version":"8cfee2ec5e47adee6939f200526066e2db206eccd3ddc4e7624e24b8d969f6c5","signature":"4729d607979da7c88951bc23f8030f27121cb7363424b797162dde45c9df7182"},{"version":"aac44a1794c0eae7920783dfdc3e9487c91803149316cd74f19ee359a2f72bf5","impliedFormat":99},{"version":"59446a866f615c634d443d77db07164a16a2e39f9db5f6ee4ad439386b609852","signature":"83a4fb7704bf62b9e0ec1c2bc9c8693301312cf43345f844679d2a74ea120909"},{"version":"5fb8f06cb73dd59003ce08eadbdd3d4326af12b5f5b2945d4ba086096c19741f","signature":"1451b9b28e4cda6be090c94aef4681ba548b0ed8c46a10c954b575441c160753"},{"version":"b5eaa97a50280489c8fea843459d399d1964b70d1f19f9e9b434342a9b25fde9","signature":"daded167cd234a760ad74721f90f1d934e29b74716c8191205d0beb9e4ba16db"},{"version":"4d17b753d798abee0eec8bfc147c76f5bf9d42139536b0691639f0a8bb08193b","signature":"341cdae4ab3c39b6620af36120d83c78d9f2e744dbd5978561d8f1d258ad3337"},"40cfbc59eaef297a6cbc6f871853e4b8bba4cdc2d12c3d8e73e21a28d8280162","3d7a81d5202f0ecb42a07bc4973e2094e291aefd583413f98b1cfdbb1d4e0816",{"version":"2d5f715779028f4a7c6a5c9b35a1a5e2eb35eae5450cb177d762d329cf018cb3","signature":"0380d928bdca55fd1a10a03a5bcf460030c77319df8f6af96f087d2e35143a13"}],"root":[[88,90],[92,95],98],"options":{"allowJs":false,"allowSyntheticDefaultImports":true,"checkJs":false,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"rootDir":"./src","skipDefaultLibCheck":true,"strict":false,"target":99},"referencedMap":[[81,1],[80,2],[79,1],[97,3],[92,4],[94,5],[93,6],[95,7],[89,8],[98,9],[85,10],[87,11],[86,12],[84,13],[83,14]],"latestChangedDtsFile":"./build-types/index.d.ts","version":"5.7.2"}