From a41d8c484fc670c8f758cdc1b5fc08f74ea5aa18 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Fri, 20 Sep 2024 12:40:44 +1000 Subject: [PATCH] Script Modules: Centralize registration (#65460) Rework how Script Modules are registered in Gutenberg. Script Module registration is handled in one central place. A combined assets file is used for Script Modules and registration. This means that dependencies and versions will be used correctly and kept up-to-date while avoiding repeated file reads. Block library Script Module assets that are enqueued on demand _are registered in a centralized location_. The assets are enqueued on demand. **This requires a Core change** since the block library PHP files are synced to Core and also require centralized Script Module registration (https://github.com/WordPress/wordpress-develop/pull/7360). This solves a problem where Gutenberg-specific code was being shipped in Core through block-library. The block library Script Module asset Module IDs are renamed to indicate they are view files and align with the naming from #65064: @wordpress/block-library/query is @wordpress/block-library/query/view (indicating it is a view file). --- This is sufficient to change Script Modules to use Gutenberg in a backwards compatible way: - `@wordpress/ineractivity` and `@wordpress/interactivity-router` were registered on `wp_enqueue_scripts`. That action fires after the `wp_default_scripts` used here. Registering an already registered Script Module is a no-op. This change registers first. - The only other Script Modules currently available in Core are from the block library. Those have been registered conditionally on use. The ID is changed here, so there's little risk of the wrong version being used. There is a Core companion PR that will be necessary to land: https://github.com/WordPress/wordpress-develop/pull/7360 --- Co-authored-by: sirreal Co-authored-by: gziolo Source: https://github.com/WordPress/gutenberg/commit/8488c647734d0c2516488fc0cb919bec8f29357c --- build-module/a11y/index.min.asset.php | 1 - build-module/a11y/index.min.js.map | 2 +- build-module/assets.php | 1 + .../block-library/file/view.min.asset.php | 1 - .../block-library/file/view.min.js.map | 2 +- .../block-library/image/view.min.asset.php | 1 - .../block-library/image/view.min.js.map | 2 +- .../navigation/view.min.asset.php | 1 - .../block-library/navigation/view.min.js.map | 2 +- .../block-library/query/view.min.asset.php | 1 - .../block-library/query/view.min.js.map | 2 +- .../block-library/search/view.min.asset.php | 1 - .../block-library/search/view.min.js.map | 2 +- .../interactivity-router/index.min.asset.php | 1 - .../interactivity-router/index.min.js.map | 2 +- .../interactivity/debug.min.asset.php | 1 - build-module/interactivity/debug.min.js.map | 2 +- .../interactivity/index.min.asset.php | 1 - build-module/interactivity/index.min.js.map | 2 +- build/block-library/blocks/file.php | 13 +---- build/block-library/blocks/image.php | 14 +----- build/block-library/blocks/navigation.php | 13 +---- build/block-library/blocks/query.php | 22 +------- build/block-library/blocks/search.php | 13 +---- gutenberg.php | 2 +- lib/client-assets.php | 50 +++++++++++++++++++ lib/experimental/script-modules.php | 25 +--------- lib/interactivity-api.php | 31 ------------ 28 files changed, 68 insertions(+), 143 deletions(-) delete mode 100644 build-module/a11y/index.min.asset.php create mode 100644 build-module/assets.php delete mode 100644 build-module/block-library/file/view.min.asset.php delete mode 100644 build-module/block-library/image/view.min.asset.php delete mode 100644 build-module/block-library/navigation/view.min.asset.php delete mode 100644 build-module/block-library/query/view.min.asset.php delete mode 100644 build-module/block-library/search/view.min.asset.php delete mode 100644 build-module/interactivity-router/index.min.asset.php delete mode 100644 build-module/interactivity/debug.min.asset.php delete mode 100644 build-module/interactivity/index.min.asset.php diff --git a/build-module/a11y/index.min.asset.php b/build-module/a11y/index.min.asset.php deleted file mode 100644 index a7c566da..00000000 --- a/build-module/a11y/index.min.asset.php +++ /dev/null @@ -1 +0,0 @@ - array(), 'version' => '25c9ec16abe91b62e906', 'type' => 'module'); diff --git a/build-module/a11y/index.min.js.map b/build-module/a11y/index.min.js.map index 3668277f..98740925 100644 --- a/build-module/a11y/index.min.js.map +++ b/build-module/a11y/index.min.js.map @@ -1 +1 @@ -{"version":3,"file":"./build-module/a11y/index.min.js","mappings":"AACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,I,8BCAlF,IAAII,EAAkB,GCwBf,SAASC,EAAOC,EAASC,ICrBjB,WACd,MAAMC,EAAUC,SAASC,uBAAwB,qBAC3CC,EAAYF,SAASG,eAAgB,yBAE3C,IAAM,IAAIC,EAAI,EAAGA,EAAIL,EAAQM,OAAQD,IACpCL,EAASK,GAAIE,YAAc,GAIvBJ,GACJA,EAAUK,aAAc,SAAU,SAEpC,CDcCC,GAEAX,EDtBc,SAAwBA,GAoBtC,OAZAA,EAAUA,EAAQY,QAAS,YAAa,KAMnCd,IAAoBE,IACxBA,GAAW,KAGZF,EAAkBE,EAEXA,CACR,CCCWa,CAAeb,GAEzB,MAAMK,EAAYF,SAASG,eAAgB,yBACrCQ,EAAqBX,SAASG,eACnC,wBAEKS,EAAkBZ,SAASG,eAAgB,qBAE5CQ,GAAmC,cAAbb,EAC1Ba,EAAmBL,YAAcT,EACtBe,IACXA,EAAgBN,YAAcT,GAO1BK,GACJA,EAAUW,gBAAiB,SAE7B,CE1CO,MAAMC,EAAQA,O","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/./packages/a11y/build-module/shared/@wordpress/a11y/src/shared/filter-message.js","webpack://wp/./packages/a11y/build-module/shared/@wordpress/a11y/src/shared/index.js","webpack://wp/./packages/a11y/build-module/shared/@wordpress/a11y/src/shared/clear.js","webpack://wp/./packages/a11y/build-module/module/@wordpress/a11y/src/module/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","let previousMessage = '';\n\n/**\n * Filter the message to be announced to the screenreader.\n *\n * @param {string} message The message to be announced.\n *\n * @return {string} The filtered message.\n */\nexport default function filterMessage( message ) {\n\t/*\n\t * Strip HTML tags (if any) from the message string. Ideally, messages should\n\t * be simple strings, carefully crafted for specific use with A11ySpeak.\n\t * When re-using already existing strings this will ensure simple HTML to be\n\t * stripped out and replaced with a space. Browsers will collapse multiple\n\t * spaces natively.\n\t */\n\tmessage = message.replace( /<[^<>]+>/g, ' ' );\n\n\t/*\n\t * Safari + VoiceOver don't announce repeated, identical strings. We use\n\t * a `no-break space` to force them to think identical strings are different.\n\t */\n\tif ( previousMessage === message ) {\n\t\tmessage += '\\u00A0';\n\t}\n\n\tpreviousMessage = message;\n\n\treturn message;\n}\n","/**\n * Internal dependencies\n */\nimport clear from './clear';\nimport filterMessage from './filter-message';\n\n/**\n * Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.\n * This module is inspired by the `speak` function in `wp-a11y.js`.\n *\n * @param {string} message The message to be announced by assistive technologies.\n * @param {'polite'|'assertive'} [ariaLive] The politeness level for aria-live; default: 'polite'.\n *\n * @example\n * ```js\n * import { speak } from '@wordpress/a11y';\n *\n * // For polite messages that shouldn't interrupt what screen readers are currently announcing.\n * speak( 'The message you want to send to the ARIA live region' );\n *\n * // For assertive messages that should interrupt what screen readers are currently announcing.\n * speak( 'The message you want to send to the ARIA live region', 'assertive' );\n * ```\n */\nexport function speak( message, ariaLive ) {\n\t/*\n\t * Clear previous messages to allow repeated strings being read out and hide\n\t * the explanatory text from assistive technologies.\n\t */\n\tclear();\n\n\tmessage = filterMessage( message );\n\n\tconst introText = document.getElementById( 'a11y-speak-intro-text' );\n\tconst containerAssertive = document.getElementById(\n\t\t'a11y-speak-assertive'\n\t);\n\tconst containerPolite = document.getElementById( 'a11y-speak-polite' );\n\n\tif ( containerAssertive && ariaLive === 'assertive' ) {\n\t\tcontainerAssertive.textContent = message;\n\t} else if ( containerPolite ) {\n\t\tcontainerPolite.textContent = message;\n\t}\n\n\t/*\n\t * Make the explanatory text available to assistive technologies by removing\n\t * the 'hidden' HTML attribute.\n\t */\n\tif ( introText ) {\n\t\tintroText.removeAttribute( 'hidden' );\n\t}\n}\n","/**\n * Clears the a11y-speak-region elements and hides the explanatory text.\n */\nexport default function clear() {\n\tconst regions = document.getElementsByClassName( 'a11y-speak-region' );\n\tconst introText = document.getElementById( 'a11y-speak-intro-text' );\n\n\tfor ( let i = 0; i < regions.length; i++ ) {\n\t\tregions[ i ].textContent = '';\n\t}\n\n\t// Make sure the explanatory text is hidden from assistive technologies.\n\tif ( introText ) {\n\t\tintroText.setAttribute( 'hidden', 'hidden' );\n\t}\n}\n","/**\n * Internal dependencies\n */\nexport { speak } from '../shared/index';\n\n/**\n * This no-op function is exported to provide compatibility with the `wp-a11y` Script.\n *\n * Filters should inject the relevant HTML on page load instead of requiring setup.\n */\nexport const setup = () => {};\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","previousMessage","speak","message","ariaLive","regions","document","getElementsByClassName","introText","getElementById","i","length","textContent","setAttribute","clear","replace","filterMessage","containerAssertive","containerPolite","removeAttribute","setup"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"a11y/index.min.js","mappings":"AACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,I,8BCAlF,IAAII,EAAkB,GCwBf,SAASC,EAAOC,EAASC,ICrBjB,WACd,MAAMC,EAAUC,SAASC,uBAAwB,qBAC3CC,EAAYF,SAASG,eAAgB,yBAE3C,IAAM,IAAIC,EAAI,EAAGA,EAAIL,EAAQM,OAAQD,IACpCL,EAASK,GAAIE,YAAc,GAIvBJ,GACJA,EAAUK,aAAc,SAAU,SAEpC,CDcCC,GAEAX,EDtBc,SAAwBA,GAoBtC,OAZAA,EAAUA,EAAQY,QAAS,YAAa,KAMnCd,IAAoBE,IACxBA,GAAW,KAGZF,EAAkBE,EAEXA,CACR,CCCWa,CAAeb,GAEzB,MAAMK,EAAYF,SAASG,eAAgB,yBACrCQ,EAAqBX,SAASG,eACnC,wBAEKS,EAAkBZ,SAASG,eAAgB,qBAE5CQ,GAAmC,cAAbb,EAC1Ba,EAAmBL,YAAcT,EACtBe,IACXA,EAAgBN,YAAcT,GAO1BK,GACJA,EAAUW,gBAAiB,SAE7B,CE1CO,MAAMC,EAAQA,O","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/./packages/a11y/build-module/shared/@wordpress/a11y/src/shared/filter-message.js","webpack://wp/./packages/a11y/build-module/shared/@wordpress/a11y/src/shared/index.js","webpack://wp/./packages/a11y/build-module/shared/@wordpress/a11y/src/shared/clear.js","webpack://wp/./packages/a11y/build-module/module/@wordpress/a11y/src/module/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","let previousMessage = '';\n\n/**\n * Filter the message to be announced to the screenreader.\n *\n * @param {string} message The message to be announced.\n *\n * @return {string} The filtered message.\n */\nexport default function filterMessage( message ) {\n\t/*\n\t * Strip HTML tags (if any) from the message string. Ideally, messages should\n\t * be simple strings, carefully crafted for specific use with A11ySpeak.\n\t * When re-using already existing strings this will ensure simple HTML to be\n\t * stripped out and replaced with a space. Browsers will collapse multiple\n\t * spaces natively.\n\t */\n\tmessage = message.replace( /<[^<>]+>/g, ' ' );\n\n\t/*\n\t * Safari + VoiceOver don't announce repeated, identical strings. We use\n\t * a `no-break space` to force them to think identical strings are different.\n\t */\n\tif ( previousMessage === message ) {\n\t\tmessage += '\\u00A0';\n\t}\n\n\tpreviousMessage = message;\n\n\treturn message;\n}\n","/**\n * Internal dependencies\n */\nimport clear from './clear';\nimport filterMessage from './filter-message';\n\n/**\n * Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.\n * This module is inspired by the `speak` function in `wp-a11y.js`.\n *\n * @param {string} message The message to be announced by assistive technologies.\n * @param {'polite'|'assertive'} [ariaLive] The politeness level for aria-live; default: 'polite'.\n *\n * @example\n * ```js\n * import { speak } from '@wordpress/a11y';\n *\n * // For polite messages that shouldn't interrupt what screen readers are currently announcing.\n * speak( 'The message you want to send to the ARIA live region' );\n *\n * // For assertive messages that should interrupt what screen readers are currently announcing.\n * speak( 'The message you want to send to the ARIA live region', 'assertive' );\n * ```\n */\nexport function speak( message, ariaLive ) {\n\t/*\n\t * Clear previous messages to allow repeated strings being read out and hide\n\t * the explanatory text from assistive technologies.\n\t */\n\tclear();\n\n\tmessage = filterMessage( message );\n\n\tconst introText = document.getElementById( 'a11y-speak-intro-text' );\n\tconst containerAssertive = document.getElementById(\n\t\t'a11y-speak-assertive'\n\t);\n\tconst containerPolite = document.getElementById( 'a11y-speak-polite' );\n\n\tif ( containerAssertive && ariaLive === 'assertive' ) {\n\t\tcontainerAssertive.textContent = message;\n\t} else if ( containerPolite ) {\n\t\tcontainerPolite.textContent = message;\n\t}\n\n\t/*\n\t * Make the explanatory text available to assistive technologies by removing\n\t * the 'hidden' HTML attribute.\n\t */\n\tif ( introText ) {\n\t\tintroText.removeAttribute( 'hidden' );\n\t}\n}\n","/**\n * Clears the a11y-speak-region elements and hides the explanatory text.\n */\nexport default function clear() {\n\tconst regions = document.getElementsByClassName( 'a11y-speak-region' );\n\tconst introText = document.getElementById( 'a11y-speak-intro-text' );\n\n\tfor ( let i = 0; i < regions.length; i++ ) {\n\t\tregions[ i ].textContent = '';\n\t}\n\n\t// Make sure the explanatory text is hidden from assistive technologies.\n\tif ( introText ) {\n\t\tintroText.setAttribute( 'hidden', 'hidden' );\n\t}\n}\n","/**\n * Internal dependencies\n */\nexport { speak } from '../shared/index';\n\n/**\n * This no-op function is exported to provide compatibility with the `wp-a11y` Script.\n *\n * Filters should inject the relevant HTML on page load instead of requiring setup.\n */\nexport const setup = () => {};\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","previousMessage","speak","message","ariaLive","regions","document","getElementsByClassName","introText","getElementById","i","length","textContent","setAttribute","clear","replace","filterMessage","containerAssertive","containerPolite","removeAttribute","setup"],"sourceRoot":""} \ No newline at end of file diff --git a/build-module/assets.php b/build-module/assets.php new file mode 100644 index 00000000..43353eb3 --- /dev/null +++ b/build-module/assets.php @@ -0,0 +1 @@ + array('dependencies' => array(), 'version' => '25c9ec16abe91b62e906', 'type' => 'module'), 'block-library/file/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '0600eabcab185ceb0430', 'type' => 'module'), 'block-library/image/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'e90ba1f1006920e85ee5', 'type' => 'module'), 'block-library/navigation/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '7b370e821516feba4955', 'type' => 'module'), 'block-library/query/view.min.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => '1100711c4bda188467ac', 'type' => 'module'), 'block-library/search/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '69851b7ac418d6ef7967', 'type' => 'module'), 'interactivity/index.min.js' => array('dependencies' => array(), 'version' => '5f35b6d3bd962e6e82b5', 'type' => 'module'), 'interactivity/debug.min.js' => array('dependencies' => array(), 'version' => 'b78f5dee01439db66197', 'type' => 'module'), 'interactivity-router/index.min.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/a11y', 'import' => 'dynamic')), 'version' => '67c16aba5bbfcdd72f9a', 'type' => 'module')); diff --git a/build-module/block-library/file/view.min.asset.php b/build-module/block-library/file/view.min.asset.php deleted file mode 100644 index e30754a7..00000000 --- a/build-module/block-library/file/view.min.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('@wordpress/interactivity'), 'version' => '0600eabcab185ceb0430', 'type' => 'module'); diff --git a/build-module/block-library/file/view.min.js.map b/build-module/block-library/file/view.min.js.map index eddbc031..3dcab1ea 100644 --- a/build-module/block-library/file/view.min.js.map +++ b/build-module/block-library/file/view.min.js.map @@ -1 +1 @@ -{"version":3,"file":"./build-module/block-library/file/view.min.js","mappings":"2CACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICElF,MAAM,GAFEI,EAE+B,CAAE,MAAW,IAAMC,EAA8DC,OAFrGC,EAAI,CAAC,EAAGjB,EAAoBkB,EAAED,EAAGH,GAAWG,GC+CzDE,EAAwBC,IAC7B,IAAIC,EACJ,IACCA,EAAK,IAAIC,OAAOC,cAAeH,EAChC,CAAE,MAAQI,GACTH,OAAKI,CACN,CACA,OAAOJ,CAAE,EDtDFP,MAAWG,GESnBD,EAAAA,EAAAA,OACC,YACA,CACCU,MAAO,CACN,iBAAIC,GACH,QDNEL,OAAOM,UAAUC,UAAUC,QAAS,SAAY,GAKhDR,OAAOM,UAAUC,UAAUC,QAAS,YAAe,GAMvDR,OAAOM,UAAUC,UAAUC,QAAS,cAAiB,GACrDR,OAAOM,UAAUG,gBACjBT,OAAOM,UAAUG,eAAiB,IAO7BT,OAAOC,eAAiB,kBAAmBD,UAE/CH,EAAqB,iBACrBA,EAAqB,eChBrB,IAGF,CAAEa,MAAM","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/external module \"@wordpress/interactivity\"","webpack://wp/./packages/block-library/build-module/file/utils/@wordpress/block-library/src/file/utils/index.js","webpack://wp/./packages/block-library/build-module/file/@wordpress/block-library/src/file/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"store\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store });","/**\n * Uses a combination of user agent matching and feature detection to determine whether\n * the current browser supports rendering PDFs inline.\n *\n * @return {boolean} Whether or not the browser supports inline PDFs.\n */\nexport const browserSupportsPdfs = () => {\n\t// Most mobile devices include \"Mobi\" in their UA.\n\tif ( window.navigator.userAgent.indexOf( 'Mobi' ) > -1 ) {\n\t\treturn false;\n\t}\n\n\t// Android tablets are the noteable exception.\n\tif ( window.navigator.userAgent.indexOf( 'Android' ) > -1 ) {\n\t\treturn false;\n\t}\n\n\t// iPad pretends to be a Mac.\n\tif (\n\t\twindow.navigator.userAgent.indexOf( 'Macintosh' ) > -1 &&\n\t\twindow.navigator.maxTouchPoints &&\n\t\twindow.navigator.maxTouchPoints > 2\n\t) {\n\t\treturn false;\n\t}\n\n\t// IE only supports PDFs when there's an ActiveX object available for it.\n\tif (\n\t\t!! ( window.ActiveXObject || 'ActiveXObject' in window ) &&\n\t\t! (\n\t\t\tcreateActiveXObject( 'AcroPDF.PDF' ) ||\n\t\t\tcreateActiveXObject( 'PDF.PdfCtrl' )\n\t\t)\n\t) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n\n/**\n * Helper function for creating ActiveX objects, catching any errors that are thrown\n * when it's generated.\n *\n * @param {string} type The name of the ActiveX object to create.\n * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed.\n */\nconst createActiveXObject = ( type ) => {\n\tlet ax;\n\ttry {\n\t\tax = new window.ActiveXObject( type );\n\t} catch ( e ) {\n\t\tax = undefined;\n\t}\n\treturn ax;\n};\n","/**\n * WordPress dependencies\n */\nimport { store } from '@wordpress/interactivity';\n/**\n * Internal dependencies\n */\nimport { browserSupportsPdfs } from './utils';\n\nstore(\n\t'core/file',\n\t{\n\t\tstate: {\n\t\t\tget hasPdfPreview() {\n\t\t\t\treturn browserSupportsPdfs();\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","store","x","d","createActiveXObject","type","ax","window","ActiveXObject","e","undefined","state","hasPdfPreview","navigator","userAgent","indexOf","maxTouchPoints","lock"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"block-library/file/view.min.js","mappings":"2CACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICElF,MAAM,GAFEI,EAE+B,CAAE,MAAW,IAAMC,EAA8DC,OAFrGC,EAAI,CAAC,EAAGjB,EAAoBkB,EAAED,EAAGH,GAAWG,GC+CzDE,EAAwBC,IAC7B,IAAIC,EACJ,IACCA,EAAK,IAAIC,OAAOC,cAAeH,EAChC,CAAE,MAAQI,GACTH,OAAKI,CACN,CACA,OAAOJ,CAAE,EDtDFP,MAAWG,GESnBD,EAAAA,EAAAA,OACC,YACA,CACCU,MAAO,CACN,iBAAIC,GACH,QDNEL,OAAOM,UAAUC,UAAUC,QAAS,SAAY,GAKhDR,OAAOM,UAAUC,UAAUC,QAAS,YAAe,GAMvDR,OAAOM,UAAUC,UAAUC,QAAS,cAAiB,GACrDR,OAAOM,UAAUG,gBACjBT,OAAOM,UAAUG,eAAiB,IAO7BT,OAAOC,eAAiB,kBAAmBD,UAE/CH,EAAqB,iBACrBA,EAAqB,eChBrB,IAGF,CAAEa,MAAM","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/external module \"@wordpress/interactivity\"","webpack://wp/./packages/block-library/build-module/file/utils/@wordpress/block-library/src/file/utils/index.js","webpack://wp/./packages/block-library/build-module/file/@wordpress/block-library/src/file/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"store\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store });","/**\n * Uses a combination of user agent matching and feature detection to determine whether\n * the current browser supports rendering PDFs inline.\n *\n * @return {boolean} Whether or not the browser supports inline PDFs.\n */\nexport const browserSupportsPdfs = () => {\n\t// Most mobile devices include \"Mobi\" in their UA.\n\tif ( window.navigator.userAgent.indexOf( 'Mobi' ) > -1 ) {\n\t\treturn false;\n\t}\n\n\t// Android tablets are the noteable exception.\n\tif ( window.navigator.userAgent.indexOf( 'Android' ) > -1 ) {\n\t\treturn false;\n\t}\n\n\t// iPad pretends to be a Mac.\n\tif (\n\t\twindow.navigator.userAgent.indexOf( 'Macintosh' ) > -1 &&\n\t\twindow.navigator.maxTouchPoints &&\n\t\twindow.navigator.maxTouchPoints > 2\n\t) {\n\t\treturn false;\n\t}\n\n\t// IE only supports PDFs when there's an ActiveX object available for it.\n\tif (\n\t\t!! ( window.ActiveXObject || 'ActiveXObject' in window ) &&\n\t\t! (\n\t\t\tcreateActiveXObject( 'AcroPDF.PDF' ) ||\n\t\t\tcreateActiveXObject( 'PDF.PdfCtrl' )\n\t\t)\n\t) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n\n/**\n * Helper function for creating ActiveX objects, catching any errors that are thrown\n * when it's generated.\n *\n * @param {string} type The name of the ActiveX object to create.\n * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed.\n */\nconst createActiveXObject = ( type ) => {\n\tlet ax;\n\ttry {\n\t\tax = new window.ActiveXObject( type );\n\t} catch ( e ) {\n\t\tax = undefined;\n\t}\n\treturn ax;\n};\n","/**\n * WordPress dependencies\n */\nimport { store } from '@wordpress/interactivity';\n/**\n * Internal dependencies\n */\nimport { browserSupportsPdfs } from './utils';\n\nstore(\n\t'core/file',\n\t{\n\t\tstate: {\n\t\t\tget hasPdfPreview() {\n\t\t\t\treturn browserSupportsPdfs();\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","store","x","d","createActiveXObject","type","ax","window","ActiveXObject","e","undefined","state","hasPdfPreview","navigator","userAgent","indexOf","maxTouchPoints","lock"],"sourceRoot":""} \ No newline at end of file diff --git a/build-module/block-library/image/view.min.asset.php b/build-module/block-library/image/view.min.asset.php deleted file mode 100644 index c3d0ddca..00000000 --- a/build-module/block-library/image/view.min.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('@wordpress/interactivity'), 'version' => 'e90ba1f1006920e85ee5', 'type' => 'module'); diff --git a/build-module/block-library/image/view.min.js.map b/build-module/block-library/image/view.min.js.map index e94156e4..5775623b 100644 --- a/build-module/block-library/image/view.min.js.map +++ b/build-module/block-library/image/view.min.js.map @@ -1 +1 @@ -{"version":3,"file":"./build-module/block-library/image/view.min.js","mappings":"2CACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICElF,MAAM,GAFEI,EAE+B,CAAE,WAAgB,IAAMC,EAA8DC,WAAY,WAAgB,IAAMD,EAA8DE,WAAY,MAAW,IAAMF,EAA8DG,OAFrSC,EAAI,CAAC,EAAGnB,EAAoBoB,EAAED,EAAGL,GAAWK,GAAvDL,MAAWK,ECWnB,IAAIE,GAAa,EAQbC,EAAgB,EAEpB,MAAM,MAAEC,EAAK,QAAEC,EAAO,UAAEC,IAAcP,EAAAA,EAAAA,OACrC,aACA,CACCK,MAAO,CACNG,eAAgB,KAChB,gBAAIC,GACH,OAAOJ,EAAMK,SAAUL,EAAMG,eAC9B,EACA,iBAAIG,GACH,OAAgC,OAAzBN,EAAMG,cACd,EACA,iBAAII,GACH,OAA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strap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/external module \"@wordpress/interactivity\"","webpack://wp/./packages/block-library/build-module/image/@wordpress/block-library/src/image/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext, [\"getElement\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement, [\"store\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store });","/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\n/**\n * Tracks whether user is touching screen; used to differentiate behavior for\n * touch and mouse input.\n *\n * @type {boolean}\n */\nlet isTouching = false;\n\n/**\n * Tracks the last time the screen was touched; used to differentiate behavior\n * for touch and mouse input.\n *\n * @type {number}\n */\nlet lastTouchTime = 0;\n\nconst { state, actions, callbacks } = store(\n\t'core/image',\n\t{\n\t\tstate: {\n\t\t\tcurrentImageId: null,\n\t\t\tget currentImage() {\n\t\t\t\treturn state.metadata[ state.currentImageId ];\n\t\t\t},\n\t\t\tget overlayOpened() {\n\t\t\t\treturn state.currentImageId !== null;\n\t\t\t},\n\t\t\tget roleAttribute() {\n\t\t\t\treturn state.overlayOpened ? 'dialog' : null;\n\t\t\t},\n\t\t\tget ariaModal() {\n\t\t\t\treturn state.overlayOpened ? 'true' : null;\n\t\t\t},\n\t\t\tget enlargedSrc() {\n\t\t\t\treturn (\n\t\t\t\t\tstate.currentImage.uploadedSrc ||\n\t\t\t\t\t'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='\n\t\t\t\t);\n\t\t\t},\n\t\t\tget figureStyles() {\n\t\t\t\treturn (\n\t\t\t\t\tstate.overlayOpened &&\n\t\t\t\t\t`${ state.currentImage.figureStyles?.replace(\n\t\t\t\t\t\t/margin[^;]*;?/g,\n\t\t\t\t\t\t''\n\t\t\t\t\t) };`\n\t\t\t\t);\n\t\t\t},\n\t\t\tget imgStyles() {\n\t\t\t\treturn (\n\t\t\t\t\tstate.overlayOpened &&\n\t\t\t\t\t`${ state.currentImage.imgStyles?.replace(\n\t\t\t\t\t\t/;$/,\n\t\t\t\t\t\t''\n\t\t\t\t\t) }; object-fit:cover;`\n\t\t\t\t);\n\t\t\t},\n\t\t\tget imageButtonRight() {\n\t\t\t\tconst { imageId } = getContext();\n\t\t\t\treturn state.metadata[ imageId ].imageButtonRight;\n\t\t\t},\n\t\t\tget imageButtonTop() {\n\t\t\t\tconst { imageId } = getContext();\n\t\t\t\treturn state.metadata[ imageId ].imageButtonTop;\n\t\t\t},\n\t\t\tget isContentHidden() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\treturn (\n\t\t\t\t\tstate.overlayEnabled && state.currentImageId === ctx.imageId\n\t\t\t\t);\n\t\t\t},\n\t\t\tget isContentVisible() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\treturn (\n\t\t\t\t\t! state.overlayEnabled &&\n\t\t\t\t\tstate.currentImageId === ctx.imageId\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\tshowLightbox() {\n\t\t\t\tconst { imageId } = getContext();\n\n\t\t\t\t// Bails out if the image has not loaded yet.\n\t\t\t\tif ( ! state.metadata[ imageId ].imageRef?.complete ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Stores the positions of the scroll to fix it until the overlay is\n\t\t\t\t// closed.\n\t\t\t\tstate.scrollTopReset = document.documentElement.scrollTop;\n\t\t\t\tstate.scrollLeftReset = document.documentElement.scrollLeft;\n\n\t\t\t\t// Sets the current expanded image in the state and enables the overlay.\n\t\t\t\tstate.overlayEnabled = true;\n\t\t\t\tstate.currentImageId = imageId;\n\n\t\t\t\t// Computes the styles of the overlay for the animation.\n\t\t\t\tcallbacks.setOverlayStyles();\n\t\t\t},\n\t\t\thideLightbox() {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Starts the overlay closing animation. The showClosingAnimation\n\t\t\t\t\t// class is used to avoid showing it on page load.\n\t\t\t\t\tstate.showClosingAnimation = true;\n\t\t\t\t\tstate.overlayEnabled = false;\n\n\t\t\t\t\t// Waits until the close animation has completed before allowing a\n\t\t\t\t\t// user to scroll again. The duration of this animation is defined in\n\t\t\t\t\t// the `styles.scss` file, but in any case we should wait a few\n\t\t\t\t\t// milliseconds longer than the duration, otherwise a user may scroll\n\t\t\t\t\t// too soon and cause the animation to look sloppy.\n\t\t\t\t\tsetTimeout( function () {\n\t\t\t\t\t\t// Delays before changing the focus. Otherwise the focus ring will\n\t\t\t\t\t\t// appear on Firefox before the image has finished animating, which\n\t\t\t\t\t\t// looks broken.\n\t\t\t\t\t\tstate.currentImage.buttonRef.focus( {\n\t\t\t\t\t\t\tpreventScroll: true,\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t// Resets the current image id to mark the overlay as closed.\n\t\t\t\t\t\tstate.currentImageId = null;\n\t\t\t\t\t}, 450 );\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleKeydown( event ) {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Focuses the close button when the user presses the tab key.\n\t\t\t\t\tif ( event.key === 'Tab' ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tconst { ref } = getElement();\n\t\t\t\t\t\tref.querySelector( 'button' ).focus();\n\t\t\t\t\t}\n\t\t\t\t\t// Closes the lightbox when the user presses the escape key.\n\t\t\t\t\tif ( event.key === 'Escape' ) {\n\t\t\t\t\t\tactions.hideLightbox();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleTouchMove( event ) {\n\t\t\t\t// On mobile devices, prevents triggering the scroll event because\n\t\t\t\t// otherwise the page jumps around when it resets the scroll position.\n\t\t\t\t// This also means that closing the lightbox requires that a user\n\t\t\t\t// perform a simple tap. This may be changed in the future if there is a\n\t\t\t\t// better alternative to override or reset the scroll position during\n\t\t\t\t// swipe actions.\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleTouchStart() {\n\t\t\t\tisTouching = true;\n\t\t\t},\n\t\t\thandleTouchEnd() {\n\t\t\t\t// Waits a few milliseconds before resetting to ensure that pinch to\n\t\t\t\t// zoom works consistently on mobile devices when the lightbox is open.\n\t\t\t\tlastTouchTime = Date.now();\n\t\t\t\tisTouching = false;\n\t\t\t},\n\t\t\thandleScroll() {\n\t\t\t\t// Prevents scrolling behaviors that trigger content shift while the\n\t\t\t\t// lightbox is open. It would be better to accomplish through CSS alone,\n\t\t\t\t// but using overflow: hidden is currently the only way to do so and\n\t\t\t\t// that causes a layout to shift and prevents the zoom animation from\n\t\t\t\t// working in some cases because it's not possible to account for the\n\t\t\t\t// layout shift when doing the animation calculations. Instead, it uses\n\t\t\t\t// JavaScript to prevent and reset the scrolling behavior.\n\t\t\t\tif ( state.overlayOpened ) {\n\t\t\t\t\t// Avoids overriding the scroll behavior on mobile devices because\n\t\t\t\t\t// doing so breaks the pinch to zoom functionality, and users should\n\t\t\t\t\t// be able to zoom in further on the high-res image.\n\t\t\t\t\tif ( ! isTouching && Date.now() - lastTouchTime > 450 ) {\n\t\t\t\t\t\t// It doesn't rely on `event.preventDefault()` to prevent scrolling\n\t\t\t\t\t\t// because the scroll event can't be canceled, so it resets the\n\t\t\t\t\t\t// position instead.\n\t\t\t\t\t\twindow.scrollTo(\n\t\t\t\t\t\t\tstate.scrollLeftReset,\n\t\t\t\t\t\t\tstate.scrollTopReset\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcallbacks: {\n\t\t\tsetOverlayStyles() {\n\t\t\t\tif ( ! state.overlayEnabled ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet {\n\t\t\t\t\tnaturalWidth,\n\t\t\t\t\tnaturalHeight,\n\t\t\t\t\toffsetWidth: originalWidth,\n\t\t\t\t\toffsetHeight: originalHeight,\n\t\t\t\t} = state.currentImage.imageRef;\n\t\t\t\tlet { x: screenPosX, y: screenPosY } =\n\t\t\t\t\tstate.currentImage.imageRef.getBoundingClientRect();\n\n\t\t\t\t// Natural ratio of the image clicked to open the lightbox.\n\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t// Original ratio of the image clicked to open the lightbox.\n\t\t\t\tlet originalRatio = originalWidth / originalHeight;\n\n\t\t\t\t// If it has object-fit: contain, recalculates the original sizes\n\t\t\t\t// and the screen position without the blank spaces.\n\t\t\t\tif ( state.currentImage.scaleAttr === 'contain' ) {\n\t\t\t\t\tif ( naturalRatio > originalRatio ) {\n\t\t\t\t\t\tconst heightWithoutSpace = originalWidth / naturalRatio;\n\t\t\t\t\t\t// Recalculates screen position without the top space.\n\t\t\t\t\t\tscreenPosY +=\n\t\t\t\t\t\t\t( originalHeight - heightWithoutSpace ) / 2;\n\t\t\t\t\t\toriginalHeight = heightWithoutSpace;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst widthWithoutSpace = originalHeight * naturalRatio;\n\t\t\t\t\t\t// Recalculates screen position without the left space.\n\t\t\t\t\t\tscreenPosX += ( originalWidth - widthWithoutSpace ) / 2;\n\t\t\t\t\t\toriginalWidth = widthWithoutSpace;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toriginalRatio = originalWidth / originalHeight;\n\n\t\t\t\t// Typically, it uses the image's full-sized dimensions. If those\n\t\t\t\t// dimensions have not been set (i.e. an external image with only one\n\t\t\t\t// size), the image's dimensions in the lightbox are the same\n\t\t\t\t// as those of the image in the content.\n\t\t\t\tlet imgMaxWidth = parseFloat(\n\t\t\t\t\tstate.currentImage.targetWidth !== 'none'\n\t\t\t\t\t\t? state.currentImage.targetWidth\n\t\t\t\t\t\t: naturalWidth\n\t\t\t\t);\n\t\t\t\tlet imgMaxHeight = parseFloat(\n\t\t\t\t\tstate.currentImage.targetHeight !== 'none'\n\t\t\t\t\t\t? state.currentImage.targetHeight\n\t\t\t\t\t\t: naturalHeight\n\t\t\t\t);\n\n\t\t\t\t// Ratio of the biggest image stored in the database.\n\t\t\t\tlet imgRatio = imgMaxWidth / imgMaxHeight;\n\t\t\t\tlet containerMaxWidth = imgMaxWidth;\n\t\t\t\tlet containerMaxHeight = imgMaxHeight;\n\t\t\t\tlet containerWidth = imgMaxWidth;\n\t\t\t\tlet containerHeight = imgMaxHeight;\n\n\t\t\t\t// Checks if the target image has a different ratio than the original\n\t\t\t\t// one (thumbnail). Recalculates the width and height.\n\t\t\t\tif ( naturalRatio.toFixed( 2 ) !== imgRatio.toFixed( 2 ) ) {\n\t\t\t\t\tif ( naturalRatio > imgRatio ) {\n\t\t\t\t\t\t// If the width is reached before the height, it keeps the maxWidth\n\t\t\t\t\t\t// and recalculates the height unless the difference between the\n\t\t\t\t\t\t// maxHeight and the reducedHeight is higher than the maxWidth,\n\t\t\t\t\t\t// where it keeps the reducedHeight and recalculate the width.\n\t\t\t\t\t\tconst reducedHeight = imgMaxWidth / naturalRatio;\n\t\t\t\t\t\tif ( imgMaxHeight - reducedHeight > imgMaxWidth ) {\n\t\t\t\t\t\t\timgMaxHeight = reducedHeight;\n\t\t\t\t\t\t\timgMaxWidth = reducedHeight * naturalRatio;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\timgMaxHeight = imgMaxWidth / naturalRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If the height is reached before the width, it keeps the maxHeight\n\t\t\t\t\t\t// and recalculate the width unlesss the difference between the\n\t\t\t\t\t\t// maxWidth and the reducedWidth is higher than the maxHeight, where\n\t\t\t\t\t\t// it keeps the reducedWidth and recalculate the height.\n\t\t\t\t\t\tconst reducedWidth = imgMaxHeight * naturalRatio;\n\t\t\t\t\t\tif ( imgMaxWidth - reducedWidth > imgMaxHeight ) {\n\t\t\t\t\t\t\timgMaxWidth = reducedWidth;\n\t\t\t\t\t\t\timgMaxHeight = reducedWidth / naturalRatio;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\timgMaxWidth = imgMaxHeight * naturalRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcontainerWidth = imgMaxWidth;\n\t\t\t\t\tcontainerHeight = imgMaxHeight;\n\t\t\t\t\timgRatio = imgMaxWidth / imgMaxHeight;\n\n\t\t\t\t\t// Calculates the max size of the container.\n\t\t\t\t\tif ( originalRatio > imgRatio ) {\n\t\t\t\t\t\tcontainerMaxWidth = imgMaxWidth;\n\t\t\t\t\t\tcontainerMaxHeight = containerMaxWidth / originalRatio;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontainerMaxHeight = imgMaxHeight;\n\t\t\t\t\t\tcontainerMaxWidth = containerMaxHeight * originalRatio;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If the image has been pixelated on purpose, it keeps that size.\n\t\t\t\tif (\n\t\t\t\t\toriginalWidth > containerWidth ||\n\t\t\t\t\toriginalHeight > containerHeight\n\t\t\t\t) {\n\t\t\t\t\tcontainerWidth = originalWidth;\n\t\t\t\t\tcontainerHeight = originalHeight;\n\t\t\t\t}\n\n\t\t\t\t// Calculates the final lightbox image size and the scale factor.\n\t\t\t\t// MaxWidth is either the window container (accounting for padding) or\n\t\t\t\t// the image resolution.\n\t\t\t\tlet horizontalPadding = 0;\n\t\t\t\tif ( window.innerWidth > 480 ) {\n\t\t\t\t\thorizontalPadding = 80;\n\t\t\t\t} else if ( window.innerWidth > 1920 ) {\n\t\t\t\t\thorizontalPadding = 160;\n\t\t\t\t}\n\t\t\t\tconst verticalPadding = 80;\n\n\t\t\t\tconst targetMaxWidth = Math.min(\n\t\t\t\t\twindow.innerWidth - horizontalPadding,\n\t\t\t\t\tcontainerWidth\n\t\t\t\t);\n\t\t\t\tconst targetMaxHeight = Math.min(\n\t\t\t\t\twindow.innerHeight - verticalPadding,\n\t\t\t\t\tcontainerHeight\n\t\t\t\t);\n\t\t\t\tconst targetContainerRatio = targetMaxWidth / targetMaxHeight;\n\n\t\t\t\tif ( originalRatio > targetContainerRatio ) {\n\t\t\t\t\t// If targetMaxWidth is reached before targetMaxHeight.\n\t\t\t\t\tcontainerWidth = targetMaxWidth;\n\t\t\t\t\tcontainerHeight = containerWidth / originalRatio;\n\t\t\t\t} else {\n\t\t\t\t\t// If targetMaxHeight is reached before targetMaxWidth.\n\t\t\t\t\tcontainerHeight = targetMaxHeight;\n\t\t\t\t\tcontainerWidth = containerHeight * originalRatio;\n\t\t\t\t}\n\n\t\t\t\tconst containerScale = originalWidth / containerWidth;\n\t\t\t\tconst lightboxImgWidth =\n\t\t\t\t\timgMaxWidth * ( containerWidth / containerMaxWidth );\n\t\t\t\tconst lightboxImgHeight =\n\t\t\t\t\timgMaxHeight * ( containerHeight / containerMaxHeight );\n\n\t\t\t\t// As of this writing, using the calculations above will render the\n\t\t\t\t// lightbox with a small, erroneous whitespace on the left side of the\n\t\t\t\t// image in iOS Safari, perhaps due to an inconsistency in how browsers\n\t\t\t\t// handle absolute positioning and CSS transformation. In any case,\n\t\t\t\t// adding 1 pixel to the container width and height solves the problem,\n\t\t\t\t// though this can be removed if the issue is fixed in the future.\n\t\t\t\tstate.overlayStyles = `\n\t\t\t\t:root {\n\t\t\t\t\t--wp--lightbox-initial-top-position: ${ screenPosY }px;\n\t\t\t\t\t--wp--lightbox-initial-left-position: ${ screenPosX }px;\n\t\t\t\t\t--wp--lightbox-container-width: ${ containerWidth + 1 }px;\n\t\t\t\t\t--wp--lightbox-container-height: ${ containerHeight + 1 }px;\n\t\t\t\t\t--wp--lightbox-image-width: ${ lightboxImgWidth }px;\n\t\t\t\t\t--wp--lightbox-image-height: ${ lightboxImgHeight }px;\n\t\t\t\t\t--wp--lightbox-scale: ${ containerScale };\n\t\t\t\t\t--wp--lightbox-scrollbar-width: ${\n\t\t\t\t\t\twindow.innerWidth - document.documentElement.clientWidth\n\t\t\t\t\t}px;\n\t\t\t\t}\n\t\t\t`;\n\t\t\t},\n\t\t\tsetButtonStyles() {\n\t\t\t\tconst { imageId } = getContext();\n\t\t\t\tconst { ref } = getElement();\n\n\t\t\t\tstate.metadata[ imageId ].imageRef = ref;\n\t\t\t\tstate.metadata[ imageId ].currentSrc = ref.currentSrc;\n\n\t\t\t\tconst {\n\t\t\t\t\tnaturalWidth,\n\t\t\t\t\tnaturalHeight,\n\t\t\t\t\toffsetWidth,\n\t\t\t\t\toffsetHeight,\n\t\t\t\t} = ref;\n\n\t\t\t\t// If the image isn't loaded yet, it can't calculate where the button\n\t\t\t\t// should be.\n\t\t\t\tif ( naturalWidth === 0 || naturalHeight === 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst figure = ref.parentElement;\n\t\t\t\tconst figureWidth = ref.parentElement.clientWidth;\n\n\t\t\t\t// It needs special handling for the height because a caption will cause\n\t\t\t\t// the figure to be taller than the image, which means it needs to\n\t\t\t\t// account for that when calculating the placement of the button in the\n\t\t\t\t// top right corner of the image.\n\t\t\t\tlet figureHeight = ref.parentElement.clientHeight;\n\t\t\t\tconst caption = figure.querySelector( 'figcaption' );\n\t\t\t\tif ( caption ) {\n\t\t\t\t\tconst captionComputedStyle =\n\t\t\t\t\t\twindow.getComputedStyle( caption );\n\t\t\t\t\tif (\n\t\t\t\t\t\t! [ 'absolute', 'fixed' ].includes(\n\t\t\t\t\t\t\tcaptionComputedStyle.position\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tfigureHeight =\n\t\t\t\t\t\t\tfigureHeight -\n\t\t\t\t\t\t\tcaption.offsetHeight -\n\t\t\t\t\t\t\tparseFloat( captionComputedStyle.marginTop ) -\n\t\t\t\t\t\t\tparseFloat( captionComputedStyle.marginBottom );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst buttonOffsetTop = figureHeight - offsetHeight;\n\t\t\t\tconst buttonOffsetRight = figureWidth - offsetWidth;\n\n\t\t\t\tlet imageButtonTop = buttonOffsetTop + 16;\n\t\t\t\tlet imageButtonRight = buttonOffsetRight + 16;\n\n\t\t\t\t// In the case of an image with object-fit: contain, the size of the\n\t\t\t\t// element can be larger than the image itself, so it needs to\n\t\t\t\t// calculate where to place the button.\n\t\t\t\tif ( state.metadata[ imageId ].scaleAttr === 'contain' ) {\n\t\t\t\t\t// Natural ratio of the image.\n\t\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t\t// Offset ratio of the image.\n\t\t\t\t\tconst offsetRatio = offsetWidth / offsetHeight;\n\n\t\t\t\t\tif ( naturalRatio >= offsetRatio ) {\n\t\t\t\t\t\t// If it reaches the width first, it keeps the width and compute the\n\t\t\t\t\t\t// height.\n\t\t\t\t\t\tconst referenceHeight = offsetWidth / naturalRatio;\n\t\t\t\t\t\timageButtonTop =\n\t\t\t\t\t\t\t( offsetHeight - referenceHeight ) / 2 +\n\t\t\t\t\t\t\tbuttonOffsetTop +\n\t\t\t\t\t\t\t16;\n\t\t\t\t\t\timageButtonRight = buttonOffsetRight + 16;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it reaches the height first, it keeps the height and compute\n\t\t\t\t\t\t// the width.\n\t\t\t\t\t\tconst referenceWidth = offsetHeight * naturalRatio;\n\t\t\t\t\t\timageButtonTop = buttonOffsetTop + 16;\n\t\t\t\t\t\timageButtonRight =\n\t\t\t\t\t\t\t( offsetWidth - referenceWidth ) / 2 +\n\t\t\t\t\t\t\tbuttonOffsetRight +\n\t\t\t\t\t\t\t16;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstate.metadata[ imageId ].imageButtonTop = imageButtonTop;\n\t\t\t\tstate.metadata[ imageId ].imageButtonRight = imageButtonRight;\n\t\t\t},\n\t\t\tsetOverlayFocus() {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Moves the focus to the dialog when it opens.\n\t\t\t\t\tconst { ref } = getElement();\n\t\t\t\t\tref.focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\tinitTriggerButton() {\n\t\t\t\tconst { imageId } = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tstate.metadata[ imageId ].buttonRef = ref;\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","getContext","getElement","store","x","d","isTouching","lastTouchTime","state","actions","callbacks","currentImageId","currentImage","metadata","overlayOpened","roleAttribute","ariaModal","enlargedSrc","uploadedSrc","figureStyles","replace","imgStyles","imageButtonRight","imageId","imageButtonTop","isContentHidden","ctx","overlayEnabled","isContentVisible","showLightbox","imageRef","complete","scrollTopReset","document","documentElement","scrollTop","scrollLeftReset","scrollLeft","setOverlayStyles","hideLightbox","showClosingAnimation","setTimeout","buttonRef","focus","preventScroll","handleKeydown","event","preventDefault","ref","querySelector","handleTouchMove","handleTouchStart","handleTouchEnd","Date","now","handleScroll","window","scrollTo","naturalWidth","naturalHeight","offsetWidth","originalWidth","offsetHeight","originalHeight","screenPosX","screenPosY","getBoundingClientRect","naturalRatio","originalRatio","scaleAttr","heightWithoutSpace","widthWithoutSpace","imgMaxWidth","parseFloat","targetWidth","imgMaxHeight","targetHeight","imgRatio","containerMaxWidth","containerMaxHeight","containerWidth","containerHeight","toFixed","reducedHeight","reducedWidth","horizontalPadding","innerWidth","targetMaxWidth","Math","min","targetMaxHeight","innerHeight","containerScale","lightboxImgWidth","lightboxImgHeight","overlayStyles","clientWidth","setButtonStyles","currentSrc","figure","parentElement","figureWidth","figureHeight","clientHeight","caption","captionComputedStyle","getComputedStyle","includes","position","marginTop","marginBottom","buttonOffsetTop","buttonOffsetRight","setOverlayFocus","initTriggerButton","lock"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"block-library/image/view.min.js","mappings":"2CACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICElF,MAAM,GAFEI,EAE+B,CAAE,WAAgB,IAAMC,EAA8DC,WAAY,WAAgB,IAAMD,EAA8DE,WAAY,MAAW,IAAMF,EAA8DG,OAFrSC,EAAI,CAAC,EAAGnB,EAAoBoB,EAAED,EAAGL,GAAWK,GAAvDL,MAAWK,ECWnB,IAAIE,GAAa,EAQbC,EAAgB,EAEpB,MAAM,MAAEC,EAAK,QAAEC,EAAO,UAAEC,IAAcP,EAAAA,EAAAA,OACrC,aACA,CACCK,MAAO,CACNG,eAAgB,KAChB,gBAAIC,GACH,OAAOJ,EAAMK,SAAUL,EAAMG,eAC9B,EACA,iBAAIG,GACH,OAAgC,OAAzBN,EAAMG,cACd,EACA,iBAAII,GACH,OAAOP,EAAMM,cAAgB,SAAW,IACzC,EACA,aAAIE,GACH,OAAOR,EAAMM,cAAgB,OAAS,IACvC,EACA,eAAIG,GACH,OACCT,EAAMI,aAAaM,aACnB,4DAEF,EACA,gBAAIC,GACH,OACCX,EAAMM,eACL,GAAGN,EAAMI,aAAaO,cAAcC,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AAcrD,EAAIoD,cAAcJ,YAMtC,IAAIM,EAAetD,EAAIoD,cAAcG,aACrC,MAAMC,EAAUL,EAAOlD,cAAe,cACtC,GAAKuD,EAAU,CACd,MAAMC,EACLjD,OAAOkD,iBAAkBF,GAEvB,CAAE,WAAY,SAAUG,SACzBF,EAAqBG,YAGtBN,EACCA,EACAE,EAAQ1C,aACRW,WAAYgC,EAAqBI,WACjCpC,WAAYgC,EAAqBK,cAEpC,CAEA,MAAMC,EAAkBT,EAAexC,EACjCkD,EAAoBX,EAAczC,EAExC,IAAIpC,EAAiBuF,EAAkB,GACnCzF,EAAmB0F,EAAoB,GAK3C,GAA6C,YAAxCxG,EAAMK,SAAUU,GAAU8C,UAA0B,CAExD,MAAMF,EAAeT,EAAeC,EAI/BQ,GAFeP,EAAcE,GAMjCtC,GACGsC,EAFqBF,EAAcO,GAEA,EACrC4C,EACA,GACDzF,EAAmB0F,EAAoB,KAKvCxF,EAAiBuF,EAAkB,GACnCzF,GACGsC,EAHoBE,EAAeK,GAGF,EACnC6C,EACA,GAEH,CAEAxG,EAAMK,SAAUU,GAAUC,eAAiBA,EAC3ChB,EAAMK,SAAUU,GAAUD,iBAAmBA,CAC9C,EACA2F,eAAAA,GACC,GAAKzG,EAAMmB,eAAiB,CAE3B,MAAM,IAAEqB,IAAQ9C,EAAAA,EAAAA,cAChB8C,EAAIL,OACL,CACD,EACAuE,iBAAAA,GACC,MAAM,QAAE3F,IAAYtB,EAAAA,EAAAA,eACd,IAAE+C,IAAQ9C,EAAAA,EAAAA,cAChBM,EAAMK,SAAUU,GAAUmB,UAAYM,CACvC,IAGF,CAAEmE,MAAM","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/external module \"@wordpress/interactivity\"","webpack://wp/./packages/block-library/build-module/image/@wordpress/block-library/src/image/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext, [\"getElement\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement, [\"store\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store });","/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\n/**\n * Tracks whether user is touching screen; used to differentiate behavior for\n * touch and mouse input.\n *\n * @type {boolean}\n */\nlet isTouching = false;\n\n/**\n * Tracks the last time the screen was touched; used to differentiate behavior\n * for touch and mouse input.\n *\n * @type {number}\n */\nlet lastTouchTime = 0;\n\nconst { state, actions, callbacks } = store(\n\t'core/image',\n\t{\n\t\tstate: {\n\t\t\tcurrentImageId: null,\n\t\t\tget currentImage() {\n\t\t\t\treturn state.metadata[ state.currentImageId ];\n\t\t\t},\n\t\t\tget overlayOpened() {\n\t\t\t\treturn state.currentImageId !== null;\n\t\t\t},\n\t\t\tget roleAttribute() {\n\t\t\t\treturn state.overlayOpened ? 'dialog' : null;\n\t\t\t},\n\t\t\tget ariaModal() {\n\t\t\t\treturn state.overlayOpened ? 'true' : null;\n\t\t\t},\n\t\t\tget enlargedSrc() {\n\t\t\t\treturn (\n\t\t\t\t\tstate.currentImage.uploadedSrc ||\n\t\t\t\t\t'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='\n\t\t\t\t);\n\t\t\t},\n\t\t\tget figureStyles() {\n\t\t\t\treturn (\n\t\t\t\t\tstate.overlayOpened &&\n\t\t\t\t\t`${ state.currentImage.figureStyles?.replace(\n\t\t\t\t\t\t/margin[^;]*;?/g,\n\t\t\t\t\t\t''\n\t\t\t\t\t) };`\n\t\t\t\t);\n\t\t\t},\n\t\t\tget imgStyles() {\n\t\t\t\treturn (\n\t\t\t\t\tstate.overlayOpened &&\n\t\t\t\t\t`${ state.currentImage.imgStyles?.replace(\n\t\t\t\t\t\t/;$/,\n\t\t\t\t\t\t''\n\t\t\t\t\t) }; object-fit:cover;`\n\t\t\t\t);\n\t\t\t},\n\t\t\tget imageButtonRight() {\n\t\t\t\tconst { imageId } = getContext();\n\t\t\t\treturn state.metadata[ imageId ].imageButtonRight;\n\t\t\t},\n\t\t\tget imageButtonTop() {\n\t\t\t\tconst { imageId } = getContext();\n\t\t\t\treturn state.metadata[ imageId ].imageButtonTop;\n\t\t\t},\n\t\t\tget isContentHidden() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\treturn (\n\t\t\t\t\tstate.overlayEnabled && state.currentImageId === ctx.imageId\n\t\t\t\t);\n\t\t\t},\n\t\t\tget isContentVisible() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\treturn (\n\t\t\t\t\t! state.overlayEnabled &&\n\t\t\t\t\tstate.currentImageId === ctx.imageId\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\tshowLightbox() {\n\t\t\t\tconst { imageId } = getContext();\n\n\t\t\t\t// Bails out if the image has not loaded yet.\n\t\t\t\tif ( ! state.metadata[ imageId ].imageRef?.complete ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Stores the positions of the scroll to fix it until the overlay is\n\t\t\t\t// closed.\n\t\t\t\tstate.scrollTopReset = document.documentElement.scrollTop;\n\t\t\t\tstate.scrollLeftReset = document.documentElement.scrollLeft;\n\n\t\t\t\t// Sets the current expanded image in the state and enables the overlay.\n\t\t\t\tstate.overlayEnabled = true;\n\t\t\t\tstate.currentImageId = imageId;\n\n\t\t\t\t// Computes the styles of the overlay for the animation.\n\t\t\t\tcallbacks.setOverlayStyles();\n\t\t\t},\n\t\t\thideLightbox() {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Starts the overlay closing animation. The showClosingAnimation\n\t\t\t\t\t// class is used to avoid showing it on page load.\n\t\t\t\t\tstate.showClosingAnimation = true;\n\t\t\t\t\tstate.overlayEnabled = false;\n\n\t\t\t\t\t// Waits until the close animation has completed before allowing a\n\t\t\t\t\t// user to scroll again. The duration of this animation is defined in\n\t\t\t\t\t// the `styles.scss` file, but in any case we should wait a few\n\t\t\t\t\t// milliseconds longer than the duration, otherwise a user may scroll\n\t\t\t\t\t// too soon and cause the animation to look sloppy.\n\t\t\t\t\tsetTimeout( function () {\n\t\t\t\t\t\t// Delays before changing the focus. Otherwise the focus ring will\n\t\t\t\t\t\t// appear on Firefox before the image has finished animating, which\n\t\t\t\t\t\t// looks broken.\n\t\t\t\t\t\tstate.currentImage.buttonRef.focus( {\n\t\t\t\t\t\t\tpreventScroll: true,\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t// Resets the current image id to mark the overlay as closed.\n\t\t\t\t\t\tstate.currentImageId = null;\n\t\t\t\t\t}, 450 );\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleKeydown( event ) {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Focuses the close button when the user presses the tab key.\n\t\t\t\t\tif ( event.key === 'Tab' ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tconst { ref } = getElement();\n\t\t\t\t\t\tref.querySelector( 'button' ).focus();\n\t\t\t\t\t}\n\t\t\t\t\t// Closes the lightbox when the user presses the escape key.\n\t\t\t\t\tif ( event.key === 'Escape' ) {\n\t\t\t\t\t\tactions.hideLightbox();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleTouchMove( event ) {\n\t\t\t\t// On mobile devices, prevents triggering the scroll event because\n\t\t\t\t// otherwise the page jumps around when it resets the scroll position.\n\t\t\t\t// This also means that closing the lightbox requires that a user\n\t\t\t\t// perform a simple tap. This may be changed in the future if there is a\n\t\t\t\t// better alternative to override or reset the scroll position during\n\t\t\t\t// swipe actions.\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleTouchStart() {\n\t\t\t\tisTouching = true;\n\t\t\t},\n\t\t\thandleTouchEnd() {\n\t\t\t\t// Waits a few milliseconds before resetting to ensure that pinch to\n\t\t\t\t// zoom works consistently on mobile devices when the lightbox is open.\n\t\t\t\tlastTouchTime = Date.now();\n\t\t\t\tisTouching = false;\n\t\t\t},\n\t\t\thandleScroll() {\n\t\t\t\t// Prevents scrolling behaviors that trigger content shift while the\n\t\t\t\t// lightbox is open. It would be better to accomplish through CSS alone,\n\t\t\t\t// but using overflow: hidden is currently the only way to do so and\n\t\t\t\t// that causes a layout to shift and prevents the zoom animation from\n\t\t\t\t// working in some cases because it's not possible to account for the\n\t\t\t\t// layout shift when doing the animation calculations. Instead, it uses\n\t\t\t\t// JavaScript to prevent and reset the scrolling behavior.\n\t\t\t\tif ( state.overlayOpened ) {\n\t\t\t\t\t// Avoids overriding the scroll behavior on mobile devices because\n\t\t\t\t\t// doing so breaks the pinch to zoom functionality, and users should\n\t\t\t\t\t// be able to zoom in further on the high-res image.\n\t\t\t\t\tif ( ! isTouching && Date.now() - lastTouchTime > 450 ) {\n\t\t\t\t\t\t// It doesn't rely on `event.preventDefault()` to prevent scrolling\n\t\t\t\t\t\t// because the scroll event can't be canceled, so it resets the\n\t\t\t\t\t\t// position instead.\n\t\t\t\t\t\twindow.scrollTo(\n\t\t\t\t\t\t\tstate.scrollLeftReset,\n\t\t\t\t\t\t\tstate.scrollTopReset\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcallbacks: {\n\t\t\tsetOverlayStyles() {\n\t\t\t\tif ( ! state.overlayEnabled ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet {\n\t\t\t\t\tnaturalWidth,\n\t\t\t\t\tnaturalHeight,\n\t\t\t\t\toffsetWidth: originalWidth,\n\t\t\t\t\toffsetHeight: originalHeight,\n\t\t\t\t} = state.currentImage.imageRef;\n\t\t\t\tlet { x: screenPosX, y: screenPosY } =\n\t\t\t\t\tstate.currentImage.imageRef.getBoundingClientRect();\n\n\t\t\t\t// Natural ratio of the image clicked to open the lightbox.\n\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t// Original ratio of the image clicked to open the lightbox.\n\t\t\t\tlet originalRatio = originalWidth / originalHeight;\n\n\t\t\t\t// If it has object-fit: contain, recalculates the original sizes\n\t\t\t\t// and the screen position without the blank spaces.\n\t\t\t\tif ( state.currentImage.scaleAttr === 'contain' ) {\n\t\t\t\t\tif ( naturalRatio > originalRatio ) {\n\t\t\t\t\t\tconst heightWithoutSpace = originalWidth / naturalRatio;\n\t\t\t\t\t\t// Recalculates screen position without the top space.\n\t\t\t\t\t\tscreenPosY +=\n\t\t\t\t\t\t\t( originalHeight - heightWithoutSpace ) / 2;\n\t\t\t\t\t\toriginalHeight = heightWithoutSpace;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst widthWithoutSpace = originalHeight * naturalRatio;\n\t\t\t\t\t\t// Recalculates screen position without the left space.\n\t\t\t\t\t\tscreenPosX += ( originalWidth - widthWithoutSpace ) / 2;\n\t\t\t\t\t\toriginalWidth = widthWithoutSpace;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toriginalRatio = originalWidth / originalHeight;\n\n\t\t\t\t// Typically, it uses the image's full-sized dimensions. If those\n\t\t\t\t// dimensions have not been set (i.e. an external image with only one\n\t\t\t\t// size), the image's dimensions in the lightbox are the same\n\t\t\t\t// as those of the image in the content.\n\t\t\t\tlet imgMaxWidth = parseFloat(\n\t\t\t\t\tstate.currentImage.targetWidth !== 'none'\n\t\t\t\t\t\t? state.currentImage.targetWidth\n\t\t\t\t\t\t: naturalWidth\n\t\t\t\t);\n\t\t\t\tlet imgMaxHeight = parseFloat(\n\t\t\t\t\tstate.currentImage.targetHeight !== 'none'\n\t\t\t\t\t\t? state.currentImage.targetHeight\n\t\t\t\t\t\t: naturalHeight\n\t\t\t\t);\n\n\t\t\t\t// Ratio of the biggest image stored in the database.\n\t\t\t\tlet imgRatio = imgMaxWidth / imgMaxHeight;\n\t\t\t\tlet containerMaxWidth = imgMaxWidth;\n\t\t\t\tlet containerMaxHeight = imgMaxHeight;\n\t\t\t\tlet containerWidth = imgMaxWidth;\n\t\t\t\tlet containerHeight = imgMaxHeight;\n\n\t\t\t\t// Checks if the target image has a different ratio than the original\n\t\t\t\t// one (thumbnail). Recalculates the width and height.\n\t\t\t\tif ( naturalRatio.toFixed( 2 ) !== imgRatio.toFixed( 2 ) ) {\n\t\t\t\t\tif ( naturalRatio > imgRatio ) {\n\t\t\t\t\t\t// If the width is reached before the height, it keeps the maxWidth\n\t\t\t\t\t\t// and recalculates the height unless the difference between the\n\t\t\t\t\t\t// maxHeight and the reducedHeight is higher than the maxWidth,\n\t\t\t\t\t\t// where it keeps the reducedHeight and recalculate the width.\n\t\t\t\t\t\tconst reducedHeight = imgMaxWidth / naturalRatio;\n\t\t\t\t\t\tif ( imgMaxHeight - reducedHeight > imgMaxWidth ) {\n\t\t\t\t\t\t\timgMaxHeight = reducedHeight;\n\t\t\t\t\t\t\timgMaxWidth = reducedHeight * naturalRatio;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\timgMaxHeight = imgMaxWidth / naturalRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If the height is reached before the width, it keeps the maxHeight\n\t\t\t\t\t\t// and recalculate the width unlesss the difference between the\n\t\t\t\t\t\t// maxWidth and the reducedWidth is higher than the maxHeight, where\n\t\t\t\t\t\t// it keeps the reducedWidth and recalculate the height.\n\t\t\t\t\t\tconst reducedWidth = imgMaxHeight * naturalRatio;\n\t\t\t\t\t\tif ( imgMaxWidth - reducedWidth > imgMaxHeight ) {\n\t\t\t\t\t\t\timgMaxWidth = reducedWidth;\n\t\t\t\t\t\t\timgMaxHeight = reducedWidth / naturalRatio;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\timgMaxWidth = imgMaxHeight * naturalRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcontainerWidth = imgMaxWidth;\n\t\t\t\t\tcontainerHeight = imgMaxHeight;\n\t\t\t\t\timgRatio = imgMaxWidth / imgMaxHeight;\n\n\t\t\t\t\t// Calculates the max size of the container.\n\t\t\t\t\tif ( originalRatio > imgRatio ) {\n\t\t\t\t\t\tcontainerMaxWidth = imgMaxWidth;\n\t\t\t\t\t\tcontainerMaxHeight = containerMaxWidth / originalRatio;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontainerMaxHeight = imgMaxHeight;\n\t\t\t\t\t\tcontainerMaxWidth = containerMaxHeight * originalRatio;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If the image has been pixelated on purpose, it keeps that size.\n\t\t\t\tif (\n\t\t\t\t\toriginalWidth > containerWidth ||\n\t\t\t\t\toriginalHeight > containerHeight\n\t\t\t\t) {\n\t\t\t\t\tcontainerWidth = originalWidth;\n\t\t\t\t\tcontainerHeight = originalHeight;\n\t\t\t\t}\n\n\t\t\t\t// Calculates the final lightbox image size and the scale factor.\n\t\t\t\t// MaxWidth is either the window container (accounting for padding) or\n\t\t\t\t// the image resolution.\n\t\t\t\tlet horizontalPadding = 0;\n\t\t\t\tif ( window.innerWidth > 480 ) {\n\t\t\t\t\thorizontalPadding = 80;\n\t\t\t\t} else if ( window.innerWidth > 1920 ) {\n\t\t\t\t\thorizontalPadding = 160;\n\t\t\t\t}\n\t\t\t\tconst verticalPadding = 80;\n\n\t\t\t\tconst targetMaxWidth = Math.min(\n\t\t\t\t\twindow.innerWidth - horizontalPadding,\n\t\t\t\t\tcontainerWidth\n\t\t\t\t);\n\t\t\t\tconst targetMaxHeight = Math.min(\n\t\t\t\t\twindow.innerHeight - verticalPadding,\n\t\t\t\t\tcontainerHeight\n\t\t\t\t);\n\t\t\t\tconst targetContainerRatio = targetMaxWidth / targetMaxHeight;\n\n\t\t\t\tif ( originalRatio > targetContainerRatio ) {\n\t\t\t\t\t// If targetMaxWidth is reached before targetMaxHeight.\n\t\t\t\t\tcontainerWidth = targetMaxWidth;\n\t\t\t\t\tcontainerHeight = containerWidth / originalRatio;\n\t\t\t\t} else {\n\t\t\t\t\t// If targetMaxHeight is reached before targetMaxWidth.\n\t\t\t\t\tcontainerHeight = targetMaxHeight;\n\t\t\t\t\tcontainerWidth = containerHeight * originalRatio;\n\t\t\t\t}\n\n\t\t\t\tconst containerScale = originalWidth / containerWidth;\n\t\t\t\tconst lightboxImgWidth =\n\t\t\t\t\timgMaxWidth * ( containerWidth / containerMaxWidth );\n\t\t\t\tconst lightboxImgHeight =\n\t\t\t\t\timgMaxHeight * ( containerHeight / containerMaxHeight );\n\n\t\t\t\t// As of this writing, using the calculations above will render the\n\t\t\t\t// lightbox with a small, erroneous whitespace on the left side of the\n\t\t\t\t// image in iOS Safari, perhaps due to an inconsistency in how browsers\n\t\t\t\t// handle absolute positioning and CSS transformation. In any case,\n\t\t\t\t// adding 1 pixel to the container width and height solves the problem,\n\t\t\t\t// though this can be removed if the issue is fixed in the future.\n\t\t\t\tstate.overlayStyles = `\n\t\t\t\t:root {\n\t\t\t\t\t--wp--lightbox-initial-top-position: ${ screenPosY }px;\n\t\t\t\t\t--wp--lightbox-initial-left-position: ${ screenPosX }px;\n\t\t\t\t\t--wp--lightbox-container-width: ${ containerWidth + 1 }px;\n\t\t\t\t\t--wp--lightbox-container-height: ${ containerHeight + 1 }px;\n\t\t\t\t\t--wp--lightbox-image-width: ${ lightboxImgWidth }px;\n\t\t\t\t\t--wp--lightbox-image-height: ${ lightboxImgHeight }px;\n\t\t\t\t\t--wp--lightbox-scale: ${ containerScale };\n\t\t\t\t\t--wp--lightbox-scrollbar-width: ${\n\t\t\t\t\t\twindow.innerWidth - document.documentElement.clientWidth\n\t\t\t\t\t}px;\n\t\t\t\t}\n\t\t\t`;\n\t\t\t},\n\t\t\tsetButtonStyles() {\n\t\t\t\tconst { imageId } = getContext();\n\t\t\t\tconst { ref } = getElement();\n\n\t\t\t\tstate.metadata[ imageId ].imageRef = ref;\n\t\t\t\tstate.metadata[ imageId ].currentSrc = ref.currentSrc;\n\n\t\t\t\tconst {\n\t\t\t\t\tnaturalWidth,\n\t\t\t\t\tnaturalHeight,\n\t\t\t\t\toffsetWidth,\n\t\t\t\t\toffsetHeight,\n\t\t\t\t} = ref;\n\n\t\t\t\t// If the image isn't loaded yet, it can't calculate where the button\n\t\t\t\t// should be.\n\t\t\t\tif ( naturalWidth === 0 || naturalHeight === 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst figure = ref.parentElement;\n\t\t\t\tconst figureWidth = ref.parentElement.clientWidth;\n\n\t\t\t\t// It needs special handling for the height because a caption will cause\n\t\t\t\t// the figure to be taller than the image, which means it needs to\n\t\t\t\t// account for that when calculating the placement of the button in the\n\t\t\t\t// top right corner of the image.\n\t\t\t\tlet figureHeight = ref.parentElement.clientHeight;\n\t\t\t\tconst caption = figure.querySelector( 'figcaption' );\n\t\t\t\tif ( caption ) {\n\t\t\t\t\tconst captionComputedStyle =\n\t\t\t\t\t\twindow.getComputedStyle( caption );\n\t\t\t\t\tif (\n\t\t\t\t\t\t! [ 'absolute', 'fixed' ].includes(\n\t\t\t\t\t\t\tcaptionComputedStyle.position\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tfigureHeight =\n\t\t\t\t\t\t\tfigureHeight -\n\t\t\t\t\t\t\tcaption.offsetHeight -\n\t\t\t\t\t\t\tparseFloat( captionComputedStyle.marginTop ) -\n\t\t\t\t\t\t\tparseFloat( captionComputedStyle.marginBottom );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst buttonOffsetTop = figureHeight - offsetHeight;\n\t\t\t\tconst buttonOffsetRight = figureWidth - offsetWidth;\n\n\t\t\t\tlet imageButtonTop = buttonOffsetTop + 16;\n\t\t\t\tlet imageButtonRight = buttonOffsetRight + 16;\n\n\t\t\t\t// In the case of an image with object-fit: contain, the size of the\n\t\t\t\t// element can be larger than the image itself, so it needs to\n\t\t\t\t// calculate where to place the button.\n\t\t\t\tif ( state.metadata[ imageId ].scaleAttr === 'contain' ) {\n\t\t\t\t\t// Natural ratio of the image.\n\t\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t\t// Offset ratio of the image.\n\t\t\t\t\tconst offsetRatio = offsetWidth / offsetHeight;\n\n\t\t\t\t\tif ( naturalRatio >= offsetRatio ) {\n\t\t\t\t\t\t// If it reaches the width first, it keeps the width and compute the\n\t\t\t\t\t\t// height.\n\t\t\t\t\t\tconst referenceHeight = offsetWidth / naturalRatio;\n\t\t\t\t\t\timageButtonTop =\n\t\t\t\t\t\t\t( offsetHeight - referenceHeight ) / 2 +\n\t\t\t\t\t\t\tbuttonOffsetTop +\n\t\t\t\t\t\t\t16;\n\t\t\t\t\t\timageButtonRight = buttonOffsetRight + 16;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it reaches the height first, it keeps the height and compute\n\t\t\t\t\t\t// the width.\n\t\t\t\t\t\tconst referenceWidth = offsetHeight * naturalRatio;\n\t\t\t\t\t\timageButtonTop = buttonOffsetTop + 16;\n\t\t\t\t\t\timageButtonRight =\n\t\t\t\t\t\t\t( offsetWidth - referenceWidth ) / 2 +\n\t\t\t\t\t\t\tbuttonOffsetRight +\n\t\t\t\t\t\t\t16;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstate.metadata[ imageId ].imageButtonTop = imageButtonTop;\n\t\t\t\tstate.metadata[ imageId ].imageButtonRight = imageButtonRight;\n\t\t\t},\n\t\t\tsetOverlayFocus() {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Moves the focus to the dialog when it opens.\n\t\t\t\t\tconst { ref } = getElement();\n\t\t\t\t\tref.focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\tinitTriggerButton() {\n\t\t\t\tconst { imageId } = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tstate.metadata[ imageId ].buttonRef = ref;\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","getContext","getElement","store","x","d","isTouching","lastTouchTime","state","actions","callbacks","currentImageId","currentImage","metadata","overlayOpened","roleAttribute","ariaModal","enlargedSrc","uploadedSrc","figureStyles","replace","imgStyles","imageButtonRight","imageId","imageButtonTop","isContentHidden","ctx","overlayEnabled","isContentVisible","showLightbox","imageRef","complete","scrollTopReset","document","documentElement","scrollTop","scrollLeftReset","scrollLeft","setOverlayStyles","hideLightbox","showClosingAnimation","setTimeout","buttonRef","focus","preventScroll","handleKeydown","event","preventDefault","ref","querySelector","handleTouchMove","handleTouchStart","handleTouchEnd","Date","now","handleScroll","window","scrollTo","naturalWidth","naturalHeight","offsetWidth","originalWidth","offsetHeight","originalHeight","screenPosX","screenPosY","getBoundingClientRect","naturalRatio","originalRatio","scaleAttr","heightWithoutSpace","widthWithoutSpace","imgMaxWidth","parseFloat","targetWidth","imgMaxHeight","targetHeight","imgRatio","containerMaxWidth","containerMaxHeight","containerWidth","containerHeight","toFixed","reducedHeight","reducedWidth","horizontalPadding","innerWidth","targetMaxWidth","Math","min","targetMaxHeight","innerHeight","containerScale","lightboxImgWidth","lightboxImgHeight","overlayStyles","clientWidth","setButtonStyles","currentSrc","figure","parentElement","figureWidth","figureHeight","clientHeight","caption","captionComputedStyle","getComputedStyle","includes","position","marginTop","marginBottom","buttonOffsetTop","buttonOffsetRight","setOverlayFocus","initTriggerButton","lock"],"sourceRoot":""} \ No newline at end of file diff --git a/build-module/block-library/navigation/view.min.asset.php b/build-module/block-library/navigation/view.min.asset.php deleted file mode 100644 index 9d2d07f1..00000000 --- a/build-module/block-library/navigation/view.min.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('@wordpress/interactivity'), 'version' => '7b370e821516feba4955', 'type' => 'module'); diff --git a/build-module/block-library/navigation/view.min.js.map b/build-module/block-library/navigation/view.min.js.map index 829e3636..2a514d53 100644 --- a/build-module/block-library/navigation/view.min.js.map +++ b/build-module/block-library/navigation/view.min.js.map @@ -1 +1 @@ -{"version":3,"file":"./build-module/block-library/navigation/view.min.js","mappings":"2CACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICElF,MAAM,GAFEI,EAE+B,CAAE,WAAgB,IAAMC,EAA8DC,WAAY,WAAgB,IAAMD,EAA8DE,WAAY,MAAW,IAAMF,EAA8DG,OAFrSC,EAAI,CAAC,EAAGnB,EAAoBoB,EAAED,EAAGL,GAAWK,GCKzDE,EAAqB,CAC1B,UACA,gEACA,4CACA,8CACA,4CACA,oBACA,mCDZOP,MAAWK,ECkBnBG,SAASC,iBAAkB,SAAS,SAEpC,MAAM,MAAEC,EAAK,QAAEC,IAAYP,EAAAA,EAAAA,OAC1B,kBACA,CACCM,MAAO,CACN,iBAAIE,GAEH,MAAoB,aADRV,EAAAA,EAAAA,cACDW,MAAsBH,EAAMI,WACpC,SACA,IACJ,EACA,aAAIC,GAEH,MAAoB,aADRb,EAAAA,EAAAA,cACDW,MA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Aa,CACvB,MAAM4C,EACL5B,EAAI6B,iBAAkBpD,GACvBU,EAAI6B,MAAQhB,EACZb,EAAIwB,sBAAwBiB,EAAmB,GAC/CzC,EAAIyB,qBACHgB,EAAmBA,EAAkBpC,OAAS,EAChD,CACD,EACAsC,iBAAAA,GACC,MAAM,IAAE9B,IAAQ3B,EAAAA,EAAAA,cAChB,GAAKO,EAAMI,WAAa,CACvB,MAAM4C,EACL5B,EAAI6B,iBAAkBpD,GACvBmD,IAAqB,IAAKrB,OAC3B,CACD,IAGF,CAAEwB,MAAM","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/external module \"@wordpress/interactivity\"","webpack://wp/./packages/block-library/build-module/navigation/@wordpress/block-library/src/navigation/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext, [\"getElement\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement, [\"store\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store });","/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\nconst focusableSelectors = [\n\t'a[href]',\n\t'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])',\n\t'select:not([disabled]):not([aria-hidden])',\n\t'textarea:not([disabled]):not([aria-hidden])',\n\t'button:not([disabled]):not([aria-hidden])',\n\t'[contenteditable]',\n\t'[tabindex]:not([tabindex^=\"-\"])',\n];\n\n// This is a fix for Safari in iOS/iPadOS. Without it, Safari doesn't focus out\n// when the user taps in the body. It can be removed once we add an overlay to\n// capture the clicks, instead of relying on the focusout event.\ndocument.addEventListener( 'click', () => {} );\n\nconst { state, actions } = store(\n\t'core/navigation',\n\t{\n\t\tstate: {\n\t\t\tget roleAttribute() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\treturn ctx.type === 'overlay' && state.isMenuOpen\n\t\t\t\t\t? 'dialog'\n\t\t\t\t\t: null;\n\t\t\t},\n\t\t\tget ariaModal() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\treturn ctx.type === 'overlay' && state.isMenuOpen\n\t\t\t\t\t? 'true'\n\t\t\t\t\t: null;\n\t\t\t},\n\t\t\tget ariaLabel() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\treturn ctx.type === 'overlay' && state.isMenuOpen\n\t\t\t\t\t? ctx.ariaLabel\n\t\t\t\t\t: null;\n\t\t\t},\n\t\t\tget isMenuOpen() {\n\t\t\t\t// The menu is opened if either `click`, `hover` or `focus` is true.\n\t\t\t\treturn (\n\t\t\t\t\tObject.values( state.menuOpenedBy ).filter( Boolean )\n\t\t\t\t\t\t.length > 0\n\t\t\t\t);\n\t\t\t},\n\t\t\tget menuOpenedBy() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\treturn ctx.type === 'overlay'\n\t\t\t\t\t? ctx.overlayOpenedBy\n\t\t\t\t\t: ctx.submenuOpenedBy;\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\topenMenuOnHover() {\n\t\t\t\tconst { type, overlayOpenedBy } = getContext();\n\t\t\t\tif (\n\t\t\t\t\ttype === 'submenu' &&\n\t\t\t\t\t// Only open on hover if the overlay is closed.\n\t\t\t\t\tObject.values( overlayOpenedBy || {} ).filter( Boolean )\n\t\t\t\t\t\t.length === 0\n\t\t\t\t) {\n\t\t\t\t\tactions.openMenu( 'hover' );\n\t\t\t\t}\n\t\t\t},\n\t\t\tcloseMenuOnHover() {\n\t\t\t\tconst { type, overlayOpenedBy } = getContext();\n\t\t\t\tif (\n\t\t\t\t\ttype === 'submenu' &&\n\t\t\t\t\t// Only close on hover if the overlay is closed.\n\t\t\t\t\tObject.values( overlayOpenedBy || {} ).filter( Boolean )\n\t\t\t\t\t\t.length === 0\n\t\t\t\t) {\n\t\t\t\t\tactions.closeMenu( 'hover' );\n\t\t\t\t}\n\t\t\t},\n\t\t\topenMenuOnClick() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tctx.previousFocus = ref;\n\t\t\t\tactions.openMenu( 'click' );\n\t\t\t},\n\t\t\tcloseMenuOnClick() {\n\t\t\t\tactions.closeMenu( 'click' );\n\t\t\t\tactions.closeMenu( 'focus' );\n\t\t\t},\n\t\t\topenMenuOnFocus() {\n\t\t\t\tactions.openMenu( 'focus' );\n\t\t\t},\n\t\t\ttoggleMenuOnClick() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\t// Safari won't send focus to the clicked element, so we need to manually place it: https://bugs.webkit.org/show_bug.cgi?id=22261\n\t\t\t\tif ( window.document.activeElement !== ref ) {\n\t\t\t\t\tref.focus();\n\t\t\t\t}\n\t\t\t\tconst { menuOpenedBy } = state;\n\t\t\t\tif ( menuOpenedBy.click || menuOpenedBy.focus ) {\n\t\t\t\t\tactions.closeMenu( 'click' );\n\t\t\t\t\tactions.closeMenu( 'focus' );\n\t\t\t\t} else {\n\t\t\t\t\tctx.previousFocus = ref;\n\t\t\t\t\tactions.openMenu( 'click' );\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleMenuKeydown( event ) {\n\t\t\t\tconst { type, firstFocusableElement, lastFocusableElement } =\n\t\t\t\t\tgetContext();\n\t\t\t\tif ( state.menuOpenedBy.click ) {\n\t\t\t\t\t// If Escape close the menu.\n\t\t\t\t\tif ( event?.key === 'Escape' ) {\n\t\t\t\t\t\tactions.closeMenu( 'click' );\n\t\t\t\t\t\tactions.closeMenu( 'focus' );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Trap focus if it is an overlay (main menu).\n\t\t\t\t\tif ( type === 'overlay' && event.key === 'Tab' ) {\n\t\t\t\t\t\t// If shift + tab it change the direction.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tevent.shiftKey &&\n\t\t\t\t\t\t\twindow.document.activeElement ===\n\t\t\t\t\t\t\t\tfirstFocusableElement\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tlastFocusableElement.focus();\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t! event.shiftKey &&\n\t\t\t\t\t\t\twindow.document.activeElement ===\n\t\t\t\t\t\t\t\tlastFocusableElement\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tfirstFocusableElement.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleMenuFocusout( event ) {\n\t\t\t\tconst { modal, type } = getContext();\n\t\t\t\t// If focus is outside modal, and in the document, close menu\n\t\t\t\t// event.target === The element losing focus\n\t\t\t\t// event.relatedTarget === The element receiving focus (if any)\n\t\t\t\t// When focusout is outside the document,\n\t\t\t\t// `window.document.activeElement` doesn't change.\n\n\t\t\t\t// The event.relatedTarget is null when something outside the navigation menu is clicked. This is only necessary for Safari.\n\t\t\t\tif (\n\t\t\t\t\tevent.relatedTarget === null ||\n\t\t\t\t\t( ! modal?.contains( event.relatedTarget ) &&\n\t\t\t\t\t\tevent.target !== window.document.activeElement &&\n\t\t\t\t\t\ttype === 'submenu' )\n\t\t\t\t) {\n\t\t\t\t\tactions.closeMenu( 'click' );\n\t\t\t\t\tactions.closeMenu( 'focus' );\n\t\t\t\t}\n\t\t\t},\n\n\t\t\topenMenu( menuOpenedOn = 'click' ) {\n\t\t\t\tconst { type } = getContext();\n\t\t\t\tstate.menuOpenedBy[ menuOpenedOn ] = true;\n\t\t\t\tif ( type === 'overlay' ) {\n\t\t\t\t\t// Add a `has-modal-open` class to the root.\n\t\t\t\t\tdocument.documentElement.classList.add( 'has-modal-open' );\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tcloseMenu( menuClosedOn = 'click' ) {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tstate.menuOpenedBy[ menuClosedOn ] = false;\n\t\t\t\t// Check if the menu is still open or not.\n\t\t\t\tif ( ! state.isMenuOpen ) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tctx.modal?.contains( window.document.activeElement )\n\t\t\t\t\t) {\n\t\t\t\t\t\tctx.previousFocus?.focus();\n\t\t\t\t\t}\n\t\t\t\t\tctx.modal = null;\n\t\t\t\t\tctx.previousFocus = null;\n\t\t\t\t\tif ( ctx.type === 'overlay' ) {\n\t\t\t\t\t\tdocument.documentElement.classList.remove(\n\t\t\t\t\t\t\t'has-modal-open'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcallbacks: {\n\t\t\tinitMenu() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( state.isMenuOpen ) {\n\t\t\t\t\tconst focusableElements =\n\t\t\t\t\t\tref.querySelectorAll( focusableSelectors );\n\t\t\t\t\tctx.modal = ref;\n\t\t\t\t\tctx.firstFocusableElement = focusableElements[ 0 ];\n\t\t\t\t\tctx.lastFocusableElement =\n\t\t\t\t\t\tfocusableElements[ focusableElements.length - 1 ];\n\t\t\t\t}\n\t\t\t},\n\t\t\tfocusFirstElement() {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( state.isMenuOpen ) {\n\t\t\t\t\tconst focusableElements =\n\t\t\t\t\t\tref.querySelectorAll( focusableSelectors );\n\t\t\t\t\tfocusableElements?.[ 0 ]?.focus();\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","getContext","getElement","store","x","d","focusableSelectors","document","addEventListener","state","actions","roleAttribute","type","isMenuOpen","ariaModal","ariaLabel","ctx","values","menuOpenedBy","filter","Boolean","length","overlayOpenedBy","submenuOpenedBy","openMenuOnHover","openMenu","closeMenuOnHover","closeMenu","openMenuOnClick","ref","previousFocus","closeMenuOnClick","openMenuOnFocus","toggleMenuOnClick","window","activeElement","focus","click","handleMenuKeydown","event","firstFocusableElement","lastFocusableElement","shiftKey","preventDefault","handleMenuFocusout","modal","relatedTarget","contains","target","menuOpenedOn","documentElement","classList","add","menuClosedOn","remove","callbacks","initMenu","focusableElements","querySelectorAll","focusFirstElement","lock"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"block-library/navigation/view.min.js","mappings":"2CACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICElF,MAAM,GAFEI,EAE+B,CAAE,WAAgB,IAAMC,EAA8DC,WAAY,WAAgB,IAAMD,EAA8DE,WAAY,MAAW,IAAMF,EAA8DG,OAFrSC,EAAI,CAAC,EAAGnB,EAAoBoB,EAAED,EAAGL,GAAWK,GCKzDE,EAAqB,CAC1B,UACA,gEACA,4CACA,8CACA,4CACA,oBACA,mCDZOP,MAAWK,ECkBnBG,SAASC,iBAAkB,SAAS,SAEpC,MA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KACZ7B,EAAIc,cAAgB,KACF,YAAbd,EAAIJ,MACRL,SAAS2C,gBAAgBC,UAAUG,OAClC,kBAIJ,GAEDC,UAAW,CACVC,QAAAA,GACC,MAAMxC,GAAMf,EAAAA,EAAAA,eACN,IAAE4B,IAAQ3B,EAAAA,EAAAA,cAChB,GAAKO,EAAMI,WAAa,CACvB,MAAM4C,EACL5B,EAAI6B,iBAAkBpD,GACvBU,EAAI6B,MAAQhB,EACZb,EAAIwB,sBAAwBiB,EAAmB,GAC/CzC,EAAIyB,qBACHgB,EAAmBA,EAAkBpC,OAAS,EAChD,CACD,EACAsC,iBAAAA,GACC,MAAM,IAAE9B,IAAQ3B,EAAAA,EAAAA,cAChB,GAAKO,EAAMI,WAAa,CACvB,MAAM4C,EACL5B,EAAI6B,iBAAkBpD,GACvBmD,IAAqB,IAAKrB,OAC3B,CACD,IAGF,CAAEwB,MAAM","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/external module \"@wordpress/interactivity\"","webpack://wp/./packages/block-library/build-module/navigation/@wordpress/block-library/src/navigation/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext, [\"getElement\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement, [\"store\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store });","/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\nconst focusableSelectors = [\n\t'a[href]',\n\t'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])',\n\t'select:not([disabled]):not([aria-hidden])',\n\t'textarea:not([disabled]):not([aria-hidden])',\n\t'button:not([disabled]):not([aria-hidden])',\n\t'[contenteditable]',\n\t'[tabindex]:not([tabindex^=\"-\"])',\n];\n\n// This is a fix for Safari in iOS/iPadOS. Without it, Safari doesn't focus out\n// when the user taps in the body. It can be removed once we add an overlay to\n// capture the clicks, instead of relying on the focusout event.\ndocument.addEventListener( 'click', () => {} );\n\nconst { state, actions } = store(\n\t'core/navigation',\n\t{\n\t\tstate: {\n\t\t\tget roleAttribute() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\treturn ctx.type === 'overlay' && state.isMenuOpen\n\t\t\t\t\t? 'dialog'\n\t\t\t\t\t: null;\n\t\t\t},\n\t\t\tget ariaModal() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\treturn ctx.type === 'overlay' && state.isMenuOpen\n\t\t\t\t\t? 'true'\n\t\t\t\t\t: null;\n\t\t\t},\n\t\t\tget ariaLabel() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\treturn ctx.type === 'overlay' && state.isMenuOpen\n\t\t\t\t\t? ctx.ariaLabel\n\t\t\t\t\t: null;\n\t\t\t},\n\t\t\tget isMenuOpen() {\n\t\t\t\t// The menu is opened if either `click`, `hover` or `focus` is true.\n\t\t\t\treturn (\n\t\t\t\t\tObject.values( state.menuOpenedBy ).filter( Boolean )\n\t\t\t\t\t\t.length > 0\n\t\t\t\t);\n\t\t\t},\n\t\t\tget menuOpenedBy() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\treturn ctx.type === 'overlay'\n\t\t\t\t\t? ctx.overlayOpenedBy\n\t\t\t\t\t: ctx.submenuOpenedBy;\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\topenMenuOnHover() {\n\t\t\t\tconst { type, overlayOpenedBy } = getContext();\n\t\t\t\tif (\n\t\t\t\t\ttype === 'submenu' &&\n\t\t\t\t\t// Only open on hover if the overlay is closed.\n\t\t\t\t\tObject.values( overlayOpenedBy || {} ).filter( Boolean )\n\t\t\t\t\t\t.length === 0\n\t\t\t\t) {\n\t\t\t\t\tactions.openMenu( 'hover' );\n\t\t\t\t}\n\t\t\t},\n\t\t\tcloseMenuOnHover() {\n\t\t\t\tconst { type, overlayOpenedBy } = getContext();\n\t\t\t\tif (\n\t\t\t\t\ttype === 'submenu' &&\n\t\t\t\t\t// Only close on hover if the overlay is closed.\n\t\t\t\t\tObject.values( overlayOpenedBy || {} ).filter( Boolean )\n\t\t\t\t\t\t.length === 0\n\t\t\t\t) {\n\t\t\t\t\tactions.closeMenu( 'hover' );\n\t\t\t\t}\n\t\t\t},\n\t\t\topenMenuOnClick() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tctx.previousFocus = ref;\n\t\t\t\tactions.openMenu( 'click' );\n\t\t\t},\n\t\t\tcloseMenuOnClick() {\n\t\t\t\tactions.closeMenu( 'click' );\n\t\t\t\tactions.closeMenu( 'focus' );\n\t\t\t},\n\t\t\topenMenuOnFocus() {\n\t\t\t\tactions.openMenu( 'focus' );\n\t\t\t},\n\t\t\ttoggleMenuOnClick() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\t// Safari won't send focus to the clicked element, so we need to manually place it: https://bugs.webkit.org/show_bug.cgi?id=22261\n\t\t\t\tif ( window.document.activeElement !== ref ) {\n\t\t\t\t\tref.focus();\n\t\t\t\t}\n\t\t\t\tconst { menuOpenedBy } = state;\n\t\t\t\tif ( menuOpenedBy.click || menuOpenedBy.focus ) {\n\t\t\t\t\tactions.closeMenu( 'click' );\n\t\t\t\t\tactions.closeMenu( 'focus' );\n\t\t\t\t} else {\n\t\t\t\t\tctx.previousFocus = ref;\n\t\t\t\t\tactions.openMenu( 'click' );\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleMenuKeydown( event ) {\n\t\t\t\tconst { type, firstFocusableElement, lastFocusableElement } =\n\t\t\t\t\tgetContext();\n\t\t\t\tif ( state.menuOpenedBy.click ) {\n\t\t\t\t\t// If Escape close the menu.\n\t\t\t\t\tif ( event?.key === 'Escape' ) {\n\t\t\t\t\t\tactions.closeMenu( 'click' );\n\t\t\t\t\t\tactions.closeMenu( 'focus' );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Trap focus if it is an overlay (main menu).\n\t\t\t\t\tif ( type === 'overlay' && event.key === 'Tab' ) {\n\t\t\t\t\t\t// If shift + tab it change the direction.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tevent.shiftKey &&\n\t\t\t\t\t\t\twindow.document.activeElement ===\n\t\t\t\t\t\t\t\tfirstFocusableElement\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tlastFocusableElement.focus();\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t! event.shiftKey &&\n\t\t\t\t\t\t\twindow.document.activeElement ===\n\t\t\t\t\t\t\t\tlastFocusableElement\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tfirstFocusableElement.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleMenuFocusout( event ) {\n\t\t\t\tconst { modal, type } = getContext();\n\t\t\t\t// If focus is outside modal, and in the document, close menu\n\t\t\t\t// event.target === The element losing focus\n\t\t\t\t// event.relatedTarget === The element receiving focus (if any)\n\t\t\t\t// When focusout is outside the document,\n\t\t\t\t// `window.document.activeElement` doesn't change.\n\n\t\t\t\t// The event.relatedTarget is null when something outside the navigation menu is clicked. This is only necessary for Safari.\n\t\t\t\tif (\n\t\t\t\t\tevent.relatedTarget === null ||\n\t\t\t\t\t( ! modal?.contains( event.relatedTarget ) &&\n\t\t\t\t\t\tevent.target !== window.document.activeElement &&\n\t\t\t\t\t\ttype === 'submenu' )\n\t\t\t\t) {\n\t\t\t\t\tactions.closeMenu( 'click' );\n\t\t\t\t\tactions.closeMenu( 'focus' );\n\t\t\t\t}\n\t\t\t},\n\n\t\t\topenMenu( menuOpenedOn = 'click' ) {\n\t\t\t\tconst { type } = getContext();\n\t\t\t\tstate.menuOpenedBy[ menuOpenedOn ] = true;\n\t\t\t\tif ( type === 'overlay' ) {\n\t\t\t\t\t// Add a `has-modal-open` class to the root.\n\t\t\t\t\tdocument.documentElement.classList.add( 'has-modal-open' );\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tcloseMenu( menuClosedOn = 'click' ) {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tstate.menuOpenedBy[ menuClosedOn ] = false;\n\t\t\t\t// Check if the menu is still open or not.\n\t\t\t\tif ( ! state.isMenuOpen ) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tctx.modal?.contains( window.document.activeElement )\n\t\t\t\t\t) {\n\t\t\t\t\t\tctx.previousFocus?.focus();\n\t\t\t\t\t}\n\t\t\t\t\tctx.modal = null;\n\t\t\t\t\tctx.previousFocus = null;\n\t\t\t\t\tif ( ctx.type === 'overlay' ) {\n\t\t\t\t\t\tdocument.documentElement.classList.remove(\n\t\t\t\t\t\t\t'has-modal-open'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcallbacks: {\n\t\t\tinitMenu() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( state.isMenuOpen ) {\n\t\t\t\t\tconst focusableElements =\n\t\t\t\t\t\tref.querySelectorAll( focusableSelectors );\n\t\t\t\t\tctx.modal = ref;\n\t\t\t\t\tctx.firstFocusableElement = focusableElements[ 0 ];\n\t\t\t\t\tctx.lastFocusableElement =\n\t\t\t\t\t\tfocusableElements[ focusableElements.length - 1 ];\n\t\t\t\t}\n\t\t\t},\n\t\t\tfocusFirstElement() {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( state.isMenuOpen ) {\n\t\t\t\t\tconst focusableElements =\n\t\t\t\t\t\tref.querySelectorAll( focusableSelectors );\n\t\t\t\t\tfocusableElements?.[ 0 ]?.focus();\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","getContext","getElement","store","x","d","focusableSelectors","document","addEventListener","state","actions","roleAttribute","type","isMenuOpen","ariaModal","ariaLabel","ctx","values","menuOpenedBy","filter","Boolean","length","overlayOpenedBy","submenuOpenedBy","openMenuOnHover","openMenu","closeMenuOnHover","closeMenu","openMenuOnClick","ref","previousFocus","closeMenuOnClick","openMenuOnFocus","toggleMenuOnClick","window","activeElement","focus","click","handleMenuKeydown","event","firstFocusableElement","lastFocusableElement","shiftKey","preventDefault","handleMenuFocusout","modal","relatedTarget","contains","target","menuOpenedOn","documentElement","classList","add","menuClosedOn","remove","callbacks","initMenu","focusableElements","querySelectorAll","focusFirstElement","lock"],"sourceRoot":""} \ No newline at end of file diff --git a/build-module/block-library/query/view.min.asset.php b/build-module/block-library/query/view.min.asset.php deleted file mode 100644 index dc1ce673..00000000 --- a/build-module/block-library/query/view.min.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('@wordpress/interactivity', array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => '1100711c4bda188467ac', 'type' => 'module'); diff --git a/build-module/block-library/query/view.min.js.map b/build-module/block-library/query/view.min.js.map index fdbb058e..c8a42029 100644 --- a/build-module/block-library/query/view.min.js.map +++ b/build-module/block-library/query/view.min.js.map @@ -1 +1 @@ -{"version":3,"file":"./build-module/block-library/query/view.min.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BA,EAAQC,SAAUR,EAAIG,MAC5BO,EAAIW,IAAMrB,EAAIG,KAGd,MAAMmB,EAAe,kCACrBX,EAASY,cAAeD,IAAeE,OACxC,CACD,EACA,SAACC,GACA,MAAM,IAAEzB,IAAQJ,EAAAA,EAAAA,cAChB,GAAKG,EAAaC,GAAQ,CACzB,MAAM,QAAEO,SAAkB,4CAGpBA,EAAQkB,SAAUzB,EAAIG,KAC7B,CACD,GAEDuB,UAAW,CACV,SAACD,GACA,MAAM,IAAEJ,IAAQ1B,EAAAA,EAAAA,eACV,IAAEK,IAAQJ,EAAAA,EAAAA,cAChB,GAAKyB,GAAOtB,EAAaC,GAAQ,CAChC,MAAM,QAAEO,SAAkB,4CAGpBA,EAAQkB,SAAUzB,EAAIG,KAC7B,CACD,IAGF,CAAEwB,MAAM,G","sources":["webpack://wp/external import \"@wordpress/interactivity-router\"","webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/external module \"@wordpress/interactivity\"","webpack://wp/./packages/block-library/build-module/query/@wordpress/block-library/src/query/view.js"],"sourcesContent":["module.exports = import(\"@wordpress/interactivity-router\");;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext, [\"getElement\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement, [\"store\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store });","/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\nconst isValidLink = ( ref ) =>\n\tref &&\n\tref instanceof window.HTMLAnchorElement &&\n\tref.href &&\n\t( ! ref.target || ref.target === '_self' ) &&\n\tref.origin === window.location.origin;\n\nconst isValidEvent = ( event ) =>\n\tevent.button === 0 && // Left clicks only.\n\t! event.metaKey && // Open in new tab (Mac).\n\t! event.ctrlKey && // Open in new tab (Windows).\n\t! event.altKey && // Download.\n\t! event.shiftKey &&\n\t! event.defaultPrevented;\n\nstore(\n\t'core/query',\n\t{\n\t\tactions: {\n\t\t\t*navigate( event ) {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tconst queryRef = ref.closest(\n\t\t\t\t\t'.wp-block-query[data-wp-router-region]'\n\t\t\t\t);\n\n\t\t\t\tif ( isValidLink( ref ) && isValidEvent( event ) ) {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\tconst { actions } = yield import(\n\t\t\t\t\t\t'@wordpress/interactivity-router'\n\t\t\t\t\t);\n\t\t\t\t\tyield actions.navigate( ref.href );\n\t\t\t\t\tctx.url = ref.href;\n\n\t\t\t\t\t// Focus the first anchor of the Query block.\n\t\t\t\t\tconst firstAnchor = `.wp-block-post-template a[href]`;\n\t\t\t\t\tqueryRef.querySelector( firstAnchor )?.focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\t*prefetch() {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( isValidLink( ref ) ) {\n\t\t\t\t\tconst { actions } = yield import(\n\t\t\t\t\t\t'@wordpress/interactivity-router'\n\t\t\t\t\t);\n\t\t\t\t\tyield actions.prefetch( ref.href );\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcallbacks: {\n\t\t\t*prefetch() {\n\t\t\t\tconst { url } = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( url && isValidLink( ref ) ) {\n\t\t\t\t\tconst { actions } = yield import(\n\t\t\t\t\t\t'@wordpress/interactivity-router'\n\t\t\t\t\t);\n\t\t\t\t\tyield actions.prefetch( ref.href );\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"names":["module","exports","import","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","getContext","getElement","store","x","isValidLink","ref","window","HTMLAnchorElement","href","target","origin","location","actions","navigate","event","ctx","queryRef","closest","button","metaKey","ctrlKey","altKey","shiftKey","defaultPrevented","isValidEvent","preventDefault","url","firstAnchor","querySelector","focus","prefetch","callbacks","lock"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"block-library/query/view.min.js","mappings":"0DAAAA,EAAOC,QAAUC,OAAO,kC,GCCpBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaL,QAGrB,IAAID,EAASG,EAAyBE,GAAY,CAGjDJ,QAAS,CAAC,GAOX,OAHAO,EAAoBH,GAAUL,EAAQA,EAAOC,QAASG,GAG/CJ,EAAOC,OACf,CCrBAG,EAAoBK,EAAI,CAACR,EAASS,KACjC,IAAI,I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AAAA,eACV,IAAEK,IAAQJ,EAAAA,EAAAA,cAChB,GAAKyB,GAAOtB,EAAaC,GAAQ,CAChC,MAAM,QAAEO,SAAkB,4CAGpBA,EAAQkB,SAAUzB,EAAIG,KAC7B,CACD,IAGF,CAAEwB,MAAM,G","sources":["webpack://wp/external import \"@wordpress/interactivity-router\"","webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/external module \"@wordpress/interactivity\"","webpack://wp/./packages/block-library/build-module/query/@wordpress/block-library/src/query/view.js"],"sourcesContent":["module.exports = import(\"@wordpress/interactivity-router\");;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext, [\"getElement\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement, [\"store\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store });","/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\nconst isValidLink = ( ref ) =>\n\tref &&\n\tref instanceof window.HTMLAnchorElement &&\n\tref.href &&\n\t( ! ref.target || ref.target === '_self' ) &&\n\tref.origin === window.location.origin;\n\nconst isValidEvent = ( event ) =>\n\tevent.button === 0 && // Left clicks only.\n\t! event.metaKey && // Open in new tab (Mac).\n\t! event.ctrlKey && // Open in new tab (Windows).\n\t! event.altKey && // Download.\n\t! event.shiftKey &&\n\t! event.defaultPrevented;\n\nstore(\n\t'core/query',\n\t{\n\t\tactions: {\n\t\t\t*navigate( event ) {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tconst queryRef = ref.closest(\n\t\t\t\t\t'.wp-block-query[data-wp-router-region]'\n\t\t\t\t);\n\n\t\t\t\tif ( isValidLink( ref ) && isValidEvent( event ) ) {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\tconst { actions } = yield import(\n\t\t\t\t\t\t'@wordpress/interactivity-router'\n\t\t\t\t\t);\n\t\t\t\t\tyield actions.navigate( ref.href );\n\t\t\t\t\tctx.url = ref.href;\n\n\t\t\t\t\t// Focus the first anchor of the Query block.\n\t\t\t\t\tconst firstAnchor = `.wp-block-post-template a[href]`;\n\t\t\t\t\tqueryRef.querySelector( firstAnchor )?.focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\t*prefetch() {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( isValidLink( ref ) ) {\n\t\t\t\t\tconst { actions } = yield import(\n\t\t\t\t\t\t'@wordpress/interactivity-router'\n\t\t\t\t\t);\n\t\t\t\t\tyield actions.prefetch( ref.href );\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcallbacks: {\n\t\t\t*prefetch() {\n\t\t\t\tconst { url } = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( url && isValidLink( ref ) ) {\n\t\t\t\t\tconst { actions } = yield import(\n\t\t\t\t\t\t'@wordpress/interactivity-router'\n\t\t\t\t\t);\n\t\t\t\t\tyield actions.prefetch( ref.href );\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"names":["module","exports","import","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","getContext","getElement","store","x","isValidLink","ref","window","HTMLAnchorElement","href","target","origin","location","actions","navigate","event","ctx","queryRef","closest","button","metaKey","ctrlKey","altKey","shiftKey","defaultPrevented","isValidEvent","preventDefault","url","firstAnchor","querySelector","focus","prefetch","callbacks","lock"],"sourceRoot":""} \ No newline at end of file diff --git a/build-module/block-library/search/view.min.asset.php b/build-module/block-library/search/view.min.asset.php deleted file mode 100644 index 7a13668c..00000000 --- a/build-module/block-library/search/view.min.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('@wordpress/interactivity'), 'version' => '69851b7ac418d6ef7967', 'type' => 'module'); diff --git a/build-module/block-library/search/view.min.js.map b/build-module/block-library/search/view.min.js.map index bd96840f..c8a27f6a 100644 --- a/build-module/block-library/search/view.min.js.map +++ b/build-module/block-library/search/view.min.js.map @@ -1 +1 @@ -{"version":3,"file":"./build-module/block-library/search/view.min.js","mappings":"2CACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICElF,MAAM,GAFEI,EAE+B,CAAE,WAAgB,IAAM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pack/runtime/hasOwnProperty shorthand","webpack://wp/external module \"@wordpress/interactivity\"","webpack://wp/./packages/block-library/build-module/search/@wordpress/block-library/src/search/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext, [\"getElement\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement, [\"store\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store });","/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\nconst { actions } = store(\n\t'core/search',\n\t{\n\t\tstate: {\n\t\t\tget ariaLabel() {\n\t\t\t\tconst {\n\t\t\t\t\tisSearchInputVisible,\n\t\t\t\t\tariaLabelCollapsed,\n\t\t\t\t\tariaLabelExpanded,\n\t\t\t\t} = getContext();\n\t\t\t\treturn isSearchInputVisible\n\t\t\t\t\t? ariaLabelExpanded\n\t\t\t\t\t: ariaLabelCollapsed;\n\t\t\t},\n\t\t\tget ariaControls() {\n\t\t\t\tconst { isSearchInputVisible, inputId } = getContext();\n\t\t\t\treturn isSearchInputVisible ? null : inputId;\n\t\t\t},\n\t\t\tget type() {\n\t\t\t\tconst { isSearchInputVisible } = getContext();\n\t\t\t\treturn isSearchInputVisible ? 'submit' : 'button';\n\t\t\t},\n\t\t\tget tabindex() {\n\t\t\t\tconst { isSearchInputVisible } = getContext();\n\t\t\t\treturn isSearchInputVisible ? '0' : '-1';\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\topenSearchInput( event ) {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( ! ctx.isSearchInputVisible ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tctx.isSearchInputVisible = true;\n\t\t\t\t\tref.parentElement.querySelector( 'input' ).focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\tcloseSearchInput() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tctx.isSearchInputVisible = false;\n\t\t\t},\n\t\t\thandleSearchKeydown( event ) {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\t// If Escape close the menu.\n\t\t\t\tif ( event?.key === 'Escape' ) {\n\t\t\t\t\tactions.closeSearchInput();\n\t\t\t\t\tref.querySelector( 'button' ).focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleSearchFocusout( event ) {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\t// If focus is outside search form, and in the document, close menu\n\t\t\t\t// event.target === The element losing focus\n\t\t\t\t// event.relatedTarget === The element receiving focus (if any)\n\t\t\t\t// When focusout is outside the document,\n\t\t\t\t// `window.document.activeElement` doesn't change.\n\t\t\t\tif (\n\t\t\t\t\t! ref.contains( event.relatedTarget ) &&\n\t\t\t\t\tevent.target !== window.document.activeElement\n\t\t\t\t) {\n\t\t\t\t\tactions.closeSearchInput();\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","getContext","getElement","store","x","d","actions","state","ariaLabel","isSearchInputVisible","ariaLabelCollapsed","ariaLabelExpanded","ariaControls","inputId","type","tabindex","openSearchInput","event","ctx","ref","preventDefault","parentElement","querySelector","focus","closeSearchInput","handleSearchKeydown","handleSearchFocusout","contains","relatedTarget","target","window","document","activeElement","lock"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"block-library/search/view.min.js","mappings":"2CACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,ICElF,MAAM,GAFEI,EAE+B,CAAE,WAAgB,IAAMC,EAA8DC,WAAY,WAAgB,IAAMD,EAA8DE,WAAY,MAAW,IAAMF,EAA8DG,OAFrSC,EAAI,CAAC,EAAGnB,EAAoBoB,EAAED,EAAGL,GAAWK,ICKzD,QAAEE,IAAYH,EAAAA,EAAAA,OACnB,cACA,CACCI,MAAO,CACN,aAAIC,GACH,MAAM,qBACLC,EAAoB,mBACpBC,EAAkB,kBAClBC,IACGV,EAAAA,EAAAA,cACJ,OAAOQ,EACJE,EACAD,CACJ,EACA,gBAAIE,GACH,MAAM,qBAAEH,EAAoB,QAAEI,IAAYZ,EAAAA,EAAAA,cAC1C,OAAOQ,EAAuB,KAAOI,CACtC,EACA,QAAIC,GACH,MAAM,qBAAEL,IAAyBR,EAAAA,EAAAA,cACjC,OAAOQ,EAAuB,SAAW,QAC1C,EACA,YAAIM,GACH,MAAM,qBAAEN,IAAyBR,EAAAA,EAAAA,cACjC,OAAOQ,EAAuB,IAAM,IACrC,GAEDH,QAAS,CACRU,eAAAA,CAAiBC,GAChB,MAAMC,GAAMjB,EAAAA,EAAAA,eACN,IAAEkB,IAAQjB,EAAAA,EAAAA,cACTgB,EAAIT,uBACVQ,EAAMG,iBACNF,EAAIT,sBAAuB,EAC3BU,EAAIE,cAAcC,cAAe,SAAUC,QAE7C,EACAC,gBAAAA,IACavB,EAAAA,EAAAA,cACRQ,sBAAuB,CAC5B,EACAgB,mBAAAA,CAAqBR,GACpB,MAAM,IAAEE,IAAQjB,EAAAA,EAAAA,cAEI,WAAfe,GAAO7B,MACXkB,EAAQkB,mBACRL,EAAIG,cAAe,UAAWC,QAEhC,EACAG,oBAAAA,CAAsBT,GACrB,MAAM,IAAEE,IAAQjB,EAAAA,EAAAA,cAObiB,EAAIQ,SAAUV,EAAMW,gBACtBX,EAAMY,SAAWC,OAAOC,SAASC,eAEjC1B,EAAQkB,kBAEV,IAGF,CAAES,MAAM,IDtEDlC,MAAWK","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/external module \"@wordpress/interactivity\"","webpack://wp/./packages/block-library/build-module/search/@wordpress/block-library/src/search/view.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"getContext\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext, [\"getElement\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement, [\"store\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store });","/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\nconst { actions } = store(\n\t'core/search',\n\t{\n\t\tstate: {\n\t\t\tget ariaLabel() {\n\t\t\t\tconst {\n\t\t\t\t\tisSearchInputVisible,\n\t\t\t\t\tariaLabelCollapsed,\n\t\t\t\t\tariaLabelExpanded,\n\t\t\t\t} = getContext();\n\t\t\t\treturn isSearchInputVisible\n\t\t\t\t\t? ariaLabelExpanded\n\t\t\t\t\t: ariaLabelCollapsed;\n\t\t\t},\n\t\t\tget ariaControls() {\n\t\t\t\tconst { isSearchInputVisible, inputId } = getContext();\n\t\t\t\treturn isSearchInputVisible ? null : inputId;\n\t\t\t},\n\t\t\tget type() {\n\t\t\t\tconst { isSearchInputVisible } = getContext();\n\t\t\t\treturn isSearchInputVisible ? 'submit' : 'button';\n\t\t\t},\n\t\t\tget tabindex() {\n\t\t\t\tconst { isSearchInputVisible } = getContext();\n\t\t\t\treturn isSearchInputVisible ? '0' : '-1';\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\topenSearchInput( event ) {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tif ( ! ctx.isSearchInputVisible ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tctx.isSearchInputVisible = true;\n\t\t\t\t\tref.parentElement.querySelector( 'input' ).focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\tcloseSearchInput() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tctx.isSearchInputVisible = false;\n\t\t\t},\n\t\t\thandleSearchKeydown( event ) {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\t// If Escape close the menu.\n\t\t\t\tif ( event?.key === 'Escape' ) {\n\t\t\t\t\tactions.closeSearchInput();\n\t\t\t\t\tref.querySelector( 'button' ).focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleSearchFocusout( event ) {\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\t// If focus is outside search form, and in the document, close menu\n\t\t\t\t// event.target === The element losing focus\n\t\t\t\t// event.relatedTarget === The element receiving focus (if any)\n\t\t\t\t// When focusout is outside the document,\n\t\t\t\t// `window.document.activeElement` doesn't change.\n\t\t\t\tif (\n\t\t\t\t\t! ref.contains( event.relatedTarget ) &&\n\t\t\t\t\tevent.target !== window.document.activeElement\n\t\t\t\t) {\n\t\t\t\t\tactions.closeSearchInput();\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","getContext","getElement","store","x","d","actions","state","ariaLabel","isSearchInputVisible","ariaLabelCollapsed","ariaLabelExpanded","ariaControls","inputId","type","tabindex","openSearchInput","event","ctx","ref","preventDefault","parentElement","querySelector","focus","closeSearchInput","handleSearchKeydown","handleSearchFocusout","contains","relatedTarget","target","window","document","activeElement","lock"],"sourceRoot":""} \ No newline at end of file diff --git a/build-module/interactivity-router/index.min.asset.php b/build-module/interactivity-router/index.min.asset.php deleted file mode 100644 index e7b6b4f7..00000000 --- a/build-module/interactivity-router/index.min.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('@wordpress/interactivity', array('id' => '@wordpress/a11y', 'import' => 'dynamic')), 'version' => '67c16aba5bbfcdd72f9a', 'type' => 'module'); diff --git a/build-module/interactivity-router/index.min.js.map b/build-module/interactivity-router/index.min.js.map index 134c06a6..afa4fdd8 100644 --- a/build-module/interactivity-router/index.min.js.map +++ b/build-module/interactivity-router/index.min.js.map @@ -1 +1 @@ -{"version":3,"file":"./build-module/interactivity-router/index.min.js","mappings":"+CAAIA,EACAC,EACAC,EACAC,E,0CCGG,MAAMC,EAAaC,UAEzB,MAAMC,EAAaC,GAAkBA,EAAIC,IAAMD,EAAIE,UAG7CC,EAAa,IAAIC,IACvB,IAAM,MAAMC,KAASC,EACpBH,EAAWI,IAAKR,EAAUM,GAASA,GAGpC,MAAMG,EAAsB,GAG5B,IAAM,MAAMH,KAASI,SAASC,KAAKC,SAAW,CAC7C,MAAMV,EAAKF,EAAUM,GAEG,SAAnBA,EAAMO,UAA0C,UAAn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AOD,EACX7B,EAAoB+B,EAAEF,EAAYC,KAAS9B,EAAoB+B,EAAEpC,EAASmC,IAC5EE,OAAOC,eAAetC,EAASmC,EAAK,CAAEI,YAAY,EAAM9J,IAAKyJ,EAAWC,IAE1E,ECND9B,EAAoB+B,EAAI,CAACV,EAAKc,IAAUH,OAAOI,UAAUC,eAAexG,KAAKwF,EAAKc,GCGlF,IAAIG,EAAsBtC,EAAoB,K","sources":["webpack://wp/webpack/runtime/async module","webpack://wp/./packages/interactivity-router/build-module/@wordpress/interactivity-router/src/head.ts","webpack://wp/./packages/interactivity-router/build-module/@wordpress/interactivity-router/src/index.ts","webpack://wp/external import \"@wordpress/a11y\"","webpack://wp/external module \"@wordpress/interactivity\"","webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/webpack/startup"],"sourcesContent":["var webpackQueues = typeof Symbol === \"function\" ? Symbol(\"webpack queues\") : \"__webpack_queues__\";\nvar webpackExports = typeof Symbol === \"function\" ? Symbol(\"webpack exports\") : \"__webpack_exports__\";\nvar webpackError = typeof Symbol === \"function\" ? Symbol(\"webpack error\") : \"__webpack_error__\";\nvar resolveQueue = (queue) => {\n\tif(queue && queue.d < 1) {\n\t\tqueue.d = 1;\n\t\tqueue.forEach((fn) => (fn.r--));\n\t\tqueue.forEach((fn) => (fn.r-- ? fn.r++ : fn()));\n\t}\n}\nvar wrapDeps = (deps) => (deps.map((dep) => {\n\tif(dep !== null && typeof dep === \"object\") {\n\t\tif(dep[webpackQueues]) return dep;\n\t\tif(dep.then) {\n\t\t\tvar queue = [];\n\t\t\tqueue.d = 0;\n\t\t\tdep.then((r) => {\n\t\t\t\tobj[webpackExports] = r;\n\t\t\t\tresolveQueue(queue);\n\t\t\t}, (e) => {\n\t\t\t\tobj[webpackError] = e;\n\t\t\t\tresolveQueue(queue);\n\t\t\t});\n\t\t\tvar obj = {};\n\t\t\tobj[webpackQueues] = (fn) => (fn(queue));\n\t\t\treturn obj;\n\t\t}\n\t}\n\tvar ret = {};\n\tret[webpackQueues] = x => {};\n\tret[webpackExports] = dep;\n\treturn ret;\n}));\n__webpack_require__.a = (module, body, hasAwait) => {\n\tvar queue;\n\thasAwait && ((queue = []).d = -1);\n\tvar depQueues = new Set();\n\tvar exports = module.exports;\n\tvar currentDeps;\n\tvar outerResolve;\n\tvar reject;\n\tvar promise = new Promise((resolve, rej) => {\n\t\treject = rej;\n\t\touterResolve = resolve;\n\t});\n\tpromise[webpackExports] = exports;\n\tpromise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise[\"catch\"](x => {}));\n\tmodule.exports = promise;\n\tbody((deps) => {\n\t\tcurrentDeps = wrapDeps(deps);\n\t\tvar fn;\n\t\tvar getResult = () => (currentDeps.map((d) => {\n\t\t\tif(d[webpackError]) throw d[webpackError];\n\t\t\treturn d[webpackExports];\n\t\t}))\n\t\tvar promise = new Promise((resolve) => {\n\t\t\tfn = () => (resolve(getResult));\n\t\t\tfn.r = 0;\n\t\t\tvar fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))));\n\t\t\tcurrentDeps.map((dep) => (dep[webpackQueues](fnQueue)));\n\t\t});\n\t\treturn fn.r ? promise : getResult();\n\t}, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue)));\n\tqueue && queue.d < 0 && (queue.d = 0);\n};","/**\n * Helper to update only the necessary tags in the head.\n *\n * @async\n * @param newHead The head elements of the new page.\n */\nexport const updateHead = async ( newHead: HTMLHeadElement[] ) => {\n\t// Helper to get the tag id store in the cache.\n\tconst getTagId = ( tag: Element ) => tag.id || tag.outerHTML;\n\n\t// Map incoming head tags by their content.\n\tconst newHeadMap = new Map< string, Element >();\n\tfor ( const child of newHead ) {\n\t\tnewHeadMap.set( getTagId( child ), child );\n\t}\n\n\tconst toRemove: Element[] = [];\n\n\t// Detect nodes that should be added or removed.\n\tfor ( const child of document.head.children ) {\n\t\tconst id = getTagId( child );\n\t\t// Always remove styles and links as they might change.\n\t\tif ( child.nodeName === 'LINK' || child.nodeName === 'STYLE' ) {\n\t\t\ttoRemove.push( child );\n\t\t} else if ( newHeadMap.has( id ) ) {\n\t\t\tnewHeadMap.delete( id );\n\t\t} else if ( child.nodeName !== 'SCRIPT' && child.nodeName !== 'META' ) {\n\t\t\ttoRemove.push( child );\n\t\t}\n\t}\n\n\t// Prepare new assets.\n\tconst toAppend = [ ...newHeadMap.values() ];\n\n\t// Apply the changes.\n\ttoRemove.forEach( ( n ) => n.remove() );\n\tdocument.head.append( ...toAppend );\n};\n\n/**\n * Fetches and processes head assets (stylesheets and scripts) from a specified document.\n *\n * @async\n * @param doc The document from which to fetch head assets. It should support standard DOM querying methods.\n * @param headElements A map of head elements to modify tracking the URLs of already processed assets to avoid duplicates.\n * @param headElements.tag\n * @param headElements.text\n *\n * @return Returns an array of HTML elements representing the head assets.\n */\nexport const fetchHeadAssets = async (\n\tdoc: Document,\n\theadElements: Map< string, { tag: HTMLElement; text: string } >\n): Promise< HTMLElement[] > => {\n\tconst headTags = [];\n\tconst assets = [\n\t\t{\n\t\t\ttagName: 'style',\n\t\t\tselector: 'link[rel=stylesheet]',\n\t\t\tattribute: 'href',\n\t\t},\n\t\t{ tagName: 'script', selector: 'script[src]', attribute: 'src' },\n\t];\n\tfor ( const asset of assets ) {\n\t\tconst { tagName, selector, attribute } = asset;\n\t\tconst tags = doc.querySelectorAll<\n\t\t\tHTMLScriptElement | HTMLStyleElement\n\t\t>( selector );\n\n\t\t// Use Promise.all to wait for fetch to complete\n\t\tawait Promise.all(\n\t\t\tArray.from( tags ).map( async ( tag ) => {\n\t\t\t\tconst attributeValue = tag.getAttribute( attribute );\n\t\t\t\tif ( ! headElements.has( attributeValue ) ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst response = await fetch( attributeValue );\n\t\t\t\t\t\tconst text = await response.text();\n\t\t\t\t\t\theadElements.set( attributeValue, {\n\t\t\t\t\t\t\ttag,\n\t\t\t\t\t\t\ttext,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\tconsole.error( e );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst headElement = headElements.get( attributeValue );\n\t\t\t\tconst element = doc.createElement( tagName );\n\t\t\t\telement.innerText = headElement.text;\n\t\t\t\tfor ( const attr of headElement.tag.attributes ) {\n\t\t\t\t\telement.setAttribute( attr.name, attr.value );\n\t\t\t\t}\n\t\t\t\theadTags.push( element );\n\t\t\t} )\n\t\t);\n\t}\n\n\treturn [\n\t\tdoc.querySelector( 'title' ),\n\t\t...doc.querySelectorAll( 'style' ),\n\t\t...headTags,\n\t];\n};\n","/**\n * WordPress dependencies\n */\nimport { store, privateApis, getConfig } from '@wordpress/interactivity';\n\n/**\n * Internal dependencies\n */\nimport { fetchHeadAssets, updateHead } from './head';\n\nconst {\n\tdirectivePrefix,\n\tgetRegionRootFragment,\n\tinitialVdom,\n\ttoVdom,\n\trender,\n\tparseServerData,\n\tpopulateServerData,\n\tbatch,\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\ninterface NavigateOptions {\n\tforce?: boolean;\n\thtml?: string;\n\treplace?: boolean;\n\ttimeout?: number;\n\tloadingAnimation?: boolean;\n\tscreenReaderAnnouncement?: boolean;\n}\n\ninterface PrefetchOptions {\n\tforce?: boolean;\n\thtml?: string;\n}\n\ninterface VdomParams {\n\tvdom?: typeof initialVdom;\n}\n\ninterface Page {\n\tregions: Record< string, any >;\n\thead: HTMLHeadElement[];\n\ttitle: string;\n\tinitialData: any;\n}\n\ntype RegionsToVdom = ( dom: Document, params?: VdomParams ) => Promise< Page >;\n\n// Check if the navigation mode is full page or region based.\nconst navigationMode: 'regionBased' | 'fullPage' =\n\tgetConfig( 'core/router' ).navigationMode ?? 'regionBased';\n\n// The cache of visited and prefetched pages, stylesheets and scripts.\nconst pages = new Map< string, Promise< Page | false > >();\nconst headElements = new Map< string, { tag: HTMLElement; text: string } >();\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// Fetch a new page and convert it to a static virtual DOM.\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 regionsToVdom( dom );\n\t} catch ( e ) {\n\t\treturn false;\n\t}\n};\n\n// Return an object with VDOM trees of those HTML regions marked with a\n// `router-region` directive.\nconst regionsToVdom: RegionsToVdom = async ( dom, { vdom } = {} ) => {\n\tconst regions = { body: undefined };\n\tlet head: HTMLElement[];\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\tif ( navigationMode === 'fullPage' ) {\n\t\t\thead = await fetchHeadAssets( dom, headElements );\n\t\t\tregions.body = vdom\n\t\t\t\t? vdom.get( document.body )\n\t\t\t\t: toVdom( dom.body );\n\t\t}\n\t}\n\tif ( navigationMode === 'regionBased' ) {\n\t\tconst attrName = `data-${ directivePrefix }-router-region`;\n\t\tdom.querySelectorAll( `[${ attrName }]` ).forEach( ( region ) => {\n\t\t\tconst id = region.getAttribute( attrName );\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\t}\n\tconst title = dom.querySelector( 'title' )?.innerText;\n\tconst initialData = parseServerData( dom );\n\treturn { regions, head, title, initialData };\n};\n\n// Render all interactive regions contained in the given page.\nconst renderRegions = ( page: Page ) => {\n\tbatch( () => {\n\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\tif ( navigationMode === 'fullPage' ) {\n\t\t\t\t// Once this code is tested and more mature, the head should be updated for region based navigation as well.\n\t\t\t\tupdateHead( page.head );\n\t\t\t\tconst fragment = getRegionRootFragment( document.body );\n\t\t\t\trender( page.regions.body, fragment );\n\t\t\t}\n\t\t}\n\t\tif ( navigationMode === 'regionBased' ) {\n\t\t\tpopulateServerData( page.initialData );\n\t\t\tconst attrName = `data-${ directivePrefix }-router-region`;\n\t\t\tdocument\n\t\t\t\t.querySelectorAll( `[${ attrName }]` )\n\t\t\t\t.forEach( ( region ) => {\n\t\t\t\t\tconst id = region.getAttribute( attrName );\n\t\t\t\t\tconst fragment = getRegionRootFragment( region );\n\t\t\t\t\trender( page.regions[ id ], fragment );\n\t\t\t\t} );\n\t\t}\n\t\tif ( page.title ) {\n\t\t\tdocument.title = page.title;\n\t\t}\n\t} );\n};\n\n/**\n * Load 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\trenderRegions( 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.\n// Once this code is tested and more mature, the head should be updated for\n// region based navigation as well.\nif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\tif ( navigationMode === 'fullPage' ) {\n\t\t// Cache the scripts. Has to be called before fetching the assets.\n\t\t[].map.call( document.querySelectorAll( 'script[src]' ), ( script ) => {\n\t\t\theadElements.set( script.getAttribute( 'src' ), {\n\t\t\t\ttag: script,\n\t\t\t\ttext: script.textContent,\n\t\t\t} );\n\t\t} );\n\t\tawait fetchHeadAssets( document, headElements );\n\t}\n}\npages.set(\n\tgetPagePath( window.location.href ),\n\tPromise.resolve( regionsToVdom( document, { vdom: initialVdom } ) )\n);\n\n// Check if the link is valid for client-side navigation.\nconst isValidLink = ( ref: HTMLAnchorElement ) =>\n\tref &&\n\tref instanceof window.HTMLAnchorElement &&\n\tref.href &&\n\t( ! ref.target || ref.target === '_self' ) &&\n\tref.origin === window.location.origin &&\n\t! ref.pathname.startsWith( '/wp-admin' ) &&\n\t! ref.pathname.startsWith( '/wp-login.php' ) &&\n\t! ref.getAttribute( 'href' ).startsWith( '#' ) &&\n\t! new URL( ref.href ).searchParams.has( '_wpnonce' );\n\n// Check if the event is valid for client-side navigation.\nconst isValidEvent = ( event: MouseEvent ) =>\n\tevent &&\n\tevent.button === 0 && // Left clicks only.\n\t! event.metaKey && // Open in new tab (Mac).\n\t! event.ctrlKey && // Open in new tab (Windows).\n\t! event.altKey && // Download.\n\t! event.shiftKey &&\n\t! event.defaultPrevented;\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\tmessage: string;\n\t\t\ttexts?: {\n\t\t\t\tloading?: string;\n\t\t\t\tloaded?: string;\n\t\t\t};\n\t\t};\n\t};\n\tactions: {\n\t\tnavigate: ( href: string, options?: NavigateOptions ) => void;\n\t\tprefetch: ( url: string, options?: PrefetchOptions ) => 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\tmessage: '',\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, fetchs 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 renderRegions( 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 * Prefetchs 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\tprefetch( 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\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 `ally.speak` direacly.\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\tif ( state.navigation.texts?.loading ) {\n\t\t\t\tnavigationTexts.loading = state.navigation.texts.loading;\n\t\t\t}\n\t\t\tif ( state.navigation.texts?.loaded ) {\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\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\timport( '@wordpress/a11y' ).then(\n\t\t\t( { speak } ) => speak( message ),\n\t\t\t// Ignore failures to load the a11y module.\n\t\t\t() => {}\n\t\t);\n\t} else {\n\t\tstate.navigation.message =\n\t\t\t// Announce that the page has been loaded. If the message is the\n\t\t\t// same, we use a no-break space similar to the @wordpress/a11y\n\t\t\t// package: https://github.com/WordPress/gutenberg/blob/c395242b8e6ee20f8b06c199e4fc2920d7018af1/packages/a11y/src/filter-message.js#L20-L26\n\t\t\tmessage + ( state.navigation.message === message ? '\\u00A0' : '' );\n\t}\n}\n\n// Add click and prefetch to all links.\nif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\tif ( navigationMode === 'fullPage' ) {\n\t\t// Navigate on click.\n\t\tdocument.addEventListener(\n\t\t\t'click',\n\t\t\tfunction ( event ) {\n\t\t\t\tconst ref = ( event.target as Element ).closest( 'a' );\n\t\t\t\tif ( isValidLink( ref ) && isValidEvent( event ) ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tactions.navigate( ref.href );\n\t\t\t\t}\n\t\t\t},\n\t\t\ttrue\n\t\t);\n\t\t// Prefetch on hover.\n\t\tdocument.addEventListener(\n\t\t\t'mouseenter',\n\t\t\tfunction ( event ) {\n\t\t\t\tif ( ( event.target as Element )?.nodeName === 'A' ) {\n\t\t\t\t\tconst ref = ( event.target as Element ).closest( 'a' );\n\t\t\t\t\tif ( isValidLink( ref ) && isValidEvent( event ) ) {\n\t\t\t\t\t\tactions.prefetch( ref.href );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\ttrue\n\t\t);\n\t}\n}\n","module.exports = import(\"@wordpress/a11y\");;","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nmodule.exports = x({ [\"getConfig\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getConfig, [\"privateApis\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.privateApis, [\"store\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store });","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// startup\n// Load entry module and return exports\n// This entry module used 'module' so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(126);\n"],"names":["webpackQueues","webpackExports","webpackError","resolveQueue","updateHead","async","getTagId","tag","id","outerHTML","newHeadMap","Map","child","newHead","set","toRemove","document","head","children","nodeName","push","has","delete","toAppend","values","forEach","n","remove","append","fetchHeadAssets","doc","headElements","headTags","assets","tagName","selector","attribute","asset","tags","querySelectorAll","Promise","all","Array","from","map","attributeValue","getAttribute","response","fetch","text","e","console","error","headElement","get","element","createElement","innerText","attr","attributes","setAttribute","name","value","querySelector","directivePrefix","getRegionRootFragment","initialVdom","toVdom","render","parseServerData","populateServerData","batch","privateApis","navigationMode","_getConfig$navigation","getConfig","pages","getPagePath","url","u","URL","window","location","href","pathname","search","fetchPage","html","res","status","dom","DOMParser","parseFromString","regionsToVdom","vdom","regions","body","undefined","attrName","region","title","initialData","renderRegions","page","fragment","forcePageReload","assign","addEventListener","pagePath","state","reload","call","script","textContent","resolve","isValidLink","ref","HTMLAnchorElement","target","origin","startsWith","searchParams","isValidEvent","event","button","metaKey","ctrlKey","altKey","shiftKey","defaultPrevented","navigatingTo","hasLoadedNavigationTextsData","navigationTexts","loading","loaded","actions","store","navigation","hasStarted","hasFinished","message","navigate","options","clientNavigationDisabled","loadingAnimation","screenReaderAnnouncement","timeout","prefetch","timeoutPromise","setTimeout","loadingTimeout","a11ySpeak","race","clearTimeout","config","history","replace","hash","scrollIntoView","force","messageKey","content","getElementById","parsed","JSON","parse","i18n","texts","then","speak","closest","preventDefault","module","exports","import","y","x","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","__webpack_require__","d","__webpack_module_cache__","moduleId","cachedModule","__webpack_modules__","Symbol","queue","fn","r","a","hasAwait","currentDeps","outerResolve","reject","depQueues","Set","promise","rej","deps","dep","obj","ret","wrapDeps","getResult","fnQueue","q","add","err","definition","key","o","Object","defineProperty","enumerable","prop","prototype","hasOwnProperty","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"interactivity-router/index.min.js","mappings":"+CAAIA,EACAC,EACAC,EACAC,E,0CCGG,MAAMC,EAAaC,UAEzB,MAAMC,EAAaC,GAAkBA,EAAIC,IAAMD,EAAIE,UAG7CC,EAAa,IAAIC,IACvB,IAAM,MAAMC,KAASC,EACpBH,EAAWI,IAAKR,EAAUM,GAASA,GAGpC,MAAMG,EAAsB,GAG5B,IAAM,MAAMH,KAASI,SAASC,KAAKC,SAAW,CAC7C,MAAMV,EAAKF,EAAUM,GAEG,SAAnBA,EAAMO,UAA0C,UAAnBP,EAAMO,SACvCJ,EAASK,KAAMR,GACJF,EAAWW,IAAKb,GAC3BE,EAAWY,OAAQd,GACW,WAAnBI,EAAMO,UAA4C,SAAnBP,EAAMO,UAChDJ,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IAAKyJ,EAAWC,IAE1E,ECND9B,EAAoB+B,EAAI,CAACV,EAAKc,IAAUH,OAAOI,UAAUC,eAAexG,KAAKwF,EAAKc,GCGlF,IAAIG,EAAsBtC,EAAoB,K","sources":["webpack://wp/webpack/runtime/async module","webpack://wp/./packages/interactivity-router/build-module/@wordpress/interactivity-router/src/head.ts","webpack://wp/./packages/interactivity-router/build-module/@wordpress/interactivity-router/src/index.ts","webpack://wp/external import \"@wordpress/a11y\"","webpack://wp/external module \"@wordpress/interactivity\"","webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/webpack/startup"],"sourcesContent":["var webpackQueues = typeof Symbol === \"function\" ? Symbol(\"webpack queues\") : \"__webpack_queues__\";\nvar webpackExports = typeof Symbol === \"function\" ? Symbol(\"webpack exports\") : \"__webpack_exports__\";\nvar webpackError = typeof Symbol === \"function\" ? Symbol(\"webpack error\") : \"__webpack_error__\";\nvar resolveQueue = (queue) => {\n\tif(queue && queue.d < 1) {\n\t\tqueue.d = 1;\n\t\tqueue.forEach((fn) => (fn.r--));\n\t\tqueue.forEach((fn) => (fn.r-- ? fn.r++ : fn()));\n\t}\n}\nvar wrapDeps = (deps) => (deps.map((dep) => {\n\tif(dep !== null && typeof dep === \"object\") {\n\t\tif(dep[webpackQueues]) return dep;\n\t\tif(dep.then) {\n\t\t\tvar queue = [];\n\t\t\tqueue.d = 0;\n\t\t\tdep.then((r) => {\n\t\t\t\tobj[webpackExports] = r;\n\t\t\t\tresolveQueue(queue);\n\t\t\t}, (e) => {\n\t\t\t\tobj[webpackError] = e;\n\t\t\t\tresolveQueue(queue);\n\t\t\t});\n\t\t\tvar obj = {};\n\t\t\tobj[webpackQueues] = (fn) => (fn(queue));\n\t\t\treturn obj;\n\t\t}\n\t}\n\tvar ret = {};\n\tret[webpackQueues] = x => {};\n\tret[webpackExports] = dep;\n\treturn ret;\n}));\n__webpack_require__.a = (module, body, hasAwait) => {\n\tvar queue;\n\thasAwait && ((queue = []).d = -1);\n\tvar depQueues = new Set();\n\tvar exports = module.exports;\n\tvar currentDeps;\n\tvar outerResolve;\n\tvar reject;\n\tvar promise = new Promise((resolve, rej) => {\n\t\treject = rej;\n\t\touterResolve = resolve;\n\t});\n\tpromise[webpackExports] = exports;\n\tpromise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise[\"catch\"](x => {}));\n\tmodule.exports = promise;\n\tbody((deps) => {\n\t\tcurrentDeps = wrapDeps(deps);\n\t\tvar fn;\n\t\tvar getResult = () => (currentDeps.map((d) => {\n\t\t\tif(d[webpackError]) throw d[webpackError];\n\t\t\treturn d[webpackExports];\n\t\t}))\n\t\tvar promise = new Promise((resolve) => {\n\t\t\tfn = () => (resolve(getResult));\n\t\t\tfn.r = 0;\n\t\t\tvar fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))));\n\t\t\tcurrentDeps.map((dep) => (dep[webpackQueues](fnQueue)));\n\t\t});\n\t\treturn fn.r ? promise : getResult();\n\t}, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue)));\n\tqueue && queue.d < 0 && (queue.d = 0);\n};","/**\n * Helper to update only the necessary tags in the head.\n *\n * @async\n * @param newHead The head elements of the new page.\n */\nexport const updateHead = async ( newHead: HTMLHeadElement[] ) => {\n\t// Helper to get the tag id store in the cache.\n\tconst getTagId = ( tag: Element ) => tag.id || tag.outerHTML;\n\n\t// Map incoming head tags by their content.\n\tconst newHeadMap = new Map< string, Element >();\n\tfor ( const child of newHead ) {\n\t\tnewHeadMap.set( getTagId( child ), child );\n\t}\n\n\tconst toRemove: Element[] = [];\n\n\t// Detect nodes that should be added or removed.\n\tfor ( const child of document.head.children ) {\n\t\tconst id = getTagId( child );\n\t\t// Always remove styles and links as they might change.\n\t\tif ( child.nodeName === 'LINK' || child.nodeName === 'STYLE' ) {\n\t\t\ttoRemove.push( child );\n\t\t} else if ( newHeadMap.has( id ) ) {\n\t\t\tnewHeadMap.delete( id );\n\t\t} else if ( child.nodeName !== 'SCRIPT' && child.nodeName !== 'META' ) {\n\t\t\ttoRemove.push( child );\n\t\t}\n\t}\n\n\t// Prepare new assets.\n\tconst toAppend = [ ...newHeadMap.values() ];\n\n\t// Apply the changes.\n\ttoRemove.forEach( ( n ) => n.remove() );\n\tdocument.head.append( ...toAppend );\n};\n\n/**\n * Fetches and processes head assets (stylesheets and scripts) from a specified document.\n *\n * @async\n * @param doc The document from which to fetch head assets. It should support standard DOM querying methods.\n * @param headElements A map of head elements to modify tracking the URLs of already processed assets to avoid duplicates.\n * @param headElements.tag\n * @param headElements.text\n *\n * @return Returns an array of HTML elements representing the head assets.\n */\nexport const fetchHeadAssets = async (\n\tdoc: Document,\n\theadElements: Map< string, { tag: HTMLElement; text: string } >\n): Promise< HTMLElement[] > => {\n\tconst headTags = [];\n\tconst assets = [\n\t\t{\n\t\t\ttagName: 'style',\n\t\t\tselector: 'link[rel=stylesheet]',\n\t\t\tattribute: 'href',\n\t\t},\n\t\t{ tagName: 'script', selector: 'script[src]', attribute: 'src' },\n\t];\n\tfor ( const asset of assets ) {\n\t\tconst { tagName, selector, attribute } = asset;\n\t\tconst tags = doc.querySelectorAll<\n\t\t\tHTMLScriptElement | HTMLStyleElement\n\t\t>( selector );\n\n\t\t// Use Promise.all to wait for fetch to complete\n\t\tawait Promise.all(\n\t\t\tArray.from( tags ).map( async ( tag ) => {\n\t\t\t\tconst attributeValue = tag.getAttribute( attribute );\n\t\t\t\tif ( ! headElements.has( attributeValue ) ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst response = await fetch( attributeValue );\n\t\t\t\t\t\tconst text = await response.text();\n\t\t\t\t\t\theadElements.set( attributeValue, {\n\t\t\t\t\t\t\ttag,\n\t\t\t\t\t\t\ttext,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\tconsole.error( e );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst headElement = headElements.get( attributeValue );\n\t\t\t\tconst element = doc.createElement( tagName );\n\t\t\t\telement.innerText = headElement.text;\n\t\t\t\tfor ( const attr of headElement.tag.attributes ) {\n\t\t\t\t\telement.setAttribute( attr.name, attr.value );\n\t\t\t\t}\n\t\t\t\theadTags.push( element );\n\t\t\t} )\n\t\t);\n\t}\n\n\treturn [\n\t\tdoc.querySelector( 'title' ),\n\t\t...doc.querySelectorAll( 'style' ),\n\t\t...headTags,\n\t];\n};\n","/**\n * WordPress dependencies\n */\nimport { store, privateApis, getConfig } from '@wordpress/interactivity';\n\n/**\n * Internal dependencies\n */\nimport { fetchHeadAssets, updateHead } from './head';\n\nconst {\n\tdirectivePrefix,\n\tgetRegionRootFragment,\n\tinitialVdom,\n\ttoVdom,\n\trender,\n\tparseServerData,\n\tpopulateServerData,\n\tbatch,\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\ninterface NavigateOptions {\n\tforce?: boolean;\n\thtml?: string;\n\treplace?: boolean;\n\ttimeout?: number;\n\tloadingAnimation?: boolean;\n\tscreenReaderAnnouncement?: boolean;\n}\n\ninterface PrefetchOptions {\n\tforce?: boolean;\n\thtml?: string;\n}\n\ninterface VdomParams {\n\tvdom?: typeof initialVdom;\n}\n\ninterface Page {\n\tregions: Record< string, any >;\n\thead: HTMLHeadElement[];\n\ttitle: string;\n\tinitialData: any;\n}\n\ntype RegionsToVdom = ( dom: Document, params?: VdomParams ) => Promise< Page >;\n\n// Check if the navigation mode is full page or region based.\nconst navigationMode: 'regionBased' | 'fullPage' =\n\tgetConfig( 'core/router' ).navigationMode ?? 'regionBased';\n\n// The cache of visited and prefetched pages, stylesheets and scripts.\nconst pages = new Map< string, Promise< Page | false > >();\nconst headElements = new Map< string, { tag: HTMLElement; text: string } >();\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// Fetch a new page and convert it to a static virtual DOM.\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 regionsToVdom( dom );\n\t} catch ( e ) {\n\t\treturn false;\n\t}\n};\n\n// Return an object with VDOM trees of those HTML regions marked with a\n// `router-region` directive.\nconst regionsToVdom: RegionsToVdom = async ( dom, { vdom } = {} ) => {\n\tconst regions = { body: undefined };\n\tlet head: HTMLElement[];\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\tif ( navigationMode === 'fullPage' ) {\n\t\t\thead = await fetchHeadAssets( dom, headElements );\n\t\t\tregions.body = vdom\n\t\t\t\t? vdom.get( document.body )\n\t\t\t\t: toVdom( dom.body );\n\t\t}\n\t}\n\tif ( navigationMode === 'regionBased' ) {\n\t\tconst attrName = `data-${ directivePrefix }-router-region`;\n\t\tdom.querySelectorAll( `[${ attrName }]` ).forEach( ( region ) => {\n\t\t\tconst id = region.getAttribute( attrName );\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\t}\n\tconst title = dom.querySelector( 'title' )?.innerText;\n\tconst initialData = parseServerData( dom );\n\treturn { regions, head, title, initialData };\n};\n\n// Render all interactive regions contained in the given page.\nconst renderRegions = ( page: Page ) => {\n\tbatch( () => {\n\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\tif ( navigationMode === 'fullPage' ) {\n\t\t\t\t// Once this code is tested and more mature, the head should be updated for region based navigation as well.\n\t\t\t\tupdateHead( page.head );\n\t\t\t\tconst fragment = getRegionRootFragment( document.body );\n\t\t\t\trender( page.regions.body, fragment );\n\t\t\t}\n\t\t}\n\t\tif ( navigationMode === 'regionBased' ) {\n\t\t\tpopulateServerData( page.initialData );\n\t\t\tconst attrName = `data-${ directivePrefix }-router-region`;\n\t\t\tdocument\n\t\t\t\t.querySelectorAll( `[${ attrName }]` )\n\t\t\t\t.forEach( ( region ) => {\n\t\t\t\t\tconst id = region.getAttribute( attrName );\n\t\t\t\t\tconst fragment = getRegionRootFragment( region );\n\t\t\t\t\trender( page.regions[ id ], fragment );\n\t\t\t\t} );\n\t\t}\n\t\tif ( page.title ) {\n\t\t\tdocument.title = page.title;\n\t\t}\n\t} );\n};\n\n/**\n * Load 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\trenderRegions( 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.\n// Once this code is tested and more mature, the head should be updated for\n// region based navigation as well.\nif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\tif ( navigationMode === 'fullPage' ) {\n\t\t// Cache the scripts. Has to be called before fetching the assets.\n\t\t[].map.call( document.querySelectorAll( 'script[src]' ), ( script ) => {\n\t\t\theadElements.set( script.getAttribute( 'src' ), {\n\t\t\t\ttag: script,\n\t\t\t\ttext: script.textContent,\n\t\t\t} );\n\t\t} );\n\t\tawait fetchHeadAssets( document, headElements );\n\t}\n}\npages.set(\n\tgetPagePath( window.location.href ),\n\tPromise.resolve( regionsToVdom( document, { vdom: initialVdom } ) )\n);\n\n// Check if the link is valid for client-side navigation.\nconst isValidLink = ( ref: HTMLAnchorElement ) =>\n\tref &&\n\tref instanceof window.HTMLAnchorElement &&\n\tref.href &&\n\t( ! ref.target || ref.target === '_self' ) &&\n\tref.origin === window.location.origin &&\n\t! ref.pathname.startsWith( '/wp-admin' ) &&\n\t! ref.pathname.startsWith( '/wp-login.php' ) &&\n\t! ref.getAttribute( 'href' ).startsWith( '#' ) &&\n\t! new URL( ref.href ).searchParams.has( '_wpnonce' );\n\n// Check if the event is valid for client-side navigation.\nconst isValidEvent = ( event: MouseEvent ) =>\n\tevent &&\n\tevent.button === 0 && // Left clicks only.\n\t! event.metaKey && // Open in new tab (Mac).\n\t! event.ctrlKey && // Open in new tab (Windows).\n\t! event.altKey && // Download.\n\t! event.shiftKey &&\n\t! event.defaultPrevented;\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\tmessage: string;\n\t\t\ttexts?: {\n\t\t\t\tloading?: string;\n\t\t\t\tloaded?: string;\n\t\t\t};\n\t\t};\n\t};\n\tactions: {\n\t\tnavigate: ( href: string, options?: NavigateOptions ) => void;\n\t\tprefetch: ( url: string, options?: PrefetchOptions ) => 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\tmessage: '',\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, fetchs 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 renderRegions( 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 * Prefetchs 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\tprefetch( 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\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 `ally.speak` direacly.\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\tif ( state.navigation.texts?.loading ) {\n\t\t\t\tnavigationTexts.loading = state.navigation.texts.loading;\n\t\t\t}\n\t\t\tif ( state.navigation.texts?.loaded ) {\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\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\timport( '@wordpress/a11y' ).then(\n\t\t\t( { speak } ) => speak( message ),\n\t\t\t// Ignore failures to load the a11y module.\n\t\t\t() => {}\n\t\t);\n\t} else {\n\t\tstate.navigation.message =\n\t\t\t// Announce that the page has been loaded. If the message is the\n\t\t\t// same, we use a no-break space similar to the @wordpress/a11y\n\t\t\t// package: https://github.com/WordPress/gutenberg/blob/c395242b8e6ee20f8b06c199e4fc2920d7018af1/packages/a11y/src/filter-message.js#L20-L26\n\t\t\tmessage + ( state.navigation.message === message ? '\\u00A0' : '' );\n\t}\n}\n\n// Add click and prefetch to all links.\nif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\tif ( navigationMode === 'fullPage' ) {\n\t\t// Navigate on click.\n\t\tdocument.addEventListener(\n\t\t\t'click',\n\t\t\tfunction ( event ) {\n\t\t\t\tconst ref = ( event.target as Element ).closest( 'a' );\n\t\t\t\tif ( isValidLink( ref ) && isValidEvent( event ) ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tactions.navigate( ref.href );\n\t\t\t\t}\n\t\t\t},\n\t\t\ttrue\n\t\t);\n\t\t// Prefetch on hover.\n\t\tdocument.addEventListener(\n\t\t\t'mouseenter',\n\t\t\tfunction ( event ) {\n\t\t\t\tif ( ( event.target as Element )?.nodeName === 'A' ) {\n\t\t\t\t\tconst ref = ( event.target as Element ).closest( 'a' );\n\t\t\t\t\tif ( isValidLink( ref ) && isValidEvent( event ) ) {\n\t\t\t\t\t\tactions.prefetch( ref.href );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\ttrue\n\t\t);\n\t}\n}\n","module.exports = import(\"@wordpress/a11y\");;","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nmodule.exports = x({ [\"getConfig\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getConfig, [\"privateApis\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.privateApis, [\"store\"]: () => __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store });","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// startup\n// Load entry module and return exports\n// This entry module used 'module' so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(126);\n"],"names":["webpackQueues","webpackExports","webpackError","resolveQueue","updateHead","async","getTagId","tag","id","outerHTML","newHeadMap","Map","child","newHead","set","toRemove","document","head","children","nodeName","push","has","delete","toAppend","values","forEach","n","remove","append","fetchHeadAssets","doc","headElements","headTags","assets","tagName","selector","attribute","asset","tags","querySelectorAll","Promise","all","Array","from","map","attributeValue","getAttribute","response","fetch","text","e","console","error","headElement","get","element","createElement","innerText","attr","attributes","setAttribute","name","value","querySelector","directivePrefix","getRegionRootFragment","initialVdom","toVdom","render","parseServerData","populateServerData","batch","privateApis","navigationMode","_getConfig$navigation","getConfig","pages","getPagePath","url","u","URL","window","location","href","pathname","search","fetchPage","html","res","status","dom","DOMParser","parseFromString","regionsToVdom","vdom","regions","body","undefined","attrName","region","title","initialData","renderRegions","page","fragment","forcePageReload","assign","addEventListener","pagePath","state","reload","call","script","textContent","resolve","isValidLink","ref","HTMLAnchorElement","target","origin","startsWith","searchParams","isValidEvent","event","button","metaKey","ctrlKey","altKey","shiftKey","defaultPrevented","navigatingTo","hasLoadedNavigationTextsData","navigationTexts","loading","loaded","actions","store","navigation","hasStarted","hasFinished","message","navigate","options","clientNavigationDisabled","loadingAnimation","screenReaderAnnouncement","timeout","prefetch","timeoutPromise","setTimeout","loadingTimeout","a11ySpeak","race","clearTimeout","config","history","replace","hash","scrollIntoView","force","messageKey","content","getElementById","parsed","JSON","parse","i18n","texts","then","speak","closest","preventDefault","module","exports","import","y","x","__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__","__webpack_require__","d","__webpack_module_cache__","moduleId","cachedModule","__webpack_modules__","Symbol","queue","fn","r","a","hasAwait","currentDeps","outerResolve","reject","depQueues","Set","promise","rej","deps","dep","obj","ret","wrapDeps","getResult","fnQueue","q","add","err","definition","key","o","Object","defineProperty","enumerable","prop","prototype","hasOwnProperty","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/build-module/interactivity/debug.min.asset.php b/build-module/interactivity/debug.min.asset.php deleted file mode 100644 index b3eb6e6a..00000000 --- a/build-module/interactivity/debug.min.asset.php +++ /dev/null @@ -1 +0,0 @@ - array(), 'version' => 'b78f5dee01439db66197', 'type' => 'module'); diff --git a/build-module/interactivity/debug.min.js.map b/build-module/interactivity/debug.min.js.map index 32a729c4..080ad6fd 100644 --- a/build-module/interactivity/debug.min.js.map +++ b/build-module/interactivity/debug.min.js.map @@ -1 +1 @@ -{"version":3,"file":"./build-module/interactivity/debug.min.js","mappings":"yMAGIA,EAGAC,EAGAC,EAiBAC,E,SAdAC,EAAc,EAGdC,EAAoB,GAEpBC,EAAQ,GAERC,EAAgBC,EAAAA,GAApBC,IACIC,EAAkBF,EAAAA,GAAtBG,IACIC,EAAeJ,EAAAA,GAAQK,OACvBC,EAAYN,EAAAA,GAAhBO,IACIC,EAAmBR,EAAAA,GAAQS,QAqG/B,SAASC,EAAaC,EAAOC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,CACD,CAMD,GAJAmnB,GAAAA,EAEIH,GAAWA,EAAUhnB,GAEF,MAAnBA,EAAAA,IAEH,IADA,IAAMuQ,EAAO,GACJtI,EAAI,EAAGA,EAAIjI,EAAKoZ,IAAWld,OAAQ+L,IAAK,CAChD,IAAMmQ,EAAQpY,EAAAA,IAAgBiI,GAC9B,GAAKmQ,GAAsB,MAAbA,EAAM5O,IAApB,CAEA,IAAMA,EAAM4O,EAAM5O,IAClB,IAA2B,IAAvB+G,EAAKsS,QAAQrZ,GAAa,CAC7B2c,QAAQ1kB,MACP,8EACyB+H,EADzB,mFAGCod,EAAe5mB,GAHhB,OAIQ6lB,EAAc7lB,IAIvB,KACA,CAEDuQ,EAAKpU,KAAKqN,EAdV,CAeA,CAGF,GAAwB,MAApBxJ,EAAKxE,KAAmD,MAA5BwE,EAAKxE,IAAuBQ,IAAM,CAGjE,IAAMD,EAAQiE,EAAdxE,IAAAQ,IAAAC,GACA,GAAIF,EACH,IAAK,IAAIkM,EAAI,EAAGA,EAAIlM,EAAMG,OAAQ+L,GAAK,EAAG,CACzC,IAAMnH,EAAO/E,EAAMkM,GACnB,GAAInH,EAAJ9E,IACC,IAAK,IAAIotB,EAAI,EAAGA,EAAItoB,EAAA9E,IAAWE,OAAQktB,IAEtC,IEhbe7pB,EF+aHuB,EAAA9E,IAAWotB,KE9aZ7pB,EF+aK,CACf,IAAMsoB,EAAgBtC,EAAevlB,GACrC,MAAM,IAAIsB,MACmG2G,4GAAAA,EAAkB4f,iBAAAA,EAAAA,wBAE/H,CAGH,CAEF,CACD,CACD,CAjZM,G","sources":["webpack://wp/./packages/interactivity/node_modules/preact/hooks/src/index.js","webpack://wp/./node_modules/@preact/signals-core/src/index.ts","webpack://wp/./packages/interactivity/node_modules/@preact/signals/src/index.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/namespaces.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/scopes.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/utils.ts","webpack://wp/./packages/interactivity/build-module/proxies/@wordpress/interactivity/src/proxies/registry.ts","webpack://wp/./packages/interactivity/build-module/proxies/@wordpress/interactivity/src/proxies/signals.ts","webpack://wp/./packages/interactivity/build-module/proxies/@wordpress/interactivity/src/proxies/state.ts","webpack://wp/./packages/interactivity/build-module/proxies/@wordpress/interactivity/src/proxies/store.ts","webpack://wp/./packages/interactivity/build-module/proxies/@wordpress/interactivity/src/proxies/context.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/store.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/hooks.tsx","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/directives.tsx","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/constants.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/vdom.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/init.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/index.ts","webpack://wp/./packages/interactivity/node_modules/preact/src/constants.js","webpack://wp/./packages/interactivity/node_modules/preact/src/util.js","webpack://wp/./packages/interactivity/node_modules/preact/src/options.js","webpack://wp/./packages/interactivity/node_modules/preact/src/create-element.js","webpack://wp/./packages/interactivity/node_modules/preact/src/component.js","webpack://wp/./packages/interactivity/node_modules/preact/src/create-context.js","webpack://wp/./packages/interactivity/node_modules/preact/src/diff/children.js","webpack://wp/./packages/interactivity/node_modules/preact/src/diff/props.js","webpack://wp/./packages/interactivity/node_modules/preact/src/diff/index.js","webpack://wp/./packages/interactivity/node_modules/preact/src/render.js","webpack://wp/./packages/interactivity/node_modules/preact/src/clone-element.js","webpack://wp/./packages/interactivity/node_modules/preact/src/diff/catch-error.js","webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/./packages/interactivity/node_modules/preact/devtools/src/devtools.js","webpack://wp/./packages/interactivity/node_modules/preact/debug/src/check-props.js","webpack://wp/./packages/interactivity/node_modules/preact/debug/src/component-stack.js","webpack://wp/./packages/interactivity/node_modules/preact/debug/src/debug.js","webpack://wp/./packages/interactivity/node_modules/preact/debug/src/constants.js","webpack://wp/./packages/interactivity/node_modules/preact/debug/src/util.js"],"sourcesContent":["import { options } from 'preact';\n\n/** @type {number} */\nlet currentIndex;\n\n/** @type {import('./internal').Component} */\nlet currentComponent;\n\n/** @type {import('./internal').Component} */\nlet previousComponent;\n\n/** @type {number} */\nlet currentHook = 0;\n\n/** @type {Array} */\nlet afterPaintEffects = [];\n\nlet EMPTY = [];\n\nlet oldBeforeDiff = options._diff;\nlet oldBeforeRender = options._render;\nlet oldAfterDiff = options.diffed;\nlet oldCommit = options._commit;\nlet oldBeforeUnmount = options.unmount;\n\nconst RAF_TIMEOUT = 100;\nlet prevRaf;\n\noptions._diff = vnode => {\n\tcurrentComponent = null;\n\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n};\n\noptions._render = vnode => {\n\tif (oldBeforeRender) oldBeforeRender(vnode);\n\n\tcurrentComponent = vnode._component;\n\tcurrentIndex = 0;\n\n\tconst hooks = currentComponent.__hooks;\n\tif (hooks) {\n\t\tif (previousComponent === currentComponent) {\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentComponent._renderCallbacks = [];\n\t\t\thooks._list.forEach(hookItem => {\n\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t}\n\t\t\t\thookItem._pendingValue = EMPTY;\n\t\t\t\thookItem._nextValue = hookItem._pendingArgs = undefined;\n\t\t\t});\n\t\t} else {\n\t\t\thooks._pendingEffects.forEach(invokeCleanup);\n\t\t\thooks._pendingEffects.forEach(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentIndex = 0;\n\t\t}\n\t}\n\tpreviousComponent = currentComponent;\n};\n\noptions.diffed = vnode => {\n\tif (oldAfterDiff) oldAfterDiff(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tif (c.__hooks._pendingEffects.length) afterPaint(afterPaintEffects.push(c));\n\t\tc.__hooks._list.forEach(hookItem => {\n\t\t\tif (hookItem._pendingArgs) {\n\t\t\t\thookItem._args = hookItem._pendingArgs;\n\t\t\t}\n\t\t\tif (hookItem._pendingValue !== EMPTY) {\n\t\t\t\thookItem._value = hookItem._pendingValue;\n\t\t\t}\n\t\t\thookItem._pendingArgs = undefined;\n\t\t\thookItem._pendingValue = EMPTY;\n\t\t});\n\t}\n\tpreviousComponent = currentComponent = null;\n};\n\noptions._commit = (vnode, commitQueue) => {\n\tcommitQueue.some(component => {\n\t\ttry {\n\t\t\tcomponent._renderCallbacks.forEach(invokeCleanup);\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\n\t\t\t\tcb._value ? invokeEffect(cb) : true\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tcommitQueue.some(c => {\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\n\t\t\t});\n\t\t\tcommitQueue = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t});\n\n\tif (oldCommit) oldCommit(vnode, commitQueue);\n};\n\noptions.unmount = vnode => {\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tlet hasErrored;\n\t\tc.__hooks._list.forEach(s => {\n\t\t\ttry {\n\t\t\t\tinvokeCleanup(s);\n\t\t\t} catch (e) {\n\t\t\t\thasErrored = e;\n\t\t\t}\n\t\t});\n\t\tc.__hooks = undefined;\n\t\tif (hasErrored) options._catchError(hasErrored, c._vnode);\n\t}\n};\n\n/**\n * Get a hook's state from the currentComponent\n * @param {number} index The index of the hook to get\n * @param {number} type The index of the hook to get\n * @returns {any}\n */\nfunction getHookState(index, type) {\n\tif (options._hook) {\n\t\toptions._hook(currentComponent, index, currentHook || type);\n\t}\n\tcurrentHook = 0;\n\n\t// Largely inspired by:\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\n\t// Other implementations to look at:\n\t// * https://codesandbox.io/s/mnox05qp8\n\tconst hooks =\n\t\tcurrentComponent.__hooks ||\n\t\t(currentComponent.__hooks = {\n\t\t\t_list: [],\n\t\t\t_pendingEffects: []\n\t\t});\n\n\tif (index >= hooks._list.length) {\n\t\thooks._list.push({ _pendingValue: EMPTY });\n\t}\n\treturn hooks._list[index];\n}\n\n/**\n * @param {import('./index').StateUpdater} [initialState]\n */\nexport function useState(initialState) {\n\tcurrentHook = 1;\n\treturn useReducer(invokeOrReturn, initialState);\n}\n\n/**\n * @param {import('./index').Reducer} reducer\n * @param {import('./index').StateUpdater} initialState\n * @param {(initialState: any) => void} [init]\n * @returns {[ any, (state: any) => void ]}\n */\nexport function useReducer(reducer, initialState, init) {\n\t/** @type {import('./internal').ReducerHookState} */\n\tconst hookState = getHookState(currentIndex++, 2);\n\thookState._reducer = reducer;\n\tif (!hookState._component) {\n\t\thookState._value = [\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\n\n\t\t\taction => {\n\t\t\t\tconst currentValue = hookState._nextValue\n\t\t\t\t\t? hookState._nextValue[0]\n\t\t\t\t\t: hookState._value[0];\n\t\t\t\tconst nextValue = hookState._reducer(currentValue, action);\n\n\t\t\t\tif (currentValue !== nextValue) {\n\t\t\t\t\thookState._nextValue = [nextValue, hookState._value[1]];\n\t\t\t\t\thookState._component.setState({});\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\n\t\thookState._component = currentComponent;\n\n\t\tif (!currentComponent._hasScuFromHooks) {\n\t\t\tcurrentComponent._hasScuFromHooks = true;\n\t\t\tlet prevScu = currentComponent.shouldComponentUpdate;\n\t\t\tconst prevCWU = currentComponent.componentWillUpdate;\n\n\t\t\t// If we're dealing with a forced update `shouldComponentUpdate` will\n\t\t\t// not be called. But we use that to update the hook values, so we\n\t\t\t// need to call it.\n\t\t\tcurrentComponent.componentWillUpdate = function (p, s, c) {\n\t\t\t\tif (this._force) {\n\t\t\t\t\tlet tmp = prevScu;\n\t\t\t\t\t// Clear to avoid other sCU hooks from being called\n\t\t\t\t\tprevScu = undefined;\n\t\t\t\t\tupdateHookState(p, s, c);\n\t\t\t\t\tprevScu = tmp;\n\t\t\t\t}\n\n\t\t\t\tif (prevCWU) prevCWU.call(this, p, s, c);\n\t\t\t};\n\n\t\t\t// This SCU has the purpose of bailing out after repeated updates\n\t\t\t// to stateful hooks.\n\t\t\t// we store the next value in _nextValue[0] and keep doing that for all\n\t\t\t// state setters, if we have next states and\n\t\t\t// all next states within a component end up being equal to their original state\n\t\t\t// we are safe to bail out for this specific component.\n\t\t\t/**\n\t\t\t *\n\t\t\t * @type {import('./internal').Component[\"shouldComponentUpdate\"]}\n\t\t\t */\n\t\t\t// @ts-ignore - We don't use TS to downtranspile\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction updateHookState(p, s, c) {\n\t\t\t\tif (!hookState._component.__hooks) return true;\n\n\t\t\t\tconst stateHooks = hookState._component.__hooks._list.filter(\n\t\t\t\t\tx => x._component\n\t\t\t\t);\n\t\t\t\tconst allHooksEmpty = stateHooks.every(x => !x._nextValue);\n\t\t\t\t// When we have no updated hooks in the component we invoke the previous SCU or\n\t\t\t\t// traverse the VDOM tree further.\n\t\t\t\tif (allHooksEmpty) {\n\t\t\t\t\treturn prevScu ? prevScu.call(this, p, s, c) : true;\n\t\t\t\t}\n\n\t\t\t\t// We check whether we have components with a nextValue set that\n\t\t\t\t// have values that aren't equal to one another this pushes\n\t\t\t\t// us to update further down the tree\n\t\t\t\tlet shouldUpdate = false;\n\t\t\t\tstateHooks.forEach(hookItem => {\n\t\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\t\tconst currentValue = hookItem._value[0];\n\t\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t\t\thookItem._nextValue = undefined;\n\t\t\t\t\t\tif (currentValue !== hookItem._value[0]) shouldUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn shouldUpdate || hookState._component.props !== p\n\t\t\t\t\t? prevScu\n\t\t\t\t\t\t? prevScu.call(this, p, s, c)\n\t\t\t\t\t\t: true\n\t\t\t\t\t: false;\n\t\t\t}\n\n\t\t\tcurrentComponent.shouldComponentUpdate = updateHookState;\n\t\t}\n\t}\n\n\treturn hookState._nextValue || hookState._value;\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {any[]} args\n */\nexport function useEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 3);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\n\t}\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {any[]} args\n */\nexport function useLayoutEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 4);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent._renderCallbacks.push(state);\n\t}\n}\n\nexport function useRef(initialValue) {\n\tcurrentHook = 5;\n\treturn useMemo(() => ({ current: initialValue }), []);\n}\n\n/**\n * @param {object} ref\n * @param {() => object} createHandle\n * @param {any[]} args\n */\nexport function useImperativeHandle(ref, createHandle, args) {\n\tcurrentHook = 6;\n\tuseLayoutEffect(\n\t\t() => {\n\t\t\tif (typeof ref == 'function') {\n\t\t\t\tref(createHandle());\n\t\t\t\treturn () => ref(null);\n\t\t\t} else if (ref) {\n\t\t\t\tref.current = createHandle();\n\t\t\t\treturn () => (ref.current = null);\n\t\t\t}\n\t\t},\n\t\targs == null ? args : args.concat(ref)\n\t);\n}\n\n/**\n * @param {() => any} factory\n * @param {any[]} args\n */\nexport function useMemo(factory, args) {\n\t/** @type {import('./internal').MemoHookState} */\n\tconst state = getHookState(currentIndex++, 7);\n\tif (argsChanged(state._args, args)) {\n\t\tstate._pendingValue = factory();\n\t\tstate._pendingArgs = args;\n\t\tstate._factory = factory;\n\t\treturn state._pendingValue;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * @param {() => void} callback\n * @param {any[]} args\n */\nexport function useCallback(callback, args) {\n\tcurrentHook = 8;\n\treturn useMemo(() => callback, args);\n}\n\n/**\n * @param {import('./internal').PreactContext} context\n */\nexport function useContext(context) {\n\tconst provider = currentComponent.context[context._id];\n\t// We could skip this call here, but than we'd not call\n\t// `options._hook`. We need to do that in order to make\n\t// the devtools aware of this hook.\n\t/** @type {import('./internal').ContextHookState} */\n\tconst state = getHookState(currentIndex++, 9);\n\t// The devtools needs access to the context object to\n\t// be able to pull of the default value when no provider\n\t// is present in the tree.\n\tstate._context = context;\n\tif (!provider) return context._defaultValue;\n\t// This is probably not safe to convert to \"!\"\n\tif (state._value == null) {\n\t\tstate._value = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n}\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {(value: T, cb?: (value: T) => string | number) => void}\n */\nexport function useDebugValue(value, formatter) {\n\tif (options.useDebugValue) {\n\t\toptions.useDebugValue(formatter ? formatter(value) : value);\n\t}\n}\n\n/**\n * @param {(error: any, errorInfo: import('preact').ErrorInfo) => void} cb\n */\nexport function useErrorBoundary(cb) {\n\t/** @type {import('./internal').ErrorBoundaryHookState} */\n\tconst state = getHookState(currentIndex++, 10);\n\tconst errState = useState();\n\tstate._value = cb;\n\tif (!currentComponent.componentDidCatch) {\n\t\tcurrentComponent.componentDidCatch = (err, errorInfo) => {\n\t\t\tif (state._value) state._value(err, errorInfo);\n\t\t\terrState[1](err);\n\t\t};\n\t}\n\treturn [\n\t\terrState[0],\n\t\t() => {\n\t\t\terrState[1](undefined);\n\t\t}\n\t];\n}\n\nexport function useId() {\n\tconst state = getHookState(currentIndex++, 11);\n\tif (!state._value) {\n\t\t// Grab either the root node or the nearest async boundary node.\n\t\t/** @type {import('./internal.d').VNode} */\n\t\tlet root = currentComponent._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\tlet mask = root._mask || (root._mask = [0, 0]);\n\t\tstate._value = 'P' + mask[0] + '-' + mask[1]++;\n\t}\n\n\treturn state._value;\n}\n/**\n * After paint effects consumer.\n */\nfunction flushAfterPaintEffects() {\n\tlet component;\n\twhile ((component = afterPaintEffects.shift())) {\n\t\tif (!component._parentDom || !component.__hooks) continue;\n\t\ttry {\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeCleanup);\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeEffect);\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t} catch (e) {\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t}\n}\n\nlet HAS_RAF = typeof requestAnimationFrame == 'function';\n\n/**\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\n * the next browser frame.\n *\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\n * even if RAF doesn't fire (for example if the browser tab is not visible)\n *\n * @param {() => void} callback\n */\nfunction afterNextFrame(callback) {\n\tconst done = () => {\n\t\tclearTimeout(timeout);\n\t\tif (HAS_RAF) cancelAnimationFrame(raf);\n\t\tsetTimeout(callback);\n\t};\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\n\n\tlet raf;\n\tif (HAS_RAF) {\n\t\traf = requestAnimationFrame(done);\n\t}\n}\n\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\n// Perhaps this is not such a big deal.\n/**\n * Schedule afterPaintEffects flush after the browser paints\n * @param {number} newQueueLength\n */\nfunction afterPaint(newQueueLength) {\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\n\t\tprevRaf = options.requestAnimationFrame;\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\n\t}\n}\n\n/**\n * @param {import('./internal').EffectHookState} hook\n */\nfunction invokeCleanup(hook) {\n\t// A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\tlet cleanup = hook._cleanup;\n\tif (typeof cleanup == 'function') {\n\t\thook._cleanup = undefined;\n\t\tcleanup();\n\t}\n\n\tcurrentComponent = comp;\n}\n\n/**\n * Invoke a Hook's effect\n * @param {import('./internal').EffectHookState} hook\n */\nfunction invokeEffect(hook) {\n\t// A hook call can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\thook._cleanup = hook._value();\n\tcurrentComponent = comp;\n}\n\n/**\n * @param {any[]} oldArgs\n * @param {any[]} newArgs\n */\nfunction argsChanged(oldArgs, newArgs) {\n\treturn (\n\t\t!oldArgs ||\n\t\toldArgs.length !== newArgs.length ||\n\t\tnewArgs.some((arg, index) => arg !== oldArgs[index])\n\t);\n}\n\nfunction invokeOrReturn(arg, f) {\n\treturn typeof f == 'function' ? f(arg) : f;\n}\n","function cycleDetected(): never {\n\tthrow new Error(\"Cycle detected\");\n}\nfunction mutationDetected(): never {\n\tthrow new Error(\"Computed cannot have side-effects\");\n}\n\n// Flags for Computed and Effect.\nconst RUNNING = 1 << 0;\nconst NOTIFIED = 1 << 1;\nconst OUTDATED = 1 << 2;\nconst DISPOSED = 1 << 3;\nconst HAS_ERROR = 1 << 4;\nconst TRACKING = 1 << 5;\n\n// A linked list node used to track dependencies (sources) and dependents (targets).\n// Also used to remember the source's last version number that the target saw.\ntype Node = {\n\t// A source whose value the target depends on.\n\t_source: Signal;\n\t_prevSource?: Node;\n\t_nextSource?: Node;\n\n\t// A target that depends on the source and should be notified when the source changes.\n\t_target: Computed | Effect;\n\t_prevTarget?: Node;\n\t_nextTarget?: Node;\n\n\t// The version number of the source that target has last seen. We use version numbers\n\t// instead of storing the source value, because source values can take arbitrary amount\n\t// of memory, and computeds could hang on to them forever because they're lazily evaluated.\n\t// Use the special value -1 to mark potentially unused but recyclable nodes.\n\t_version: number;\n\n\t// Used to remember & roll back the source's previous `._node` value when entering &\n\t// exiting a new evaluation context.\n\t_rollbackNode?: Node;\n};\n\nfunction startBatch() {\n\tbatchDepth++;\n}\n\nfunction endBatch() {\n\tif (batchDepth > 1) {\n\t\tbatchDepth--;\n\t\treturn;\n\t}\n\n\tlet error: unknown;\n\tlet hasError = false;\n\n\twhile (batchedEffect !== undefined) {\n\t\tlet effect: Effect | undefined = batchedEffect;\n\t\tbatchedEffect = undefined;\n\n\t\tbatchIteration++;\n\n\t\twhile (effect !== undefined) {\n\t\t\tconst next: Effect | undefined = effect._nextBatchedEffect;\n\t\t\teffect._nextBatchedEffect = undefined;\n\t\t\teffect._flags &= ~NOTIFIED;\n\n\t\t\tif (!(effect._flags & DISPOSED) && needsToRecompute(effect)) {\n\t\t\t\ttry {\n\t\t\t\t\teffect._callback();\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (!hasError) {\n\t\t\t\t\t\terror = err;\n\t\t\t\t\t\thasError = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\teffect = next;\n\t\t}\n\t}\n\tbatchIteration = 0;\n\tbatchDepth--;\n\n\tif (hasError) {\n\t\tthrow error;\n\t}\n}\n\nfunction batch(callback: () => T): T {\n\tif (batchDepth > 0) {\n\t\treturn callback();\n\t}\n\t/*@__INLINE__**/ startBatch();\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tendBatch();\n\t}\n}\n\n// Currently evaluated computed or effect.\nlet evalContext: Computed | Effect | undefined = undefined;\n\nlet untrackedDepth = 0;\n\nfunction untracked(callback: () => T): T {\n\tif (untrackedDepth > 0) {\n\t\treturn callback();\n\t}\n\tconst prevContext = evalContext;\n\tevalContext = undefined;\n\tuntrackedDepth++;\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tuntrackedDepth--;\n\t\tevalContext = prevContext;\n\t}\n}\n\n// Effects collected into a batch.\nlet batchedEffect: Effect | undefined = undefined;\nlet batchDepth = 0;\nlet batchIteration = 0;\n\n// A global version number for signals, used for fast-pathing repeated\n// computed.peek()/computed.value calls when nothing has changed globally.\nlet globalVersion = 0;\n\nfunction addDependency(signal: Signal): Node | undefined {\n\tif (evalContext === undefined) {\n\t\treturn undefined;\n\t}\n\n\tlet node = signal._node;\n\tif (node === undefined || node._target !== evalContext) {\n\t\t/**\n\t\t * `signal` is a new dependency. Create a new dependency node, and set it\n\t\t * as the tail of the current context's dependency list. e.g:\n\t\t *\n\t\t * { A <-> B }\n\t\t * ↑ ↑\n\t\t * tail node (new)\n\t\t * ↓\n\t\t * { A <-> B <-> C }\n\t\t * ↑\n\t\t * tail (evalContext._sources)\n\t\t */\n\t\tnode = {\n\t\t\t_version: 0,\n\t\t\t_source: signal,\n\t\t\t_prevSource: evalContext._sources,\n\t\t\t_nextSource: undefined,\n\t\t\t_target: evalContext,\n\t\t\t_prevTarget: undefined,\n\t\t\t_nextTarget: undefined,\n\t\t\t_rollbackNode: node,\n\t\t};\n\n\t\tif (evalContext._sources !== undefined) {\n\t\t\tevalContext._sources._nextSource = node;\n\t\t}\n\t\tevalContext._sources = node;\n\t\tsignal._node = node;\n\n\t\t// Subscribe to change notifications from this dependency if we're in an effect\n\t\t// OR evaluating a computed signal that in turn has subscribers.\n\t\tif (evalContext._flags & TRACKING) {\n\t\t\tsignal._subscribe(node);\n\t\t}\n\t\treturn node;\n\t} else if (node._version === -1) {\n\t\t// `signal` is an existing dependency from a previous evaluation. Reuse it.\n\t\tnode._version = 0;\n\n\t\t/**\n\t\t * If `node` is not already the current tail of the dependency list (i.e.\n\t\t * there is a next node in the list), then make the `node` the new tail. e.g:\n\t\t *\n\t\t * { A <-> B <-> C <-> D }\n\t\t * ↑ ↑\n\t\t * node ┌─── tail (evalContext._sources)\n\t\t * └─────│─────┐\n\t\t * ↓ ↓\n\t\t * { A <-> C <-> D <-> B }\n\t\t * ↑\n\t\t * tail (evalContext._sources)\n\t\t */\n\t\tif (node._nextSource !== undefined) {\n\t\t\tnode._nextSource._prevSource = node._prevSource;\n\n\t\t\tif (node._prevSource !== undefined) {\n\t\t\t\tnode._prevSource._nextSource = node._nextSource;\n\t\t\t}\n\n\t\t\tnode._prevSource = evalContext._sources;\n\t\t\tnode._nextSource = undefined;\n\n\t\t\tevalContext._sources!._nextSource = node;\n\t\t\tevalContext._sources = node;\n\t\t}\n\n\t\t// We can assume that the currently evaluated effect / computed signal is already\n\t\t// subscribed to change notifications from `signal` if needed.\n\t\treturn node;\n\t}\n\treturn undefined;\n}\n\n// @ts-ignore internal Signal is viewed as a function\ndeclare class Signal {\n\t/** @internal */\n\t_value: unknown;\n\n\t/**\n\t * @internal\n\t * Version numbers should always be >= 0, because the special value -1 is used\n\t * by Nodes to signify potentially unused but recyclable nodes.\n\t */\n\t_version: number;\n\n\t/** @internal */\n\t_node?: Node;\n\n\t/** @internal */\n\t_targets?: Node;\n\n\tconstructor(value?: T);\n\n\t/** @internal */\n\t_refresh(): boolean;\n\n\t/** @internal */\n\t_subscribe(node: Node): void;\n\n\t/** @internal */\n\t_unsubscribe(node: Node): void;\n\n\tsubscribe(fn: (value: T) => void): () => void;\n\n\tvalueOf(): T;\n\n\ttoString(): string;\n\n\ttoJSON(): T;\n\n\tpeek(): T;\n\n\tget value(): T;\n\tset value(value: T);\n}\n\n/** @internal */\n// @ts-ignore internal Signal is viewed as function\nfunction Signal(this: Signal, value?: unknown) {\n\tthis._value = value;\n\tthis._version = 0;\n\tthis._node = undefined;\n\tthis._targets = undefined;\n}\n\nSignal.prototype._refresh = function () {\n\treturn true;\n};\n\nSignal.prototype._subscribe = function (node) {\n\tif (this._targets !== node && node._prevTarget === undefined) {\n\t\tnode._nextTarget = this._targets;\n\t\tif (this._targets !== undefined) {\n\t\t\tthis._targets._prevTarget = node;\n\t\t}\n\t\tthis._targets = node;\n\t}\n};\n\nSignal.prototype._unsubscribe = function (node) {\n\t// Only run the unsubscribe step if the signal has any subscribers to begin with.\n\tif (this._targets !== undefined) {\n\t\tconst prev = node._prevTarget;\n\t\tconst next = node._nextTarget;\n\t\tif (prev !== undefined) {\n\t\t\tprev._nextTarget = next;\n\t\t\tnode._prevTarget = undefined;\n\t\t}\n\t\tif (next !== undefined) {\n\t\t\tnext._prevTarget = prev;\n\t\t\tnode._nextTarget = undefined;\n\t\t}\n\t\tif (node === this._targets) {\n\t\t\tthis._targets = next;\n\t\t}\n\t}\n};\n\nSignal.prototype.subscribe = function (fn) {\n\tconst signal = this;\n\treturn effect(function (this: Effect) {\n\t\tconst value = signal.value;\n\t\tconst flag = this._flags & TRACKING;\n\t\tthis._flags &= ~TRACKING;\n\t\ttry {\n\t\t\tfn(value);\n\t\t} finally {\n\t\t\tthis._flags |= flag;\n\t\t}\n\t});\n};\n\nSignal.prototype.valueOf = function () {\n\treturn this.value;\n};\n\nSignal.prototype.toString = function () {\n\treturn this.value + \"\";\n};\n\nSignal.prototype.toJSON = function () {\n\treturn this.value;\n};\n\nSignal.prototype.peek = function () {\n\treturn this._value;\n};\n\nObject.defineProperty(Signal.prototype, \"value\", {\n\tget() {\n\t\tconst node = addDependency(this);\n\t\tif (node !== undefined) {\n\t\t\tnode._version = this._version;\n\t\t}\n\t\treturn this._value;\n\t},\n\tset(this: Signal, value) {\n\t\tif (evalContext instanceof Computed) {\n\t\t\tmutationDetected();\n\t\t}\n\n\t\tif (value !== this._value) {\n\t\t\tif (batchIteration > 100) {\n\t\t\t\tcycleDetected();\n\t\t\t}\n\n\t\t\tthis._value = value;\n\t\t\tthis._version++;\n\t\t\tglobalVersion++;\n\n\t\t\t/**@__INLINE__*/ startBatch();\n\t\t\ttry {\n\t\t\t\tfor (\n\t\t\t\t\tlet node = this._targets;\n\t\t\t\t\tnode !== undefined;\n\t\t\t\t\tnode = node._nextTarget\n\t\t\t\t) {\n\t\t\t\t\tnode._target._notify();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tendBatch();\n\t\t\t}\n\t\t}\n\t},\n});\n\nfunction signal(value: T): Signal {\n\treturn new Signal(value);\n}\n\nfunction needsToRecompute(target: Computed | Effect): boolean {\n\t// Check the dependencies for changed values. The dependency list is already\n\t// in order of use. Therefore if multiple dependencies have changed values, only\n\t// the first used dependency is re-evaluated at this point.\n\tfor (\n\t\tlet node = target._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\t// If there's a new version of the dependency before or after refreshing,\n\t\t// or the dependency has something blocking it from refreshing at all (e.g. a\n\t\t// dependency cycle), then we need to recompute.\n\t\tif (\n\t\t\tnode._source._version !== node._version ||\n\t\t\t!node._source._refresh() ||\n\t\t\tnode._source._version !== node._version\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\t// If none of the dependencies have changed values since last recompute then\n\t// there's no need to recompute.\n\treturn false;\n}\n\nfunction prepareSources(target: Computed | Effect) {\n\t/**\n\t * 1. Mark all current sources as re-usable nodes (version: -1)\n\t * 2. Set a rollback node if the current node is being used in a different context\n\t * 3. Point 'target._sources' to the tail of the doubly-linked list, e.g:\n\t *\n\t * { undefined <- A <-> B <-> C -> undefined }\n\t * ↑ ↑\n\t * │ └──────┐\n\t * target._sources = A; (node is head) │\n\t * ↓ │\n\t * target._sources = C; (node is tail) ─┘\n\t */\n\tfor (\n\t\tlet node = target._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\tconst rollbackNode = node._source._node;\n\t\tif (rollbackNode !== undefined) {\n\t\t\tnode._rollbackNode = rollbackNode;\n\t\t}\n\t\tnode._source._node = node;\n\t\tnode._version = -1;\n\n\t\tif (node._nextSource === undefined) {\n\t\t\ttarget._sources = node;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nfunction cleanupSources(target: Computed | Effect) {\n\tlet node = target._sources;\n\tlet head = undefined;\n\n\t/**\n\t * At this point 'target._sources' points to the tail of the doubly-linked list.\n\t * It contains all existing sources + new sources in order of use.\n\t * Iterate backwards until we find the head node while dropping old dependencies.\n\t */\n\twhile (node !== undefined) {\n\t\tconst prev = node._prevSource;\n\n\t\t/**\n\t\t * The node was not re-used, unsubscribe from its change notifications and remove itself\n\t\t * from the doubly-linked list. e.g:\n\t\t *\n\t\t * { A <-> B <-> C }\n\t\t * ↓\n\t\t * { A <-> C }\n\t\t */\n\t\tif (node._version === -1) {\n\t\t\tnode._source._unsubscribe(node);\n\n\t\t\tif (prev !== undefined) {\n\t\t\t\tprev._nextSource = node._nextSource;\n\t\t\t}\n\t\t\tif (node._nextSource !== undefined) {\n\t\t\t\tnode._nextSource._prevSource = prev;\n\t\t\t}\n\t\t} else {\n\t\t\t/**\n\t\t\t * The new head is the last node seen which wasn't removed/unsubscribed\n\t\t\t * from the doubly-linked list. e.g:\n\t\t\t *\n\t\t\t * { A <-> B <-> C }\n\t\t\t * ↑ ↑ ↑\n\t\t\t * │ │ └ head = node\n\t\t\t * │ └ head = node\n\t\t\t * └ head = node\n\t\t\t */\n\t\t\thead = node;\n\t\t}\n\n\t\tnode._source._node = node._rollbackNode;\n\t\tif (node._rollbackNode !== undefined) {\n\t\t\tnode._rollbackNode = undefined;\n\t\t}\n\n\t\tnode = prev;\n\t}\n\n\ttarget._sources = head;\n}\n\ndeclare class Computed extends Signal {\n\t_compute: () => T;\n\t_sources?: Node;\n\t_globalVersion: number;\n\t_flags: number;\n\n\tconstructor(compute: () => T);\n\n\t_notify(): void;\n\tget value(): T;\n}\n\nfunction Computed(this: Computed, compute: () => unknown) {\n\tSignal.call(this, undefined);\n\n\tthis._compute = compute;\n\tthis._sources = undefined;\n\tthis._globalVersion = globalVersion - 1;\n\tthis._flags = OUTDATED;\n}\n\nComputed.prototype = new Signal() as Computed;\n\nComputed.prototype._refresh = function () {\n\tthis._flags &= ~NOTIFIED;\n\n\tif (this._flags & RUNNING) {\n\t\treturn false;\n\t}\n\n\t// If this computed signal has subscribed to updates from its dependencies\n\t// (TRACKING flag set) and none of them have notified about changes (OUTDATED\n\t// flag not set), then the computed value can't have changed.\n\tif ((this._flags & (OUTDATED | TRACKING)) === TRACKING) {\n\t\treturn true;\n\t}\n\tthis._flags &= ~OUTDATED;\n\n\tif (this._globalVersion === globalVersion) {\n\t\treturn true;\n\t}\n\tthis._globalVersion = globalVersion;\n\n\t// Mark this computed signal running before checking the dependencies for value\n\t// changes, so that the RUNNING flag can be used to notice cyclical dependencies.\n\tthis._flags |= RUNNING;\n\tif (this._version > 0 && !needsToRecompute(this)) {\n\t\tthis._flags &= ~RUNNING;\n\t\treturn true;\n\t}\n\n\tconst prevContext = evalContext;\n\ttry {\n\t\tprepareSources(this);\n\t\tevalContext = this;\n\t\tconst value = this._compute();\n\t\tif (\n\t\t\tthis._flags & HAS_ERROR ||\n\t\t\tthis._value !== value ||\n\t\t\tthis._version === 0\n\t\t) {\n\t\t\tthis._value = value;\n\t\t\tthis._flags &= ~HAS_ERROR;\n\t\t\tthis._version++;\n\t\t}\n\t} catch (err) {\n\t\tthis._value = err;\n\t\tthis._flags |= HAS_ERROR;\n\t\tthis._version++;\n\t}\n\tevalContext = prevContext;\n\tcleanupSources(this);\n\tthis._flags &= ~RUNNING;\n\treturn true;\n};\n\nComputed.prototype._subscribe = function (node) {\n\tif (this._targets === undefined) {\n\t\tthis._flags |= OUTDATED | TRACKING;\n\n\t\t// A computed signal subscribes lazily to its dependencies when the it\n\t\t// gets its first subscriber.\n\t\tfor (\n\t\t\tlet node = this._sources;\n\t\t\tnode !== undefined;\n\t\t\tnode = node._nextSource\n\t\t) {\n\t\t\tnode._source._subscribe(node);\n\t\t}\n\t}\n\tSignal.prototype._subscribe.call(this, node);\n};\n\nComputed.prototype._unsubscribe = function (node) {\n\t// Only run the unsubscribe step if the computed signal has any subscribers.\n\tif (this._targets !== undefined) {\n\t\tSignal.prototype._unsubscribe.call(this, node);\n\n\t\t// Computed signal unsubscribes from its dependencies when it loses its last subscriber.\n\t\t// This makes it possible for unreferences subgraphs of computed signals to get garbage collected.\n\t\tif (this._targets === undefined) {\n\t\t\tthis._flags &= ~TRACKING;\n\n\t\t\tfor (\n\t\t\t\tlet node = this._sources;\n\t\t\t\tnode !== undefined;\n\t\t\t\tnode = node._nextSource\n\t\t\t) {\n\t\t\t\tnode._source._unsubscribe(node);\n\t\t\t}\n\t\t}\n\t}\n};\n\nComputed.prototype._notify = function () {\n\tif (!(this._flags & NOTIFIED)) {\n\t\tthis._flags |= OUTDATED | NOTIFIED;\n\n\t\tfor (\n\t\t\tlet node = this._targets;\n\t\t\tnode !== undefined;\n\t\t\tnode = node._nextTarget\n\t\t) {\n\t\t\tnode._target._notify();\n\t\t}\n\t}\n};\n\nComputed.prototype.peek = function () {\n\tif (!this._refresh()) {\n\t\tcycleDetected();\n\t}\n\tif (this._flags & HAS_ERROR) {\n\t\tthrow this._value;\n\t}\n\treturn this._value;\n};\n\nObject.defineProperty(Computed.prototype, \"value\", {\n\tget() {\n\t\tif (this._flags & RUNNING) {\n\t\t\tcycleDetected();\n\t\t}\n\t\tconst node = addDependency(this);\n\t\tthis._refresh();\n\t\tif (node !== undefined) {\n\t\t\tnode._version = this._version;\n\t\t}\n\t\tif (this._flags & HAS_ERROR) {\n\t\t\tthrow this._value;\n\t\t}\n\t\treturn this._value;\n\t},\n});\n\ninterface ReadonlySignal extends Signal {\n\treadonly value: T;\n}\n\nfunction computed(compute: () => T): ReadonlySignal {\n\treturn new Computed(compute);\n}\n\nfunction cleanupEffect(effect: Effect) {\n\tconst cleanup = effect._cleanup;\n\teffect._cleanup = undefined;\n\n\tif (typeof cleanup === \"function\") {\n\t\t/*@__INLINE__**/ startBatch();\n\n\t\t// Run cleanup functions always outside of any context.\n\t\tconst prevContext = evalContext;\n\t\tevalContext = undefined;\n\t\ttry {\n\t\t\tcleanup();\n\t\t} catch (err) {\n\t\t\teffect._flags &= ~RUNNING;\n\t\t\teffect._flags |= DISPOSED;\n\t\t\tdisposeEffect(effect);\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tevalContext = prevContext;\n\t\t\tendBatch();\n\t\t}\n\t}\n}\n\nfunction disposeEffect(effect: Effect) {\n\tfor (\n\t\tlet node = effect._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\tnode._source._unsubscribe(node);\n\t}\n\teffect._compute = undefined;\n\teffect._sources = undefined;\n\n\tcleanupEffect(effect);\n}\n\nfunction endEffect(this: Effect, prevContext?: Computed | Effect) {\n\tif (evalContext !== this) {\n\t\tthrow new Error(\"Out-of-order effect\");\n\t}\n\tcleanupSources(this);\n\tevalContext = prevContext;\n\n\tthis._flags &= ~RUNNING;\n\tif (this._flags & DISPOSED) {\n\t\tdisposeEffect(this);\n\t}\n\tendBatch();\n}\n\ntype EffectCleanup = () => unknown;\ndeclare class Effect {\n\t_compute?: () => unknown | EffectCleanup;\n\t_cleanup?: () => unknown;\n\t_sources?: Node;\n\t_nextBatchedEffect?: Effect;\n\t_flags: number;\n\n\tconstructor(compute: () => unknown | EffectCleanup);\n\n\t_callback(): void;\n\t_start(): () => void;\n\t_notify(): void;\n\t_dispose(): void;\n}\n\nfunction Effect(this: Effect, compute: () => unknown | EffectCleanup) {\n\tthis._compute = compute;\n\tthis._cleanup = undefined;\n\tthis._sources = undefined;\n\tthis._nextBatchedEffect = undefined;\n\tthis._flags = TRACKING;\n}\n\nEffect.prototype._callback = function () {\n\tconst finish = this._start();\n\ttry {\n\t\tif (this._flags & DISPOSED) return;\n\t\tif (this._compute === undefined) return;\n\n\t\tconst cleanup = this._compute();\n\t\tif (typeof cleanup === \"function\") {\n\t\t\tthis._cleanup = cleanup as EffectCleanup;\n\t\t}\n\t} finally {\n\t\tfinish();\n\t}\n};\n\nEffect.prototype._start = function () {\n\tif (this._flags & RUNNING) {\n\t\tcycleDetected();\n\t}\n\tthis._flags |= RUNNING;\n\tthis._flags &= ~DISPOSED;\n\tcleanupEffect(this);\n\tprepareSources(this);\n\n\t/*@__INLINE__**/ startBatch();\n\tconst prevContext = evalContext;\n\tevalContext = this;\n\treturn endEffect.bind(this, prevContext);\n};\n\nEffect.prototype._notify = function () {\n\tif (!(this._flags & NOTIFIED)) {\n\t\tthis._flags |= NOTIFIED;\n\t\tthis._nextBatchedEffect = batchedEffect;\n\t\tbatchedEffect = this;\n\t}\n};\n\nEffect.prototype._dispose = function () {\n\tthis._flags |= DISPOSED;\n\n\tif (!(this._flags & RUNNING)) {\n\t\tdisposeEffect(this);\n\t}\n};\n\nfunction effect(compute: () => unknown | EffectCleanup): () => void {\n\tconst effect = new Effect(compute);\n\ttry {\n\t\teffect._callback();\n\t} catch (err) {\n\t\teffect._dispose();\n\t\tthrow err;\n\t}\n\t// Return a bound function instead of a wrapper like `() => effect._dispose()`,\n\t// because bound functions seem to be just as fast and take up a lot less memory.\n\treturn effect._dispose.bind(effect);\n}\n\nexport {\n\tsignal,\n\tcomputed,\n\teffect,\n\tbatch,\n\tSignal,\n\ttype ReadonlySignal,\n\tuntracked,\n};\n","import { options, Component, isValidElement } from \"preact\";\nimport { useRef, useMemo, useEffect } from \"preact/hooks\";\nimport {\n\tsignal,\n\tcomputed,\n\tbatch,\n\teffect,\n\tSignal,\n\ttype ReadonlySignal,\n\tuntracked,\n} from \"@preact/signals-core\";\nimport {\n\tVNode,\n\tOptionsTypes,\n\tHookFn,\n\tEffect,\n\tPropertyUpdater,\n\tAugmentedComponent,\n\tAugmentedElement as Element,\n} from \"./internal\";\n\nexport {\n\tsignal,\n\tcomputed,\n\tbatch,\n\teffect,\n\tSignal,\n\ttype ReadonlySignal,\n\tuntracked,\n};\n\nconst HAS_PENDING_UPDATE = 1 << 0;\nconst HAS_HOOK_STATE = 1 << 1;\nconst HAS_COMPUTEDS = 1 << 2;\n\n// Install a Preact options hook\nfunction hook(hookName: T, hookFn: HookFn) {\n\t// @ts-ignore-next-line private options hooks usage\n\toptions[hookName] = hookFn.bind(null, options[hookName] || (() => {}));\n}\n\nlet currentComponent: AugmentedComponent | undefined;\nlet finishUpdate: (() => void) | undefined;\n\nfunction setCurrentUpdater(updater?: Effect) {\n\t// end tracking for the current update:\n\tif (finishUpdate) finishUpdate();\n\t// start tracking the new update:\n\tfinishUpdate = updater && updater._start();\n}\n\nfunction createUpdater(update: () => void) {\n\tlet updater!: Effect;\n\teffect(function (this: Effect) {\n\t\tupdater = this;\n\t});\n\tupdater._callback = update;\n\treturn updater;\n}\n\n/** @todo This may be needed for complex prop value detection. */\n// function isSignalValue(value: any): value is Signal {\n// \tif (typeof value !== \"object\" || value == null) return false;\n// \tif (value instanceof Signal) return true;\n// \t// @TODO: uncomment this when we land Reactive (ideally behind a brand check)\n// \t// for (let i in value) if (value[i] instanceof Signal) return true;\n// \treturn false;\n// }\n\n/**\n * A wrapper component that renders a Signal directly as a Text node.\n * @todo: in Preact 11, just decorate Signal with `type:null`\n */\nfunction SignalValue(this: AugmentedComponent, { data }: { data: Signal }) {\n\t// hasComputeds.add(this);\n\n\t// Store the props.data signal in another signal so that\n\t// passing a new signal reference re-runs the text computed:\n\tconst currentSignal = useSignal(data);\n\tcurrentSignal.value = data;\n\n\tconst s = useMemo(() => {\n\t\t// mark the parent component as having computeds so it gets optimized\n\t\tlet v = this.__v;\n\t\twhile ((v = v.__!)) {\n\t\t\tif (v.__c) {\n\t\t\t\tv.__c._updateFlags |= HAS_COMPUTEDS;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tthis._updater!._callback = () => {\n\t\t\tif (isValidElement(s.peek()) || this.base?.nodeType !== 3) {\n\t\t\t\tthis._updateFlags |= HAS_PENDING_UPDATE;\n\t\t\t\tthis.setState({});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t(this.base as Text).data = s.peek();\n\t\t};\n\n\t\treturn computed(() => {\n\t\t\tlet data = currentSignal.value;\n\t\t\tlet s = data.value;\n\t\t\treturn s === 0 ? 0 : s === true ? \"\" : s || \"\";\n\t\t});\n\t}, []);\n\n\treturn s.value;\n}\nSignalValue.displayName = \"_st\";\n\nObject.defineProperties(Signal.prototype, {\n\tconstructor: { configurable: true, value: undefined },\n\ttype: { configurable: true, value: SignalValue },\n\tprops: {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn { data: this };\n\t\t},\n\t},\n\t// Setting a VNode's _depth to 1 forces Preact to clone it before modifying:\n\t// https://github.com/preactjs/preact/blob/d7a433ee8463a7dc23a05111bb47de9ec729ad4d/src/diff/children.js#L77\n\t// @todo remove this for Preact 11\n\t__b: { configurable: true, value: 1 },\n});\n\n/** Inject low-level property/attribute bindings for Signals into Preact's diff */\nhook(OptionsTypes.DIFF, (old, vnode) => {\n\tif (typeof vnode.type === \"string\") {\n\t\tlet signalProps: Record | undefined;\n\n\t\tlet props = vnode.props;\n\t\tfor (let i in props) {\n\t\t\tif (i === \"children\") continue;\n\n\t\t\tlet value = props[i];\n\t\t\tif (value instanceof Signal) {\n\t\t\t\tif (!signalProps) vnode.__np = signalProps = {};\n\t\t\t\tsignalProps[i] = value;\n\t\t\t\tprops[i] = value.peek();\n\t\t\t}\n\t\t}\n\t}\n\n\told(vnode);\n});\n\n/** Set up Updater before rendering a component */\nhook(OptionsTypes.RENDER, (old, vnode) => {\n\tsetCurrentUpdater();\n\n\tlet updater;\n\n\tlet component = vnode.__c;\n\tif (component) {\n\t\tcomponent._updateFlags &= ~HAS_PENDING_UPDATE;\n\n\t\tupdater = component._updater;\n\t\tif (updater === undefined) {\n\t\t\tcomponent._updater = updater = createUpdater(() => {\n\t\t\t\tcomponent._updateFlags |= HAS_PENDING_UPDATE;\n\t\t\t\tcomponent.setState({});\n\t\t\t});\n\t\t}\n\t}\n\n\tcurrentComponent = component;\n\tsetCurrentUpdater(updater);\n\told(vnode);\n});\n\n/** Finish current updater if a component errors */\nhook(OptionsTypes.CATCH_ERROR, (old, error, vnode, oldVNode) => {\n\tsetCurrentUpdater();\n\tcurrentComponent = undefined;\n\told(error, vnode, oldVNode);\n});\n\n/** Finish current updater after rendering any VNode */\nhook(OptionsTypes.DIFFED, (old, vnode) => {\n\tsetCurrentUpdater();\n\tcurrentComponent = undefined;\n\n\tlet dom: Element;\n\n\t// vnode._dom is undefined during string rendering,\n\t// so we use this to skip prop subscriptions during SSR.\n\tif (typeof vnode.type === \"string\" && (dom = vnode.__e as Element)) {\n\t\tlet props = vnode.__np;\n\t\tlet renderedProps = vnode.props;\n\t\tif (props) {\n\t\t\tlet updaters = dom._updaters;\n\t\t\tif (updaters) {\n\t\t\t\tfor (let prop in updaters) {\n\t\t\t\t\tlet updater = updaters[prop];\n\t\t\t\t\tif (updater !== undefined && !(prop in props)) {\n\t\t\t\t\t\tupdater._dispose();\n\t\t\t\t\t\t// @todo we could just always invoke _dispose() here\n\t\t\t\t\t\tupdaters[prop] = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tupdaters = {};\n\t\t\t\tdom._updaters = updaters;\n\t\t\t}\n\t\t\tfor (let prop in props) {\n\t\t\t\tlet updater = updaters[prop];\n\t\t\t\tlet signal = props[prop];\n\t\t\t\tif (updater === undefined) {\n\t\t\t\t\tupdater = createPropUpdater(dom, prop, signal, renderedProps);\n\t\t\t\t\tupdaters[prop] = updater;\n\t\t\t\t} else {\n\t\t\t\t\tupdater._update(signal, renderedProps);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\told(vnode);\n});\n\nfunction createPropUpdater(\n\tdom: Element,\n\tprop: string,\n\tpropSignal: Signal,\n\tprops: Record\n): PropertyUpdater {\n\tconst setAsProperty =\n\t\tprop in dom &&\n\t\t// SVG elements need to go through `setAttribute` because they\n\t\t// expect things like SVGAnimatedTransformList instead of strings.\n\t\t// @ts-ignore\n\t\tdom.ownerSVGElement === undefined;\n\n\tconst changeSignal = signal(propSignal);\n\treturn {\n\t\t_update: (newSignal: Signal, newProps: typeof props) => {\n\t\t\tchangeSignal.value = newSignal;\n\t\t\tprops = newProps;\n\t\t},\n\t\t_dispose: effect(() => {\n\t\t\tconst value = changeSignal.value.value;\n\t\t\t// If Preact just rendered this value, don't render it again:\n\t\t\tif (props[prop] === value) return;\n\t\t\tprops[prop] = value;\n\t\t\tif (setAsProperty) {\n\t\t\t\t// @ts-ignore-next-line silly\n\t\t\t\tdom[prop] = value;\n\t\t\t} else if (value) {\n\t\t\t\tdom.setAttribute(prop, value);\n\t\t\t} else {\n\t\t\t\tdom.removeAttribute(prop);\n\t\t\t}\n\t\t}),\n\t};\n}\n\n/** Unsubscribe from Signals when unmounting components/vnodes */\nhook(OptionsTypes.UNMOUNT, (old, vnode: VNode) => {\n\tif (typeof vnode.type === \"string\") {\n\t\tlet dom = vnode.__e as Element | undefined;\n\t\t// vnode._dom is undefined during string rendering\n\t\tif (dom) {\n\t\t\tconst updaters = dom._updaters;\n\t\t\tif (updaters) {\n\t\t\t\tdom._updaters = undefined;\n\t\t\t\tfor (let prop in updaters) {\n\t\t\t\t\tlet updater = updaters[prop];\n\t\t\t\t\tif (updater) updater._dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tlet component = vnode.__c;\n\t\tif (component) {\n\t\t\tconst updater = component._updater;\n\t\t\tif (updater) {\n\t\t\t\tcomponent._updater = undefined;\n\t\t\t\tupdater._dispose();\n\t\t\t}\n\t\t}\n\t}\n\told(vnode);\n});\n\n/** Mark components that use hook state so we can skip sCU optimization. */\nhook(OptionsTypes.HOOK, (old, component, index, type) => {\n\tif (type < 3 || type === 9)\n\t\t(component as AugmentedComponent)._updateFlags |= HAS_HOOK_STATE;\n\told(component, index, type);\n});\n\n/**\n * Auto-memoize components that use Signals/Computeds.\n * Note: Does _not_ optimize components that use hook/class state.\n */\nComponent.prototype.shouldComponentUpdate = function (\n\tthis: AugmentedComponent,\n\tprops,\n\tstate\n) {\n\t// @todo: Once preactjs/preact#3671 lands, this could just use `currentUpdater`:\n\tconst updater = this._updater;\n\tconst hasSignals = updater && updater._sources !== undefined;\n\n\t// let reason;\n\t// if (!hasSignals && !hasComputeds.has(this)) {\n\t// \treason = \"no signals or computeds\";\n\t// } else if (hasPendingUpdate.has(this)) {\n\t// \treason = \"has pending update\";\n\t// } else if (hasHookState.has(this)) {\n\t// \treason = \"has hook state\";\n\t// }\n\t// if (reason) {\n\t// \tif (!this) reason += \" (`this` bug)\";\n\t// \tconsole.log(\"not optimizing\", this?.constructor?.name, \": \", reason, {\n\t// \t\tdetails: {\n\t// \t\t\thasSignals,\n\t// \t\t\thasComputeds: hasComputeds.has(this),\n\t// \t\t\thasPendingUpdate: hasPendingUpdate.has(this),\n\t// \t\t\thasHookState: hasHookState.has(this),\n\t// \t\t\tdeps: Array.from(updater._deps),\n\t// \t\t\tupdater,\n\t// \t\t},\n\t// \t});\n\t// }\n\n\t// if this component used no signals or computeds, update:\n\tif (!hasSignals && !(this._updateFlags & HAS_COMPUTEDS)) return true;\n\n\t// if there is a pending re-render triggered from Signals,\n\t// or if there is hook or class state, update:\n\tif (this._updateFlags & (HAS_PENDING_UPDATE | HAS_HOOK_STATE)) return true;\n\n\t// @ts-ignore\n\tfor (let i in state) return true;\n\n\t// if any non-Signal props changed, update:\n\tfor (let i in props) {\n\t\tif (i !== \"__source\" && props[i] !== this.props[i]) return true;\n\t}\n\tfor (let i in this.props) if (!(i in props)) return true;\n\n\t// this is a purely Signal-driven component, don't update:\n\treturn false;\n};\n\nexport function useSignal(value: T) {\n\treturn useMemo(() => signal(value), []);\n}\n\nexport function useComputed(compute: () => T) {\n\tconst $compute = useRef(compute);\n\t$compute.current = compute;\n\t(currentComponent as AugmentedComponent)._updateFlags |= HAS_COMPUTEDS;\n\treturn useMemo(() => computed(() => $compute.current()), []);\n}\n\nexport function useSignalEffect(cb: () => void | (() => void)) {\n\tconst callback = useRef(cb);\n\tcallback.current = cb;\n\n\tuseEffect(() => {\n\t\treturn effect(() => callback.current());\n\t}, []);\n}\n\n/**\n * @todo Determine which Reactive implementation we'll be using.\n * @internal\n */\n// export function useReactive(value: T): Reactive {\n// \treturn useMemo(() => reactive(value), []);\n// }\n\n/**\n * @internal\n * Update a Reactive's using the properties of an object or other Reactive.\n * Also works for Signals.\n * @example\n * // Update a Reactive with Object.assign()-like syntax:\n * const r = reactive({ name: \"Alice\" });\n * update(r, { name: \"Bob\" });\n * update(r, { age: 42 }); // property 'age' does not exist in type '{ name?: string }'\n * update(r, 2); // '2' has no properties in common with '{ name?: string }'\n * console.log(r.name.value); // \"Bob\"\n *\n * @example\n * // Update a Reactive with the properties of another Reactive:\n * const A = reactive({ name: \"Alice\" });\n * const B = reactive({ name: \"Bob\", age: 42 });\n * update(A, B);\n * console.log(`${A.name} is ${A.age}`); // \"Bob is 42\"\n *\n * @example\n * // Update a signal with assign()-like syntax:\n * const s = signal(42);\n * update(s, \"hi\"); // Argument type 'string' not assignable to type 'number'\n * update(s, {}); // Argument type '{}' not assignable to type 'number'\n * update(s, 43);\n * console.log(s.value); // 43\n *\n * @param obj The Reactive or Signal to be updated\n * @param update The value, Signal, object or Reactive to update `obj` to match\n * @param overwrite If `true`, any properties `obj` missing from `update` are set to `undefined`\n */\n/*\nexport function update(\n\tobj: T,\n\tupdate: Partial>,\n\toverwrite = false\n) {\n\tif (obj instanceof Signal) {\n\t\tobj.value = peekValue(update);\n\t} else {\n\t\tfor (let i in update) {\n\t\t\tif (i in obj) {\n\t\t\t\tobj[i].value = peekValue(update[i]);\n\t\t\t} else {\n\t\t\t\tlet sig = signal(peekValue(update[i]));\n\t\t\t\tsig[KEY] = i;\n\t\t\t\tobj[i] = sig;\n\t\t\t}\n\t\t}\n\t\tif (overwrite) {\n\t\t\tfor (let i in obj) {\n\t\t\t\tif (!(i in update)) {\n\t\t\t\t\tobj[i].value = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n*/\n","const namespaceStack: string[] = [];\n\nexport const getNamespace = () => namespaceStack.slice( -1 )[ 0 ];\n\nexport const setNamespace = ( namespace: string ) => {\n\tnamespaceStack.push( namespace );\n};\nexport const resetNamespace = () => {\n\tnamespaceStack.pop();\n};\n","/**\n * External dependencies\n */\nimport type { h as createElement, RefObject } from 'preact';\n\n/**\n * Internal dependencies\n */\nimport { getNamespace } from './namespaces';\nimport type { Evaluate } from './hooks';\n\nexport interface Scope {\n\tevaluate: Evaluate;\n\tcontext: object;\n\tserverContext: object;\n\tref: RefObject< HTMLElement >;\n\tattributes: createElement.JSX.HTMLAttributes;\n}\n\n// Store stacks for the current scope and the default namespaces and export APIs\n// to interact with them.\nconst scopeStack: Scope[] = [];\n\nexport const getScope = () => scopeStack.slice( -1 )[ 0 ];\n\nexport const setScope = ( scope: Scope ) => {\n\tscopeStack.push( scope );\n};\nexport const resetScope = () => {\n\tscopeStack.pop();\n};\n\n// Wrap the element props to prevent modifications.\nconst immutableMap = new WeakMap();\nconst immutableError = () => {\n\tthrow new Error(\n\t\t'Please use `data-wp-bind` to modify the attributes of an element.'\n\t);\n};\nconst immutableHandlers: ProxyHandler< object > = {\n\tget( target, key, receiver ) {\n\t\tconst value = Reflect.get( target, key, receiver );\n\t\treturn !! value && typeof value === 'object'\n\t\t\t? deepImmutable( value )\n\t\t\t: value;\n\t},\n\tset: immutableError,\n\tdeleteProperty: immutableError,\n};\nconst deepImmutable = < T extends object = {} >( target: T ): T => {\n\tif ( ! immutableMap.has( target ) ) {\n\t\timmutableMap.set( target, new Proxy( target, immutableHandlers ) );\n\t}\n\treturn immutableMap.get( target );\n};\n\n/**\n * Retrieves the context inherited by the element evaluating a function from the\n * store. The returned value depends on the element and the namespace where the\n * function calling `getContext()` exists.\n *\n * @param namespace Store namespace. By default, the namespace where the calling\n * function exists is used.\n * @return The context content.\n */\nexport const getContext = < T extends object >( namespace?: string ): T => {\n\tconst scope = getScope();\n\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\tif ( ! scope ) {\n\t\t\tthrow Error(\n\t\t\t\t'Cannot call `getContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.'\n\t\t\t);\n\t\t}\n\t}\n\treturn scope.context[ namespace || getNamespace() ];\n};\n\n/**\n * Retrieves a representation of the element where a function from the store\n * is being evalutated. Such representation is read-only, and contains a\n * reference to the DOM element, its props and a local reactive state.\n *\n * @return Element representation.\n */\nexport const getElement = () => {\n\tconst scope = getScope();\n\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\tif ( ! scope ) {\n\t\t\tthrow Error(\n\t\t\t\t'Cannot call `getElement()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.'\n\t\t\t);\n\t\t}\n\t}\n\tconst { ref, attributes } = scope;\n\treturn Object.freeze( {\n\t\tref: ref.current,\n\t\tattributes: deepImmutable( attributes ),\n\t} );\n};\n\n/**\n * Retrieves the part of the inherited context defined and updated from the\n * server.\n *\n * The object returned is read-only, and includes the context defined in PHP\n * with `wp_interactivity_data_wp_context()`, including the corresponding\n * inherited properties. When `actions.navigate()` is called, this object is\n * updated to reflect the changes in the new visited page, without affecting the\n * context returned by `getContext()`. Directives can subscribe to those changes\n * to update the context if needed.\n *\n * @example\n * ```js\n * store('...', {\n * callbacks: {\n * updateServerContext() {\n * const context = getContext();\n * const serverContext = getServerContext();\n * // Override some property with the new value that came from the server.\n * context.overridableProp = serverContext.overridableProp;\n * },\n * },\n * });\n * ```\n *\n * @param namespace Store namespace. By default, the namespace where the calling\n * function exists is used.\n * @return The server context content.\n */\nexport const getServerContext = < T extends object >(\n\tnamespace?: string\n): T => {\n\tconst scope = getScope();\n\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\tif ( ! scope ) {\n\t\t\tthrow Error(\n\t\t\t\t'Cannot call `getServerContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.'\n\t\t\t);\n\t\t}\n\t}\n\treturn scope.serverContext[ namespace || getNamespace() ];\n};\n","/**\n * External dependencies\n */\nimport {\n\tuseMemo as _useMemo,\n\tuseCallback as _useCallback,\n\tuseEffect as _useEffect,\n\tuseLayoutEffect as _useLayoutEffect,\n\ttype EffectCallback,\n\ttype Inputs,\n} from 'preact/hooks';\nimport { effect } from '@preact/signals';\n\n/**\n * Internal dependencies\n */\nimport { getScope, setScope, resetScope } from './scopes';\nimport { getNamespace, setNamespace, resetNamespace } from './namespaces';\n\ninterface Flusher {\n\treadonly flush: () => void;\n\treadonly dispose: () => void;\n}\n\n/**\n * Executes a callback function after the next frame is rendered.\n *\n * @param callback The callback function to be executed.\n * @return A promise that resolves after the callback function is executed.\n */\nconst afterNextFrame = ( callback: () => void ) => {\n\treturn new Promise< void >( ( resolve ) => {\n\t\tconst done = () => {\n\t\t\tclearTimeout( timeout );\n\t\t\twindow.cancelAnimationFrame( raf );\n\t\t\tsetTimeout( () => {\n\t\t\t\tcallback();\n\t\t\t\tresolve();\n\t\t\t} );\n\t\t};\n\t\tconst timeout = setTimeout( done, 100 );\n\t\tconst raf = window.requestAnimationFrame( done );\n\t} );\n};\n\n/**\n * Returns a promise that resolves after yielding to main.\n *\n * @return Promise\n */\nexport const splitTask = () => {\n\treturn new Promise( ( resolve ) => {\n\t\t// TODO: Use scheduler.yield() when available.\n\t\tsetTimeout( resolve, 0 );\n\t} );\n};\n\n/**\n * Creates a Flusher object that can be used to flush computed values and notify listeners.\n *\n * Using the mangled properties:\n * this.c: this._callback\n * this.x: this._compute\n * https://github.com/preactjs/signals/blob/main/mangle.json\n *\n * @param compute The function that computes the value to be flushed.\n * @param notify The function that notifies listeners when the value is flushed.\n * @return The Flusher object with `flush` and `dispose` properties.\n */\nfunction createFlusher( compute: () => unknown, notify: () => void ): Flusher {\n\tlet flush: () => void = () => undefined;\n\tconst dispose = effect( function ( this: any ) {\n\t\tflush = this.c.bind( this );\n\t\tthis.x = compute;\n\t\tthis.c = notify;\n\t\treturn compute();\n\t} );\n\treturn { flush, dispose } as const;\n}\n\n/**\n * Custom hook that executes a callback function whenever a signal is triggered.\n * Version of `useSignalEffect` with a `useEffect`-like execution. This hook\n * implementation comes from this PR, but we added short-cirtuiting to avoid\n * infinite loops: https://github.com/preactjs/signals/pull/290\n *\n * @param callback The callback function to be executed.\n */\nexport function useSignalEffect( callback: () => unknown ) {\n\t_useEffect( () => {\n\t\tlet eff: Flusher | null = null;\n\t\tlet isExecuting = false;\n\n\t\tconst notify = async () => {\n\t\t\tif ( eff && ! isExecuting ) {\n\t\t\t\tisExecuting = true;\n\t\t\t\tawait afterNextFrame( eff.flush );\n\t\t\t\tisExecuting = false;\n\t\t\t}\n\t\t};\n\n\t\teff = createFlusher( callback, notify );\n\t\treturn eff.dispose;\n\t}, [] );\n}\n\n/**\n * Returns the passed function wrapped with the current scope so it is\n * accessible whenever the function runs. This is primarily to make the scope\n * available inside hook callbacks.\n *\n * Asyncronous functions should use generators that yield promises instead of awaiting them.\n * See the documentation for details: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#the-store\n *\n * @param func The passed function.\n * @return The wrapped function.\n */\nexport function withScope<\n\tFunc extends ( ...args: any[] ) => Generator< any, any >,\n>(\n\tfunc: Func\n): (\n\t...args: Parameters< Func >\n) => ReturnType< Func > extends Generator< any, infer Return >\n\t? Promise< Return >\n\t: never;\nexport function withScope< Func extends Function >( func: Func ): Func;\nexport function withScope( func: ( ...args: unknown[] ) => unknown ) {\n\tconst scope = getScope();\n\tconst ns = getNamespace();\n\tif ( func?.constructor?.name === 'GeneratorFunction' ) {\n\t\treturn async ( ...args: Parameters< typeof func > ) => {\n\t\t\tconst gen = func( ...args ) as Generator;\n\t\t\tlet value: any;\n\t\t\tlet it: any;\n\t\t\twhile ( true ) {\n\t\t\t\tsetNamespace( ns );\n\t\t\t\tsetScope( scope );\n\t\t\t\ttry {\n\t\t\t\t\tit = gen.next( value );\n\t\t\t\t} finally {\n\t\t\t\t\tresetScope();\n\t\t\t\t\tresetNamespace();\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvalue = await it.value;\n\t\t\t\t} catch ( e ) {\n\t\t\t\t\tsetNamespace( ns );\n\t\t\t\t\tsetScope( scope );\n\t\t\t\t\tgen.throw( e );\n\t\t\t\t} finally {\n\t\t\t\t\tresetScope();\n\t\t\t\t\tresetNamespace();\n\t\t\t\t}\n\n\t\t\t\tif ( it.done ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn value;\n\t\t};\n\t}\n\treturn ( ...args: Parameters< typeof func > ) => {\n\t\tsetNamespace( ns );\n\t\tsetScope( scope );\n\t\ttry {\n\t\t\treturn func( ...args );\n\t\t} finally {\n\t\t\tresetNamespace();\n\t\t\tresetScope();\n\t\t}\n\t};\n}\n\n/**\n * Accepts a function that contains imperative code which runs whenever any of\n * the accessed _reactive_ properties (e.g., values from the global state or the\n * context) is modified.\n *\n * This hook makes the element's scope available so functions like\n * `getElement()` and `getContext()` can be used inside the passed callback.\n *\n * @param callback The hook callback.\n */\nexport function useWatch( callback: () => unknown ) {\n\tuseSignalEffect( withScope( callback ) );\n}\n\n/**\n * Accepts a function that contains imperative code which runs only after the\n * element's first render, mainly useful for intialization logic.\n *\n * This hook makes the element's scope available so functions like\n * `getElement()` and `getContext()` can be used inside the passed callback.\n *\n * @param callback The hook callback.\n */\nexport function useInit( callback: EffectCallback ) {\n\t_useEffect( withScope( callback ), [] );\n}\n\n/**\n * Accepts a function that contains imperative, possibly effectful code. The\n * effects run after browser paint, without blocking it.\n *\n * This hook is equivalent to Preact's `useEffect` and makes the element's scope\n * available so functions like `getElement()` and `getContext()` can be used\n * inside the passed callback.\n *\n * @param callback Imperative function that can return a cleanup\n * function.\n * @param inputs If present, effect will only activate if the\n * values in the list change (using `===`).\n */\nexport function useEffect( callback: EffectCallback, inputs: Inputs ) {\n\t_useEffect( withScope( callback ), inputs );\n}\n\n/**\n * Accepts a function that contains imperative, possibly effectful code. Use\n * this to read layout from the DOM and synchronously re-render.\n *\n * This hook is equivalent to Preact's `useLayoutEffect` and makes the element's\n * scope available so functions like `getElement()` and `getContext()` can be\n * used inside the passed callback.\n *\n * @param callback Imperative function that can return a cleanup\n * function.\n * @param inputs If present, effect will only activate if the\n * values in the list change (using `===`).\n */\nexport function useLayoutEffect( callback: EffectCallback, inputs: Inputs ) {\n\t_useLayoutEffect( withScope( callback ), inputs );\n}\n\n/**\n * Returns a memoized version of the callback that only changes if one of the\n * inputs has changed (using `===`).\n *\n * This hook is equivalent to Preact's `useCallback` and makes the element's\n * scope available so functions like `getElement()` and `getContext()` can be\n * used inside the passed callback.\n *\n * @param callback Callback function.\n * @param inputs If present, the callback will only be updated if the\n * values in the list change (using `===`).\n *\n * @return The callback function.\n */\nexport function useCallback< T extends Function >(\n\tcallback: T,\n\tinputs: Inputs\n): T {\n\treturn _useCallback< T >( withScope( callback ), inputs );\n}\n\n/**\n * Pass a factory function and an array of inputs. `useMemo` will only recompute\n * the memoized value when one of the inputs has changed.\n *\n * This hook is equivalent to Preact's `useMemo` and makes the element's scope\n * available so functions like `getElement()` and `getContext()` can be used\n * inside the passed factory function.\n *\n * @param factory Factory function that returns that value for memoization.\n * @param inputs If present, the factory will only be run to recompute if\n * the values in the list change (using `===`).\n *\n * @return The memoized value.\n */\nexport function useMemo< T >( factory: () => T, inputs: Inputs ): T {\n\treturn _useMemo( withScope( factory ), inputs );\n}\n\n/**\n * Creates a root fragment by replacing a node or an array of nodes in a parent element.\n * For wrapperless hydration.\n * See https://gist.github.com/developit/f4c67a2ede71dc2fab7f357f39cff28c\n *\n * @param parent The parent element where the nodes will be replaced.\n * @param replaceNode The node or array of nodes to replace in the parent element.\n * @return The created root fragment.\n */\nexport const createRootFragment = (\n\tparent: Element,\n\treplaceNode: Node | Node[]\n) => {\n\treplaceNode = ( [] as Node[] ).concat( replaceNode );\n\tconst sibling = replaceNode[ replaceNode.length - 1 ].nextSibling;\n\tfunction insert( child: any, root: any ) {\n\t\tparent.insertBefore( child, root || sibling );\n\t}\n\treturn ( ( parent as any ).__k = {\n\t\tnodeType: 1,\n\t\tparentNode: parent,\n\t\tfirstChild: replaceNode[ 0 ],\n\t\tchildNodes: replaceNode,\n\t\tinsertBefore: insert,\n\t\tappendChild: insert,\n\t\tremoveChild( c: Node ) {\n\t\t\tparent.removeChild( c );\n\t\t},\n\t} );\n};\n\n/**\n * Transforms a kebab-case string to camelCase.\n *\n * @param str The kebab-case string to transform to camelCase.\n * @return The transformed camelCase string.\n */\nexport function kebabToCamelCase( str: string ): string {\n\treturn str\n\t\t.replace( /^-+|-+$/g, '' )\n\t\t.toLowerCase()\n\t\t.replace( /-([a-z])/g, function ( _match, group1: string ) {\n\t\t\treturn group1.toUpperCase();\n\t\t} );\n}\n\nconst logged: Set< string > = new Set();\n\n/**\n * Shows a warning with `message` if environment is not `production`.\n *\n * Based on the `@wordpress/warning` package.\n *\n * @param message Message to show in the warning.\n */\nexport const warn = ( message: string ): void => {\n\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\tif ( logged.has( message ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn( message );\n\n\t\t// Throwing an error and catching it immediately to improve debugging\n\t\t// A consumer can use 'pause on caught exceptions'\n\t\ttry {\n\t\t\tthrow Error( message );\n\t\t} catch ( e ) {\n\t\t\t// Do nothing.\n\t\t}\n\t\tlogged.add( message );\n\t}\n};\n\n/**\n * Checks if the passed `candidate` is a plain object with just the `Object`\n * prototype.\n *\n * @param candidate The item to check.\n * @return Whether `candidate` is a plain object.\n */\nexport const isPlainObject = (\n\tcandidate: unknown\n): candidate is Record< string, unknown > =>\n\tBoolean(\n\t\tcandidate &&\n\t\t\ttypeof candidate === 'object' &&\n\t\t\tcandidate.constructor === Object\n\t);\n","/**\n * Proxies for each object.\n */\nconst objToProxy = new WeakMap< object, object >();\nconst proxyToObj = new WeakMap< object, object >();\n\n/**\n * Namespaces for each created proxy.\n */\nconst proxyToNs = new WeakMap< object, string >();\n\n/**\n * Object types that can be proxied.\n */\nconst supported = new Set( [ Object, Array ] );\n\n/**\n * Returns a proxy to the passed object with the given handlers, assigning the\n * specified namespace to it. If a proxy for the passed object was created\n * before, that proxy is returned.\n *\n * @param namespace The namespace that will be associated to this proxy.\n * @param obj The object to proxify.\n * @param handlers Handlers that the proxy will use.\n *\n * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to\n * check if a proxy can be created for a specific object.\n *\n * @return The created proxy.\n */\nexport const createProxy = < T extends object >(\n\tnamespace: string,\n\tobj: T,\n\thandlers: ProxyHandler< T >\n): T => {\n\tif ( ! shouldProxy( obj ) ) {\n\t\tthrow Error( 'This object cannot be proxified.' );\n\t}\n\tif ( ! objToProxy.has( obj ) ) {\n\t\tconst proxy = new Proxy( obj, handlers );\n\t\tobjToProxy.set( obj, proxy );\n\t\tproxyToObj.set( proxy, obj );\n\t\tproxyToNs.set( proxy, namespace );\n\t}\n\treturn objToProxy.get( obj ) as T;\n};\n\n/**\n * Returns the proxy for the given object. If there is no associated proxy, the\n * function returns `undefined`.\n *\n * @param obj Object from which to know the proxy.\n * @return Associated proxy or `undefined`.\n */\nexport const getProxyFromObject = < T extends object >(\n\tobj: T\n): T | undefined => objToProxy.get( obj ) as T;\n\n/**\n * Gets the namespace associated with the given proxy.\n *\n * Proxies have a namespace assigned upon creation. See {@link createProxy}.\n *\n * @param proxy Proxy.\n * @return Namespace.\n */\nexport const getNamespaceFromProxy = ( proxy: object ): string =>\n\tproxyToNs.get( proxy )!;\n\n/**\n * Checks if a given object can be proxied.\n *\n * @param candidate Object to know whether it can be proxied.\n * @return True if the passed instance can be proxied.\n */\nexport const shouldProxy = (\n\tcandidate: any\n): candidate is Object | Array< unknown > => {\n\tif ( typeof candidate !== 'object' || candidate === null ) {\n\t\treturn false;\n\t}\n\treturn (\n\t\t! proxyToNs.has( candidate ) && supported.has( candidate.constructor )\n\t);\n};\n\n/**\n * Returns the target object for the passed proxy. If the passed object is not a registered proxy, the\n * function returns `undefined`.\n *\n * @param proxy Proxy from which to know the target.\n * @return The target object or `undefined`.\n */\nexport const getObjectFromProxy = < T extends object >(\n\tproxy: T\n): T | undefined => proxyToObj.get( proxy ) as T;\n","/**\n * External dependencies\n */\nimport {\n\tcomputed,\n\tsignal,\n\tbatch,\n\ttype Signal,\n\ttype ReadonlySignal,\n} from '@preact/signals';\n\n/**\n * Internal dependencies\n */\nimport { getNamespaceFromProxy } from './registry';\nimport { getScope } from '../scopes';\nimport { setNamespace, resetNamespace } from '../namespaces';\nimport { withScope } from '../utils';\n\n/**\n * Identifier for property computeds not associated to any scope.\n */\nconst NO_SCOPE = {};\n\n/**\n * Structure that manages reactivity for a property in a state object. It uses\n * signals to keep track of property value or getter modifications.\n */\nexport class PropSignal {\n\t/**\n\t * Proxy that holds the property this PropSignal is associated with.\n\t */\n\tprivate owner: object;\n\n\t/**\n\t * Relation of computeds by scope. These computeds are read-only signals\n\t * that depend on whether the property is a value or a getter and,\n\t * therefore, can return different values depending on the scope in which\n\t * the getter is accessed.\n\t */\n\tprivate computedsByScope: WeakMap< WeakKey, ReadonlySignal >;\n\n\t/**\n\t * Signal with the value assigned to the related property.\n\t */\n\tprivate valueSignal?: Signal;\n\n\t/**\n\t * Signal with the getter assigned to the related property.\n\t */\n\tprivate getterSignal?: Signal< ( () => any ) | undefined >;\n\n\t/**\n\t * Structure that manages reactivity for a property in a state object, using\n\t * signals to keep track of property value or getter modifications.\n\t *\n\t * @param owner Proxy that holds the property this instance is associated\n\t * with.\n\t */\n\tconstructor( owner: object ) {\n\t\tthis.owner = owner;\n\t\tthis.computedsByScope = new WeakMap();\n\t}\n\n\t/**\n\t * Changes the internal value. If a getter was set before, it is set to\n\t * `undefined`.\n\t *\n\t * @param value New value.\n\t */\n\tpublic setValue( value: unknown ) {\n\t\tthis.update( { value } );\n\t}\n\n\t/**\n\t * Changes the internal getter. If a value was set before, it is set to\n\t * `undefined`.\n\t *\n\t * @param getter New getter.\n\t */\n\tpublic setGetter( getter: () => any ) {\n\t\tthis.update( { get: getter } );\n\t}\n\n\t/**\n\t * Returns the computed that holds the result of evaluating the prop in the\n\t * current scope.\n\t *\n\t * These computeds are read-only signals that depend on whether the property\n\t * is a value or a getter and, therefore, can return different values\n\t * depending on the scope in which the getter is accessed.\n\t *\n\t * @return Computed that depends on the scope.\n\t */\n\tpublic getComputed(): ReadonlySignal {\n\t\tconst scope = getScope() || NO_SCOPE;\n\n\t\tif ( ! this.valueSignal && ! this.getterSignal ) {\n\t\t\tthis.update( {} );\n\t\t}\n\n\t\tif ( ! this.computedsByScope.has( scope ) ) {\n\t\t\tconst callback = () => {\n\t\t\t\tconst getter = this.getterSignal?.value;\n\t\t\t\treturn getter\n\t\t\t\t\t? getter.call( this.owner )\n\t\t\t\t\t: this.valueSignal?.value;\n\t\t\t};\n\n\t\t\tsetNamespace( getNamespaceFromProxy( this.owner ) );\n\t\t\tthis.computedsByScope.set(\n\t\t\t\tscope,\n\t\t\t\tcomputed( withScope( callback ) )\n\t\t\t);\n\t\t\tresetNamespace();\n\t\t}\n\n\t\treturn this.computedsByScope.get( scope )!;\n\t}\n\n\t/**\n\t * Update the internal signals for the value and the getter of the\n\t * corresponding prop.\n\t *\n\t * @param param0\n\t * @param param0.get New getter.\n\t * @param param0.value New value.\n\t */\n\tprivate update( { get, value }: { get?: () => any; value?: unknown } ) {\n\t\tif ( ! this.valueSignal ) {\n\t\t\tthis.valueSignal = signal( value );\n\t\t\tthis.getterSignal = signal( get );\n\t\t} else if (\n\t\t\tvalue !== this.valueSignal.peek() ||\n\t\t\tget !== this.getterSignal!.peek()\n\t\t) {\n\t\t\tbatch( () => {\n\t\t\t\tthis.valueSignal!.value = value;\n\t\t\t\tthis.getterSignal!.value = get;\n\t\t\t} );\n\t\t}\n\t}\n}\n","/**\n * External dependencies\n */\nimport { batch, signal, type Signal } from '@preact/signals';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcreateProxy,\n\tgetProxyFromObject,\n\tgetNamespaceFromProxy,\n\tshouldProxy,\n\tgetObjectFromProxy,\n} from './registry';\nimport { PropSignal } from './signals';\nimport { setNamespace, resetNamespace } from '../namespaces';\nimport { isPlainObject } from '../utils';\n\n/**\n * Set of built-in symbols.\n */\nconst wellKnownSymbols = new Set(\n\tObject.getOwnPropertyNames( Symbol )\n\t\t.map( ( key ) => Symbol[ key ] )\n\t\t.filter( ( value ) => typeof value === 'symbol' )\n);\n\n/**\n * Relates each proxy with a map of {@link PropSignal} instances, representing\n * the proxy's accessed properties.\n */\nconst proxyToProps: WeakMap<\n\tobject,\n\tMap< string | symbol, PropSignal >\n> = new WeakMap();\n\n/**\n * Checks wether a {@link PropSignal | `PropSignal`} instance exists for the\n * given property in the passed proxy.\n *\n * @param proxy Proxy of a state object or array.\n * @param key The property key.\n * @return `true` when it exists; false otherwise.\n */\nexport const hasPropSignal = ( proxy: object, key: string ) =>\n\tproxyToProps.has( proxy ) && proxyToProps.get( proxy )!.has( key );\n\nconst readOnlyProxies = new WeakSet();\n\n/**\n * Returns the {@link PropSignal | `PropSignal`} instance associated with the\n * specified prop in the passed proxy.\n *\n * The `PropSignal` instance is generated if it doesn't exist yet, using the\n * `initial` parameter to initialize the internal signals.\n *\n * @param proxy Proxy of a state object or array.\n * @param key The property key.\n * @param initial Initial data for the `PropSignal` instance.\n * @return The `PropSignal` instance.\n */\nconst getPropSignal = (\n\tproxy: object,\n\tkey: string | number | symbol,\n\tinitial?: PropertyDescriptor\n) => {\n\tif ( ! proxyToProps.has( proxy ) ) {\n\t\tproxyToProps.set( proxy, new Map() );\n\t}\n\tkey = typeof key === 'number' ? `${ key }` : key;\n\tconst props = proxyToProps.get( proxy )!;\n\tif ( ! props.has( key ) ) {\n\t\tconst ns = getNamespaceFromProxy( proxy );\n\t\tconst prop = new PropSignal( proxy );\n\t\tprops.set( key, prop );\n\t\tif ( initial ) {\n\t\t\tconst { get, value } = initial;\n\t\t\tif ( get ) {\n\t\t\t\tprop.setGetter( get );\n\t\t\t} else {\n\t\t\t\tconst readOnly = readOnlyProxies.has( proxy );\n\t\t\t\tprop.setValue(\n\t\t\t\t\tshouldProxy( value )\n\t\t\t\t\t\t? proxifyState( ns, value, { readOnly } )\n\t\t\t\t\t\t: value\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\treturn props.get( key )!;\n};\n\n/**\n * Relates each proxied object (i.e., the original object) with a signal that\n * tracks changes in the number of properties.\n */\nconst objToIterable = new WeakMap< object, Signal< number > >();\n\n/**\n * When this flag is `true`, it avoids any signal subscription, overriding state\n * props' \"reactive\" behavior.\n */\nlet peeking = false;\n\n/**\n * Handlers for reactive objects and arrays in the state.\n */\nconst stateHandlers: ProxyHandler< object > = {\n\tget( target: object, key: string | symbol, receiver: object ): any {\n\t\t/*\n\t\t * The property should not be reactive for the following cases:\n\t\t * 1. While using the `peek` function to read the property.\n\t\t * 2. The property exists but comes from the Object or Array prototypes.\n\t\t * 3. The property key is a known symbol.\n\t\t */\n\t\tif (\n\t\t\tpeeking ||\n\t\t\t( ! target.hasOwnProperty( key ) && key in target ) ||\n\t\t\t( typeof key === 'symbol' && wellKnownSymbols.has( key ) )\n\t\t) {\n\t\t\treturn Reflect.get( target, key, receiver );\n\t\t}\n\n\t\t// At this point, the property should be reactive.\n\t\tconst desc = Object.getOwnPropertyDescriptor( target, key );\n\t\tconst prop = getPropSignal( receiver, key, desc );\n\t\tconst result = prop.getComputed().value;\n\n\t\t/*\n\t\t * Check if the property is a synchronous function. If it is, set the\n\t\t * default namespace. Synchronous functions always run in the proper scope,\n\t\t * which is set by the Directives component.\n\t\t */\n\t\tif ( typeof result === 'function' ) {\n\t\t\tconst ns = getNamespaceFromProxy( receiver );\n\t\t\treturn ( ...args: unknown[] ) => {\n\t\t\t\tsetNamespace( ns );\n\t\t\t\ttry {\n\t\t\t\t\treturn result.call( receiver, ...args );\n\t\t\t\t} finally {\n\t\t\t\t\tresetNamespace();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\treturn result;\n\t},\n\n\tset(\n\t\ttarget: object,\n\t\tkey: string,\n\t\tvalue: unknown,\n\t\treceiver: object\n\t): boolean {\n\t\tif ( readOnlyProxies.has( receiver ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tsetNamespace( getNamespaceFromProxy( receiver ) );\n\t\ttry {\n\t\t\treturn Reflect.set( target, key, value, receiver );\n\t\t} finally {\n\t\t\tresetNamespace();\n\t\t}\n\t},\n\n\tdefineProperty(\n\t\ttarget: object,\n\t\tkey: string,\n\t\tdesc: PropertyDescriptor\n\t): boolean {\n\t\tif ( readOnlyProxies.has( getProxyFromObject( target )! ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst isNew = ! ( key in target );\n\t\tconst result = Reflect.defineProperty( target, key, desc );\n\n\t\tif ( result ) {\n\t\t\tconst receiver = getProxyFromObject( target )!;\n\t\t\tconst prop = getPropSignal( receiver, key );\n\t\t\tconst { get, value } = desc;\n\t\t\tif ( get ) {\n\t\t\t\tprop.setGetter( get );\n\t\t\t} else {\n\t\t\t\tconst ns = getNamespaceFromProxy( receiver );\n\t\t\t\tprop.setValue(\n\t\t\t\t\tshouldProxy( value ) ? proxifyState( ns, value ) : value\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( isNew && objToIterable.has( target ) ) {\n\t\t\t\tobjToIterable.get( target )!.value++;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Modify the `length` property value only if the related\n\t\t\t * `PropSignal` exists, which means that there are subscriptions to\n\t\t\t * this property.\n\t\t\t */\n\t\t\tif (\n\t\t\t\tArray.isArray( target ) &&\n\t\t\t\tproxyToProps.get( receiver )?.has( 'length' )\n\t\t\t) {\n\t\t\t\tconst length = getPropSignal( receiver, 'length' );\n\t\t\t\tlength.setValue( target.length );\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t},\n\n\tdeleteProperty( target: object, key: string ): boolean {\n\t\tif ( readOnlyProxies.has( getProxyFromObject( target )! ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst result = Reflect.deleteProperty( target, key );\n\n\t\tif ( result ) {\n\t\t\tconst prop = getPropSignal( getProxyFromObject( target )!, key );\n\t\t\tprop.setValue( undefined );\n\n\t\t\tif ( objToIterable.has( target ) ) {\n\t\t\t\tobjToIterable.get( target )!.value++;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t},\n\n\townKeys( target: object ): ( string | symbol )[] {\n\t\tif ( ! objToIterable.has( target ) ) {\n\t\t\tobjToIterable.set( target, signal( 0 ) );\n\t\t}\n\t\t/*\n\t\t *This subscribes to the signal while preventing the minifier from\n\t\t * deleting this line in production.\n\t\t */\n\t\t( objToIterable as any )._ = objToIterable.get( target )!.value;\n\t\treturn Reflect.ownKeys( target );\n\t},\n};\n\n/**\n * Returns the proxy associated with the given state object, creating it if it\n * does not exist.\n *\n * @param namespace The namespace that will be associated to this proxy.\n * @param obj The object to proxify.\n * @param options Options.\n * @param options.readOnly Read-only.\n *\n * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to\n * check if a proxy can be created for a specific object.\n *\n * @return The associated proxy.\n */\nexport const proxifyState = < T extends object >(\n\tnamespace: string,\n\tobj: T,\n\toptions?: { readOnly?: boolean }\n): T => {\n\tconst proxy = createProxy( namespace, obj, stateHandlers ) as T;\n\tif ( options?.readOnly ) {\n\t\treadOnlyProxies.add( proxy );\n\t}\n\treturn proxy;\n};\n\n/**\n * Reads the value of the specified property without subscribing to it.\n *\n * @param obj The object to read the property from.\n * @param key The property key.\n * @return The property value.\n */\nexport const peek = < T extends object, K extends keyof T >(\n\tobj: T,\n\tkey: K\n): T[ K ] => {\n\tpeeking = true;\n\ttry {\n\t\treturn obj[ key ];\n\t} finally {\n\t\tpeeking = false;\n\t}\n};\n\n/**\n * Internal recursive implementation for {@link deepMerge | `deepMerge`}.\n *\n * @param target The target object.\n * @param source The source object containing new values and props.\n * @param override Whether existing props should be overwritten or not (`true`\n * by default).\n */\nconst deepMergeRecursive = (\n\ttarget: any,\n\tsource: any,\n\toverride: boolean = true\n) => {\n\tif ( isPlainObject( target ) && isPlainObject( source ) ) {\n\t\tlet hasNewKeys = false;\n\t\tfor ( const key in source ) {\n\t\t\tconst isNew = ! ( key in target );\n\t\t\thasNewKeys = hasNewKeys || isNew;\n\n\t\t\tconst desc = Object.getOwnPropertyDescriptor( source, key );\n\t\t\tif (\n\t\t\t\ttypeof desc?.get === 'function' ||\n\t\t\t\ttypeof desc?.set === 'function'\n\t\t\t) {\n\t\t\t\tif ( override || isNew ) {\n\t\t\t\t\tObject.defineProperty( target, key, {\n\t\t\t\t\t\t...desc,\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t} );\n\n\t\t\t\t\tconst proxy = getProxyFromObject( target );\n\t\t\t\t\tif ( desc?.get && proxy && hasPropSignal( proxy, key ) ) {\n\t\t\t\t\t\tconst propSignal = getPropSignal( proxy, key );\n\t\t\t\t\t\tpropSignal.setGetter( desc.get );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ( isPlainObject( source[ key ] ) ) {\n\t\t\t\tif ( isNew ) {\n\t\t\t\t\ttarget[ key ] = {};\n\t\t\t\t}\n\n\t\t\t\tdeepMergeRecursive( target[ key ], source[ key ], override );\n\t\t\t} else if ( override || isNew ) {\n\t\t\t\tObject.defineProperty( target, key, desc! );\n\n\t\t\t\tconst proxy = getProxyFromObject( target );\n\t\t\t\tif ( desc?.value && proxy && hasPropSignal( proxy, key ) ) {\n\t\t\t\t\tconst propSignal = getPropSignal( proxy, key );\n\t\t\t\t\tpropSignal.setValue( desc.value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( hasNewKeys && objToIterable.has( target ) ) {\n\t\t\tobjToIterable.get( target )!.value++;\n\t\t}\n\t}\n};\n\n/**\n * Recursively update prop values inside the passed `target` and nested plain\n * objects, using the values present in `source`. References to plain objects\n * are kept, only updating props containing primitives or arrays. Arrays are\n * replaced instead of merged or concatenated.\n *\n * If the `override` parameter is set to `false`, then all values in `target`\n * are preserved, and only new properties from `source` are added.\n *\n * @param target The target object.\n * @param source The source object containing new values and props.\n * @param override Whether existing props should be overwritten or not (`true`\n * by default).\n */\nexport const deepMerge = (\n\ttarget: any,\n\tsource: any,\n\toverride: boolean = true\n) =>\n\tbatch( () =>\n\t\tdeepMergeRecursive(\n\t\t\tgetObjectFromProxy( target ) || target,\n\t\t\tsource,\n\t\t\toverride\n\t\t)\n\t);\n","/**\n * Internal dependencies\n */\nimport { createProxy, getNamespaceFromProxy, shouldProxy } from './registry';\n/**\n * External dependencies\n */\nimport { setNamespace, resetNamespace } from '../namespaces';\nimport { withScope, isPlainObject } from '../utils';\n\n/**\n * Identifies the store proxies handling the root objects of each store.\n */\nconst storeRoots = new WeakSet();\n\n/**\n * Handlers for store proxies.\n */\nconst storeHandlers: ProxyHandler< object > = {\n\tget: ( target: any, key: string | symbol, receiver: any ) => {\n\t\tconst result = Reflect.get( target, key );\n\t\tconst ns = getNamespaceFromProxy( receiver );\n\n\t\t/*\n\t\t * Check if the proxy is the store root and no key with that name exist. In\n\t\t * that case, return an empty object for the requested key.\n\t\t */\n\t\tif ( typeof result === 'undefined' && storeRoots.has( receiver ) ) {\n\t\t\tconst obj = {};\n\t\t\tReflect.set( target, key, obj );\n\t\t\treturn proxifyStore( ns, obj, false );\n\t\t}\n\n\t\t/*\n\t\t * Check if the property is a function. If it is, add the store\n\t\t * namespace to the stack and wrap the function with the current scope.\n\t\t * The `withScope` util handles both synchronous functions and generator\n\t\t * functions.\n\t\t */\n\t\tif ( typeof result === 'function' ) {\n\t\t\tsetNamespace( ns );\n\t\t\tconst scoped = withScope( result );\n\t\t\tresetNamespace();\n\t\t\treturn scoped;\n\t\t}\n\n\t\t// Check if the property is an object. If it is, proxyify it.\n\t\tif ( isPlainObject( result ) && shouldProxy( result ) ) {\n\t\t\treturn proxifyStore( ns, result, false );\n\t\t}\n\n\t\treturn result;\n\t},\n};\n\n/**\n * Returns the proxy associated with the given store object, creating it if it\n * does not exist.\n *\n * @param namespace The namespace that will be associated to this proxy.\n * @param obj The object to proxify.\n *\n * @param isRoot Whether the passed object is the store root object.\n * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to\n * check if a proxy can be created for a specific object.\n *\n * @return The associated proxy.\n */\nexport const proxifyStore = < T extends object >(\n\tnamespace: string,\n\tobj: T,\n\tisRoot = true\n): T => {\n\tconst proxy = createProxy( namespace, obj, storeHandlers );\n\tif ( proxy && isRoot ) {\n\t\tstoreRoots.add( proxy );\n\t}\n\treturn proxy as T;\n};\n","const contextObjectToProxy = new WeakMap();\nconst contextObjectToFallback = new WeakMap();\nconst contextProxies = new WeakSet();\n\nconst descriptor = Reflect.getOwnPropertyDescriptor;\n\n// TODO: Use the proxy registry to avoid multiple proxies on the same object.\nconst contextHandlers: ProxyHandler< object > = {\n\tget: ( target, key ) => {\n\t\tconst fallback = contextObjectToFallback.get( target );\n\t\t// Always subscribe to prop changes in the current context.\n\t\tconst currentProp = target[ key ];\n\n\t\t/*\n\t\t * Return the value from `target` if it exists, or from `fallback`\n\t\t * otherwise. This way, in the case the property doesn't exist either in\n\t\t * `target` or `fallback`, it also subscribes to changes in the parent\n\t\t * context.\n\t\t */\n\t\treturn key in target ? currentProp : fallback[ key ];\n\t},\n\tset: ( target, key, value ) => {\n\t\tconst fallback = contextObjectToFallback.get( target );\n\n\t\t// If the property exists in the current context, modify it. Otherwise,\n\t\t// add it to the current context.\n\t\tconst obj = key in target || ! ( key in fallback ) ? target : fallback;\n\t\tobj[ key ] = value;\n\n\t\treturn true;\n\t},\n\townKeys: ( target ) => [\n\t\t...new Set( [\n\t\t\t...Object.keys( contextObjectToFallback.get( target ) ),\n\t\t\t...Object.keys( target ),\n\t\t] ),\n\t],\n\tgetOwnPropertyDescriptor: ( target, key ) =>\n\t\tdescriptor( target, key ) ||\n\t\tdescriptor( contextObjectToFallback.get( target ), key ),\n};\n\n/**\n * Wrap a context object with a proxy to reproduce the context stack. The proxy\n * uses the passed `inherited` context as a fallback to look up for properties\n * that don't exist in the given context. Also, updated properties are modified\n * where they are defined, or added to the main context when they don't exist.\n *\n * @param current Current context.\n * @param inherited Inherited context, used as fallback.\n *\n * @return The wrapped context object.\n */\nexport const proxifyContext = (\n\tcurrent: object,\n\tinherited: object = {}\n): object => {\n\tif ( contextProxies.has( current ) ) {\n\t\tthrow Error( 'This object cannot be proxified.' );\n\t}\n\t// Update the fallback object reference when it changes.\n\tcontextObjectToFallback.set( current, inherited );\n\tif ( ! contextObjectToProxy.has( current ) ) {\n\t\tconst proxy = new Proxy( current, contextHandlers );\n\t\tcontextObjectToProxy.set( current, proxy );\n\t\tcontextProxies.add( proxy );\n\t}\n\treturn contextObjectToProxy.get( current );\n};\n","/**\n * Internal dependencies\n */\nimport { proxifyState, proxifyStore, deepMerge } from './proxies';\n/**\n * External dependencies\n */\nimport { getNamespace } from './namespaces';\nimport { isPlainObject } from './utils';\n\nexport const stores = new Map();\nconst rawStores = new Map();\nconst storeLocks = new Map();\nconst storeConfigs = new Map();\nconst serverStates = new Map();\n\n/**\n * Get the defined config for the store with the passed namespace.\n *\n * @param namespace Store's namespace from which to retrieve the config.\n * @return Defined config for the given namespace.\n */\nexport const getConfig = ( namespace?: string ) =>\n\tstoreConfigs.get( namespace || getNamespace() ) || {};\n\n/**\n * Get the part of the state defined and updated from the server.\n *\n * The object returned is read-only, and includes the state defined in PHP with\n * `wp_interactivity_state()`. When using `actions.navigate()`, this object is\n * updated to reflect the changes in its properites, without affecting the state\n * returned by `store()`. Directives can subscribe to those changes to update\n * the state if needed.\n *\n * @example\n * ```js\n * const { state } = store('myStore', {\n * callbacks: {\n * updateServerState() {\n * const serverState = getServerState();\n * // Override some property with the new value that came from the server.\n * state.overridableProp = serverState.overridableProp;\n * },\n * },\n * });\n * ```\n *\n * @param namespace Store's namespace from which to retrieve the server state.\n * @return The server state for the given namespace.\n */\nexport const getServerState = ( namespace?: string ) => {\n\tconst ns = namespace || getNamespace();\n\tif ( ! serverStates.has( ns ) ) {\n\t\tserverStates.set( ns, proxifyState( ns, {}, { readOnly: true } ) );\n\t}\n\treturn serverStates.get( ns );\n};\n\ninterface StoreOptions {\n\t/**\n\t * Property to block/unblock private store namespaces.\n\t *\n\t * If the passed value is `true`, it blocks the given namespace, making it\n\t * accessible only trough the returned variables of the `store()` call. In\n\t * the case a lock string is passed, it also blocks the namespace, but can\n\t * be unblocked for other `store()` calls using the same lock string.\n\t *\n\t * @example\n\t * ```\n\t * // The store can only be accessed where the `state` const can.\n\t * const { state } = store( 'myblock/private', { ... }, { lock: true } );\n\t * ```\n\t *\n\t * @example\n\t * ```\n\t * // Other modules knowing `SECRET_LOCK_STRING` can access the namespace.\n\t * const { state } = store(\n\t * 'myblock/private',\n\t * { ... },\n\t * { lock: 'SECRET_LOCK_STRING' }\n\t * );\n\t * ```\n\t */\n\tlock?: boolean | string;\n}\n\nexport const universalUnlock =\n\t'I acknowledge that using a private store means my plugin will inevitably break on the next store release.';\n\n/**\n * Extends the Interactivity API global store adding the passed properties to\n * the given namespace. It also returns stable references to the namespace\n * content.\n *\n * These props typically consist of `state`, which is the reactive part of the\n * store ― which means that any directive referencing a state property will be\n * re-rendered anytime it changes ― and function properties like `actions` and\n * `callbacks`, mostly used for event handlers. These props can then be\n * referenced by any directive to make the HTML interactive.\n *\n * @example\n * ```js\n * const { state } = store( 'counter', {\n * state: {\n * value: 0,\n * get double() { return state.value * 2; },\n * },\n * actions: {\n * increment() {\n * state.value += 1;\n * },\n * },\n * } );\n * ```\n *\n * The code from the example above allows blocks to subscribe and interact with\n * the store by using directives in the HTML, e.g.:\n *\n * ```html\n *
\n * \n * 0\n * \n *
\n * ```\n * @param namespace The store namespace to interact with.\n * @param storePart Properties to add to the store namespace.\n * @param options Options for the given namespace.\n *\n * @return A reference to the namespace content.\n */\nexport function store< S extends object = {} >(\n\tnamespace: string,\n\tstorePart?: S,\n\toptions?: StoreOptions\n): S;\n\nexport function store< T extends object >(\n\tnamespace: string,\n\tstorePart?: T,\n\toptions?: StoreOptions\n): T;\n\nexport function store(\n\tnamespace: string,\n\t{ state = {}, ...block }: any = {},\n\t{ lock = false }: StoreOptions = {}\n) {\n\tif ( ! stores.has( namespace ) ) {\n\t\t// Lock the store if the passed lock is different from the universal\n\t\t// unlock. Once the lock is set (either false, true, or a given string),\n\t\t// it cannot change.\n\t\tif ( lock !== universalUnlock ) {\n\t\t\tstoreLocks.set( namespace, lock );\n\t\t}\n\t\tconst rawStore = {\n\t\t\tstate: proxifyState(\n\t\t\t\tnamespace,\n\t\t\t\tisPlainObject( state ) ? state : {}\n\t\t\t),\n\t\t\t...block,\n\t\t};\n\t\tconst proxifiedStore = proxifyStore( namespace, rawStore );\n\t\trawStores.set( namespace, rawStore );\n\t\tstores.set( namespace, proxifiedStore );\n\t} else {\n\t\t// Lock the store if it wasn't locked yet and the passed lock is\n\t\t// different from the universal unlock. If no lock is given, the store\n\t\t// will be public and won't accept any lock from now on.\n\t\tif ( lock !== universalUnlock && ! storeLocks.has( namespace ) ) {\n\t\t\tstoreLocks.set( namespace, lock );\n\t\t} else {\n\t\t\tconst storeLock = storeLocks.get( namespace );\n\t\t\tconst isLockValid =\n\t\t\t\tlock === universalUnlock ||\n\t\t\t\t( lock !== true && lock === storeLock );\n\n\t\t\tif ( ! isLockValid ) {\n\t\t\t\tif ( ! storeLock ) {\n\t\t\t\t\tthrow Error( 'Cannot lock a public store' );\n\t\t\t\t} else {\n\t\t\t\t\tthrow Error(\n\t\t\t\t\t\t'Cannot unlock a private store with an invalid lock code'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst target = rawStores.get( namespace );\n\t\tdeepMerge( target, block );\n\t\tdeepMerge( target.state, state );\n\t}\n\n\treturn stores.get( namespace );\n}\n\nexport const parseServerData = ( dom = document ) => {\n\tconst jsonDataScriptTag =\n\t\t// Preferred Script Module data passing form\n\t\tdom.getElementById(\n\t\t\t'wp-script-module-data-@wordpress/interactivity'\n\t\t) ??\n\t\t// Legacy form\n\t\tdom.getElementById( 'wp-interactivity-data' );\n\tif ( jsonDataScriptTag?.textContent ) {\n\t\ttry {\n\t\t\treturn JSON.parse( jsonDataScriptTag.textContent );\n\t\t} catch {}\n\t}\n\treturn {};\n};\n\nexport const populateServerData = ( data?: {\n\tstate?: Record< string, unknown >;\n\tconfig?: Record< string, unknown >;\n} ) => {\n\tif ( isPlainObject( data?.state ) ) {\n\t\tObject.entries( data!.state ).forEach( ( [ namespace, state ] ) => {\n\t\t\tconst st = store< any >( namespace, {}, { lock: universalUnlock } );\n\t\t\tdeepMerge( st.state, state, false );\n\t\t\tdeepMerge( getServerState( namespace ), state );\n\t\t} );\n\t}\n\tif ( isPlainObject( data?.config ) ) {\n\t\tObject.entries( data!.config ).forEach( ( [ namespace, config ] ) => {\n\t\t\tstoreConfigs.set( namespace, config );\n\t\t} );\n\t}\n};\n\n// Parse and populate the initial state and config.\nconst data = parseServerData();\npopulateServerData( data );\n","// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable react-hooks/exhaustive-deps */\n\n/**\n * External dependencies\n */\nimport {\n\th as createElement,\n\toptions,\n\tcreateContext,\n\tcloneElement,\n\ttype ComponentChildren,\n} from 'preact';\nimport { useRef, useCallback, useContext } from 'preact/hooks';\nimport type { VNode, Context } from 'preact';\n\n/**\n * Internal dependencies\n */\nimport { store, stores, universalUnlock } from './store';\nimport { warn } from './utils';\nimport { getScope, setScope, resetScope, type Scope } from './scopes';\nexport interface DirectiveEntry {\n\tvalue: string | object;\n\tnamespace: string;\n\tsuffix: string;\n}\n\ntype DirectiveEntries = Record< string, DirectiveEntry[] >;\n\ninterface DirectiveArgs {\n\t/**\n\t * Object map with the defined directives of the element being evaluated.\n\t */\n\tdirectives: DirectiveEntries;\n\t/**\n\t * Props present in the current element.\n\t */\n\tprops: { children?: ComponentChildren };\n\t/**\n\t * Virtual node representing the element.\n\t */\n\telement: VNode< {\n\t\tclass?: string;\n\t\tstyle?: string | Record< string, string | number >;\n\t\tcontent?: ComponentChildren;\n\t} >;\n\t/**\n\t * The inherited context.\n\t */\n\tcontext: Context< any >;\n\t/**\n\t * Function that resolves a given path to a value either in the store or the\n\t * context.\n\t */\n\tevaluate: Evaluate;\n}\n\ninterface DirectiveCallback {\n\t( args: DirectiveArgs ): VNode< any > | null | void;\n}\n\ninterface DirectiveOptions {\n\t/**\n\t * Value that specifies the priority to evaluate directives of this type.\n\t * Lower numbers correspond with earlier execution.\n\t *\n\t * @default 10\n\t */\n\tpriority?: number;\n}\n\nexport interface Evaluate {\n\t( entry: DirectiveEntry, ...args: any[] ): any;\n}\n\ninterface GetEvaluate {\n\t( args: { scope: Scope } ): Evaluate;\n}\n\ntype PriorityLevel = string[];\n\ninterface GetPriorityLevels {\n\t( directives: DirectiveEntries ): PriorityLevel[];\n}\n\ninterface DirectivesProps {\n\tdirectives: DirectiveEntries;\n\tpriorityLevels: PriorityLevel[];\n\telement: VNode;\n\toriginalProps: any;\n\tpreviousScope?: Scope;\n}\n\n// Main context.\nconst context = createContext< any >( { client: {}, server: {} } );\n\n// WordPress Directives.\nconst directiveCallbacks: Record< string, DirectiveCallback > = {};\nconst directivePriorities: Record< string, number > = {};\n\n/**\n * Register a new directive type in the Interactivity API runtime.\n *\n * @example\n * ```js\n * directive(\n * 'alert', // Name without the `data-wp-` prefix.\n * ( { directives: { alert }, element, evaluate } ) => {\n * const defaultEntry = alert.find( entry => entry.suffix === 'default' );\n * element.props.onclick = () => { alert( evaluate( defaultEntry ) ); }\n * }\n * )\n * ```\n *\n * The previous code registers a custom directive type for displaying an alert\n * message whenever an element using it is clicked. The message text is obtained\n * from the store under the inherited namespace, using `evaluate`.\n *\n * When the HTML is processed by the Interactivity API, any element containing\n * the `data-wp-alert` directive will have the `onclick` event handler, e.g.,\n *\n * ```html\n *
\n * \n *
\n * ```\n * Note that, in the previous example, the directive callback gets the path\n * value (`state.alert`) from the directive entry with suffix `default`. A\n * custom suffix can also be specified by appending `--` to the directive\n * attribute, followed by the suffix, like in the following HTML snippet:\n *\n * ```html\n *
\n * Click me!\n *
\n * ```\n *\n * This could be an hypothetical implementation of the custom directive used in\n * the snippet above.\n *\n * @example\n * ```js\n * directive(\n * 'color', // Name without prefix and suffix.\n * ( { directives: { color: colors }, ref, evaluate } ) =>\n * colors.forEach( ( color ) => {\n * if ( color.suffix = 'text' ) {\n * ref.style.setProperty(\n * 'color',\n * evaluate( color.text )\n * );\n * }\n * if ( color.suffix = 'background' ) {\n * ref.style.setProperty(\n * 'background-color',\n * evaluate( color.background )\n * );\n * }\n * } );\n * }\n * )\n * ```\n *\n * @param name Directive name, without the `data-wp-` prefix.\n * @param callback Function that runs the directive logic.\n * @param options Options object.\n * @param options.priority Option to control the directive execution order. The\n * lesser, the highest priority. Default is `10`.\n */\nexport const directive = (\n\tname: string,\n\tcallback: DirectiveCallback,\n\t{ priority = 10 }: DirectiveOptions = {}\n) => {\n\tdirectiveCallbacks[ name ] = callback;\n\tdirectivePriorities[ name ] = priority;\n};\n\n// Resolve the path to some property of the store object.\nconst resolve = ( path: string, namespace: string ) => {\n\tif ( ! namespace ) {\n\t\twarn(\n\t\t\t`Namespace missing for \"${ path }\". The value for that path won't be resolved.`\n\t\t);\n\t\treturn;\n\t}\n\tlet resolvedStore = stores.get( namespace );\n\tif ( typeof resolvedStore === 'undefined' ) {\n\t\tresolvedStore = store( namespace, undefined, {\n\t\t\tlock: universalUnlock,\n\t\t} );\n\t}\n\tconst current = {\n\t\t...resolvedStore,\n\t\tcontext: getScope().context[ namespace ],\n\t};\n\ttry {\n\t\t// TODO: Support lazy/dynamically initialized stores\n\t\treturn path.split( '.' ).reduce( ( acc, key ) => acc[ key ], current );\n\t} catch ( e ) {}\n};\n\n// Generate the evaluate function.\nexport const getEvaluate: GetEvaluate =\n\t( { scope } ) =>\n\t( entry, ...args ) => {\n\t\tlet { value: path, namespace } = entry;\n\t\tif ( typeof path !== 'string' ) {\n\t\t\tthrow new Error( 'The `value` prop should be a string path' );\n\t\t}\n\t\t// If path starts with !, remove it and save a flag.\n\t\tconst hasNegationOperator =\n\t\t\tpath[ 0 ] === '!' && !! ( path = path.slice( 1 ) );\n\t\tsetScope( scope );\n\t\tconst value = resolve( path, namespace );\n\t\tconst result = typeof value === 'function' ? value( ...args ) : value;\n\t\tresetScope();\n\t\treturn hasNegationOperator ? ! result : result;\n\t};\n\n// Separate directives by priority. The resulting array contains objects\n// of directives grouped by same priority, and sorted in ascending order.\nconst getPriorityLevels: GetPriorityLevels = ( directives ) => {\n\tconst byPriority = Object.keys( directives ).reduce<\n\t\tRecord< number, string[] >\n\t>( ( obj, name ) => {\n\t\tif ( directiveCallbacks[ name ] ) {\n\t\t\tconst priority = directivePriorities[ name ];\n\t\t\t( obj[ priority ] = obj[ priority ] || [] ).push( name );\n\t\t}\n\t\treturn obj;\n\t}, {} );\n\n\treturn Object.entries( byPriority )\n\t\t.sort( ( [ p1 ], [ p2 ] ) => parseInt( p1 ) - parseInt( p2 ) )\n\t\t.map( ( [ , arr ] ) => arr );\n};\n\n// Component that wraps each priority level of directives of an element.\nconst Directives = ( {\n\tdirectives,\n\tpriorityLevels: [ currentPriorityLevel, ...nextPriorityLevels ],\n\telement,\n\toriginalProps,\n\tpreviousScope,\n}: DirectivesProps ) => {\n\t// Initialize the scope of this element. These scopes are different per each\n\t// level because each level has a different context, but they share the same\n\t// element ref, state and props.\n\tconst scope = useRef< Scope >( {} as Scope ).current;\n\tscope.evaluate = useCallback( getEvaluate( { scope } ), [] );\n\tconst { client, server } = useContext( context );\n\tscope.context = client;\n\tscope.serverContext = server;\n\t/* eslint-disable react-hooks/rules-of-hooks */\n\tscope.ref = previousScope?.ref || useRef( null );\n\t/* eslint-enable react-hooks/rules-of-hooks */\n\n\t// Create a fresh copy of the vnode element and add the props to the scope,\n\t// named as attributes (HTML Attributes).\n\telement = cloneElement( element, { ref: scope.ref } );\n\tscope.attributes = element.props;\n\n\t// Recursively render the wrapper for the next priority level.\n\tconst children =\n\t\tnextPriorityLevels.length > 0\n\t\t\t? createElement( Directives, {\n\t\t\t\t\tdirectives,\n\t\t\t\t\tpriorityLevels: nextPriorityLevels,\n\t\t\t\t\telement,\n\t\t\t\t\toriginalProps,\n\t\t\t\t\tpreviousScope: scope,\n\t\t\t } )\n\t\t\t: element;\n\n\tconst props = { ...originalProps, children };\n\tconst directiveArgs = {\n\t\tdirectives,\n\t\tprops,\n\t\telement,\n\t\tcontext,\n\t\tevaluate: scope.evaluate,\n\t};\n\n\tsetScope( scope );\n\n\tfor ( const directiveName of currentPriorityLevel ) {\n\t\tconst wrapper = directiveCallbacks[ directiveName ]?.( directiveArgs );\n\t\tif ( wrapper !== undefined ) {\n\t\t\tprops.children = wrapper;\n\t\t}\n\t}\n\n\tresetScope();\n\n\treturn props.children;\n};\n\n// Preact Options Hook called each time a vnode is created.\nconst old = options.vnode;\noptions.vnode = ( vnode: VNode< any > ) => {\n\tif ( vnode.props.__directives ) {\n\t\tconst props = vnode.props;\n\t\tconst directives = props.__directives;\n\t\tif ( directives.key ) {\n\t\t\tvnode.key = directives.key.find(\n\t\t\t\t( { suffix } ) => suffix === 'default'\n\t\t\t).value;\n\t\t}\n\t\tdelete props.__directives;\n\t\tconst priorityLevels = getPriorityLevels( directives );\n\t\tif ( priorityLevels.length > 0 ) {\n\t\t\tvnode.props = {\n\t\t\t\tdirectives,\n\t\t\t\tpriorityLevels,\n\t\t\t\toriginalProps: props,\n\t\t\t\ttype: vnode.type,\n\t\t\t\telement: createElement( vnode.type as any, props ),\n\t\t\t\ttop: true,\n\t\t\t};\n\t\t\tvnode.type = Directives;\n\t\t}\n\t}\n\n\tif ( old ) {\n\t\told( vnode );\n\t}\n};\n","// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable react-hooks/exhaustive-deps */\n\n/**\n * External dependencies\n */\nimport { h as createElement, type RefObject } from 'preact';\nimport { useContext, useMemo, useRef } from 'preact/hooks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseWatch,\n\tuseInit,\n\tkebabToCamelCase,\n\twarn,\n\tsplitTask,\n\tisPlainObject,\n} from './utils';\nimport { directive, getEvaluate, type DirectiveEntry } from './hooks';\nimport { getScope } from './scopes';\nimport { proxifyState, proxifyContext, deepMerge } from './proxies';\n\n/**\n * Recursively clone the passed object.\n *\n * @param source Source object.\n * @return Cloned object.\n */\nfunction deepClone< T >( source: T ): T {\n\tif ( isPlainObject( source ) ) {\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries( source as object ).map( ( [ key, value ] ) => [\n\t\t\t\tkey,\n\t\t\t\tdeepClone( value ),\n\t\t\t] )\n\t\t) as T;\n\t}\n\tif ( Array.isArray( source ) ) {\n\t\treturn source.map( ( i ) => deepClone( i ) ) as T;\n\t}\n\treturn source;\n}\n\nconst newRule =\n\t/(?:([\\u0080-\\uFFFF\\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\\s*)/g;\nconst ruleClean = /\\/\\*[^]*?\\*\\/| +/g;\nconst ruleNewline = /\\n+/g;\nconst empty = ' ';\n\n/**\n * Convert a css style string into a object.\n *\n * Made by Cristian Bote (@cristianbote) for Goober.\n * https://unpkg.com/browse/goober@2.1.13/src/core/astish.js\n *\n * @param val CSS string.\n * @return CSS object.\n */\nconst cssStringToObject = (\n\tval: string\n): Record< string, string | number > => {\n\tconst tree = [ {} ];\n\tlet block, left;\n\n\twhile ( ( block = newRule.exec( val.replace( ruleClean, '' ) ) ) ) {\n\t\tif ( block[ 4 ] ) {\n\t\t\ttree.shift();\n\t\t} else if ( block[ 3 ] ) {\n\t\t\tleft = block[ 3 ].replace( ruleNewline, empty ).trim();\n\t\t\ttree.unshift( ( tree[ 0 ][ left ] = tree[ 0 ][ left ] || {} ) );\n\t\t} else {\n\t\t\ttree[ 0 ][ block[ 1 ] ] = block[ 2 ]\n\t\t\t\t.replace( ruleNewline, empty )\n\t\t\t\t.trim();\n\t\t}\n\t}\n\n\treturn tree[ 0 ];\n};\n\n/**\n * Creates a directive that adds an event listener to the global window or\n * document object.\n *\n * @param type 'window' or 'document'\n */\nconst getGlobalEventDirective = ( type: 'window' | 'document' ) => {\n\treturn ( { directives, evaluate } ) => {\n\t\tdirectives[ `on-${ type }` ]\n\t\t\t.filter( ( { suffix } ) => suffix !== 'default' )\n\t\t\t.forEach( ( entry: DirectiveEntry ) => {\n\t\t\t\tconst eventName = entry.suffix.split( '--', 1 )[ 0 ];\n\t\t\t\tuseInit( () => {\n\t\t\t\t\tconst cb = ( event: Event ) => evaluate( entry, event );\n\t\t\t\t\tconst globalVar = type === 'window' ? window : document;\n\t\t\t\t\tglobalVar.addEventListener( eventName, cb );\n\t\t\t\t\treturn () => globalVar.removeEventListener( eventName, cb );\n\t\t\t\t} );\n\t\t\t} );\n\t};\n};\n\n/**\n * Creates a directive that adds an async event listener to the global window or\n * document object.\n *\n * @param type 'window' or 'document'\n */\nconst getGlobalAsyncEventDirective = ( type: 'window' | 'document' ) => {\n\treturn ( { directives, evaluate } ) => {\n\t\tdirectives[ `on-async-${ type }` ]\n\t\t\t.filter( ( { suffix } ) => suffix !== 'default' )\n\t\t\t.forEach( ( entry: DirectiveEntry ) => {\n\t\t\t\tconst eventName = entry.suffix.split( '--', 1 )[ 0 ];\n\t\t\t\tuseInit( () => {\n\t\t\t\t\tconst cb = async ( event: Event ) => {\n\t\t\t\t\t\tawait splitTask();\n\t\t\t\t\t\tevaluate( entry, event );\n\t\t\t\t\t};\n\t\t\t\t\tconst globalVar = type === 'window' ? window : document;\n\t\t\t\t\tglobalVar.addEventListener( eventName, cb, {\n\t\t\t\t\t\tpassive: true,\n\t\t\t\t\t} );\n\t\t\t\t\treturn () => globalVar.removeEventListener( eventName, cb );\n\t\t\t\t} );\n\t\t\t} );\n\t};\n};\n\nexport default () => {\n\t// data-wp-context\n\tdirective(\n\t\t'context',\n\t\t( {\n\t\t\tdirectives: { context },\n\t\t\tprops: { children },\n\t\t\tcontext: inheritedContext,\n\t\t} ) => {\n\t\t\tconst { Provider } = inheritedContext;\n\t\t\tconst defaultEntry = context.find(\n\t\t\t\t( { suffix } ) => suffix === 'default'\n\t\t\t);\n\t\t\tconst { client: inheritedClient, server: inheritedServer } =\n\t\t\t\tuseContext( inheritedContext );\n\n\t\t\tconst ns = defaultEntry!.namespace;\n\t\t\tconst client = useRef( proxifyState( ns, {} ) );\n\t\t\tconst server = useRef( proxifyState( ns, {}, { readOnly: true } ) );\n\n\t\t\t// No change should be made if `defaultEntry` does not exist.\n\t\t\tconst contextStack = useMemo( () => {\n\t\t\t\tconst result = {\n\t\t\t\t\tclient: { ...inheritedClient },\n\t\t\t\t\tserver: { ...inheritedServer },\n\t\t\t\t};\n\t\t\t\tif ( defaultEntry ) {\n\t\t\t\t\tconst { namespace, value } = defaultEntry;\n\t\t\t\t\t// Check that the value is a JSON object. Send a console warning if not.\n\t\t\t\t\tif ( ! isPlainObject( value ) ) {\n\t\t\t\t\t\twarn(\n\t\t\t\t\t\t\t`The value of data-wp-context in \"${ namespace }\" store must be a valid stringified JSON object.`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tdeepMerge(\n\t\t\t\t\t\tclient.current,\n\t\t\t\t\t\tdeepClone( value ) as object,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t);\n\t\t\t\t\tdeepMerge( server.current, deepClone( value ) as object );\n\t\t\t\t\tresult.client[ namespace ] = proxifyContext(\n\t\t\t\t\t\tclient.current,\n\t\t\t\t\t\tinheritedClient[ namespace ]\n\t\t\t\t\t);\n\t\t\t\t\tresult.server[ namespace ] = proxifyContext(\n\t\t\t\t\t\tserver.current,\n\t\t\t\t\t\tinheritedServer[ namespace ]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}, [ defaultEntry, inheritedClient, inheritedServer ] );\n\n\t\t\treturn createElement( Provider, { value: contextStack }, children );\n\t\t},\n\t\t{ priority: 5 }\n\t);\n\n\t// data-wp-watch--[name]\n\tdirective( 'watch', ( { directives: { watch }, evaluate } ) => {\n\t\twatch.forEach( ( entry ) => {\n\t\t\tuseWatch( () => {\n\t\t\t\tlet start;\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t\t\t\t\tstart = performance.now();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst result = evaluate( entry );\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\tperformance.measure(\n\t\t\t\t\t\t\t`interactivity api watch ${ entry.namespace }`,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\t\tend: performance.now(),\n\t\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\t\tdevtools: {\n\t\t\t\t\t\t\t\t\t\ttrack: `IA: watch ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} );\n\t\t} );\n\t} );\n\n\t// data-wp-init--[name]\n\tdirective( 'init', ( { directives: { init }, evaluate } ) => {\n\t\tinit.forEach( ( entry ) => {\n\t\t\t// TODO: Replace with useEffect to prevent unneeded scopes.\n\t\t\tuseInit( () => {\n\t\t\t\tlet start;\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\tstart = performance.now();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst result = evaluate( entry );\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\tperformance.measure(\n\t\t\t\t\t\t\t`interactivity api init ${ entry.namespace }`,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// eslint-disable-next-line no-undef\n\t\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\t\tend: performance.now(),\n\t\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\t\tdevtools: {\n\t\t\t\t\t\t\t\t\t\ttrack: `IA: init ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} );\n\t\t} );\n\t} );\n\n\t// data-wp-on--[event]\n\tdirective( 'on', ( { directives: { on }, element, evaluate } ) => {\n\t\tconst events = new Map< string, Set< DirectiveEntry > >();\n\t\ton.filter( ( { suffix } ) => suffix !== 'default' ).forEach(\n\t\t\t( entry ) => {\n\t\t\t\tconst event = entry.suffix.split( '--' )[ 0 ];\n\t\t\t\tif ( ! events.has( event ) ) {\n\t\t\t\t\tevents.set( event, new Set< DirectiveEntry >() );\n\t\t\t\t}\n\t\t\t\tevents.get( event )!.add( entry );\n\t\t\t}\n\t\t);\n\n\t\tevents.forEach( ( entries, eventType ) => {\n\t\t\tconst existingHandler = element.props[ `on${ eventType }` ];\n\t\t\telement.props[ `on${ eventType }` ] = ( event: Event ) => {\n\t\t\t\tentries.forEach( ( entry ) => {\n\t\t\t\t\tif ( existingHandler ) {\n\t\t\t\t\t\texistingHandler( event );\n\t\t\t\t\t}\n\t\t\t\t\tlet start;\n\t\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\t\tstart = performance.now();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tevaluate( entry, event );\n\t\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\t\tperformance.measure(\n\t\t\t\t\t\t\t\t`interactivity api on ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line no-undef\n\t\t\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\t\t\tend: performance.now(),\n\t\t\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\t\t\tdevtools: {\n\t\t\t\t\t\t\t\t\t\t\ttrack: `IA: on ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\t\t} );\n\t} );\n\n\t// data-wp-on-async--[event]\n\tdirective(\n\t\t'on-async',\n\t\t( { directives: { 'on-async': onAsync }, element, evaluate } ) => {\n\t\t\tconst events = new Map< string, Set< DirectiveEntry > >();\n\t\t\tonAsync\n\t\t\t\t.filter( ( { suffix } ) => suffix !== 'default' )\n\t\t\t\t.forEach( ( entry ) => {\n\t\t\t\t\tconst event = entry.suffix.split( '--' )[ 0 ];\n\t\t\t\t\tif ( ! events.has( event ) ) {\n\t\t\t\t\t\tevents.set( event, new Set< DirectiveEntry >() );\n\t\t\t\t\t}\n\t\t\t\t\tevents.get( event )!.add( entry );\n\t\t\t\t} );\n\n\t\t\tevents.forEach( ( entries, eventType ) => {\n\t\t\t\tconst existingHandler = element.props[ `on${ eventType }` ];\n\t\t\t\telement.props[ `on${ eventType }` ] = ( event: Event ) => {\n\t\t\t\t\tif ( existingHandler ) {\n\t\t\t\t\t\texistingHandler( event );\n\t\t\t\t\t}\n\t\t\t\t\tentries.forEach( async ( entry ) => {\n\t\t\t\t\t\tawait splitTask();\n\t\t\t\t\t\tevaluate( entry, event );\n\t\t\t\t\t} );\n\t\t\t\t};\n\t\t\t} );\n\t\t}\n\t);\n\n\t// data-wp-on-window--[event]\n\tdirective( 'on-window', getGlobalEventDirective( 'window' ) );\n\t// data-wp-on-document--[event]\n\tdirective( 'on-document', getGlobalEventDirective( 'document' ) );\n\n\t// data-wp-on-async-window--[event]\n\tdirective( 'on-async-window', getGlobalAsyncEventDirective( 'window' ) );\n\t// data-wp-on-async-document--[event]\n\tdirective(\n\t\t'on-async-document',\n\t\tgetGlobalAsyncEventDirective( 'document' )\n\t);\n\n\t// data-wp-class--[classname]\n\tdirective(\n\t\t'class',\n\t\t( { directives: { class: classNames }, element, evaluate } ) => {\n\t\t\tclassNames\n\t\t\t\t.filter( ( { suffix } ) => suffix !== 'default' )\n\t\t\t\t.forEach( ( entry ) => {\n\t\t\t\t\tconst className = entry.suffix;\n\t\t\t\t\tconst result = evaluate( entry );\n\t\t\t\t\tconst currentClass = element.props.class || '';\n\t\t\t\t\tconst classFinder = new RegExp(\n\t\t\t\t\t\t`(^|\\\\s)${ className }(\\\\s|$)`,\n\t\t\t\t\t\t'g'\n\t\t\t\t\t);\n\t\t\t\t\tif ( ! result ) {\n\t\t\t\t\t\telement.props.class = currentClass\n\t\t\t\t\t\t\t.replace( classFinder, ' ' )\n\t\t\t\t\t\t\t.trim();\n\t\t\t\t\t} else if ( ! classFinder.test( currentClass ) ) {\n\t\t\t\t\t\telement.props.class = currentClass\n\t\t\t\t\t\t\t? `${ currentClass } ${ className }`\n\t\t\t\t\t\t\t: className;\n\t\t\t\t\t}\n\n\t\t\t\t\tuseInit( () => {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * This seems necessary because Preact doesn't change the class\n\t\t\t\t\t\t * names on the hydration, so we have to do it manually. It doesn't\n\t\t\t\t\t\t * need deps because it only needs to do it the first time.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif ( ! result ) {\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\telement.ref as RefObject< HTMLElement >\n\t\t\t\t\t\t\t ).current!.classList.remove( className );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\telement.ref as RefObject< HTMLElement >\n\t\t\t\t\t\t\t ).current!.classList.add( className );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t}\n\t);\n\n\t// data-wp-style--[style-prop]\n\tdirective( 'style', ( { directives: { style }, element, evaluate } ) => {\n\t\tstyle\n\t\t\t.filter( ( { suffix } ) => suffix !== 'default' )\n\t\t\t.forEach( ( entry ) => {\n\t\t\t\tconst styleProp = entry.suffix;\n\t\t\t\tconst result = evaluate( entry );\n\t\t\t\telement.props.style = element.props.style || {};\n\t\t\t\tif ( typeof element.props.style === 'string' ) {\n\t\t\t\t\telement.props.style = cssStringToObject(\n\t\t\t\t\t\telement.props.style\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif ( ! result ) {\n\t\t\t\t\tdelete element.props.style[ styleProp ];\n\t\t\t\t} else {\n\t\t\t\t\telement.props.style[ styleProp ] = result;\n\t\t\t\t}\n\n\t\t\t\tuseInit( () => {\n\t\t\t\t\t/*\n\t\t\t\t\t * This seems necessary because Preact doesn't change the styles on\n\t\t\t\t\t * the hydration, so we have to do it manually. It doesn't need deps\n\t\t\t\t\t * because it only needs to do it the first time.\n\t\t\t\t\t */\n\t\t\t\t\tif ( ! result ) {\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\telement.ref as RefObject< HTMLElement >\n\t\t\t\t\t\t ).current!.style.removeProperty( styleProp );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\telement.ref as RefObject< HTMLElement >\n\t\t\t\t\t\t ).current!.style[ styleProp ] = result;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\t} );\n\n\t// data-wp-bind--[attribute]\n\tdirective( 'bind', ( { directives: { bind }, element, evaluate } ) => {\n\t\tbind.filter( ( { suffix } ) => suffix !== 'default' ).forEach(\n\t\t\t( entry ) => {\n\t\t\t\tconst attribute = entry.suffix;\n\t\t\t\tconst result = evaluate( entry );\n\t\t\t\telement.props[ attribute ] = result;\n\n\t\t\t\t/*\n\t\t\t\t * This is necessary because Preact doesn't change the attributes on the\n\t\t\t\t * hydration, so we have to do it manually. It only needs to do it the\n\t\t\t\t * first time. After that, Preact will handle the changes.\n\t\t\t\t */\n\t\t\t\tuseInit( () => {\n\t\t\t\t\tconst el = ( element.ref as RefObject< HTMLElement > )\n\t\t\t\t\t\t.current!;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * We set the value directly to the corresponding HTMLElement instance\n\t\t\t\t\t * property excluding the following special cases. We follow Preact's\n\t\t\t\t\t * logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L110-L129\n\t\t\t\t\t */\n\t\t\t\t\tif ( attribute === 'style' ) {\n\t\t\t\t\t\tif ( typeof result === 'string' ) {\n\t\t\t\t\t\t\tel.style.cssText = result;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else if (\n\t\t\t\t\t\tattribute !== 'width' &&\n\t\t\t\t\t\tattribute !== 'height' &&\n\t\t\t\t\t\tattribute !== 'href' &&\n\t\t\t\t\t\tattribute !== 'list' &&\n\t\t\t\t\t\tattribute !== 'form' &&\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * The value for `tabindex` follows the parsing rules for an\n\t\t\t\t\t\t * integer. If that fails, or if the attribute isn't present, then\n\t\t\t\t\t\t * the browsers should \"follow platform conventions to determine if\n\t\t\t\t\t\t * the element should be considered as a focusable area\",\n\t\t\t\t\t\t * practically meaning that most elements get a default of `-1` (not\n\t\t\t\t\t\t * focusable), but several also get a default of `0` (focusable in\n\t\t\t\t\t\t * order after all elements with a positive `tabindex` value).\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @see https://html.spec.whatwg.org/#tabindex-value\n\t\t\t\t\t\t */\n\t\t\t\t\t\tattribute !== 'tabIndex' &&\n\t\t\t\t\t\tattribute !== 'download' &&\n\t\t\t\t\t\tattribute !== 'rowSpan' &&\n\t\t\t\t\t\tattribute !== 'colSpan' &&\n\t\t\t\t\t\tattribute !== 'role' &&\n\t\t\t\t\t\tattribute in el\n\t\t\t\t\t) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tel[ attribute ] =\n\t\t\t\t\t\t\t\tresult === null || result === undefined\n\t\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t\t: result;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} catch ( err ) {}\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\t * aria- and data- attributes have no boolean representation.\n\t\t\t\t\t * A `false` value is different from the attribute not being\n\t\t\t\t\t * present, so we can't remove it.\n\t\t\t\t\t * We follow Preact's logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L131C24-L136\n\t\t\t\t\t */\n\t\t\t\t\tif (\n\t\t\t\t\t\tresult !== null &&\n\t\t\t\t\t\tresult !== undefined &&\n\t\t\t\t\t\t( result !== false || attribute[ 4 ] === '-' )\n\t\t\t\t\t) {\n\t\t\t\t\t\tel.setAttribute( attribute, result );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tel.removeAttribute( attribute );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t);\n\t} );\n\n\t// data-wp-ignore\n\tdirective(\n\t\t'ignore',\n\t\t( {\n\t\t\telement: {\n\t\t\t\ttype: Type,\n\t\t\t\tprops: { innerHTML, ...rest },\n\t\t\t},\n\t\t}: {\n\t\t\telement: any;\n\t\t} ) => {\n\t\t\t// Preserve the initial inner HTML.\n\t\t\tconst cached = useMemo( () => innerHTML, [] );\n\t\t\treturn createElement( Type, {\n\t\t\t\tdangerouslySetInnerHTML: { __html: cached },\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t}\n\t);\n\n\t// data-wp-text\n\tdirective( 'text', ( { directives: { text }, element, evaluate } ) => {\n\t\tconst entry = text.find( ( { suffix } ) => suffix === 'default' );\n\t\tif ( ! entry ) {\n\t\t\telement.props.children = null;\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst result = evaluate( entry );\n\t\t\telement.props.children =\n\t\t\t\ttypeof result === 'object' ? null : result.toString();\n\t\t} catch ( e ) {\n\t\t\telement.props.children = null;\n\t\t}\n\t} );\n\n\t// data-wp-run\n\tdirective( 'run', ( { directives: { run }, evaluate } ) => {\n\t\trun.forEach( ( entry ) => evaluate( entry ) );\n\t} );\n\n\t// data-wp-each--[item]\n\tdirective(\n\t\t'each',\n\t\t( {\n\t\t\tdirectives: { each, 'each-key': eachKey },\n\t\t\tcontext: inheritedContext,\n\t\t\telement,\n\t\t\tevaluate,\n\t\t} ) => {\n\t\t\tif ( element.type !== 'template' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { Provider } = inheritedContext;\n\t\t\tconst inheritedValue = useContext( inheritedContext );\n\n\t\t\tconst [ entry ] = each;\n\t\t\tconst { namespace, suffix } = entry;\n\n\t\t\tconst list = evaluate( entry );\n\t\t\treturn list.map( ( item ) => {\n\t\t\t\tconst itemProp =\n\t\t\t\t\tsuffix === 'default' ? 'item' : kebabToCamelCase( suffix );\n\t\t\t\tconst itemContext = proxifyContext(\n\t\t\t\t\tproxifyState( namespace, {} ),\n\t\t\t\t\tinheritedValue.client[ namespace ]\n\t\t\t\t);\n\t\t\t\tconst mergedContext = {\n\t\t\t\t\tclient: {\n\t\t\t\t\t\t...inheritedValue.client,\n\t\t\t\t\t\t[ namespace ]: itemContext,\n\t\t\t\t\t},\n\t\t\t\t\tserver: { ...inheritedValue.server },\n\t\t\t\t};\n\n\t\t\t\t// Set the item after proxifying the context.\n\t\t\t\tmergedContext.client[ namespace ][ itemProp ] = item;\n\n\t\t\t\tconst scope = {\n\t\t\t\t\t...getScope(),\n\t\t\t\t\tcontext: mergedContext.client,\n\t\t\t\t\tserverContext: mergedContext.server,\n\t\t\t\t};\n\t\t\t\tconst key = eachKey\n\t\t\t\t\t? getEvaluate( { scope } )( eachKey[ 0 ] )\n\t\t\t\t\t: item;\n\n\t\t\t\treturn createElement(\n\t\t\t\t\tProvider,\n\t\t\t\t\t{ value: mergedContext, key },\n\t\t\t\t\telement.props.content\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t{ priority: 20 }\n\t);\n\n\tdirective( 'each-child', () => null, { priority: 1 } );\n};\n","export const directivePrefix: string = 'wp';\n","/**\n * External dependencies\n */\nimport { h, type ComponentChild, type JSX } from 'preact';\n/**\n * Internal dependencies\n */\nimport { directivePrefix as p } from './constants';\nimport { warn } from './utils';\n\nconst ignoreAttr = `data-${ p }-ignore`;\nconst islandAttr = `data-${ p }-interactive`;\nconst fullPrefix = `data-${ p }-`;\nconst namespaces: Array< string | null > = [];\nconst currentNamespace = () => namespaces[ namespaces.length - 1 ] ?? null;\nconst isObject = ( item: unknown ): item is Record< string, unknown > =>\n\tBoolean( item && typeof item === 'object' && item.constructor === Object );\n\n// Regular expression for directive parsing.\nconst directiveParser = new RegExp(\n\t`^data-${ p }-` + // ${p} must be a prefix string, like 'wp'.\n\t\t// Match alphanumeric characters including hyphen-separated\n\t\t// segments. It excludes underscore intentionally to prevent confusion.\n\t\t// E.g., \"custom-directive\".\n\t\t'([a-z0-9]+(?:-[a-z0-9]+)*)' +\n\t\t// (Optional) Match '--' followed by any alphanumeric charachters. It\n\t\t// excludes underscore intentionally to prevent confusion, but it can\n\t\t// contain multiple hyphens. E.g., \"--custom-prefix--with-more-info\".\n\t\t'(?:--([a-z0-9_-]+))?$',\n\t'i' // Case insensitive.\n);\n\n// Regular expression for reference parsing. It can contain a namespace before\n// the reference, separated by `::`, like `some-namespace::state.somePath`.\n// Namespaces can contain any alphanumeric characters, hyphens, underscores or\n// forward slashes. References don't have any restrictions.\nconst nsPathRegExp = /^([\\w_\\/-]+)::(.+)$/;\n\nexport const hydratedIslands = new WeakSet();\n\n/**\n * Recursive function that transforms a DOM tree into vDOM.\n *\n * @param root The root element or node to start traversing on.\n * @return The resulting vDOM tree.\n */\nexport function toVdom( root: Node ): Array< ComponentChild > {\n\tconst treeWalker = document.createTreeWalker(\n\t\troot,\n\t\t205 // TEXT + CDATA_SECTION + COMMENT + PROCESSING_INSTRUCTION + ELEMENT\n\t);\n\n\tfunction walk(\n\t\tnode: Node\n\t): [ ComponentChild ] | [ ComponentChild, Node | null ] {\n\t\tconst { nodeType } = node;\n\n\t\t// TEXT_NODE (3)\n\t\tif ( nodeType === 3 ) {\n\t\t\treturn [ ( node as Text ).data ];\n\t\t}\n\n\t\t// CDATA_SECTION_NODE (4)\n\t\tif ( nodeType === 4 ) {\n\t\t\tconst next = treeWalker.nextSibling();\n\t\t\t( node as CDATASection ).replaceWith(\n\t\t\t\tnew window.Text( ( node as CDATASection ).nodeValue ?? '' )\n\t\t\t);\n\t\t\treturn [ node.nodeValue, next ];\n\t\t}\n\n\t\t// COMMENT_NODE (8) || PROCESSING_INSTRUCTION_NODE (7)\n\t\tif ( nodeType === 8 || nodeType === 7 ) {\n\t\t\tconst next = treeWalker.nextSibling();\n\t\t\t( node as Comment | ProcessingInstruction ).remove();\n\t\t\treturn [ null, next ];\n\t\t}\n\n\t\tconst elementNode = node as HTMLElement;\n\t\tconst { attributes } = elementNode;\n\t\tconst localName = elementNode.localName as keyof JSX.IntrinsicElements;\n\n\t\tconst props: Record< string, any > = {};\n\t\tconst children: Array< ComponentChild > = [];\n\t\tconst directives: Array<\n\t\t\t[ name: string, namespace: string | null, value: unknown ]\n\t\t> = [];\n\t\tlet ignore = false;\n\t\tlet island = false;\n\n\t\tfor ( let i = 0; i < attributes.length; i++ ) {\n\t\t\tconst attributeName = attributes[ i ].name;\n\t\t\tconst attributeValue = attributes[ i ].value;\n\t\t\tif (\n\t\t\t\tattributeName[ fullPrefix.length ] &&\n\t\t\t\tattributeName.slice( 0, fullPrefix.length ) === fullPrefix\n\t\t\t) {\n\t\t\t\tif ( attributeName === ignoreAttr ) {\n\t\t\t\t\tignore = true;\n\t\t\t\t} else {\n\t\t\t\t\tconst regexResult = nsPathRegExp.exec( attributeValue );\n\t\t\t\t\tconst namespace = regexResult?.[ 1 ] ?? null;\n\t\t\t\t\tlet value: any = regexResult?.[ 2 ] ?? attributeValue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst parsedValue = JSON.parse( value );\n\t\t\t\t\t\tvalue = isObject( parsedValue ) ? parsedValue : value;\n\t\t\t\t\t} catch {}\n\t\t\t\t\tif ( attributeName === islandAttr ) {\n\t\t\t\t\t\tisland = true;\n\t\t\t\t\t\tconst islandNamespace =\n\t\t\t\t\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\t\t\t\t\ttypeof value === 'string'\n\t\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t\t: typeof value?.namespace === 'string'\n\t\t\t\t\t\t\t\t? value.namespace\n\t\t\t\t\t\t\t\t: null;\n\t\t\t\t\t\tnamespaces.push( islandNamespace );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdirectives.push( [ attributeName, namespace, value ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ( attributeName === 'ref' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprops[ attributeName ] = attributeValue;\n\t\t}\n\n\t\tif ( ignore && ! island ) {\n\t\t\treturn [\n\t\t\t\th< any, any >( localName, {\n\t\t\t\t\t...props,\n\t\t\t\t\tinnerHTML: elementNode.innerHTML,\n\t\t\t\t\t__directives: { ignore: true },\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t\tif ( island ) {\n\t\t\thydratedIslands.add( elementNode );\n\t\t}\n\n\t\tif ( directives.length ) {\n\t\t\tprops.__directives = directives.reduce(\n\t\t\t\t( obj, [ name, ns, value ] ) => {\n\t\t\t\t\tconst directiveMatch = directiveParser.exec( name );\n\t\t\t\t\tif ( directiveMatch === null ) {\n\t\t\t\t\t\twarn( `Found malformed directive name: ${ name }.` );\n\t\t\t\t\t\treturn obj;\n\t\t\t\t\t}\n\t\t\t\t\tconst prefix = directiveMatch[ 1 ] || '';\n\t\t\t\t\tconst suffix = directiveMatch[ 2 ] || 'default';\n\n\t\t\t\t\tobj[ prefix ] = obj[ prefix ] || [];\n\t\t\t\t\tobj[ prefix ].push( {\n\t\t\t\t\t\tnamespace: ns ?? currentNamespace(),\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tsuffix,\n\t\t\t\t\t} );\n\t\t\t\t\treturn obj;\n\t\t\t\t},\n\t\t\t\t{}\n\t\t\t);\n\t\t}\n\n\t\t// @ts-expect-error Fixed in upcoming preact release https://github.com/preactjs/preact/pull/4334\n\t\tif ( localName === 'template' ) {\n\t\t\tprops.content = [\n\t\t\t\t...( elementNode as HTMLTemplateElement ).content.childNodes,\n\t\t\t].map( ( childNode ) => toVdom( childNode ) );\n\t\t} else {\n\t\t\tlet child = treeWalker.firstChild();\n\t\t\tif ( child ) {\n\t\t\t\twhile ( child ) {\n\t\t\t\t\tconst [ vnode, nextChild ] = walk( child );\n\t\t\t\t\tif ( vnode ) {\n\t\t\t\t\t\tchildren.push( vnode );\n\t\t\t\t\t}\n\t\t\t\t\tchild = nextChild || treeWalker.nextSibling();\n\t\t\t\t}\n\t\t\t\ttreeWalker.parentNode();\n\t\t\t}\n\t\t}\n\n\t\t// Restore previous namespace.\n\t\tif ( island ) {\n\t\t\tnamespaces.pop();\n\t\t}\n\n\t\treturn [ h( localName, props, children ) ];\n\t}\n\n\treturn walk( treeWalker.currentNode );\n}\n","/**\n * External dependencies\n */\nimport { hydrate, type ContainerNode, type ComponentChild } from 'preact';\n/**\n * Internal dependencies\n */\nimport { toVdom, hydratedIslands } from './vdom';\nimport { createRootFragment, splitTask } from './utils';\nimport { directivePrefix } from './constants';\n\n// Keep the same root fragment for each interactive region node.\nconst regionRootFragments = new WeakMap();\nexport const getRegionRootFragment = ( region: Element ): ContainerNode => {\n\tif ( ! region.parentElement ) {\n\t\tthrow Error( 'The passed region should be an element with a parent.' );\n\t}\n\tif ( ! regionRootFragments.has( region ) ) {\n\t\tregionRootFragments.set(\n\t\t\tregion,\n\t\t\tcreateRootFragment( region.parentElement, region )\n\t\t);\n\t}\n\treturn regionRootFragments.get( region );\n};\n\n// Initial vDOM regions associated with its DOM element.\nexport const initialVdom = new WeakMap< Element, ComponentChild[] >();\n\n// Initialize the router with the initial DOM.\nexport const init = async () => {\n\tconst nodes = document.querySelectorAll(\n\t\t`[data-${ directivePrefix }-interactive]`\n\t);\n\n\tfor ( const node of nodes ) {\n\t\tif ( ! hydratedIslands.has( node ) ) {\n\t\t\tawait splitTask();\n\t\t\tconst fragment = getRegionRootFragment( node );\n\t\t\tconst vdom = toVdom( node );\n\t\t\tinitialVdom.set( node, vdom );\n\t\t\tawait splitTask();\n\t\t\thydrate( vdom, fragment );\n\t\t}\n\t}\n};\n","/**\n * External dependencies\n */\nimport { h, cloneElement, render } from 'preact';\nimport { batch } from '@preact/signals';\n\n/**\n * Internal dependencies\n */\nimport registerDirectives from './directives';\nimport { init, getRegionRootFragment, initialVdom } from './init';\nimport { directivePrefix } from './constants';\nimport { toVdom } from './vdom';\nimport { directive } from './hooks';\nimport { getNamespace } from './namespaces';\nimport { parseServerData, populateServerData } from './store';\nimport { proxifyState } from './proxies';\n\nexport { store, getConfig, getServerState } from './store';\nexport { getContext, getServerContext, getElement } from './scopes';\nexport {\n\twithScope,\n\tuseWatch,\n\tuseInit,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseCallback,\n\tuseMemo,\n\tsplitTask,\n} from './utils';\n\nexport { useState, useRef } from 'preact/hooks';\n\nconst requiredConsent =\n\t'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.';\n\nexport const privateApis = ( lock ): any => {\n\tif ( lock === requiredConsent ) {\n\t\treturn {\n\t\t\tdirectivePrefix,\n\t\t\tgetRegionRootFragment,\n\t\t\tinitialVdom,\n\t\t\ttoVdom,\n\t\t\tdirective,\n\t\t\tgetNamespace,\n\t\t\th,\n\t\t\tcloneElement,\n\t\t\trender,\n\t\t\tproxifyState,\n\t\t\tparseServerData,\n\t\t\tpopulateServerData,\n\t\t\tbatch,\n\t\t};\n\t}\n\n\tthrow new Error( 'Forbidden access.' );\n};\n\nregisterDirectives();\ninit();\n","/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 16;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 17;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-expect-error We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {preact.ContainerNode} node The node to remove\n */\nexport function removeNode(node) {\n\tlet parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import { slice } from './util';\nimport options from './options';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {VNode[\"type\"]} type The node name or Component constructor for this\n * virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array} [children] The children of the\n * virtual node\n * @returns {VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != null) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, null);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\t/** @type {VNode} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t// _nextDom must be initialized to undefined b/c it will eventually\n\t\t// be set to dom.nextSibling which can return `null` and it is important\n\t\t// to be able to distinguish between an uninitialized _nextDom and\n\t\t// a _nextDom that has been set to `null`\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\tconstructor: undefined,\n\t\t_original: original == null ? ++vnodeId : original,\n\t\t_index: -1,\n\t\t_flags: 0\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == null && options.vnode != null) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: null };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != null && vnode.constructor == undefined;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\nimport { MODE_HYDRATE } from './constants';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != null && this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == null) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == null) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._index + 1)\n\t\t\t: null;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != null && sibling._dom != null) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : null;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet oldVNode = component._vnode,\n\t\toldDom = oldVNode._dom,\n\t\tparentDom = component._parentDom,\n\t\tcommitQueue = [],\n\t\trefQueue = [];\n\n\tif (parentDom) {\n\t\tconst newVNode = assign({}, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tparentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tparentDom.ownerSVGElement !== undefined,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : null,\n\t\t\tcommitQueue,\n\t\t\toldDom == null ? getDomSibling(oldVNode) : oldDom,\n\t\t\t!!(oldVNode._flags & MODE_HYDRATE),\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != null && vnode._component != null) {\n\t\tvnode._dom = vnode._component.base = null;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != null && child._dom != null) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/**\n * @param {Component} a\n * @param {Component} b\n */\nconst depthSort = (a, b) => a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet c;\n\trerenderQueue.sort(depthSort);\n\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t// process() calls from getting scheduled while `queue` is still being consumed.\n\twhile ((c = rerenderQueue.shift())) {\n\t\tif (c._dirty) {\n\t\t\tlet renderQueueLength = rerenderQueue.length;\n\t\t\trenderComponent(c);\n\t\t\tif (rerenderQueue.length > renderQueueLength) {\n\t\t\t\t// When i.e. rerendering a provider additional new items can be injected, we want to\n\t\t\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t\t\t// single pass\n\t\t\t\trerenderQueue.sort(depthSort);\n\t\t\t}\n\t\t}\n\t}\n\tprocess._rerenderCount = 0;\n}\n\nprocess._rerenderCount = 0;\n","import { enqueueRender } from './component';\n\nexport let i = 0;\n\nexport function createContext(defaultValue, contextId) {\n\tcontextId = '__cC' + i++;\n\n\tconst context = {\n\t\t_id: contextId,\n\t\t_defaultValue: defaultValue,\n\t\t/** @type {FunctionComponent} */\n\t\tConsumer(props, contextValue) {\n\t\t\t// return props.children(\n\t\t\t// \tcontext[contextId] ? context[contextId].props.value : defaultValue\n\t\t\t// );\n\t\t\treturn props.children(contextValue);\n\t\t},\n\t\t/** @type {FunctionComponent} */\n\t\tProvider(props) {\n\t\t\tif (!this.getChildContext) {\n\t\t\t\t/** @type {Component[]} */\n\t\t\t\tlet subs = [];\n\t\t\t\tlet ctx = {};\n\t\t\t\tctx[contextId] = this;\n\n\t\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t\tif (this.props.value !== _props.value) {\n\t\t\t\t\t\t// I think the forced value propagation here was only needed when `options.debounceRendering` was being bypassed:\n\t\t\t\t\t\t// https://github.com/preactjs/preact/commit/4d339fb803bea09e9f198abf38ca1bf8ea4b7771#diff-54682ce380935a717e41b8bfc54737f6R358\n\t\t\t\t\t\t// In those cases though, even with the value corrected, we're double-rendering all nodes.\n\t\t\t\t\t\t// It might be better to just tell folks not to use force-sync mode.\n\t\t\t\t\t\t// Currently, using `useContext()` in a class component will overwrite its `this.context` value.\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context[contextId] = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\t\t\t\t\t\tsubs.some(c => {\n\t\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.sub = c => {\n\t\t\t\t\tsubs.push(c);\n\t\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\t\tsubs.splice(subs.indexOf(c), 1);\n\t\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn props.children;\n\t\t}\n\t};\n\n\t// Devtools needs access to the context object when it\n\t// encounters a Provider. This is necessary to support\n\t// setting `displayName` on the context object instead\n\t// of on the component itself. See:\n\t// https://reactjs.org/docs/context.html#contextdisplayname\n\n\treturn (context.Provider._contextRef = context.Consumer.contextType =\n\t\tcontext);\n}\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport { EMPTY_OBJ, EMPTY_ARR, INSERT_VNODE, MATCHED } from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * Diff the children of a virtual node\n * @param {PreactElement} parentDom The DOM element whose children are being\n * diffed\n * @param {ComponentChildren[]} renderResult\n * @param {VNode} newParentVNode The new virtual node whose children should be\n * diff'ed against oldParentVNode\n * @param {VNode} oldParentVNode The old virtual node whose children should be\n * diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\tlet i,\n\t\t/** @type {VNode} */\n\t\toldVNode,\n\t\t/** @type {VNode} */\n\t\tchildVNode,\n\t\t/** @type {PreactElement} */\n\t\tnewDom,\n\t\t/** @type {PreactElement} */\n\t\tfirstChildDom;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\t/** @type {VNode[]} */\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\tnewParentVNode._nextDom = oldDom;\n\tconstructNewChildrenArray(newParentVNode, renderResult, oldChildren);\n\toldDom = newParentVNode._nextDom;\n\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\tchildVNode = newParentVNode._children[i];\n\n\t\tif (\n\t\t\tchildVNode == null ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// At this point, constructNewChildrenArray has assigned _index to be the\n\t\t// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).\n\t\tif (childVNode._index === -1) {\n\t\t\toldVNode = EMPTY_OBJ;\n\t\t} else {\n\t\t\toldVNode = oldChildren[childVNode._index] || EMPTY_OBJ;\n\t\t}\n\n\t\t// Update childVNode._index to its final index\n\t\tchildVNode._index = i;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tdiff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tisSvg,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\n\t\t// Adjust DOM nodes\n\t\tnewDom = childVNode._dom;\n\t\tif (childVNode.ref && oldVNode.ref != childVNode.ref) {\n\t\t\tif (oldVNode.ref) {\n\t\t\t\tapplyRef(oldVNode.ref, null, childVNode);\n\t\t\t}\n\t\t\trefQueue.push(\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildVNode._component || newDom,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t}\n\n\t\tif (firstChildDom == null && newDom != null) {\n\t\t\tfirstChildDom = newDom;\n\t\t}\n\n\t\tif (\n\t\t\tchildVNode._flags & INSERT_VNODE ||\n\t\t\toldVNode._children === childVNode._children\n\t\t) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom);\n\t\t} else if (\n\t\t\ttypeof childVNode.type == 'function' &&\n\t\t\tchildVNode._nextDom !== undefined\n\t\t) {\n\t\t\t// Since Fragments or components that return Fragment like VNodes can\n\t\t\t// contain multiple DOM nodes as the same level, continue the diff from\n\t\t\t// the sibling of last DOM child of this child VNode\n\t\t\toldDom = childVNode._nextDom;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Eagerly cleanup _nextDom. We don't need to persist the value because it\n\t\t// is only used by `diffChildren` to determine where to resume the diff\n\t\t// after diffing Components and Fragments. Once we store it the nextDOM\n\t\t// local var, we can clean up the property. Also prevents us hanging on to\n\t\t// DOM nodes that may have been unmounted.\n\t\tchildVNode._nextDom = undefined;\n\n\t\t// Unset diffing flags\n\t\tchildVNode._flags &= ~(INSERT_VNODE | MATCHED);\n\t}\n\n\t// TODO: With new child diffing algo, consider alt ways to diff Fragments.\n\t// Such as dropping oldDom and moving fragments in place\n\t//\n\t// Because the newParentVNode is Fragment-like, we need to set it's\n\t// _nextDom property to the nextSibling of its last child DOM node.\n\t//\n\t// `oldDom` contains the correct value here because if the last child\n\t// is a Fragment-like, then oldDom has already been set to that child's _nextDom.\n\t// If the last child is a DOM VNode, then oldDom will be set to that DOM\n\t// node's nextSibling.\n\tnewParentVNode._nextDom = oldDom;\n\tnewParentVNode._dom = firstChildDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(newParentVNode, renderResult, oldChildren) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tconst newChildrenLength = renderResult.length;\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\tnewParentVNode._children = [];\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\t// @ts-expect-error We are reusing the childVNode variable to hold both the\n\t\t// pre and post normalized childVNode\n\t\tchildVNode = renderResult[i];\n\n\t\tif (\n\t\t\tchildVNode == null ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = null;\n\t\t}\n\t\t// If this newVNode is being reused (e.g.
{reuse}{reuse}
) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint' ||\n\t\t\tchildVNode.constructor == String\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tnull,\n\t\t\t\tchildVNode,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if (childVNode.constructor === undefined && childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t// const reuse =
\n\t\t\t//
{reuse}{reuse}
\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : null,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tchildVNode = newParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\t// Handle unmounting null placeholders, i.e. VNode => null in unkeyed children\n\t\tif (childVNode == null) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode && oldVNode.key == null && oldVNode._dom) {\n\t\t\t\tif (oldVNode._dom == newParentVNode._nextDom) {\n\t\t\t\t\tnewParentVNode._nextDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode, false);\n\n\t\t\t\t// Explicitly nullify this position in oldChildren instead of just\n\t\t\t\t// setting `_match=true` to prevent other routines (e.g.\n\t\t\t\t// `findMatchingIndex` or `getDomSibling`) from thinking VNodes or DOM\n\t\t\t\t// nodes in this position are still available to be used in diffing when\n\t\t\t\t// they have actually already been unmounted. For example, by only\n\t\t\t\t// setting `_match=true` here, the unmounting loop later would attempt\n\t\t\t\t// to unmount this VNode again seeing `_match==true`. Further,\n\t\t\t\t// getDomSibling doesn't know about _match and so would incorrectly\n\t\t\t\t// assume DOM nodes in this subtree are mounted and usable.\n\t\t\t\toldChildren[i] = null;\n\t\t\t\tremainingOldChildren--;\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\tconst skewedIndex = i + skew;\n\t\tconst matchingIndex = findMatchingIndex(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\tskewedIndex,\n\t\t\tremainingOldChildren\n\t\t);\n\n\t\t// Temporarily store the matchingIndex on the _index property so we can pull\n\t\t// out the oldVNode in diffChildren. We'll override this to the VNode's\n\t\t// final index after using this property to get the oldVNode\n\t\tchildVNode._index = matchingIndex;\n\n\t\toldVNode = null;\n\t\tif (matchingIndex !== -1) {\n\t\t\toldVNode = oldChildren[matchingIndex];\n\t\t\tremainingOldChildren--;\n\t\t\tif (oldVNode) {\n\t\t\t\toldVNode._flags |= MATCHED;\n\t\t\t}\n\t\t}\n\n\t\t// Here, we define isMounting for the purposes of the skew diffing\n\t\t// algorithm. Nodes that are unsuspending are considered mounting and we detect\n\t\t// this by checking if oldVNode._original === null\n\t\tconst isMounting = oldVNode == null || oldVNode._original === null;\n\n\t\tif (isMounting) {\n\t\t\tif (matchingIndex == -1) {\n\t\t\t\tskew--;\n\t\t\t}\n\n\t\t\t// If we are mounting a DOM VNode, mark it for insertion\n\t\t\tif (typeof childVNode.type != 'function') {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t} else if (matchingIndex !== skewedIndex) {\n\t\t\tif (matchingIndex === skewedIndex + 1) {\n\t\t\t\tskew++;\n\t\t\t} else if (matchingIndex > skewedIndex) {\n\t\t\t\tif (remainingOldChildren > newChildrenLength - skewedIndex) {\n\t\t\t\t\tskew += matchingIndex - skewedIndex;\n\t\t\t\t} else {\n\t\t\t\t\t// ### Change from keyed: I think this was missing from the algo...\n\t\t\t\t\tskew--;\n\t\t\t\t}\n\t\t\t} else if (matchingIndex < skewedIndex) {\n\t\t\t\tif (matchingIndex == skewedIndex - 1) {\n\t\t\t\t\tskew = matchingIndex - skewedIndex;\n\t\t\t\t} else {\n\t\t\t\t\tskew = 0;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tskew = 0;\n\t\t\t}\n\n\t\t\t// Move this VNode's DOM if the original index (matchingIndex) doesn't\n\t\t\t// match the new skew index (i + new skew)\n\t\t\tif (matchingIndex !== i + skew) {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any. Loop forwards so that as we\n\t// unmount DOM from the beginning of the oldChildren, we can adjust oldDom to\n\t// point to the next child, which needs to be the first DOM node that won't be\n\t// unmounted.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i < oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode != null && (oldVNode._flags & MATCHED) === 0) {\n\t\t\t\tif (oldVNode._dom == newParentVNode._nextDom) {\n\t\t\t\t\tnewParentVNode._nextDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\n\tif (typeof parentVNode.type == 'function') {\n\t\tlet children = parentVNode._children;\n\t\tfor (let i = 0; children && i < children.length; i++) {\n\t\t\tif (children[i]) {\n\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t// here).\n\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\toldDom = insert(children[i], oldDom, parentDom);\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else if (parentVNode._dom != oldDom) {\n\t\tparentDom.insertBefore(parentVNode._dom, oldDom || null);\n\t\toldDom = parentVNode._dom;\n\t}\n\n\treturn oldDom && oldDom.nextSibling;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {ComponentChildren} children The unflattened children of a virtual\n * node\n * @returns {VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == null || typeof children == 'boolean') {\n\t} else if (isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\n/**\n * @param {VNode} childVNode\n * @param {VNode[]} oldChildren\n * @param {number} skewedIndex\n * @param {number} remainingOldChildren\n * @returns {number}\n */\nfunction findMatchingIndex(\n\tchildVNode,\n\toldChildren,\n\tskewedIndex,\n\tremainingOldChildren\n) {\n\tconst key = childVNode.key;\n\tconst type = childVNode.type;\n\tlet x = skewedIndex - 1;\n\tlet y = skewedIndex + 1;\n\tlet oldVNode = oldChildren[skewedIndex];\n\n\t// We only need to perform a search if there are more children\n\t// (remainingOldChildren) to search. However, if the oldVNode we just looked\n\t// at skewedIndex was not already used in this diff, then there must be at\n\t// least 1 other (so greater than 1) remainingOldChildren to attempt to match\n\t// against. So the following condition checks that ensuring\n\t// remainingOldChildren > 1 if the oldVNode is not already used/matched. Else\n\t// if the oldVNode was null or matched, then there could needs to be at least\n\t// 1 (aka `remainingOldChildren > 0`) children to find and compare against.\n\tlet shouldSearch =\n\t\tremainingOldChildren >\n\t\t(oldVNode != null && (oldVNode._flags & MATCHED) === 0 ? 1 : 0);\n\n\tif (\n\t\toldVNode === null ||\n\t\t(oldVNode && key == oldVNode.key && type === oldVNode.type)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\twhile (x >= 0 || y < oldChildren.length) {\n\t\t\tif (x >= 0) {\n\t\t\t\toldVNode = oldChildren[x];\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\t(oldVNode._flags & MATCHED) === 0 &&\n\t\t\t\t\tkey == oldVNode.key &&\n\t\t\t\t\ttype === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\treturn x;\n\t\t\t\t}\n\t\t\t\tx--;\n\t\t\t}\n\n\t\t\tif (y < oldChildren.length) {\n\t\t\t\toldVNode = oldChildren[y];\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\t(oldVNode._flags & MATCHED) === 0 &&\n\t\t\t\t\tkey == oldVNode.key &&\n\t\t\t\t\ttype === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\treturn y;\n\t\t\t\t}\n\t\t\t\ty++;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n}\n","import { IS_NON_DIMENSIONAL } from '../constants';\nimport options from '../options';\n\nfunction setStyle(style, key, value) {\n\tif (key[0] === '-') {\n\t\tstyle.setProperty(key, value == null ? '' : value);\n\t} else if (value == null) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\n/**\n * Set a property value on a DOM node\n * @param {PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, isSvg) {\n\tlet useCapture;\n\n\to: if (name === 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] !== oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] === 'o' && name[1] === 'n') {\n\t\tuseCapture =\n\t\t\tname !== (name = name.replace(/(PointerCapture)$|Capture$/, '$1'));\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (name.toLowerCase() in dom) name = name.toLowerCase().slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tvalue._attached = Date.now();\n\t\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\t\tdom.addEventListener(name, handler, useCapture);\n\t\t\t} else {\n\t\t\t\tvalue._attached = oldValue._attached;\n\t\t\t}\n\t\t} else {\n\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\tdom.removeEventListener(name, handler, useCapture);\n\t\t}\n\t} else {\n\t\tif (isSvg) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname !== 'width' &&\n\t\t\tname !== 'height' &&\n\t\t\tname !== 'href' &&\n\t\t\tname !== 'list' &&\n\t\t\tname !== 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname !== 'tabIndex' &&\n\t\t\tname !== 'download' &&\n\t\t\tname !== 'rowSpan' &&\n\t\t\tname !== 'colSpan' &&\n\t\t\tname !== 'role' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == null ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\tif (typeof value == 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != null && (value !== false || name[4] === '-')) {\n\t\t\tdom.setAttribute(name, value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {PreactEvent} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n\tconst eventHandler = this._listeners[e.type + false];\n\t/**\n\t * This trick is inspired by Vue https://github.com/vuejs/core/blob/main/packages/runtime-dom/src/modules/events.ts#L90-L101\n\t * when the dom performs an event it leaves micro-ticks in between bubbling up which means that an event can trigger on a newly\n\t * created DOM-node while the event bubbles up, this can cause quirky behavior as seen in https://github.com/preactjs/preact/issues/3927\n\t */\n\tif (!e._dispatched) {\n\t\t// When an event has no _dispatched we know this is the first event-target in the chain\n\t\t// so we set the initial dispatched time.\n\t\te._dispatched = Date.now();\n\t\t// When the _dispatched is smaller than the time when the targetted event handler was attached\n\t\t// we know we have bubbled up to an element that was added during patching the dom.\n\t} else if (e._dispatched <= eventHandler._attached) {\n\t\treturn;\n\t}\n\treturn eventHandler(options.event ? options.event(e) : e);\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {PreactEvent} e The event object from the browser\n * @private\n */\nfunction eventProxyCapture(e) {\n\treturn this._listeners[e.type + true](options.event ? options.event(e) : e);\n}\n","import {\n\tEMPTY_OBJ,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tRESET_MODE\n} from '../constants';\nimport { BaseComponent, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {PreactElement} parentDom The parent of the DOM element\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by\n * getChildContext\n * @param {boolean} isSvg Whether or not this element is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\t/** @type {any} */\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== undefined) return null;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._flags & MODE_SUSPENDED) {\n\t\tisHydrating = !!(oldVNode._flags & MODE_HYDRATE);\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\ttry {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\t\t// @ts-expect-error The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new BaseComponent(\n\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tc.props = newProps;\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc.context = componentContext;\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (c._nextState == null) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (newType.getDerivedStateFromProps != null) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tc.componentWillMount != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidMount != null) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t!c._force &&\n\t\t\t\t\t((c.shouldComponentUpdate != null &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false) ||\n\t\t\t\t\t\tnewVNode._original === oldVNode._original)\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original !== oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.forEach(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t\t}\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != null) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidUpdate != null) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\t\t\tc._force = false;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t}\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != null) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (!isNew && c.getSnapshotBeforeUpdate != null) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != null && tmp.type === Fragment && tmp.key == null;\n\t\t\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\n\n\t\t\tdiffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._flags &= RESET_MODE;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = null;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tnewVNode._original = null;\n\t\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\t\tif (isHydrating || excessDomChildren != null) {\n\t\t\t\tnewVNode._dom = oldDom;\n\t\t\t\tnewVNode._flags |= isHydrating\n\t\t\t\t\t? MODE_HYDRATE | MODE_SUSPENDED\n\t\t\t\t\t: MODE_HYDRATE;\n\t\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = null;\n\t\t\t\t// ^ could possibly be simplified to:\n\t\t\t\t// excessDomChildren.length = 0;\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t}\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else if (\n\t\texcessDomChildren == null &&\n\t\tnewVNode._original === oldVNode._original\n\t) {\n\t\tnewVNode._children = oldVNode._children;\n\t\tnewVNode._dom = oldVNode._dom;\n\t} else {\n\t\tnewVNode._dom = diffElementNodes(\n\t\t\toldVNode._dom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tisSvg,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n}\n\n/**\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {VNode} root\n */\nexport function commitRoot(commitQueue, root, refQueue) {\n\troot._nextDom = undefined;\n\n\tfor (let i = 0; i < refQueue.length; i++) {\n\t\tapplyRef(refQueue[i], refQueue[++i], refQueue[++i]);\n\t}\n\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-expect-error Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-expect-error See above comment on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {PreactElement} dom The DOM element representing the virtual nodes\n * being diffed\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @returns {PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating,\n\trefQueue\n) {\n\tlet oldProps = oldVNode.props;\n\tlet newProps = newVNode.props;\n\tlet nodeType = /** @type {string} */ (newVNode.type);\n\t/** @type {any} */\n\tlet i;\n\t/** @type {{ __html?: string }} */\n\tlet newHtml;\n\t/** @type {{ __html?: string }} */\n\tlet oldHtml;\n\t/** @type {ComponentChildren} */\n\tlet newChildren;\n\tlet value;\n\tlet inputValue;\n\tlet checked;\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tif (nodeType === 'svg') isSvg = true;\n\n\tif (excessDomChildren != null) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tvalue = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\t'setAttribute' in value === !!nodeType &&\n\t\t\t\t(nodeType ? value.localName === nodeType : value.nodeType === 3)\n\t\t\t) {\n\t\t\t\tdom = value;\n\t\t\t\texcessDomChildren[i] = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == null) {\n\t\tif (nodeType === null) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tif (isSvg) {\n\t\t\tdom = document.createElementNS('http://www.w3.org/2000/svg', nodeType);\n\t\t} else {\n\t\t\tdom = document.createElement(nodeType, newProps.is && newProps);\n\t\t}\n\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = null;\n\t\t// we are creating a new node, so we can assume this is a new subtree (in\n\t\t// case we are hydrating), this deopts the hydrate\n\t\tisHydrating = false;\n\t}\n\n\tif (nodeType === null) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\n\n\t\t// If we are in a situation where we are not hydrating but are using\n\t\t// existing DOM (e.g. replaceNode) we should read the existing DOM\n\t\t// attributes to diff them\n\t\tif (!isHydrating && excessDomChildren != null) {\n\t\t\toldProps = {};\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i];\n\t\t\t\toldProps[value.name] = value.value;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in oldProps) {\n\t\t\tvalue = oldProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (i !== 'key' && !(i in newProps)) {\n\t\t\t\tsetProperty(dom, i, null, value, isSvg);\n\t\t\t}\n\t\t}\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i == 'value') {\n\t\t\t\tinputValue = value;\n\t\t\t} else if (i == 'checked') {\n\t\t\t\tchecked = value;\n\t\t\t} else if (\n\t\t\t\ti !== 'key' &&\n\t\t\t\t(!isHydrating || typeof value == 'function') &&\n\t\t\t\toldProps[i] !== value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, oldProps[i], isSvg);\n\t\t\t}\n\t\t}\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\tif (\n\t\t\t\t!isHydrating &&\n\t\t\t\t(!oldHtml ||\n\t\t\t\t\t(newHtml.__html !== oldHtml.__html &&\n\t\t\t\t\t\tnewHtml.__html !== dom.innerHTML))\n\t\t\t) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\t\tdiffChildren(\n\t\t\t\tdom,\n\t\t\t\tisArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg && nodeType !== 'foreignObject',\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != null) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tif (excessDomChildren[i] != null) removeNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating) {\n\t\t\ti = 'value';\n\t\t\tif (\n\t\t\t\tinputValue !== undefined &&\n\t\t\t\t// #2756 For the -element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(inputValue !== dom[i] ||\n\t\t\t\t\t(nodeType === 'progress' && !inputValue) ||\n\t\t\t\t\t// This is only for IE 11 to fix value not being updated.\n\t\t\t\t\t// To avoid a stale select value we need to set the option.value\n\t\t\t\t\t// again, which triggers IE11 to re-evaluate the select value\n\t\t\t\t\t(nodeType === 'option' && inputValue !== oldProps[i]))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, inputValue, oldProps[i], false);\n\t\t\t}\n\n\t\t\ti = 'checked';\n\t\t\tif (checked !== undefined && checked !== dom[i]) {\n\t\t\t\tsetProperty(dom, i, checked, oldProps[i], false);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {Ref} ref\n * @param {any} value\n * @param {VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') ref(value);\n\t\telse ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {VNode} vnode The virtual node to unmount\n * @param {VNode} parentVNode The parent of the VNode that initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current === vnode._dom) {\n\t\t\tapplyRef(r, null, parentVNode);\n\t\t}\n\t}\n\n\tif ((r = vnode._component) != null) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = null;\n\t\tvnode._component = undefined;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tskipRemove || typeof vnode.type !== 'function'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove && vnode._dom != null) {\n\t\tremoveNode(vnode._dom);\n\t}\n\n\t// Must be set to `undefined` to properly clean up `_nextDom`\n\t// for which `null` is a valid value. See comment in `create-element.js`\n\tvnode._parent = vnode._dom = vnode._nextDom = undefined;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { EMPTY_OBJ } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {ComponentChild} vnode The virtual node to render\n * @param {PreactElement} parentDom The DOM element to render into\n * @param {PreactElement | object} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\n\t// element..\n\tlet isHydrating = typeof replaceNode == 'function';\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? null\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\n\tvnode = ((!isHydrating && replaceNode) || parentDom)._children =\n\t\tcreateElement(Fragment, null, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tvnode,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.ownerSVGElement !== undefined,\n\t\t!isHydrating && replaceNode\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t? null\n\t\t\t: parentDom.firstChild\n\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t: null,\n\t\tcommitQueue,\n\t\t!isHydrating && replaceNode\n\t\t\t? replaceNode\n\t\t\t: oldVNode\n\t\t\t? oldVNode._dom\n\t\t\t: parentDom.firstChild,\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode, refQueue);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {ComponentChild} vnode The virtual node to render\n * @param {PreactElement} parentDom The DOM element to update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, hydrate);\n}\n","import { assign, slice } from './util';\nimport { createVNode } from './create-element';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * children.\n * @param {VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array} rest Any additional arguments will be used\n * as replacement children.\n * @returns {VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\n\tlet defaultProps;\n\n\tif (vnode.type && vnode.type.defaultProps) {\n\t\tdefaultProps = vnode.type.defaultProps;\n\t}\n\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse if (props[i] === undefined && defaultProps !== undefined) {\n\t\t\tnormalizedProps[i] = defaultProps[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tnull\n\t);\n}\n","/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {VNode} [oldVNode]\n * @param {ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {Component} */\n\tlet component,\n\t\t/** @type {ComponentType} */\n\t\tctor,\n\t\t/** @type {boolean} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != null) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != null) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import { options, Fragment, Component } from 'preact';\n\nexport function initDevTools() {\n\tif (typeof window != 'undefined' && window.__PREACT_DEVTOOLS__) {\n\t\twindow.__PREACT_DEVTOOLS__.attachPreact('10.19.3', options, {\n\t\t\tFragment,\n\t\t\tComponent\n\t\t});\n\t}\n}\n","const ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nlet loggedTypeFailures = {};\n\n/**\n * Reset the history of which prop type warnings have been logged.\n */\nexport function resetPropWarnings() {\n\tloggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * Adapted from https://github.com/facebook/prop-types/blob/master/checkPropTypes.js\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n */\nexport function checkPropTypes(\n\ttypeSpecs,\n\tvalues,\n\tlocation,\n\tcomponentName,\n\tgetStack\n) {\n\tObject.keys(typeSpecs).forEach(typeSpecName => {\n\t\tlet error;\n\t\ttry {\n\t\t\terror = typeSpecs[typeSpecName](\n\t\t\t\tvalues,\n\t\t\t\ttypeSpecName,\n\t\t\t\tcomponentName,\n\t\t\t\tlocation,\n\t\t\t\tnull,\n\t\t\t\tReactPropTypesSecret\n\t\t\t);\n\t\t} catch (e) {\n\t\t\terror = e;\n\t\t}\n\t\tif (error && !(error.message in loggedTypeFailures)) {\n\t\t\tloggedTypeFailures[error.message] = true;\n\t\t\tconsole.error(\n\t\t\t\t`Failed ${location} type: ${error.message}${\n\t\t\t\t\t(getStack && `\\n${getStack()}`) || ''\n\t\t\t\t}`\n\t\t\t);\n\t\t}\n\t});\n}\n","import { options, Fragment } from 'preact';\n\n/**\n * Get human readable name of the component/dom node\n * @param {import('./internal').VNode} vnode\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getDisplayName(vnode) {\n\tif (vnode.type === Fragment) {\n\t\treturn 'Fragment';\n\t} else if (typeof vnode.type == 'function') {\n\t\treturn vnode.type.displayName || vnode.type.name;\n\t} else if (typeof vnode.type == 'string') {\n\t\treturn vnode.type;\n\t}\n\n\treturn '#text';\n}\n\n/**\n * Used to keep track of the currently rendered `vnode` and print it\n * in debug messages.\n */\nlet renderStack = [];\n\n/**\n * Keep track of the current owners. An owner describes a component\n * which was responsible to render a specific `vnode`. This exclude\n * children that are passed via `props.children`, because they belong\n * to the parent owner.\n *\n * ```jsx\n * const Foo = props =>
{props.children}
// div's owner is Foo\n * const Bar = props => {\n * return (\n * // Foo's owner is Bar, span's owner is Bar\n * )\n * }\n * ```\n *\n * Note: A `vnode` may be hoisted to the root scope due to compiler\n * optimiztions. In these cases the `_owner` will be different.\n */\nlet ownerStack = [];\n\n/**\n * Get the currently rendered `vnode`\n * @returns {import('./internal').VNode | null}\n */\nexport function getCurrentVNode() {\n\treturn renderStack.length > 0 ? renderStack[renderStack.length - 1] : null;\n}\n\n/**\n * If the user doesn't have `@babel/plugin-transform-react-jsx-source`\n * somewhere in his tool chain we can't print the filename and source\n * location of a component. In that case we just omit that, but we'll\n * print a helpful message to the console, notifying the user of it.\n */\nlet hasBabelPlugin = false;\n\n/**\n * Check if a `vnode` is a possible owner.\n * @param {import('./internal').VNode} vnode\n */\nfunction isPossibleOwner(vnode) {\n\treturn typeof vnode.type == 'function' && vnode.type != Fragment;\n}\n\n/**\n * Return the component stack that was captured up to this point.\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getOwnerStack(vnode) {\n\tconst stack = [vnode];\n\tlet next = vnode;\n\twhile (next._owner != null) {\n\t\tstack.push(next._owner);\n\t\tnext = next._owner;\n\t}\n\n\treturn stack.reduce((acc, owner) => {\n\t\tacc += ` in ${getDisplayName(owner)}`;\n\n\t\tconst source = owner.__source;\n\t\tif (source) {\n\t\t\tacc += ` (at ${source.fileName}:${source.lineNumber})`;\n\t\t} else if (!hasBabelPlugin) {\n\t\t\thasBabelPlugin = true;\n\t\t\tconsole.warn(\n\t\t\t\t'Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.'\n\t\t\t);\n\t\t}\n\n\t\treturn (acc += '\\n');\n\t}, '');\n}\n\n/**\n * Setup code to capture the component trace while rendering. Note that\n * we cannot simply traverse `vnode._parent` upwards, because we have some\n * debug messages for `this.setState` where the `vnode` is `undefined`.\n */\nexport function setupComponentStack() {\n\tlet oldDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldRoot = options._root;\n\tlet oldVNode = options.vnode;\n\tlet oldRender = options._render;\n\n\toptions.diffed = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.pop();\n\t\t}\n\t\trenderStack.pop();\n\t\tif (oldDiffed) oldDiffed(vnode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\trenderStack.push(vnode);\n\t\t}\n\t\tif (oldDiff) oldDiff(vnode);\n\t};\n\n\toptions._root = (vnode, parent) => {\n\t\townerStack = [];\n\t\tif (oldRoot) oldRoot(vnode, parent);\n\t};\n\n\toptions.vnode = vnode => {\n\t\tvnode._owner =\n\t\t\townerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null;\n\t\tif (oldVNode) oldVNode(vnode);\n\t};\n\n\toptions._render = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.push(vnode);\n\t\t}\n\n\t\tif (oldRender) oldRender(vnode);\n\t};\n}\n","import { checkPropTypes } from './check-props';\nimport { options, Component } from 'preact';\nimport {\n\tELEMENT_NODE,\n\tDOCUMENT_NODE,\n\tDOCUMENT_FRAGMENT_NODE\n} from './constants';\nimport {\n\tgetOwnerStack,\n\tsetupComponentStack,\n\tgetCurrentVNode,\n\tgetDisplayName\n} from './component-stack';\nimport { assign, isNaN } from './util';\n\nconst isWeakMapSupported = typeof WeakMap == 'function';\n\n/**\n * @param {import('./internal').VNode} vnode\n * @returns {Array}\n */\nfunction getDomChildren(vnode) {\n\tlet domChildren = [];\n\n\tif (!vnode._children) return domChildren;\n\n\tvnode._children.forEach(child => {\n\t\tif (child && typeof child.type === 'function') {\n\t\t\tdomChildren.push.apply(domChildren, getDomChildren(child));\n\t\t} else if (child && typeof child.type === 'string') {\n\t\t\tdomChildren.push(child.type);\n\t\t}\n\t});\n\n\treturn domChildren;\n}\n\n/**\n * @param {import('./internal').VNode} parent\n * @returns {string}\n */\nfunction getClosestDomNodeParentName(parent) {\n\tif (!parent) return '';\n\tif (typeof parent.type == 'function') {\n\t\tif (parent._parent === null) {\n\t\t\tif (parent._dom !== null && parent._dom.parentNode !== null) {\n\t\t\t\treturn parent._dom.parentNode.localName;\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\t\treturn getClosestDomNodeParentName(parent._parent);\n\t}\n\treturn /** @type {string} */ (parent.type);\n}\n\nexport function initDebug() {\n\tsetupComponentStack();\n\n\tlet hooksAllowed = false;\n\n\t/* eslint-disable no-console */\n\tlet oldBeforeDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldVnode = options.vnode;\n\tlet oldRender = options._render;\n\tlet oldCatchError = options._catchError;\n\tlet oldRoot = options._root;\n\tlet oldHook = options._hook;\n\tconst warnedComponents = !isWeakMapSupported\n\t\t? null\n\t\t: {\n\t\t\t\tuseEffect: new WeakMap(),\n\t\t\t\tuseLayoutEffect: new WeakMap(),\n\t\t\t\tlazyPropTypes: new WeakMap()\n\t\t };\n\tconst deprecations = [];\n\n\toptions._catchError = (error, vnode, oldVNode, errorInfo) => {\n\t\tlet component = vnode && vnode._component;\n\t\tif (component && typeof error.then == 'function') {\n\t\t\tconst promise = error;\n\t\t\terror = new Error(\n\t\t\t\t`Missing Suspense. The throwing component was: ${getDisplayName(vnode)}`\n\t\t\t);\n\n\t\t\tlet parent = vnode;\n\t\t\tfor (; parent; parent = parent._parent) {\n\t\t\t\tif (parent._component && parent._component._childDidSuspend) {\n\t\t\t\t\terror = promise;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// We haven't recovered and we know at this point that there is no\n\t\t\t// Suspense component higher up in the tree\n\t\t\tif (error instanceof Error) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\terrorInfo = errorInfo || {};\n\t\t\terrorInfo.componentStack = getOwnerStack(vnode);\n\t\t\toldCatchError(error, vnode, oldVNode, errorInfo);\n\n\t\t\t// when an error was handled by an ErrorBoundary we will nonetheless emit an error\n\t\t\t// event on the window object. This is to make up for react compatibility in dev mode\n\t\t\t// and thus make the Next.js dev overlay work.\n\t\t\tif (typeof error.then != 'function') {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthrow e;\n\t\t}\n\t};\n\n\toptions._root = (vnode, parentNode) => {\n\t\tif (!parentNode) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined parent passed to render(), this is the second argument.\\n' +\n\t\t\t\t\t'Check if the element is available in the DOM/has the correct id.'\n\t\t\t);\n\t\t}\n\n\t\tlet isValid;\n\t\tswitch (parentNode.nodeType) {\n\t\t\tcase ELEMENT_NODE:\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\tcase DOCUMENT_NODE:\n\t\t\t\tisValid = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tisValid = false;\n\t\t}\n\n\t\tif (!isValid) {\n\t\t\tlet componentName = getDisplayName(vnode);\n\t\t\tthrow new Error(\n\t\t\t\t`Expected a valid HTML node as a second argument to render.\tReceived ${parentNode} instead: render(<${componentName} />, ${parentNode});`\n\t\t\t);\n\t\t}\n\n\t\tif (oldRoot) oldRoot(vnode, parentNode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tlet { type } = vnode;\n\n\t\thooksAllowed = true;\n\n\t\tif (type === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined component passed to createElement()\\n\\n' +\n\t\t\t\t\t'You likely forgot to export your component or might have mixed up default and named imports' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (type != null && typeof type == 'object') {\n\t\t\tif (type._children !== undefined && type._dom !== undefined) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Invalid type passed to createElement(): ${type}\\n\\n` +\n\t\t\t\t\t\t'Did you accidentally pass a JSX literal as JSX twice?\\n\\n' +\n\t\t\t\t\t\t` let My${getDisplayName(vnode)} = ${serializeVNode(type)};\\n` +\n\t\t\t\t\t\t` let vnode = ;\\n\\n` +\n\t\t\t\t\t\t'This usually happens when you export a JSX literal and not the component.' +\n\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new Error(\n\t\t\t\t'Invalid type passed to createElement(): ' +\n\t\t\t\t\t(Array.isArray(type) ? 'array' : type)\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tvnode.ref !== undefined &&\n\t\t\ttypeof vnode.ref != 'function' &&\n\t\t\ttypeof vnode.ref != 'object' &&\n\t\t\t!('$$typeof' in vnode) // allow string refs when preact-compat is installed\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`Component's \"ref\" property should be a function, or an object created ` +\n\t\t\t\t\t`by createRef(), but got [${typeof vnode.ref}] instead\\n` +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t}\n\n\t\tif (typeof vnode.type == 'string') {\n\t\t\tfor (const key in vnode.props) {\n\t\t\t\tif (\n\t\t\t\t\tkey[0] === 'o' &&\n\t\t\t\t\tkey[1] === 'n' &&\n\t\t\t\t\ttypeof vnode.props[key] != 'function' &&\n\t\t\t\t\tvnode.props[key] != null\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Component's \"${key}\" property should be a function, ` +\n\t\t\t\t\t\t\t`but got [${typeof vnode.props[key]}] instead\\n` +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check prop-types if available\n\t\tif (typeof vnode.type == 'function' && vnode.type.propTypes) {\n\t\t\tif (\n\t\t\t\tvnode.type.displayName === 'Lazy' &&\n\t\t\t\twarnedComponents &&\n\t\t\t\t!warnedComponents.lazyPropTypes.has(vnode.type)\n\t\t\t) {\n\t\t\t\tconst m =\n\t\t\t\t\t'PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ';\n\t\t\t\ttry {\n\t\t\t\t\tconst lazyVNode = vnode.type();\n\t\t\t\t\twarnedComponents.lazyPropTypes.set(vnode.type, true);\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + `Component wrapped in lazy() is ${getDisplayName(lazyVNode)}`\n\t\t\t\t\t);\n\t\t\t\t} catch (promise) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + \"We will log the wrapped component's name once it is loaded.\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet values = vnode.props;\n\t\t\tif (vnode.type._forwarded) {\n\t\t\t\tvalues = assign({}, values);\n\t\t\t\tdelete values.ref;\n\t\t\t}\n\n\t\t\tcheckPropTypes(\n\t\t\t\tvnode.type.propTypes,\n\t\t\t\tvalues,\n\t\t\t\t'prop',\n\t\t\t\tgetDisplayName(vnode),\n\t\t\t\t() => getOwnerStack(vnode)\n\t\t\t);\n\t\t}\n\n\t\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n\t};\n\n\toptions._render = vnode => {\n\t\tif (oldRender) {\n\t\t\toldRender(vnode);\n\t\t}\n\t\thooksAllowed = true;\n\t};\n\n\toptions._hook = (comp, index, type) => {\n\t\tif (!comp || !hooksAllowed) {\n\t\t\tthrow new Error('Hook can only be invoked from render methods.');\n\t\t}\n\n\t\tif (oldHook) oldHook(comp, index, type);\n\t};\n\n\t// Ideally we'd want to print a warning once per component, but we\n\t// don't have access to the vnode that triggered it here. As a\n\t// compromise and to avoid flooding the console with warnings we\n\t// print each deprecation warning only once.\n\tconst warn = (property, message) => ({\n\t\tget() {\n\t\t\tconst key = 'get' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`getting vnode.${property} is deprecated, ${message}`);\n\t\t\t}\n\t\t},\n\t\tset() {\n\t\t\tconst key = 'set' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`setting vnode.${property} is not allowed, ${message}`);\n\t\t\t}\n\t\t}\n\t});\n\n\tconst deprecatedAttributes = {\n\t\tnodeName: warn('nodeName', 'use vnode.type'),\n\t\tattributes: warn('attributes', 'use vnode.props'),\n\t\tchildren: warn('children', 'use vnode.props.children')\n\t};\n\n\tconst deprecatedProto = Object.create({}, deprecatedAttributes);\n\n\toptions.vnode = vnode => {\n\t\tconst props = vnode.props;\n\t\tif (\n\t\t\tvnode.type !== null &&\n\t\t\tprops != null &&\n\t\t\t('__source' in props || '__self' in props)\n\t\t) {\n\t\t\tconst newProps = (vnode.props = {});\n\t\t\tfor (let i in props) {\n\t\t\t\tconst v = props[i];\n\t\t\t\tif (i === '__source') vnode.__source = v;\n\t\t\t\telse if (i === '__self') vnode.__self = v;\n\t\t\t\telse newProps[i] = v;\n\t\t\t}\n\t\t}\n\n\t\t// eslint-disable-next-line\n\t\tvnode.__proto__ = deprecatedProto;\n\t\tif (oldVnode) oldVnode(vnode);\n\t};\n\n\toptions.diffed = vnode => {\n\t\tconst { type, _parent: parent } = vnode;\n\t\t// Check if the user passed plain objects as children. Note that we cannot\n\t\t// move this check into `options.vnode` because components can receive\n\t\t// children in any shape they want (e.g.\n\t\t// `{{ foo: 123, bar: \"abc\" }}`).\n\t\t// Putting this check in `options.diffed` ensures that\n\t\t// `vnode._children` is set and that we only validate the children\n\t\t// that were actually rendered.\n\t\tif (vnode._children) {\n\t\t\tvnode._children.forEach(child => {\n\t\t\t\tif (typeof child === 'object' && child && child.type === undefined) {\n\t\t\t\t\tconst keys = Object.keys(child).join(',');\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Objects are not valid as a child. Encountered an object with the keys {${keys}}.` +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (typeof type === 'string' && (isTableElement(type) || type === 'p')) {\n\t\t\t// Avoid false positives when Preact only partially rendered the\n\t\t\t// HTML tree. Whilst we attempt to include the outer DOM in our\n\t\t\t// validation, this wouldn't work on the server for\n\t\t\t// `preact-render-to-string`. There we'd otherwise flood the terminal\n\t\t\t// with false positives, which we'd like to avoid.\n\t\t\tlet domParentName = getClosestDomNodeParentName(parent);\n\t\t\tif (domParentName !== '') {\n\t\t\t\tif (\n\t\t\t\t\ttype === 'table' &&\n\t\t\t\t\t// Tables can be nested inside each other if it's inside a cell.\n\t\t\t\t\t// See https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/Advanced#nesting_tables\n\t\t\t\t\tdomParentName !== 'td' &&\n\t\t\t\t\tisTableElement(domParentName)\n\t\t\t\t) {\n\t\t\t\t\tconsole.log(domParentName, parent._dom);\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your should not have a table-node parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (\n\t\t\t\t\t(type === 'thead' || type === 'tfoot' || type === 'tbody') &&\n\t\t\t\t\tdomParentName !== 'table'\n\t\t\t\t) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your should have a
parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (\n\t\t\t\t\ttype === 'tr' &&\n\t\t\t\t\tdomParentName !== 'thead' &&\n\t\t\t\t\tdomParentName !== 'tfoot' &&\n\t\t\t\t\tdomParentName !== 'tbody' &&\n\t\t\t\t\tdomParentName !== 'table'\n\t\t\t\t) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your should have a parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (type === 'td' && domParentName !== 'tr') {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your parent.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t} else if (type === 'th' && domParentName !== 'tr') {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of table. Your .' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if (type === 'p') {\n\t\t\t\tlet illegalDomChildrenTypes = getDomChildren(vnode).filter(childType =>\n\t\t\t\t\tILLEGAL_PARAGRAPH_CHILD_ELEMENTS.test(childType)\n\t\t\t\t);\n\t\t\t\tif (illegalDomChildrenTypes.length) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Improper nesting of paragraph. Your

should not have ' +\n\t\t\t\t\t\t\tillegalDomChildrenTypes.join(', ') +\n\t\t\t\t\t\t\t'as child-elements.' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\thooksAllowed = false;\n\n\t\tif (oldDiffed) oldDiffed(vnode);\n\n\t\tif (vnode._children != null) {\n\t\t\tconst keys = [];\n\t\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\t\tconst child = vnode._children[i];\n\t\t\t\tif (!child || child.key == null) continue;\n\n\t\t\t\tconst key = child.key;\n\t\t\t\tif (keys.indexOf(key) !== -1) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Following component has two or more children with the ' +\n\t\t\t\t\t\t\t`same key attribute: \"${key}\". This may cause glitches and misbehavior ` +\n\t\t\t\t\t\t\t'in rendering process. Component: \\n\\n' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\n\t\t\t\t\t// Break early to not spam the console\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tkeys.push(key);\n\t\t\t}\n\t\t}\n\n\t\tif (vnode._component != null && vnode._component.__hooks != null) {\n\t\t\t// Validate that none of the hooks in this component contain arguments that are NaN.\n\t\t\t// This is a common mistake that can be hard to debug, so we want to catch it early.\n\t\t\tconst hooks = vnode._component.__hooks._list;\n\t\t\tif (hooks) {\n\t\t\t\tfor (let i = 0; i < hooks.length; i += 1) {\n\t\t\t\t\tconst hook = hooks[i];\n\t\t\t\t\tif (hook._args) {\n\t\t\t\t\t\tfor (let j = 0; j < hook._args.length; j++) {\n\t\t\t\t\t\t\tconst arg = hook._args[j];\n\t\t\t\t\t\t\tif (isNaN(arg)) {\n\t\t\t\t\t\t\t\tconst componentName = getDisplayName(vnode);\n\t\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t\t`Invalid argument passed to hook. Hooks should not be called with NaN in the dependency array. Hook index ${i} in component ${componentName} was called with NaN.`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\nconst setState = Component.prototype.setState;\nComponent.prototype.setState = function (update, callback) {\n\tif (this._vnode == null) {\n\t\t// `this._vnode` will be `null` during componentWillMount. But it\n\t\t// is perfectly valid to call `setState` during cWM. So we\n\t\t// need an additional check to verify that we are dealing with a\n\t\t// call inside constructor.\n\t\tif (this.state == null) {\n\t\t\tconsole.warn(\n\t\t\t\t`Calling \"this.setState\" inside the constructor of a component is a ` +\n\t\t\t\t\t`no-op and might be a bug in your application. Instead, set ` +\n\t\t\t\t\t`\"this.state = {}\" directly.\\n\\n${getOwnerStack(getCurrentVNode())}`\n\t\t\t);\n\t\t}\n\t}\n\n\treturn setState.call(this, update, callback);\n};\n\nfunction isTableElement(type) {\n\treturn (\n\t\ttype === 'table' ||\n\t\ttype === 'tfoot' ||\n\t\ttype === 'tbody' ||\n\t\ttype === 'thead' ||\n\t\ttype === 'td' ||\n\t\ttype === 'tr' ||\n\t\ttype === 'th'\n\t);\n}\n\nconst ILLEGAL_PARAGRAPH_CHILD_ELEMENTS =\n\t/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/;\n\nconst forceUpdate = Component.prototype.forceUpdate;\nComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode == null) {\n\t\tconsole.warn(\n\t\t\t`Calling \"this.forceUpdate\" inside the constructor of a component is a ` +\n\t\t\t\t`no-op and might be a bug in your application.\\n\\n${getOwnerStack(\n\t\t\t\t\tgetCurrentVNode()\n\t\t\t\t)}`\n\t\t);\n\t} else if (this._parentDom == null) {\n\t\tconsole.warn(\n\t\t\t`Can't call \"this.forceUpdate\" on an unmounted component. This is a no-op, ` +\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\n\t\t);\n\t}\n\treturn forceUpdate.call(this, callback);\n};\n\n/**\n * Serialize a vnode tree to a string\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function serializeVNode(vnode) {\n\tlet { props } = vnode;\n\tlet name = getDisplayName(vnode);\n\n\tlet attrs = '';\n\tfor (let prop in props) {\n\t\tif (props.hasOwnProperty(prop) && prop !== 'children') {\n\t\t\tlet value = props[prop];\n\n\t\t\t// If it is an object but doesn't have toString(), use Object.toString\n\t\t\tif (typeof value == 'function') {\n\t\t\t\tvalue = `function ${value.displayName || value.name}() {}`;\n\t\t\t}\n\n\t\t\tvalue =\n\t\t\t\tObject(value) === value && !value.toString\n\t\t\t\t\t? Object.prototype.toString.call(value)\n\t\t\t\t\t: value + '';\n\n\t\t\tattrs += ` ${prop}=${JSON.stringify(value)}`;\n\t\t}\n\t}\n\n\tlet children = props.children;\n\treturn `<${name}${attrs}${\n\t\tchildren && children.length ? '>..' : ' />'\n\t}`;\n}\n","export const ELEMENT_NODE = 1;\nexport const DOCUMENT_NODE = 9;\nexport const DOCUMENT_FRAGMENT_NODE = 11;\n","/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\nexport function isNaN(value) {\n\treturn value !== value;\n}\n"],"names":["currentIndex","currentComponent","previousComponent","prevRaf","currentHook","afterPaintEffects","EMPTY","oldBeforeDiff","options","__b","oldBeforeRender","__r","oldAfterDiff","diffed","oldCommit","__c","oldBeforeUnmount","unmount","getHookState","index","type","__h","hooks","__H","__","length","push","__V","useState","initialState","useReducer","reducer","hookState","_reducer","invokeOrReturn","action","currentValue","__N","nextValue","setState","_hasScuFromHooks","updateHookState","p","s","c","stateHooks","filter","x","every","prevScu","call","this","shouldUpdate","forEach","hookItem","props","shouldComponentUpdate","prevCWU","componentWillUpdate","__e","tmp","useEffect","callback","args","state","__s","argsChanged","_pendingArgs","useRef","initialValue","useMemo","current","factory","useCallback","useContext","context","provider","sub","value","flushAfterPaintEffects","component","shift","__P","invokeCleanup","invokeEffect","e","__v","vnode","requestAnimationFrame","afterNextFrame","commitQueue","some","cb","hasErrored","HAS_RAF","raf","done","clearTimeout","timeout","cancelAnimationFrame","setTimeout","hook","comp","cleanup","oldArgs","newArgs","arg","f","cycleDetected","Error","endBatch","batchDepth","error","hasError","batchedEffect","effect","batchIteration","next","_nextBatchedEffect","_flags","needsToRecompute","_callback","err","batch","finishUpdate","evalContext","globalVersion","addDependency","signal","node","_node","_target","_version","_source","_prevSource","_sources","_nextSource","_prevTarget","_nextTarget","_rollbackNode","_subscribe","Signal","_value","_targets","target","_refresh","prepareSources","rollbackNode","cleanupSources","head","prev","_unsubscribe","Computed","compute","_compute","_globalVersion","computed","cleanupEffect","_cleanup","prevContext","disposeEffect","endEffect","Effect","_dispose","bind","hookName","hookFn","setCurrentUpdater","updater","_start","SignalValue","_ref","_this","data","currentSignal","useSignal","v","_updateFlags","_updater","_this$base","isValidElement","peek","base","nodeType","createPropUpdater","dom","prop","propSignal","setAsProperty","ownerSVGElement","changeSignal","_update","newSignal","newProps","setAttribute","removeAttribute","prototype","subscribe","fn","flag","valueOf","toString","toJSON","Object","defineProperty","get","set","_notify","OUTDATED","finish","displayName","defineProperties","constructor","configurable","old","signalProps","i","__np","oldVNode","renderedProps","updaters","_updaters","Component","namespaceStack","getNamespace","slice","setNamespace","namespace","resetNamespace","pop","scopeStack","getScope","setScope","scope","resetScope","immutableMap","WeakMap","immutableError","immutableHandlers","key","receiver","Reflect","deepImmutable","deleteProperty","has","Proxy","getContext","getElement","ref","attributes","freeze","getServerContext","serverContext","Promise","resolve","window","splitTask","withScope","func","ns","name","async","gen","it","throw","useWatch","_useEffect","eff","isExecuting","notify","flush","dispose","createFlusher","useSignalEffect","useInit","inputs","useLayoutEffect","_useLayoutEffect","_useCallback","_useMemo","Set","isPlainObject","candidate","Boolean","objToProxy","proxyToObj","proxyToNs","supported","Array","createProxy","obj","handlers","shouldProxy","proxy","getProxyFromObject","getNamespaceFromProxy","NO_SCOPE","PropSignal","owner","computedsByScope","setValue","update","setGetter","getter","getComputed","valueSignal","getterSignal","wellKnownSymbols","getOwnPropertyNames","Symbol","map","proxyToProps","hasPropSignal","readOnlyProxies","WeakSet","getPropSignal","initial","Map","readOnly","proxifyState","objToIterable","stateHandlers","hasOwnProperty","desc","getOwnPropertyDescriptor","result","isNew","isArray","undefined","ownKeys","_","add","deepMergeRecursive","source","override","hasNewKeys","enumerable","deepMerge","storeRoots","storeHandlers","proxifyStore","scoped","isRoot","contextObjectToProxy","contextObjectToFallback","contextProxies","descriptor","contextHandlers","fallback","currentProp","keys","proxifyContext","inherited","stores","rawStores","storeLocks","storeConfigs","serverStates","getConfig","getServerState","universalUnlock","store","block","lock","storeLock","rawStore","proxifiedStore","parseServerData","document","_dom$getElementById","jsonDataScriptTag","getElementById","textContent","JSON","parse","populateServerData","entries","st","config","createContext","client","server","directiveCallbacks","directivePriorities","directive","priority","getEvaluate","entry","path","hasNegationOperator","resolvedStore","split","reduce","acc","Directives","directives","priorityLevels","currentPriorityLevel","nextPriorityLevels","element","originalProps","previousScope","evaluate","cloneElement","children","createElement","directiveArgs","directiveName","wrapper","deepClone","fromEntries","__directives","find","suffix","byPriority","sort","p1","p2","parseInt","arr","getPriorityLevels","top","newRule","ruleClean","ruleNewline","getGlobalEventDirective","eventName","event","globalVar","addEventListener","removeEventListener","getGlobalAsyncEventDirective","passive","directivePrefix","ignoreAttr","islandAttr","fullPrefix","namespaces","directiveParser","RegExp","nsPathRegExp","hydratedIslands","toVdom","root","treeWalker","createTreeWalker","walk","_nodeValue","nextSibling","replaceWith","Text","nodeValue","remove","elementNode","localName","ignore","island","attributeName","attributeValue","_regexResult$","_regexResult$2","regexResult","exec","parsedValue","item","islandNamespace","h","innerHTML","directiveMatch","prefix","currentNamespace","_namespaces","content","childNodes","childNode","child","firstChild","nextChild","parentNode","currentNode","regionRootFragments","getRegionRootFragment","region","parentElement","createRootFragment","parent","replaceNode","sibling","concat","insert","insertBefore","__k","appendChild","removeChild","initialVdom","privateApis","render","inheritedContext","Provider","defaultEntry","inheritedClient","inheritedServer","contextStack","watch","init","on","events","eventType","existingHandler","onAsync","class","classNames","className","currentClass","classFinder","test","replace","trim","classList","style","styleProp","val","tree","left","unshift","cssStringToObject","removeProperty","attribute","el","cssText","Type","rest","cached","dangerouslySetInnerHTML","__html","text","run","each","eachKey","inheritedValue","itemProp","toLowerCase","_match","group1","toUpperCase","itemContext","mergedContext","nodes","querySelectorAll","fragment","vdom","hydrate","MODE_HYDRATE","vnodeId","rerenderQueue","prevDebounce","defer","depthSort","EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","assign","removeNode","normalizedProps","arguments","defaultProps","createVNode","original","__d","__i","__u","Fragment","BaseComponent","getDomSibling","childIndex","updateParentDomPointers","enqueueRender","process","debounceRendering","renderQueueLength","newVNode","oldDom","parentDom","refQueue","diff","__n","commitRoot","diffChildren","renderResult","newParentVNode","oldParentVNode","globalContext","isSvg","excessDomChildren","isHydrating","childVNode","newDom","firstChildDom","oldChildren","newChildrenLength","constructNewChildrenArray","applyRef","skewedIndex","matchingIndex","oldChildrenLength","remainingOldChildren","skew","String","findMatchingIndex","parentVNode","y","setStyle","setProperty","oldValue","useCapture","o","l","_attached","Date","now","eventProxyCapture","eventProxy","eventHandler","_dispatched","oldProps","oldState","snapshot","clearProcessingException","componentContext","renderHook","count","newType","outer","contextType","__E","doRender","_sb","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","componentDidUpdate","getChildContext","getSnapshotBeforeUpdate","indexOf","diffElementNodes","newHtml","oldHtml","newChildren","inputValue","checked","createTextNode","createElementNS","is","skipRemove","r","componentWillUnmount","defaultValue","contextId","Consumer","contextValue","subs","ctx","_props","splice","errorInfo","ctor","handled","getDerivedStateFromError","componentDidCatch","forceUpdate","then","a","b","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","d","definition","__PREACT_DEVTOOLS__","attachPreact","loggedTypeFailures","getDisplayName","renderStack","ownerStack","getCurrentVNode","hasBabelPlugin","isPossibleOwner","getOwnerStack","stack","__o","__source","fileName","lineNumber","console","warn","isWeakMapSupported","getDomChildren","domChildren","apply","getClosestDomNodeParentName","isTableElement","ILLEGAL_PARAGRAPH_CHILD_ELEMENTS","serializeVNode","attrs","stringify","oldDiff","oldDiffed","oldRoot","oldRender","hooksAllowed","oldVnode","oldCatchError","oldHook","warnedComponents","lazyPropTypes","deprecations","promise","componentStack","isValid","componentName","propTypes","m","lazyVNode","values","checkPropTypes","typeSpecs","location","getStack","typeSpecName","message","property","deprecatedAttributes","nodeName","deprecatedProto","create","__self","__proto__","join","domParentName","log","illegalDomChildrenTypes","childType","j"],"sourceRoot":""} \ No newline at end of file diff --git a/build-module/interactivity/index.min.asset.php b/build-module/interactivity/index.min.asset.php deleted file mode 100644 index c3501525..00000000 --- a/build-module/interactivity/index.min.asset.php +++ /dev/null @@ -1 +0,0 @@ - array(), 'version' => '5f35b6d3bd962e6e82b5', 'type' => 'module'); diff --git a/build-module/interactivity/index.min.js.map b/build-module/interactivity/index.min.js.map index 7e023094..46488479 100644 --- a/build-module/interactivity/index.min.js.map +++ b/build-module/interactivity/index.min.js.map @@ -1 +1 @@ -{"version":3,"file":"./build-module/interactivity/index.min.js","mappings":"qGACaA,IC2BAC,ECjBPC,ECRFC,EAgGSC,EC+ETC,EAWAC,EAEEC,EA0BAC,ECvNKC,ELUEC,EAAgC,CAAC,EACjCC,EAAY,GACZC,EACZ,oECbYC,EAAUC,MAAMD,QAStB,SAASE,EAAOC,EAAKC,GAE3B,IAAK,IAAIR,KAAKQ,EAAOD,EAAIP,GAAKQ,EAAMR,GACpC,OAA6BO,CAC7B,UAQeE,EAAWC,GAC1B,IAAIC,EAAaD,EAAKC,WAClBA,GAAYA,EAAWC,YAAYF,EACvC,CEZM,SAASG,EAAcC,EAAMN,EAAOO,GAC1C,IACCC,EACAC,EACAjB,EAHGkB,EAAkB,CAAC,EAIvB,IAAKlB,KAAKQ,EACA,OAALR,EAAYgB,EAAMR,EAAMR,GACd,OAALA,EAAYiB,EAAMT,EAAMR,GAC5BkB,EAAgBlB,GAAKQ,EAAMR,GAUjC,GAPImB,UAAUC,OAAS,IACtBF,EAAgBH,SACfI,UAAUC,OAAS,EAAI5B,EAAM6B,KAAKF,UAAW,GAAKJ,GAKjC,mBAARD,GAA2C,MAArBA,EAAKQ,aACrC,IAAKtB,KAAKc,EAAKQ,kBAAa,IACvBJ,EAAgBlB,KACnBkB,EAAgBlB,GAAKc,EAAKQ,aAAatB,IAK1C,OAAOuB,EAAYT,E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,WAAY,IACrBC,cACAD,QAAS,aAAa,SAAW+iB,EAAQC,GACzC,OAAOA,EAAOC,aACf,IQ8PQC,EAAcnK,GACnB3B,GAAcnF,EAAW,CAAC,GAC1B4Q,EAAenI,OAAQzI,IAElBkR,EAAgB,CACrBzI,OAAQ,IACJmI,EAAenI,OAClB,CAAEzI,GAAaiR,GAEhBvI,OAAQ,IAAKkI,EAAelI,SAI7BwI,EAAczI,OAAQzI,GAAa6Q,GAAa1D,EAEhD,MAAM7M,EAAQ,IACVF,KACHzW,QAASunB,EAAczI,OACvBnH,cAAe4P,EAAcxI,QAExBrgB,EAAMsoB,EACT5H,GAAa,CAAEzI,SAAfyI,CAA0B4H,EAAS,IACnCxD,EAEH,OAAOjlB,EAAAA,EAAAA,GACNkL,EACA,CAAE9F,MAAO4jB,EAAe7oB,OACxBuhB,EAAQ/hB,MAAM6lB,QACd,GACC,GAEJ,CAAE5E,SAAU,KAGbD,GAAW,cAAc,IAAM,MAAM,CAAEC,SAAU,IGjkB9BlH,WACnB,MAAMuP,EAAQrf,SAASsf,iBACrB,SAAS7F,mBAGX,IAAM,MAAMxjB,KAAQopB,EACnB,IAAOpF,GAAgB/K,IAAKjZ,GAAS,OAC9ByZ,KACN,MAAM6P,EAAWtD,GAAuBhmB,GAClCupB,EAAOtF,GAAQjkB,GACrBumB,GAAYtP,IAAKjX,EAAMupB,SACjB9P,MACN3O,EAAAA,EAAAA,IAASye,EAAMD,EAChB,CACD,ECeDvC,E","sources":["webpack://wp/./packages/interactivity/node_modules/preact/src/constants.js","webpack://wp/./packages/interactivity/node_modules/preact/src/util.js","webpack://wp/./packages/interactivity/node_modules/preact/src/options.js","webpack://wp/./packages/interactivity/node_modules/preact/src/create-element.js","webpack://wp/./packages/interactivity/node_modules/preact/src/component.js","webpack://wp/./packages/interactivity/node_modules/preact/src/create-context.js","webpack://wp/./packages/interactivity/node_modules/preact/src/diff/children.js","webpack://wp/./packages/interactivity/node_modules/preact/src/diff/props.js","webpack://wp/./packages/interactivity/node_modules/preact/src/diff/index.js","webpack://wp/./packages/interactivity/node_modules/preact/src/render.js","webpack://wp/./packages/interactivity/node_modules/preact/src/clone-element.js","webpack://wp/./packages/interactivity/node_modules/preact/src/diff/catch-error.js","webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/./packages/interactivity/node_modules/preact/hooks/src/index.js","webpack://wp/./node_modules/@preact/signals-core/src/index.ts","webpack://wp/./packages/interactivity/node_modules/@preact/signals/src/index.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/namespaces.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/scopes.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/utils.ts","webpack://wp/./packages/interactivity/build-module/proxies/@wordpress/interactivity/src/proxies/registry.ts","webpack://wp/./packages/interactivity/build-module/proxies/@wordpress/interactivity/src/proxies/signals.ts","webpack://wp/./packages/interactivity/build-module/proxies/@wordpress/interactivity/src/proxies/state.ts","webpack://wp/./packages/interactivity/build-module/proxies/@wordpress/interactivity/src/proxies/store.ts","webpack://wp/./packages/interactivity/build-module/proxies/@wordpress/interactivity/src/proxies/context.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/store.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/hooks.tsx","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/directives.tsx","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/constants.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/vdom.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/init.ts","webpack://wp/./packages/interactivity/build-module/@wordpress/interactivity/src/index.ts"],"sourcesContent":["/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 16;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 17;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-expect-error We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {preact.ContainerNode} node The node to remove\n */\nexport function removeNode(node) {\n\tlet parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import { slice } from './util';\nimport options from './options';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {VNode[\"type\"]} type The node name or Component constructor for this\n * virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array} [children] The children of the\n * virtual node\n * @returns {VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != null) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, null);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\t/** @type {VNode} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t// _nextDom must be initialized to undefined b/c it will eventually\n\t\t// be set to dom.nextSibling which can return `null` and it is important\n\t\t// to be able to distinguish between an uninitialized _nextDom and\n\t\t// a _nextDom that has been set to `null`\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\tconstructor: undefined,\n\t\t_original: original == null ? ++vnodeId : original,\n\t\t_index: -1,\n\t\t_flags: 0\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == null && options.vnode != null) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: null };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != null && vnode.constructor == undefined;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\nimport { MODE_HYDRATE } from './constants';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != null && this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == null) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == null) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._index + 1)\n\t\t\t: null;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != null && sibling._dom != null) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : null;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet oldVNode = component._vnode,\n\t\toldDom = oldVNode._dom,\n\t\tparentDom = component._parentDom,\n\t\tcommitQueue = [],\n\t\trefQueue = [];\n\n\tif (parentDom) {\n\t\tconst newVNode = assign({}, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tparentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tparentDom.ownerSVGElement !== undefined,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : null,\n\t\t\tcommitQueue,\n\t\t\toldDom == null ? getDomSibling(oldVNode) : oldDom,\n\t\t\t!!(oldVNode._flags & MODE_HYDRATE),\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != null && vnode._component != null) {\n\t\tvnode._dom = vnode._component.base = null;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != null && child._dom != null) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/**\n * @param {Component} a\n * @param {Component} b\n */\nconst depthSort = (a, b) => a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet c;\n\trerenderQueue.sort(depthSort);\n\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t// process() calls from getting scheduled while `queue` is still being consumed.\n\twhile ((c = rerenderQueue.shift())) {\n\t\tif (c._dirty) {\n\t\t\tlet renderQueueLength = rerenderQueue.length;\n\t\t\trenderComponent(c);\n\t\t\tif (rerenderQueue.length > renderQueueLength) {\n\t\t\t\t// When i.e. rerendering a provider additional new items can be injected, we want to\n\t\t\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t\t\t// single pass\n\t\t\t\trerenderQueue.sort(depthSort);\n\t\t\t}\n\t\t}\n\t}\n\tprocess._rerenderCount = 0;\n}\n\nprocess._rerenderCount = 0;\n","import { enqueueRender } from './component';\n\nexport let i = 0;\n\nexport function createContext(defaultValue, contextId) {\n\tcontextId = '__cC' + i++;\n\n\tconst context = {\n\t\t_id: contextId,\n\t\t_defaultValue: defaultValue,\n\t\t/** @type {FunctionComponent} */\n\t\tConsumer(props, contextValue) {\n\t\t\t// return props.children(\n\t\t\t// \tcontext[contextId] ? context[contextId].props.value : defaultValue\n\t\t\t// );\n\t\t\treturn props.children(contextValue);\n\t\t},\n\t\t/** @type {FunctionComponent} */\n\t\tProvider(props) {\n\t\t\tif (!this.getChildContext) {\n\t\t\t\t/** @type {Component[]} */\n\t\t\t\tlet subs = [];\n\t\t\t\tlet ctx = {};\n\t\t\t\tctx[contextId] = this;\n\n\t\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t\tif (this.props.value !== _props.value) {\n\t\t\t\t\t\t// I think the forced value propagation here was only needed when `options.debounceRendering` was being bypassed:\n\t\t\t\t\t\t// https://github.com/preactjs/preact/commit/4d339fb803bea09e9f198abf38ca1bf8ea4b7771#diff-54682ce380935a717e41b8bfc54737f6R358\n\t\t\t\t\t\t// In those cases though, even with the value corrected, we're double-rendering all nodes.\n\t\t\t\t\t\t// It might be better to just tell folks not to use force-sync mode.\n\t\t\t\t\t\t// Currently, using `useContext()` in a class component will overwrite its `this.context` value.\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\n\t\t\t\t\t\t// subs.some(c => {\n\t\t\t\t\t\t// \tc.context[contextId] = _props.value;\n\t\t\t\t\t\t// \tenqueueRender(c);\n\t\t\t\t\t\t// });\n\t\t\t\t\t\tsubs.some(c => {\n\t\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.sub = c => {\n\t\t\t\t\tsubs.push(c);\n\t\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\t\tsubs.splice(subs.indexOf(c), 1);\n\t\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn props.children;\n\t\t}\n\t};\n\n\t// Devtools needs access to the context object when it\n\t// encounters a Provider. This is necessary to support\n\t// setting `displayName` on the context object instead\n\t// of on the component itself. See:\n\t// https://reactjs.org/docs/context.html#contextdisplayname\n\n\treturn (context.Provider._contextRef = context.Consumer.contextType =\n\t\tcontext);\n}\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport { EMPTY_OBJ, EMPTY_ARR, INSERT_VNODE, MATCHED } from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * Diff the children of a virtual node\n * @param {PreactElement} parentDom The DOM element whose children are being\n * diffed\n * @param {ComponentChildren[]} renderResult\n * @param {VNode} newParentVNode The new virtual node whose children should be\n * diff'ed against oldParentVNode\n * @param {VNode} oldParentVNode The old virtual node whose children should be\n * diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\tlet i,\n\t\t/** @type {VNode} */\n\t\toldVNode,\n\t\t/** @type {VNode} */\n\t\tchildVNode,\n\t\t/** @type {PreactElement} */\n\t\tnewDom,\n\t\t/** @type {PreactElement} */\n\t\tfirstChildDom;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\t/** @type {VNode[]} */\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\tnewParentVNode._nextDom = oldDom;\n\tconstructNewChildrenArray(newParentVNode, renderResult, oldChildren);\n\toldDom = newParentVNode._nextDom;\n\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\tchildVNode = newParentVNode._children[i];\n\n\t\tif (\n\t\t\tchildVNode == null ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// At this point, constructNewChildrenArray has assigned _index to be the\n\t\t// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).\n\t\tif (childVNode._index === -1) {\n\t\t\toldVNode = EMPTY_OBJ;\n\t\t} else {\n\t\t\toldVNode = oldChildren[childVNode._index] || EMPTY_OBJ;\n\t\t}\n\n\t\t// Update childVNode._index to its final index\n\t\tchildVNode._index = i;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tdiff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tisSvg,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\n\t\t// Adjust DOM nodes\n\t\tnewDom = childVNode._dom;\n\t\tif (childVNode.ref && oldVNode.ref != childVNode.ref) {\n\t\t\tif (oldVNode.ref) {\n\t\t\t\tapplyRef(oldVNode.ref, null, childVNode);\n\t\t\t}\n\t\t\trefQueue.push(\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildVNode._component || newDom,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t}\n\n\t\tif (firstChildDom == null && newDom != null) {\n\t\t\tfirstChildDom = newDom;\n\t\t}\n\n\t\tif (\n\t\t\tchildVNode._flags & INSERT_VNODE ||\n\t\t\toldVNode._children === childVNode._children\n\t\t) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom);\n\t\t} else if (\n\t\t\ttypeof childVNode.type == 'function' &&\n\t\t\tchildVNode._nextDom !== undefined\n\t\t) {\n\t\t\t// Since Fragments or components that return Fragment like VNodes can\n\t\t\t// contain multiple DOM nodes as the same level, continue the diff from\n\t\t\t// the sibling of last DOM child of this child VNode\n\t\t\toldDom = childVNode._nextDom;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Eagerly cleanup _nextDom. We don't need to persist the value because it\n\t\t// is only used by `diffChildren` to determine where to resume the diff\n\t\t// after diffing Components and Fragments. Once we store it the nextDOM\n\t\t// local var, we can clean up the property. Also prevents us hanging on to\n\t\t// DOM nodes that may have been unmounted.\n\t\tchildVNode._nextDom = undefined;\n\n\t\t// Unset diffing flags\n\t\tchildVNode._flags &= ~(INSERT_VNODE | MATCHED);\n\t}\n\n\t// TODO: With new child diffing algo, consider alt ways to diff Fragments.\n\t// Such as dropping oldDom and moving fragments in place\n\t//\n\t// Because the newParentVNode is Fragment-like, we need to set it's\n\t// _nextDom property to the nextSibling of its last child DOM node.\n\t//\n\t// `oldDom` contains the correct value here because if the last child\n\t// is a Fragment-like, then oldDom has already been set to that child's _nextDom.\n\t// If the last child is a DOM VNode, then oldDom will be set to that DOM\n\t// node's nextSibling.\n\tnewParentVNode._nextDom = oldDom;\n\tnewParentVNode._dom = firstChildDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(newParentVNode, renderResult, oldChildren) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tconst newChildrenLength = renderResult.length;\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\tnewParentVNode._children = [];\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\t// @ts-expect-error We are reusing the childVNode variable to hold both the\n\t\t// pre and post normalized childVNode\n\t\tchildVNode = renderResult[i];\n\n\t\tif (\n\t\t\tchildVNode == null ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = null;\n\t\t}\n\t\t// If this newVNode is being reused (e.g.

{reuse}{reuse}
) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint' ||\n\t\t\tchildVNode.constructor == String\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tnull,\n\t\t\t\tchildVNode,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if (childVNode.constructor === undefined && childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t// const reuse =
\n\t\t\t//
{reuse}{reuse}
\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : null,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tchildVNode = newParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\t// Handle unmounting null placeholders, i.e. VNode => null in unkeyed children\n\t\tif (childVNode == null) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode && oldVNode.key == null && oldVNode._dom) {\n\t\t\t\tif (oldVNode._dom == newParentVNode._nextDom) {\n\t\t\t\t\tnewParentVNode._nextDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode, false);\n\n\t\t\t\t// Explicitly nullify this position in oldChildren instead of just\n\t\t\t\t// setting `_match=true` to prevent other routines (e.g.\n\t\t\t\t// `findMatchingIndex` or `getDomSibling`) from thinking VNodes or DOM\n\t\t\t\t// nodes in this position are still available to be used in diffing when\n\t\t\t\t// they have actually already been unmounted. For example, by only\n\t\t\t\t// setting `_match=true` here, the unmounting loop later would attempt\n\t\t\t\t// to unmount this VNode again seeing `_match==true`. Further,\n\t\t\t\t// getDomSibling doesn't know about _match and so would incorrectly\n\t\t\t\t// assume DOM nodes in this subtree are mounted and usable.\n\t\t\t\toldChildren[i] = null;\n\t\t\t\tremainingOldChildren--;\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\tconst skewedIndex = i + skew;\n\t\tconst matchingIndex = findMatchingIndex(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\tskewedIndex,\n\t\t\tremainingOldChildren\n\t\t);\n\n\t\t// Temporarily store the matchingIndex on the _index property so we can pull\n\t\t// out the oldVNode in diffChildren. We'll override this to the VNode's\n\t\t// final index after using this property to get the oldVNode\n\t\tchildVNode._index = matchingIndex;\n\n\t\toldVNode = null;\n\t\tif (matchingIndex !== -1) {\n\t\t\toldVNode = oldChildren[matchingIndex];\n\t\t\tremainingOldChildren--;\n\t\t\tif (oldVNode) {\n\t\t\t\toldVNode._flags |= MATCHED;\n\t\t\t}\n\t\t}\n\n\t\t// Here, we define isMounting for the purposes of the skew diffing\n\t\t// algorithm. Nodes that are unsuspending are considered mounting and we detect\n\t\t// this by checking if oldVNode._original === null\n\t\tconst isMounting = oldVNode == null || oldVNode._original === null;\n\n\t\tif (isMounting) {\n\t\t\tif (matchingIndex == -1) {\n\t\t\t\tskew--;\n\t\t\t}\n\n\t\t\t// If we are mounting a DOM VNode, mark it for insertion\n\t\t\tif (typeof childVNode.type != 'function') {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t} else if (matchingIndex !== skewedIndex) {\n\t\t\tif (matchingIndex === skewedIndex + 1) {\n\t\t\t\tskew++;\n\t\t\t} else if (matchingIndex > skewedIndex) {\n\t\t\t\tif (remainingOldChildren > newChildrenLength - skewedIndex) {\n\t\t\t\t\tskew += matchingIndex - skewedIndex;\n\t\t\t\t} else {\n\t\t\t\t\t// ### Change from keyed: I think this was missing from the algo...\n\t\t\t\t\tskew--;\n\t\t\t\t}\n\t\t\t} else if (matchingIndex < skewedIndex) {\n\t\t\t\tif (matchingIndex == skewedIndex - 1) {\n\t\t\t\t\tskew = matchingIndex - skewedIndex;\n\t\t\t\t} else {\n\t\t\t\t\tskew = 0;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tskew = 0;\n\t\t\t}\n\n\t\t\t// Move this VNode's DOM if the original index (matchingIndex) doesn't\n\t\t\t// match the new skew index (i + new skew)\n\t\t\tif (matchingIndex !== i + skew) {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any. Loop forwards so that as we\n\t// unmount DOM from the beginning of the oldChildren, we can adjust oldDom to\n\t// point to the next child, which needs to be the first DOM node that won't be\n\t// unmounted.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i < oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode != null && (oldVNode._flags & MATCHED) === 0) {\n\t\t\t\tif (oldVNode._dom == newParentVNode._nextDom) {\n\t\t\t\t\tnewParentVNode._nextDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\n\tif (typeof parentVNode.type == 'function') {\n\t\tlet children = parentVNode._children;\n\t\tfor (let i = 0; children && i < children.length; i++) {\n\t\t\tif (children[i]) {\n\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t// here).\n\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\toldDom = insert(children[i], oldDom, parentDom);\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else if (parentVNode._dom != oldDom) {\n\t\tparentDom.insertBefore(parentVNode._dom, oldDom || null);\n\t\toldDom = parentVNode._dom;\n\t}\n\n\treturn oldDom && oldDom.nextSibling;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {ComponentChildren} children The unflattened children of a virtual\n * node\n * @returns {VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == null || typeof children == 'boolean') {\n\t} else if (isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\n/**\n * @param {VNode} childVNode\n * @param {VNode[]} oldChildren\n * @param {number} skewedIndex\n * @param {number} remainingOldChildren\n * @returns {number}\n */\nfunction findMatchingIndex(\n\tchildVNode,\n\toldChildren,\n\tskewedIndex,\n\tremainingOldChildren\n) {\n\tconst key = childVNode.key;\n\tconst type = childVNode.type;\n\tlet x = skewedIndex - 1;\n\tlet y = skewedIndex + 1;\n\tlet oldVNode = oldChildren[skewedIndex];\n\n\t// We only need to perform a search if there are more children\n\t// (remainingOldChildren) to search. However, if the oldVNode we just looked\n\t// at skewedIndex was not already used in this diff, then there must be at\n\t// least 1 other (so greater than 1) remainingOldChildren to attempt to match\n\t// against. So the following condition checks that ensuring\n\t// remainingOldChildren > 1 if the oldVNode is not already used/matched. Else\n\t// if the oldVNode was null or matched, then there could needs to be at least\n\t// 1 (aka `remainingOldChildren > 0`) children to find and compare against.\n\tlet shouldSearch =\n\t\tremainingOldChildren >\n\t\t(oldVNode != null && (oldVNode._flags & MATCHED) === 0 ? 1 : 0);\n\n\tif (\n\t\toldVNode === null ||\n\t\t(oldVNode && key == oldVNode.key && type === oldVNode.type)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\twhile (x >= 0 || y < oldChildren.length) {\n\t\t\tif (x >= 0) {\n\t\t\t\toldVNode = oldChildren[x];\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\t(oldVNode._flags & MATCHED) === 0 &&\n\t\t\t\t\tkey == oldVNode.key &&\n\t\t\t\t\ttype === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\treturn x;\n\t\t\t\t}\n\t\t\t\tx--;\n\t\t\t}\n\n\t\t\tif (y < oldChildren.length) {\n\t\t\t\toldVNode = oldChildren[y];\n\t\t\t\tif (\n\t\t\t\t\toldVNode &&\n\t\t\t\t\t(oldVNode._flags & MATCHED) === 0 &&\n\t\t\t\t\tkey == oldVNode.key &&\n\t\t\t\t\ttype === oldVNode.type\n\t\t\t\t) {\n\t\t\t\t\treturn y;\n\t\t\t\t}\n\t\t\t\ty++;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n}\n","import { IS_NON_DIMENSIONAL } from '../constants';\nimport options from '../options';\n\nfunction setStyle(style, key, value) {\n\tif (key[0] === '-') {\n\t\tstyle.setProperty(key, value == null ? '' : value);\n\t} else if (value == null) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\n/**\n * Set a property value on a DOM node\n * @param {PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, isSvg) {\n\tlet useCapture;\n\n\to: if (name === 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] !== oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] === 'o' && name[1] === 'n') {\n\t\tuseCapture =\n\t\t\tname !== (name = name.replace(/(PointerCapture)$|Capture$/, '$1'));\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (name.toLowerCase() in dom) name = name.toLowerCase().slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tvalue._attached = Date.now();\n\t\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\t\tdom.addEventListener(name, handler, useCapture);\n\t\t\t} else {\n\t\t\t\tvalue._attached = oldValue._attached;\n\t\t\t}\n\t\t} else {\n\t\t\tconst handler = useCapture ? eventProxyCapture : eventProxy;\n\t\t\tdom.removeEventListener(name, handler, useCapture);\n\t\t}\n\t} else {\n\t\tif (isSvg) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname !== 'width' &&\n\t\t\tname !== 'height' &&\n\t\t\tname !== 'href' &&\n\t\t\tname !== 'list' &&\n\t\t\tname !== 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname !== 'tabIndex' &&\n\t\t\tname !== 'download' &&\n\t\t\tname !== 'rowSpan' &&\n\t\t\tname !== 'colSpan' &&\n\t\t\tname !== 'role' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == null ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\tif (typeof value == 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != null && (value !== false || name[4] === '-')) {\n\t\t\tdom.setAttribute(name, value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {PreactEvent} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n\tconst eventHandler = this._listeners[e.type + false];\n\t/**\n\t * This trick is inspired by Vue https://github.com/vuejs/core/blob/main/packages/runtime-dom/src/modules/events.ts#L90-L101\n\t * when the dom performs an event it leaves micro-ticks in between bubbling up which means that an event can trigger on a newly\n\t * created DOM-node while the event bubbles up, this can cause quirky behavior as seen in https://github.com/preactjs/preact/issues/3927\n\t */\n\tif (!e._dispatched) {\n\t\t// When an event has no _dispatched we know this is the first event-target in the chain\n\t\t// so we set the initial dispatched time.\n\t\te._dispatched = Date.now();\n\t\t// When the _dispatched is smaller than the time when the targetted event handler was attached\n\t\t// we know we have bubbled up to an element that was added during patching the dom.\n\t} else if (e._dispatched <= eventHandler._attached) {\n\t\treturn;\n\t}\n\treturn eventHandler(options.event ? options.event(e) : e);\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {PreactEvent} e The event object from the browser\n * @private\n */\nfunction eventProxyCapture(e) {\n\treturn this._listeners[e.type + true](options.event ? options.event(e) : e);\n}\n","import {\n\tEMPTY_OBJ,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tRESET_MODE\n} from '../constants';\nimport { BaseComponent, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {PreactElement} parentDom The parent of the DOM element\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by\n * getChildContext\n * @param {boolean} isSvg Whether or not this element is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\t/** @type {any} */\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== undefined) return null;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._flags & MODE_SUSPENDED) {\n\t\tisHydrating = !!(oldVNode._flags & MODE_HYDRATE);\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\ttry {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\t\t// @ts-expect-error The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new BaseComponent(\n\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tc.props = newProps;\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc.context = componentContext;\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (c._nextState == null) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (newType.getDerivedStateFromProps != null) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tc.componentWillMount != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidMount != null) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t!c._force &&\n\t\t\t\t\t((c.shouldComponentUpdate != null &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false) ||\n\t\t\t\t\t\tnewVNode._original === oldVNode._original)\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original !== oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.forEach(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t\t}\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != null) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidUpdate != null) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\t\t\tc._force = false;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tfor (let i = 0; i < c._stateCallbacks.length; i++) {\n\t\t\t\t\tc._renderCallbacks.push(c._stateCallbacks[i]);\n\t\t\t\t}\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != null) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (!isNew && c.getSnapshotBeforeUpdate != null) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != null && tmp.type === Fragment && tmp.key == null;\n\t\t\tlet renderResult = isTopLevelFragment ? tmp.props.children : tmp;\n\n\t\t\tdiffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._flags &= RESET_MODE;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = null;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tnewVNode._original = null;\n\t\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\t\tif (isHydrating || excessDomChildren != null) {\n\t\t\t\tnewVNode._dom = oldDom;\n\t\t\t\tnewVNode._flags |= isHydrating\n\t\t\t\t\t? MODE_HYDRATE | MODE_SUSPENDED\n\t\t\t\t\t: MODE_HYDRATE;\n\t\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = null;\n\t\t\t\t// ^ could possibly be simplified to:\n\t\t\t\t// excessDomChildren.length = 0;\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t}\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else if (\n\t\texcessDomChildren == null &&\n\t\tnewVNode._original === oldVNode._original\n\t) {\n\t\tnewVNode._children = oldVNode._children;\n\t\tnewVNode._dom = oldVNode._dom;\n\t} else {\n\t\tnewVNode._dom = diffElementNodes(\n\t\t\toldVNode._dom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tisSvg,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n}\n\n/**\n * @param {Array} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {VNode} root\n */\nexport function commitRoot(commitQueue, root, refQueue) {\n\troot._nextDom = undefined;\n\n\tfor (let i = 0; i < refQueue.length; i++) {\n\t\tapplyRef(refQueue[i], refQueue[++i], refQueue[++i]);\n\t}\n\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-expect-error Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-expect-error See above comment on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {PreactElement} dom The DOM element representing the virtual nodes\n * being diffed\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {Array} excessDomChildren\n * @param {Array} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @returns {PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating,\n\trefQueue\n) {\n\tlet oldProps = oldVNode.props;\n\tlet newProps = newVNode.props;\n\tlet nodeType = /** @type {string} */ (newVNode.type);\n\t/** @type {any} */\n\tlet i;\n\t/** @type {{ __html?: string }} */\n\tlet newHtml;\n\t/** @type {{ __html?: string }} */\n\tlet oldHtml;\n\t/** @type {ComponentChildren} */\n\tlet newChildren;\n\tlet value;\n\tlet inputValue;\n\tlet checked;\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tif (nodeType === 'svg') isSvg = true;\n\n\tif (excessDomChildren != null) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tvalue = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\t'setAttribute' in value === !!nodeType &&\n\t\t\t\t(nodeType ? value.localName === nodeType : value.nodeType === 3)\n\t\t\t) {\n\t\t\t\tdom = value;\n\t\t\t\texcessDomChildren[i] = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == null) {\n\t\tif (nodeType === null) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tif (isSvg) {\n\t\t\tdom = document.createElementNS('http://www.w3.org/2000/svg', nodeType);\n\t\t} else {\n\t\t\tdom = document.createElement(nodeType, newProps.is && newProps);\n\t\t}\n\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = null;\n\t\t// we are creating a new node, so we can assume this is a new subtree (in\n\t\t// case we are hydrating), this deopts the hydrate\n\t\tisHydrating = false;\n\t}\n\n\tif (nodeType === null) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data !== newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\n\n\t\t// If we are in a situation where we are not hydrating but are using\n\t\t// existing DOM (e.g. replaceNode) we should read the existing DOM\n\t\t// attributes to diff them\n\t\tif (!isHydrating && excessDomChildren != null) {\n\t\t\toldProps = {};\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i];\n\t\t\t\toldProps[value.name] = value.value;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in oldProps) {\n\t\t\tvalue = oldProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (i !== 'key' && !(i in newProps)) {\n\t\t\t\tsetProperty(dom, i, null, value, isSvg);\n\t\t\t}\n\t\t}\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i == 'value') {\n\t\t\t\tinputValue = value;\n\t\t\t} else if (i == 'checked') {\n\t\t\t\tchecked = value;\n\t\t\t} else if (\n\t\t\t\ti !== 'key' &&\n\t\t\t\t(!isHydrating || typeof value == 'function') &&\n\t\t\t\toldProps[i] !== value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, oldProps[i], isSvg);\n\t\t\t}\n\t\t}\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\tif (\n\t\t\t\t!isHydrating &&\n\t\t\t\t(!oldHtml ||\n\t\t\t\t\t(newHtml.__html !== oldHtml.__html &&\n\t\t\t\t\t\tnewHtml.__html !== dom.innerHTML))\n\t\t\t) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\t\tdiffChildren(\n\t\t\t\tdom,\n\t\t\t\tisArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg && nodeType !== 'foreignObject',\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != null) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tif (excessDomChildren[i] != null) removeNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating) {\n\t\t\ti = 'value';\n\t\t\tif (\n\t\t\t\tinputValue !== undefined &&\n\t\t\t\t// #2756 For the -element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(inputValue !== dom[i] ||\n\t\t\t\t\t(nodeType === 'progress' && !inputValue) ||\n\t\t\t\t\t// This is only for IE 11 to fix value not being updated.\n\t\t\t\t\t// To avoid a stale select value we need to set the option.value\n\t\t\t\t\t// again, which triggers IE11 to re-evaluate the select value\n\t\t\t\t\t(nodeType === 'option' && inputValue !== oldProps[i]))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, inputValue, oldProps[i], false);\n\t\t\t}\n\n\t\t\ti = 'checked';\n\t\t\tif (checked !== undefined && checked !== dom[i]) {\n\t\t\t\tsetProperty(dom, i, checked, oldProps[i], false);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {Ref} ref\n * @param {any} value\n * @param {VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') ref(value);\n\t\telse ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {VNode} vnode The virtual node to unmount\n * @param {VNode} parentVNode The parent of the VNode that initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current === vnode._dom) {\n\t\t\tapplyRef(r, null, parentVNode);\n\t\t}\n\t}\n\n\tif ((r = vnode._component) != null) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = null;\n\t\tvnode._component = undefined;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tskipRemove || typeof vnode.type !== 'function'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove && vnode._dom != null) {\n\t\tremoveNode(vnode._dom);\n\t}\n\n\t// Must be set to `undefined` to properly clean up `_nextDom`\n\t// for which `null` is a valid value. See comment in `create-element.js`\n\tvnode._parent = vnode._dom = vnode._nextDom = undefined;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { EMPTY_OBJ } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {ComponentChild} vnode The virtual node to render\n * @param {PreactElement} parentDom The DOM element to render into\n * @param {PreactElement | object} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\n\t// element..\n\tlet isHydrating = typeof replaceNode == 'function';\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? null\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\n\tvnode = ((!isHydrating && replaceNode) || parentDom)._children =\n\t\tcreateElement(Fragment, null, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tvnode,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.ownerSVGElement !== undefined,\n\t\t!isHydrating && replaceNode\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t? null\n\t\t\t: parentDom.firstChild\n\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t: null,\n\t\tcommitQueue,\n\t\t!isHydrating && replaceNode\n\t\t\t? replaceNode\n\t\t\t: oldVNode\n\t\t\t? oldVNode._dom\n\t\t\t: parentDom.firstChild,\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode, refQueue);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {ComponentChild} vnode The virtual node to render\n * @param {PreactElement} parentDom The DOM element to update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, hydrate);\n}\n","import { assign, slice } from './util';\nimport { createVNode } from './create-element';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * children.\n * @param {VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array} rest Any additional arguments will be used\n * as replacement children.\n * @returns {VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\n\tlet defaultProps;\n\n\tif (vnode.type && vnode.type.defaultProps) {\n\t\tdefaultProps = vnode.type.defaultProps;\n\t}\n\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse if (props[i] === undefined && defaultProps !== undefined) {\n\t\t\tnormalizedProps[i] = defaultProps[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tnull\n\t);\n}\n","/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {VNode} [oldVNode]\n * @param {ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {Component} */\n\tlet component,\n\t\t/** @type {ComponentType} */\n\t\tctor,\n\t\t/** @type {boolean} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != null) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != null) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import { options } from 'preact';\n\n/** @type {number} */\nlet currentIndex;\n\n/** @type {import('./internal').Component} */\nlet currentComponent;\n\n/** @type {import('./internal').Component} */\nlet previousComponent;\n\n/** @type {number} */\nlet currentHook = 0;\n\n/** @type {Array} */\nlet afterPaintEffects = [];\n\nlet EMPTY = [];\n\nlet oldBeforeDiff = options._diff;\nlet oldBeforeRender = options._render;\nlet oldAfterDiff = options.diffed;\nlet oldCommit = options._commit;\nlet oldBeforeUnmount = options.unmount;\n\nconst RAF_TIMEOUT = 100;\nlet prevRaf;\n\noptions._diff = vnode => {\n\tcurrentComponent = null;\n\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n};\n\noptions._render = vnode => {\n\tif (oldBeforeRender) oldBeforeRender(vnode);\n\n\tcurrentComponent = vnode._component;\n\tcurrentIndex = 0;\n\n\tconst hooks = currentComponent.__hooks;\n\tif (hooks) {\n\t\tif (previousComponent === currentComponent) {\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentComponent._renderCallbacks = [];\n\t\t\thooks._list.forEach(hookItem => {\n\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t}\n\t\t\t\thookItem._pendingValue = EMPTY;\n\t\t\t\thookItem._nextValue = hookItem._pendingArgs = undefined;\n\t\t\t});\n\t\t} else {\n\t\t\thooks._pendingEffects.forEach(invokeCleanup);\n\t\t\thooks._pendingEffects.forEach(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentIndex = 0;\n\t\t}\n\t}\n\tpreviousComponent = currentComponent;\n};\n\noptions.diffed = vnode => {\n\tif (oldAfterDiff) oldAfterDiff(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tif (c.__hooks._pendingEffects.length) afterPaint(afterPaintEffects.push(c));\n\t\tc.__hooks._list.forEach(hookItem => {\n\t\t\tif (hookItem._pendingArgs) {\n\t\t\t\thookItem._args = hookItem._pendingArgs;\n\t\t\t}\n\t\t\tif (hookItem._pendingValue !== EMPTY) {\n\t\t\t\thookItem._value = hookItem._pendingValue;\n\t\t\t}\n\t\t\thookItem._pendingArgs = undefined;\n\t\t\thookItem._pendingValue = EMPTY;\n\t\t});\n\t}\n\tpreviousComponent = currentComponent = null;\n};\n\noptions._commit = (vnode, commitQueue) => {\n\tcommitQueue.some(component => {\n\t\ttry {\n\t\t\tcomponent._renderCallbacks.forEach(invokeCleanup);\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\n\t\t\t\tcb._value ? invokeEffect(cb) : true\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tcommitQueue.some(c => {\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\n\t\t\t});\n\t\t\tcommitQueue = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t});\n\n\tif (oldCommit) oldCommit(vnode, commitQueue);\n};\n\noptions.unmount = vnode => {\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tlet hasErrored;\n\t\tc.__hooks._list.forEach(s => {\n\t\t\ttry {\n\t\t\t\tinvokeCleanup(s);\n\t\t\t} catch (e) {\n\t\t\t\thasErrored = e;\n\t\t\t}\n\t\t});\n\t\tc.__hooks = undefined;\n\t\tif (hasErrored) options._catchError(hasErrored, c._vnode);\n\t}\n};\n\n/**\n * Get a hook's state from the currentComponent\n * @param {number} index The index of the hook to get\n * @param {number} type The index of the hook to get\n * @returns {any}\n */\nfunction getHookState(index, type) {\n\tif (options._hook) {\n\t\toptions._hook(currentComponent, index, currentHook || type);\n\t}\n\tcurrentHook = 0;\n\n\t// Largely inspired by:\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\n\t// Other implementations to look at:\n\t// * https://codesandbox.io/s/mnox05qp8\n\tconst hooks =\n\t\tcurrentComponent.__hooks ||\n\t\t(currentComponent.__hooks = {\n\t\t\t_list: [],\n\t\t\t_pendingEffects: []\n\t\t});\n\n\tif (index >= hooks._list.length) {\n\t\thooks._list.push({ _pendingValue: EMPTY });\n\t}\n\treturn hooks._list[index];\n}\n\n/**\n * @param {import('./index').StateUpdater} [initialState]\n */\nexport function useState(initialState) {\n\tcurrentHook = 1;\n\treturn useReducer(invokeOrReturn, initialState);\n}\n\n/**\n * @param {import('./index').Reducer} reducer\n * @param {import('./index').StateUpdater} initialState\n * @param {(initialState: any) => void} [init]\n * @returns {[ any, (state: any) => void ]}\n */\nexport function useReducer(reducer, initialState, init) {\n\t/** @type {import('./internal').ReducerHookState} */\n\tconst hookState = getHookState(currentIndex++, 2);\n\thookState._reducer = reducer;\n\tif (!hookState._component) {\n\t\thookState._value = [\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\n\n\t\t\taction => {\n\t\t\t\tconst currentValue = hookState._nextValue\n\t\t\t\t\t? hookState._nextValue[0]\n\t\t\t\t\t: hookState._value[0];\n\t\t\t\tconst nextValue = hookState._reducer(currentValue, action);\n\n\t\t\t\tif (currentValue !== nextValue) {\n\t\t\t\t\thookState._nextValue = [nextValue, hookState._value[1]];\n\t\t\t\t\thookState._component.setState({});\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\n\t\thookState._component = currentComponent;\n\n\t\tif (!currentComponent._hasScuFromHooks) {\n\t\t\tcurrentComponent._hasScuFromHooks = true;\n\t\t\tlet prevScu = currentComponent.shouldComponentUpdate;\n\t\t\tconst prevCWU = currentComponent.componentWillUpdate;\n\n\t\t\t// If we're dealing with a forced update `shouldComponentUpdate` will\n\t\t\t// not be called. But we use that to update the hook values, so we\n\t\t\t// need to call it.\n\t\t\tcurrentComponent.componentWillUpdate = function (p, s, c) {\n\t\t\t\tif (this._force) {\n\t\t\t\t\tlet tmp = prevScu;\n\t\t\t\t\t// Clear to avoid other sCU hooks from being called\n\t\t\t\t\tprevScu = undefined;\n\t\t\t\t\tupdateHookState(p, s, c);\n\t\t\t\t\tprevScu = tmp;\n\t\t\t\t}\n\n\t\t\t\tif (prevCWU) prevCWU.call(this, p, s, c);\n\t\t\t};\n\n\t\t\t// This SCU has the purpose of bailing out after repeated updates\n\t\t\t// to stateful hooks.\n\t\t\t// we store the next value in _nextValue[0] and keep doing that for all\n\t\t\t// state setters, if we have next states and\n\t\t\t// all next states within a component end up being equal to their original state\n\t\t\t// we are safe to bail out for this specific component.\n\t\t\t/**\n\t\t\t *\n\t\t\t * @type {import('./internal').Component[\"shouldComponentUpdate\"]}\n\t\t\t */\n\t\t\t// @ts-ignore - We don't use TS to downtranspile\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction updateHookState(p, s, c) {\n\t\t\t\tif (!hookState._component.__hooks) return true;\n\n\t\t\t\tconst stateHooks = hookState._component.__hooks._list.filter(\n\t\t\t\t\tx => x._component\n\t\t\t\t);\n\t\t\t\tconst allHooksEmpty = stateHooks.every(x => !x._nextValue);\n\t\t\t\t// When we have no updated hooks in the component we invoke the previous SCU or\n\t\t\t\t// traverse the VDOM tree further.\n\t\t\t\tif (allHooksEmpty) {\n\t\t\t\t\treturn prevScu ? prevScu.call(this, p, s, c) : true;\n\t\t\t\t}\n\n\t\t\t\t// We check whether we have components with a nextValue set that\n\t\t\t\t// have values that aren't equal to one another this pushes\n\t\t\t\t// us to update further down the tree\n\t\t\t\tlet shouldUpdate = false;\n\t\t\t\tstateHooks.forEach(hookItem => {\n\t\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\t\tconst currentValue = hookItem._value[0];\n\t\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t\t\thookItem._nextValue = undefined;\n\t\t\t\t\t\tif (currentValue !== hookItem._value[0]) shouldUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn shouldUpdate || hookState._component.props !== p\n\t\t\t\t\t? prevScu\n\t\t\t\t\t\t? prevScu.call(this, p, s, c)\n\t\t\t\t\t\t: true\n\t\t\t\t\t: false;\n\t\t\t}\n\n\t\t\tcurrentComponent.shouldComponentUpdate = updateHookState;\n\t\t}\n\t}\n\n\treturn hookState._nextValue || hookState._value;\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {any[]} args\n */\nexport function useEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 3);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\n\t}\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {any[]} args\n */\nexport function useLayoutEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 4);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent._renderCallbacks.push(state);\n\t}\n}\n\nexport function useRef(initialValue) {\n\tcurrentHook = 5;\n\treturn useMemo(() => ({ current: initialValue }), []);\n}\n\n/**\n * @param {object} ref\n * @param {() => object} createHandle\n * @param {any[]} args\n */\nexport function useImperativeHandle(ref, createHandle, args) {\n\tcurrentHook = 6;\n\tuseLayoutEffect(\n\t\t() => {\n\t\t\tif (typeof ref == 'function') {\n\t\t\t\tref(createHandle());\n\t\t\t\treturn () => ref(null);\n\t\t\t} else if (ref) {\n\t\t\t\tref.current = createHandle();\n\t\t\t\treturn () => (ref.current = null);\n\t\t\t}\n\t\t},\n\t\targs == null ? args : args.concat(ref)\n\t);\n}\n\n/**\n * @param {() => any} factory\n * @param {any[]} args\n */\nexport function useMemo(factory, args) {\n\t/** @type {import('./internal').MemoHookState} */\n\tconst state = getHookState(currentIndex++, 7);\n\tif (argsChanged(state._args, args)) {\n\t\tstate._pendingValue = factory();\n\t\tstate._pendingArgs = args;\n\t\tstate._factory = factory;\n\t\treturn state._pendingValue;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * @param {() => void} callback\n * @param {any[]} args\n */\nexport function useCallback(callback, args) {\n\tcurrentHook = 8;\n\treturn useMemo(() => callback, args);\n}\n\n/**\n * @param {import('./internal').PreactContext} context\n */\nexport function useContext(context) {\n\tconst provider = currentComponent.context[context._id];\n\t// We could skip this call here, but than we'd not call\n\t// `options._hook`. We need to do that in order to make\n\t// the devtools aware of this hook.\n\t/** @type {import('./internal').ContextHookState} */\n\tconst state = getHookState(currentIndex++, 9);\n\t// The devtools needs access to the context object to\n\t// be able to pull of the default value when no provider\n\t// is present in the tree.\n\tstate._context = context;\n\tif (!provider) return context._defaultValue;\n\t// This is probably not safe to convert to \"!\"\n\tif (state._value == null) {\n\t\tstate._value = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n}\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {(value: T, cb?: (value: T) => string | number) => void}\n */\nexport function useDebugValue(value, formatter) {\n\tif (options.useDebugValue) {\n\t\toptions.useDebugValue(formatter ? formatter(value) : value);\n\t}\n}\n\n/**\n * @param {(error: any, errorInfo: import('preact').ErrorInfo) => void} cb\n */\nexport function useErrorBoundary(cb) {\n\t/** @type {import('./internal').ErrorBoundaryHookState} */\n\tconst state = getHookState(currentIndex++, 10);\n\tconst errState = useState();\n\tstate._value = cb;\n\tif (!currentComponent.componentDidCatch) {\n\t\tcurrentComponent.componentDidCatch = (err, errorInfo) => {\n\t\t\tif (state._value) state._value(err, errorInfo);\n\t\t\terrState[1](err);\n\t\t};\n\t}\n\treturn [\n\t\terrState[0],\n\t\t() => {\n\t\t\terrState[1](undefined);\n\t\t}\n\t];\n}\n\nexport function useId() {\n\tconst state = getHookState(currentIndex++, 11);\n\tif (!state._value) {\n\t\t// Grab either the root node or the nearest async boundary node.\n\t\t/** @type {import('./internal.d').VNode} */\n\t\tlet root = currentComponent._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\tlet mask = root._mask || (root._mask = [0, 0]);\n\t\tstate._value = 'P' + mask[0] + '-' + mask[1]++;\n\t}\n\n\treturn state._value;\n}\n/**\n * After paint effects consumer.\n */\nfunction flushAfterPaintEffects() {\n\tlet component;\n\twhile ((component = afterPaintEffects.shift())) {\n\t\tif (!component._parentDom || !component.__hooks) continue;\n\t\ttry {\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeCleanup);\n\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeEffect);\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t} catch (e) {\n\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t}\n}\n\nlet HAS_RAF = typeof requestAnimationFrame == 'function';\n\n/**\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\n * the next browser frame.\n *\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\n * even if RAF doesn't fire (for example if the browser tab is not visible)\n *\n * @param {() => void} callback\n */\nfunction afterNextFrame(callback) {\n\tconst done = () => {\n\t\tclearTimeout(timeout);\n\t\tif (HAS_RAF) cancelAnimationFrame(raf);\n\t\tsetTimeout(callback);\n\t};\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\n\n\tlet raf;\n\tif (HAS_RAF) {\n\t\traf = requestAnimationFrame(done);\n\t}\n}\n\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\n// Perhaps this is not such a big deal.\n/**\n * Schedule afterPaintEffects flush after the browser paints\n * @param {number} newQueueLength\n */\nfunction afterPaint(newQueueLength) {\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\n\t\tprevRaf = options.requestAnimationFrame;\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\n\t}\n}\n\n/**\n * @param {import('./internal').EffectHookState} hook\n */\nfunction invokeCleanup(hook) {\n\t// A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\tlet cleanup = hook._cleanup;\n\tif (typeof cleanup == 'function') {\n\t\thook._cleanup = undefined;\n\t\tcleanup();\n\t}\n\n\tcurrentComponent = comp;\n}\n\n/**\n * Invoke a Hook's effect\n * @param {import('./internal').EffectHookState} hook\n */\nfunction invokeEffect(hook) {\n\t// A hook call can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\thook._cleanup = hook._value();\n\tcurrentComponent = comp;\n}\n\n/**\n * @param {any[]} oldArgs\n * @param {any[]} newArgs\n */\nfunction argsChanged(oldArgs, newArgs) {\n\treturn (\n\t\t!oldArgs ||\n\t\toldArgs.length !== newArgs.length ||\n\t\tnewArgs.some((arg, index) => arg !== oldArgs[index])\n\t);\n}\n\nfunction invokeOrReturn(arg, f) {\n\treturn typeof f == 'function' ? f(arg) : f;\n}\n","function cycleDetected(): never {\n\tthrow new Error(\"Cycle detected\");\n}\nfunction mutationDetected(): never {\n\tthrow new Error(\"Computed cannot have side-effects\");\n}\n\n// Flags for Computed and Effect.\nconst RUNNING = 1 << 0;\nconst NOTIFIED = 1 << 1;\nconst OUTDATED = 1 << 2;\nconst DISPOSED = 1 << 3;\nconst HAS_ERROR = 1 << 4;\nconst TRACKING = 1 << 5;\n\n// A linked list node used to track dependencies (sources) and dependents (targets).\n// Also used to remember the source's last version number that the target saw.\ntype Node = {\n\t// A source whose value the target depends on.\n\t_source: Signal;\n\t_prevSource?: Node;\n\t_nextSource?: Node;\n\n\t// A target that depends on the source and should be notified when the source changes.\n\t_target: Computed | Effect;\n\t_prevTarget?: Node;\n\t_nextTarget?: Node;\n\n\t// The version number of the source that target has last seen. We use version numbers\n\t// instead of storing the source value, because source values can take arbitrary amount\n\t// of memory, and computeds could hang on to them forever because they're lazily evaluated.\n\t// Use the special value -1 to mark potentially unused but recyclable nodes.\n\t_version: number;\n\n\t// Used to remember & roll back the source's previous `._node` value when entering &\n\t// exiting a new evaluation context.\n\t_rollbackNode?: Node;\n};\n\nfunction startBatch() {\n\tbatchDepth++;\n}\n\nfunction endBatch() {\n\tif (batchDepth > 1) {\n\t\tbatchDepth--;\n\t\treturn;\n\t}\n\n\tlet error: unknown;\n\tlet hasError = false;\n\n\twhile (batchedEffect !== undefined) {\n\t\tlet effect: Effect | undefined = batchedEffect;\n\t\tbatchedEffect = undefined;\n\n\t\tbatchIteration++;\n\n\t\twhile (effect !== undefined) {\n\t\t\tconst next: Effect | undefined = effect._nextBatchedEffect;\n\t\t\teffect._nextBatchedEffect = undefined;\n\t\t\teffect._flags &= ~NOTIFIED;\n\n\t\t\tif (!(effect._flags & DISPOSED) && needsToRecompute(effect)) {\n\t\t\t\ttry {\n\t\t\t\t\teffect._callback();\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (!hasError) {\n\t\t\t\t\t\terror = err;\n\t\t\t\t\t\thasError = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\teffect = next;\n\t\t}\n\t}\n\tbatchIteration = 0;\n\tbatchDepth--;\n\n\tif (hasError) {\n\t\tthrow error;\n\t}\n}\n\nfunction batch(callback: () => T): T {\n\tif (batchDepth > 0) {\n\t\treturn callback();\n\t}\n\t/*@__INLINE__**/ startBatch();\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tendBatch();\n\t}\n}\n\n// Currently evaluated computed or effect.\nlet evalContext: Computed | Effect | undefined = undefined;\n\nlet untrackedDepth = 0;\n\nfunction untracked(callback: () => T): T {\n\tif (untrackedDepth > 0) {\n\t\treturn callback();\n\t}\n\tconst prevContext = evalContext;\n\tevalContext = undefined;\n\tuntrackedDepth++;\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tuntrackedDepth--;\n\t\tevalContext = prevContext;\n\t}\n}\n\n// Effects collected into a batch.\nlet batchedEffect: Effect | undefined = undefined;\nlet batchDepth = 0;\nlet batchIteration = 0;\n\n// A global version number for signals, used for fast-pathing repeated\n// computed.peek()/computed.value calls when nothing has changed globally.\nlet globalVersion = 0;\n\nfunction addDependency(signal: Signal): Node | undefined {\n\tif (evalContext === undefined) {\n\t\treturn undefined;\n\t}\n\n\tlet node = signal._node;\n\tif (node === undefined || node._target !== evalContext) {\n\t\t/**\n\t\t * `signal` is a new dependency. Create a new dependency node, and set it\n\t\t * as the tail of the current context's dependency list. e.g:\n\t\t *\n\t\t * { A <-> B }\n\t\t * ↑ ↑\n\t\t * tail node (new)\n\t\t * ↓\n\t\t * { A <-> B <-> C }\n\t\t * ↑\n\t\t * tail (evalContext._sources)\n\t\t */\n\t\tnode = {\n\t\t\t_version: 0,\n\t\t\t_source: signal,\n\t\t\t_prevSource: evalContext._sources,\n\t\t\t_nextSource: undefined,\n\t\t\t_target: evalContext,\n\t\t\t_prevTarget: undefined,\n\t\t\t_nextTarget: undefined,\n\t\t\t_rollbackNode: node,\n\t\t};\n\n\t\tif (evalContext._sources !== undefined) {\n\t\t\tevalContext._sources._nextSource = node;\n\t\t}\n\t\tevalContext._sources = node;\n\t\tsignal._node = node;\n\n\t\t// Subscribe to change notifications from this dependency if we're in an effect\n\t\t// OR evaluating a computed signal that in turn has subscribers.\n\t\tif (evalContext._flags & TRACKING) {\n\t\t\tsignal._subscribe(node);\n\t\t}\n\t\treturn node;\n\t} else if (node._version === -1) {\n\t\t// `signal` is an existing dependency from a previous evaluation. Reuse it.\n\t\tnode._version = 0;\n\n\t\t/**\n\t\t * If `node` is not already the current tail of the dependency list (i.e.\n\t\t * there is a next node in the list), then make the `node` the new tail. e.g:\n\t\t *\n\t\t * { A <-> B <-> C <-> D }\n\t\t * ↑ ↑\n\t\t * node ┌─── tail (evalContext._sources)\n\t\t * └─────│─────┐\n\t\t * ↓ ↓\n\t\t * { A <-> C <-> D <-> B }\n\t\t * ↑\n\t\t * tail (evalContext._sources)\n\t\t */\n\t\tif (node._nextSource !== undefined) {\n\t\t\tnode._nextSource._prevSource = node._prevSource;\n\n\t\t\tif (node._prevSource !== undefined) {\n\t\t\t\tnode._prevSource._nextSource = node._nextSource;\n\t\t\t}\n\n\t\t\tnode._prevSource = evalContext._sources;\n\t\t\tnode._nextSource = undefined;\n\n\t\t\tevalContext._sources!._nextSource = node;\n\t\t\tevalContext._sources = node;\n\t\t}\n\n\t\t// We can assume that the currently evaluated effect / computed signal is already\n\t\t// subscribed to change notifications from `signal` if needed.\n\t\treturn node;\n\t}\n\treturn undefined;\n}\n\n// @ts-ignore internal Signal is viewed as a function\ndeclare class Signal {\n\t/** @internal */\n\t_value: unknown;\n\n\t/**\n\t * @internal\n\t * Version numbers should always be >= 0, because the special value -1 is used\n\t * by Nodes to signify potentially unused but recyclable nodes.\n\t */\n\t_version: number;\n\n\t/** @internal */\n\t_node?: Node;\n\n\t/** @internal */\n\t_targets?: Node;\n\n\tconstructor(value?: T);\n\n\t/** @internal */\n\t_refresh(): boolean;\n\n\t/** @internal */\n\t_subscribe(node: Node): void;\n\n\t/** @internal */\n\t_unsubscribe(node: Node): void;\n\n\tsubscribe(fn: (value: T) => void): () => void;\n\n\tvalueOf(): T;\n\n\ttoString(): string;\n\n\ttoJSON(): T;\n\n\tpeek(): T;\n\n\tget value(): T;\n\tset value(value: T);\n}\n\n/** @internal */\n// @ts-ignore internal Signal is viewed as function\nfunction Signal(this: Signal, value?: unknown) {\n\tthis._value = value;\n\tthis._version = 0;\n\tthis._node = undefined;\n\tthis._targets = undefined;\n}\n\nSignal.prototype._refresh = function () {\n\treturn true;\n};\n\nSignal.prototype._subscribe = function (node) {\n\tif (this._targets !== node && node._prevTarget === undefined) {\n\t\tnode._nextTarget = this._targets;\n\t\tif (this._targets !== undefined) {\n\t\t\tthis._targets._prevTarget = node;\n\t\t}\n\t\tthis._targets = node;\n\t}\n};\n\nSignal.prototype._unsubscribe = function (node) {\n\t// Only run the unsubscribe step if the signal has any subscribers to begin with.\n\tif (this._targets !== undefined) {\n\t\tconst prev = node._prevTarget;\n\t\tconst next = node._nextTarget;\n\t\tif (prev !== undefined) {\n\t\t\tprev._nextTarget = next;\n\t\t\tnode._prevTarget = undefined;\n\t\t}\n\t\tif (next !== undefined) {\n\t\t\tnext._prevTarget = prev;\n\t\t\tnode._nextTarget = undefined;\n\t\t}\n\t\tif (node === this._targets) {\n\t\t\tthis._targets = next;\n\t\t}\n\t}\n};\n\nSignal.prototype.subscribe = function (fn) {\n\tconst signal = this;\n\treturn effect(function (this: Effect) {\n\t\tconst value = signal.value;\n\t\tconst flag = this._flags & TRACKING;\n\t\tthis._flags &= ~TRACKING;\n\t\ttry {\n\t\t\tfn(value);\n\t\t} finally {\n\t\t\tthis._flags |= flag;\n\t\t}\n\t});\n};\n\nSignal.prototype.valueOf = function () {\n\treturn this.value;\n};\n\nSignal.prototype.toString = function () {\n\treturn this.value + \"\";\n};\n\nSignal.prototype.toJSON = function () {\n\treturn this.value;\n};\n\nSignal.prototype.peek = function () {\n\treturn this._value;\n};\n\nObject.defineProperty(Signal.prototype, \"value\", {\n\tget() {\n\t\tconst node = addDependency(this);\n\t\tif (node !== undefined) {\n\t\t\tnode._version = this._version;\n\t\t}\n\t\treturn this._value;\n\t},\n\tset(this: Signal, value) {\n\t\tif (evalContext instanceof Computed) {\n\t\t\tmutationDetected();\n\t\t}\n\n\t\tif (value !== this._value) {\n\t\t\tif (batchIteration > 100) {\n\t\t\t\tcycleDetected();\n\t\t\t}\n\n\t\t\tthis._value = value;\n\t\t\tthis._version++;\n\t\t\tglobalVersion++;\n\n\t\t\t/**@__INLINE__*/ startBatch();\n\t\t\ttry {\n\t\t\t\tfor (\n\t\t\t\t\tlet node = this._targets;\n\t\t\t\t\tnode !== undefined;\n\t\t\t\t\tnode = node._nextTarget\n\t\t\t\t) {\n\t\t\t\t\tnode._target._notify();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tendBatch();\n\t\t\t}\n\t\t}\n\t},\n});\n\nfunction signal(value: T): Signal {\n\treturn new Signal(value);\n}\n\nfunction needsToRecompute(target: Computed | Effect): boolean {\n\t// Check the dependencies for changed values. The dependency list is already\n\t// in order of use. Therefore if multiple dependencies have changed values, only\n\t// the first used dependency is re-evaluated at this point.\n\tfor (\n\t\tlet node = target._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\t// If there's a new version of the dependency before or after refreshing,\n\t\t// or the dependency has something blocking it from refreshing at all (e.g. a\n\t\t// dependency cycle), then we need to recompute.\n\t\tif (\n\t\t\tnode._source._version !== node._version ||\n\t\t\t!node._source._refresh() ||\n\t\t\tnode._source._version !== node._version\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\t// If none of the dependencies have changed values since last recompute then\n\t// there's no need to recompute.\n\treturn false;\n}\n\nfunction prepareSources(target: Computed | Effect) {\n\t/**\n\t * 1. Mark all current sources as re-usable nodes (version: -1)\n\t * 2. Set a rollback node if the current node is being used in a different context\n\t * 3. Point 'target._sources' to the tail of the doubly-linked list, e.g:\n\t *\n\t * { undefined <- A <-> B <-> C -> undefined }\n\t * ↑ ↑\n\t * │ └──────┐\n\t * target._sources = A; (node is head) │\n\t * ↓ │\n\t * target._sources = C; (node is tail) ─┘\n\t */\n\tfor (\n\t\tlet node = target._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\tconst rollbackNode = node._source._node;\n\t\tif (rollbackNode !== undefined) {\n\t\t\tnode._rollbackNode = rollbackNode;\n\t\t}\n\t\tnode._source._node = node;\n\t\tnode._version = -1;\n\n\t\tif (node._nextSource === undefined) {\n\t\t\ttarget._sources = node;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nfunction cleanupSources(target: Computed | Effect) {\n\tlet node = target._sources;\n\tlet head = undefined;\n\n\t/**\n\t * At this point 'target._sources' points to the tail of the doubly-linked list.\n\t * It contains all existing sources + new sources in order of use.\n\t * Iterate backwards until we find the head node while dropping old dependencies.\n\t */\n\twhile (node !== undefined) {\n\t\tconst prev = node._prevSource;\n\n\t\t/**\n\t\t * The node was not re-used, unsubscribe from its change notifications and remove itself\n\t\t * from the doubly-linked list. e.g:\n\t\t *\n\t\t * { A <-> B <-> C }\n\t\t * ↓\n\t\t * { A <-> C }\n\t\t */\n\t\tif (node._version === -1) {\n\t\t\tnode._source._unsubscribe(node);\n\n\t\t\tif (prev !== undefined) {\n\t\t\t\tprev._nextSource = node._nextSource;\n\t\t\t}\n\t\t\tif (node._nextSource !== undefined) {\n\t\t\t\tnode._nextSource._prevSource = prev;\n\t\t\t}\n\t\t} else {\n\t\t\t/**\n\t\t\t * The new head is the last node seen which wasn't removed/unsubscribed\n\t\t\t * from the doubly-linked list. e.g:\n\t\t\t *\n\t\t\t * { A <-> B <-> C }\n\t\t\t * ↑ ↑ ↑\n\t\t\t * │ │ └ head = node\n\t\t\t * │ └ head = node\n\t\t\t * └ head = node\n\t\t\t */\n\t\t\thead = node;\n\t\t}\n\n\t\tnode._source._node = node._rollbackNode;\n\t\tif (node._rollbackNode !== undefined) {\n\t\t\tnode._rollbackNode = undefined;\n\t\t}\n\n\t\tnode = prev;\n\t}\n\n\ttarget._sources = head;\n}\n\ndeclare class Computed extends Signal {\n\t_compute: () => T;\n\t_sources?: Node;\n\t_globalVersion: number;\n\t_flags: number;\n\n\tconstructor(compute: () => T);\n\n\t_notify(): void;\n\tget value(): T;\n}\n\nfunction Computed(this: Computed, compute: () => unknown) {\n\tSignal.call(this, undefined);\n\n\tthis._compute = compute;\n\tthis._sources = undefined;\n\tthis._globalVersion = globalVersion - 1;\n\tthis._flags = OUTDATED;\n}\n\nComputed.prototype = new Signal() as Computed;\n\nComputed.prototype._refresh = function () {\n\tthis._flags &= ~NOTIFIED;\n\n\tif (this._flags & RUNNING) {\n\t\treturn false;\n\t}\n\n\t// If this computed signal has subscribed to updates from its dependencies\n\t// (TRACKING flag set) and none of them have notified about changes (OUTDATED\n\t// flag not set), then the computed value can't have changed.\n\tif ((this._flags & (OUTDATED | TRACKING)) === TRACKING) {\n\t\treturn true;\n\t}\n\tthis._flags &= ~OUTDATED;\n\n\tif (this._globalVersion === globalVersion) {\n\t\treturn true;\n\t}\n\tthis._globalVersion = globalVersion;\n\n\t// Mark this computed signal running before checking the dependencies for value\n\t// changes, so that the RUNNING flag can be used to notice cyclical dependencies.\n\tthis._flags |= RUNNING;\n\tif (this._version > 0 && !needsToRecompute(this)) {\n\t\tthis._flags &= ~RUNNING;\n\t\treturn true;\n\t}\n\n\tconst prevContext = evalContext;\n\ttry {\n\t\tprepareSources(this);\n\t\tevalContext = this;\n\t\tconst value = this._compute();\n\t\tif (\n\t\t\tthis._flags & HAS_ERROR ||\n\t\t\tthis._value !== value ||\n\t\t\tthis._version === 0\n\t\t) {\n\t\t\tthis._value = value;\n\t\t\tthis._flags &= ~HAS_ERROR;\n\t\t\tthis._version++;\n\t\t}\n\t} catch (err) {\n\t\tthis._value = err;\n\t\tthis._flags |= HAS_ERROR;\n\t\tthis._version++;\n\t}\n\tevalContext = prevContext;\n\tcleanupSources(this);\n\tthis._flags &= ~RUNNING;\n\treturn true;\n};\n\nComputed.prototype._subscribe = function (node) {\n\tif (this._targets === undefined) {\n\t\tthis._flags |= OUTDATED | TRACKING;\n\n\t\t// A computed signal subscribes lazily to its dependencies when the it\n\t\t// gets its first subscriber.\n\t\tfor (\n\t\t\tlet node = this._sources;\n\t\t\tnode !== undefined;\n\t\t\tnode = node._nextSource\n\t\t) {\n\t\t\tnode._source._subscribe(node);\n\t\t}\n\t}\n\tSignal.prototype._subscribe.call(this, node);\n};\n\nComputed.prototype._unsubscribe = function (node) {\n\t// Only run the unsubscribe step if the computed signal has any subscribers.\n\tif (this._targets !== undefined) {\n\t\tSignal.prototype._unsubscribe.call(this, node);\n\n\t\t// Computed signal unsubscribes from its dependencies when it loses its last subscriber.\n\t\t// This makes it possible for unreferences subgraphs of computed signals to get garbage collected.\n\t\tif (this._targets === undefined) {\n\t\t\tthis._flags &= ~TRACKING;\n\n\t\t\tfor (\n\t\t\t\tlet node = this._sources;\n\t\t\t\tnode !== undefined;\n\t\t\t\tnode = node._nextSource\n\t\t\t) {\n\t\t\t\tnode._source._unsubscribe(node);\n\t\t\t}\n\t\t}\n\t}\n};\n\nComputed.prototype._notify = function () {\n\tif (!(this._flags & NOTIFIED)) {\n\t\tthis._flags |= OUTDATED | NOTIFIED;\n\n\t\tfor (\n\t\t\tlet node = this._targets;\n\t\t\tnode !== undefined;\n\t\t\tnode = node._nextTarget\n\t\t) {\n\t\t\tnode._target._notify();\n\t\t}\n\t}\n};\n\nComputed.prototype.peek = function () {\n\tif (!this._refresh()) {\n\t\tcycleDetected();\n\t}\n\tif (this._flags & HAS_ERROR) {\n\t\tthrow this._value;\n\t}\n\treturn this._value;\n};\n\nObject.defineProperty(Computed.prototype, \"value\", {\n\tget() {\n\t\tif (this._flags & RUNNING) {\n\t\t\tcycleDetected();\n\t\t}\n\t\tconst node = addDependency(this);\n\t\tthis._refresh();\n\t\tif (node !== undefined) {\n\t\t\tnode._version = this._version;\n\t\t}\n\t\tif (this._flags & HAS_ERROR) {\n\t\t\tthrow this._value;\n\t\t}\n\t\treturn this._value;\n\t},\n});\n\ninterface ReadonlySignal extends Signal {\n\treadonly value: T;\n}\n\nfunction computed(compute: () => T): ReadonlySignal {\n\treturn new Computed(compute);\n}\n\nfunction cleanupEffect(effect: Effect) {\n\tconst cleanup = effect._cleanup;\n\teffect._cleanup = undefined;\n\n\tif (typeof cleanup === \"function\") {\n\t\t/*@__INLINE__**/ startBatch();\n\n\t\t// Run cleanup functions always outside of any context.\n\t\tconst prevContext = evalContext;\n\t\tevalContext = undefined;\n\t\ttry {\n\t\t\tcleanup();\n\t\t} catch (err) {\n\t\t\teffect._flags &= ~RUNNING;\n\t\t\teffect._flags |= DISPOSED;\n\t\t\tdisposeEffect(effect);\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tevalContext = prevContext;\n\t\t\tendBatch();\n\t\t}\n\t}\n}\n\nfunction disposeEffect(effect: Effect) {\n\tfor (\n\t\tlet node = effect._sources;\n\t\tnode !== undefined;\n\t\tnode = node._nextSource\n\t) {\n\t\tnode._source._unsubscribe(node);\n\t}\n\teffect._compute = undefined;\n\teffect._sources = undefined;\n\n\tcleanupEffect(effect);\n}\n\nfunction endEffect(this: Effect, prevContext?: Computed | Effect) {\n\tif (evalContext !== this) {\n\t\tthrow new Error(\"Out-of-order effect\");\n\t}\n\tcleanupSources(this);\n\tevalContext = prevContext;\n\n\tthis._flags &= ~RUNNING;\n\tif (this._flags & DISPOSED) {\n\t\tdisposeEffect(this);\n\t}\n\tendBatch();\n}\n\ntype EffectCleanup = () => unknown;\ndeclare class Effect {\n\t_compute?: () => unknown | EffectCleanup;\n\t_cleanup?: () => unknown;\n\t_sources?: Node;\n\t_nextBatchedEffect?: Effect;\n\t_flags: number;\n\n\tconstructor(compute: () => unknown | EffectCleanup);\n\n\t_callback(): void;\n\t_start(): () => void;\n\t_notify(): void;\n\t_dispose(): void;\n}\n\nfunction Effect(this: Effect, compute: () => unknown | EffectCleanup) {\n\tthis._compute = compute;\n\tthis._cleanup = undefined;\n\tthis._sources = undefined;\n\tthis._nextBatchedEffect = undefined;\n\tthis._flags = TRACKING;\n}\n\nEffect.prototype._callback = function () {\n\tconst finish = this._start();\n\ttry {\n\t\tif (this._flags & DISPOSED) return;\n\t\tif (this._compute === undefined) return;\n\n\t\tconst cleanup = this._compute();\n\t\tif (typeof cleanup === \"function\") {\n\t\t\tthis._cleanup = cleanup as EffectCleanup;\n\t\t}\n\t} finally {\n\t\tfinish();\n\t}\n};\n\nEffect.prototype._start = function () {\n\tif (this._flags & RUNNING) {\n\t\tcycleDetected();\n\t}\n\tthis._flags |= RUNNING;\n\tthis._flags &= ~DISPOSED;\n\tcleanupEffect(this);\n\tprepareSources(this);\n\n\t/*@__INLINE__**/ startBatch();\n\tconst prevContext = evalContext;\n\tevalContext = this;\n\treturn endEffect.bind(this, prevContext);\n};\n\nEffect.prototype._notify = function () {\n\tif (!(this._flags & NOTIFIED)) {\n\t\tthis._flags |= NOTIFIED;\n\t\tthis._nextBatchedEffect = batchedEffect;\n\t\tbatchedEffect = this;\n\t}\n};\n\nEffect.prototype._dispose = function () {\n\tthis._flags |= DISPOSED;\n\n\tif (!(this._flags & RUNNING)) {\n\t\tdisposeEffect(this);\n\t}\n};\n\nfunction effect(compute: () => unknown | EffectCleanup): () => void {\n\tconst effect = new Effect(compute);\n\ttry {\n\t\teffect._callback();\n\t} catch (err) {\n\t\teffect._dispose();\n\t\tthrow err;\n\t}\n\t// Return a bound function instead of a wrapper like `() => effect._dispose()`,\n\t// because bound functions seem to be just as fast and take up a lot less memory.\n\treturn effect._dispose.bind(effect);\n}\n\nexport {\n\tsignal,\n\tcomputed,\n\teffect,\n\tbatch,\n\tSignal,\n\ttype ReadonlySignal,\n\tuntracked,\n};\n","import { options, Component, isValidElement } from \"preact\";\nimport { useRef, useMemo, useEffect } from \"preact/hooks\";\nimport {\n\tsignal,\n\tcomputed,\n\tbatch,\n\teffect,\n\tSignal,\n\ttype ReadonlySignal,\n\tuntracked,\n} from \"@preact/signals-core\";\nimport {\n\tVNode,\n\tOptionsTypes,\n\tHookFn,\n\tEffect,\n\tPropertyUpdater,\n\tAugmentedComponent,\n\tAugmentedElement as Element,\n} from \"./internal\";\n\nexport {\n\tsignal,\n\tcomputed,\n\tbatch,\n\teffect,\n\tSignal,\n\ttype ReadonlySignal,\n\tuntracked,\n};\n\nconst HAS_PENDING_UPDATE = 1 << 0;\nconst HAS_HOOK_STATE = 1 << 1;\nconst HAS_COMPUTEDS = 1 << 2;\n\n// Install a Preact options hook\nfunction hook(hookName: T, hookFn: HookFn) {\n\t// @ts-ignore-next-line private options hooks usage\n\toptions[hookName] = hookFn.bind(null, options[hookName] || (() => {}));\n}\n\nlet currentComponent: AugmentedComponent | undefined;\nlet finishUpdate: (() => void) | undefined;\n\nfunction setCurrentUpdater(updater?: Effect) {\n\t// end tracking for the current update:\n\tif (finishUpdate) finishUpdate();\n\t// start tracking the new update:\n\tfinishUpdate = updater && updater._start();\n}\n\nfunction createUpdater(update: () => void) {\n\tlet updater!: Effect;\n\teffect(function (this: Effect) {\n\t\tupdater = this;\n\t});\n\tupdater._callback = update;\n\treturn updater;\n}\n\n/** @todo This may be needed for complex prop value detection. */\n// function isSignalValue(value: any): value is Signal {\n// \tif (typeof value !== \"object\" || value == null) return false;\n// \tif (value instanceof Signal) return true;\n// \t// @TODO: uncomment this when we land Reactive (ideally behind a brand check)\n// \t// for (let i in value) if (value[i] instanceof Signal) return true;\n// \treturn false;\n// }\n\n/**\n * A wrapper component that renders a Signal directly as a Text node.\n * @todo: in Preact 11, just decorate Signal with `type:null`\n */\nfunction SignalValue(this: AugmentedComponent, { data }: { data: Signal }) {\n\t// hasComputeds.add(this);\n\n\t// Store the props.data signal in another signal so that\n\t// passing a new signal reference re-runs the text computed:\n\tconst currentSignal = useSignal(data);\n\tcurrentSignal.value = data;\n\n\tconst s = useMemo(() => {\n\t\t// mark the parent component as having computeds so it gets optimized\n\t\tlet v = this.__v;\n\t\twhile ((v = v.__!)) {\n\t\t\tif (v.__c) {\n\t\t\t\tv.__c._updateFlags |= HAS_COMPUTEDS;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tthis._updater!._callback = () => {\n\t\t\tif (isValidElement(s.peek()) || this.base?.nodeType !== 3) {\n\t\t\t\tthis._updateFlags |= HAS_PENDING_UPDATE;\n\t\t\t\tthis.setState({});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t(this.base as Text).data = s.peek();\n\t\t};\n\n\t\treturn computed(() => {\n\t\t\tlet data = currentSignal.value;\n\t\t\tlet s = data.value;\n\t\t\treturn s === 0 ? 0 : s === true ? \"\" : s || \"\";\n\t\t});\n\t}, []);\n\n\treturn s.value;\n}\nSignalValue.displayName = \"_st\";\n\nObject.defineProperties(Signal.prototype, {\n\tconstructor: { configurable: true, value: undefined },\n\ttype: { configurable: true, value: SignalValue },\n\tprops: {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn { data: this };\n\t\t},\n\t},\n\t// Setting a VNode's _depth to 1 forces Preact to clone it before modifying:\n\t// https://github.com/preactjs/preact/blob/d7a433ee8463a7dc23a05111bb47de9ec729ad4d/src/diff/children.js#L77\n\t// @todo remove this for Preact 11\n\t__b: { configurable: true, value: 1 },\n});\n\n/** Inject low-level property/attribute bindings for Signals into Preact's diff */\nhook(OptionsTypes.DIFF, (old, vnode) => {\n\tif (typeof vnode.type === \"string\") {\n\t\tlet signalProps: Record | undefined;\n\n\t\tlet props = vnode.props;\n\t\tfor (let i in props) {\n\t\t\tif (i === \"children\") continue;\n\n\t\t\tlet value = props[i];\n\t\t\tif (value instanceof Signal) {\n\t\t\t\tif (!signalProps) vnode.__np = signalProps = {};\n\t\t\t\tsignalProps[i] = value;\n\t\t\t\tprops[i] = value.peek();\n\t\t\t}\n\t\t}\n\t}\n\n\told(vnode);\n});\n\n/** Set up Updater before rendering a component */\nhook(OptionsTypes.RENDER, (old, vnode) => {\n\tsetCurrentUpdater();\n\n\tlet updater;\n\n\tlet component = vnode.__c;\n\tif (component) {\n\t\tcomponent._updateFlags &= ~HAS_PENDING_UPDATE;\n\n\t\tupdater = component._updater;\n\t\tif (updater === undefined) {\n\t\t\tcomponent._updater = updater = createUpdater(() => {\n\t\t\t\tcomponent._updateFlags |= HAS_PENDING_UPDATE;\n\t\t\t\tcomponent.setState({});\n\t\t\t});\n\t\t}\n\t}\n\n\tcurrentComponent = component;\n\tsetCurrentUpdater(updater);\n\told(vnode);\n});\n\n/** Finish current updater if a component errors */\nhook(OptionsTypes.CATCH_ERROR, (old, error, vnode, oldVNode) => {\n\tsetCurrentUpdater();\n\tcurrentComponent = undefined;\n\told(error, vnode, oldVNode);\n});\n\n/** Finish current updater after rendering any VNode */\nhook(OptionsTypes.DIFFED, (old, vnode) => {\n\tsetCurrentUpdater();\n\tcurrentComponent = undefined;\n\n\tlet dom: Element;\n\n\t// vnode._dom is undefined during string rendering,\n\t// so we use this to skip prop subscriptions during SSR.\n\tif (typeof vnode.type === \"string\" && (dom = vnode.__e as Element)) {\n\t\tlet props = vnode.__np;\n\t\tlet renderedProps = vnode.props;\n\t\tif (props) {\n\t\t\tlet updaters = dom._updaters;\n\t\t\tif (updaters) {\n\t\t\t\tfor (let prop in updaters) {\n\t\t\t\t\tlet updater = updaters[prop];\n\t\t\t\t\tif (updater !== undefined && !(prop in props)) {\n\t\t\t\t\t\tupdater._dispose();\n\t\t\t\t\t\t// @todo we could just always invoke _dispose() here\n\t\t\t\t\t\tupdaters[prop] = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tupdaters = {};\n\t\t\t\tdom._updaters = updaters;\n\t\t\t}\n\t\t\tfor (let prop in props) {\n\t\t\t\tlet updater = updaters[prop];\n\t\t\t\tlet signal = props[prop];\n\t\t\t\tif (updater === undefined) {\n\t\t\t\t\tupdater = createPropUpdater(dom, prop, signal, renderedProps);\n\t\t\t\t\tupdaters[prop] = updater;\n\t\t\t\t} else {\n\t\t\t\t\tupdater._update(signal, renderedProps);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\told(vnode);\n});\n\nfunction createPropUpdater(\n\tdom: Element,\n\tprop: string,\n\tpropSignal: Signal,\n\tprops: Record\n): PropertyUpdater {\n\tconst setAsProperty =\n\t\tprop in dom &&\n\t\t// SVG elements need to go through `setAttribute` because they\n\t\t// expect things like SVGAnimatedTransformList instead of strings.\n\t\t// @ts-ignore\n\t\tdom.ownerSVGElement === undefined;\n\n\tconst changeSignal = signal(propSignal);\n\treturn {\n\t\t_update: (newSignal: Signal, newProps: typeof props) => {\n\t\t\tchangeSignal.value = newSignal;\n\t\t\tprops = newProps;\n\t\t},\n\t\t_dispose: effect(() => {\n\t\t\tconst value = changeSignal.value.value;\n\t\t\t// If Preact just rendered this value, don't render it again:\n\t\t\tif (props[prop] === value) return;\n\t\t\tprops[prop] = value;\n\t\t\tif (setAsProperty) {\n\t\t\t\t// @ts-ignore-next-line silly\n\t\t\t\tdom[prop] = value;\n\t\t\t} else if (value) {\n\t\t\t\tdom.setAttribute(prop, value);\n\t\t\t} else {\n\t\t\t\tdom.removeAttribute(prop);\n\t\t\t}\n\t\t}),\n\t};\n}\n\n/** Unsubscribe from Signals when unmounting components/vnodes */\nhook(OptionsTypes.UNMOUNT, (old, vnode: VNode) => {\n\tif (typeof vnode.type === \"string\") {\n\t\tlet dom = vnode.__e as Element | undefined;\n\t\t// vnode._dom is undefined during string rendering\n\t\tif (dom) {\n\t\t\tconst updaters = dom._updaters;\n\t\t\tif (updaters) {\n\t\t\t\tdom._updaters = undefined;\n\t\t\t\tfor (let prop in updaters) {\n\t\t\t\t\tlet updater = updaters[prop];\n\t\t\t\t\tif (updater) updater._dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tlet component = vnode.__c;\n\t\tif (component) {\n\t\t\tconst updater = component._updater;\n\t\t\tif (updater) {\n\t\t\t\tcomponent._updater = undefined;\n\t\t\t\tupdater._dispose();\n\t\t\t}\n\t\t}\n\t}\n\told(vnode);\n});\n\n/** Mark components that use hook state so we can skip sCU optimization. */\nhook(OptionsTypes.HOOK, (old, component, index, type) => {\n\tif (type < 3 || type === 9)\n\t\t(component as AugmentedComponent)._updateFlags |= HAS_HOOK_STATE;\n\told(component, index, type);\n});\n\n/**\n * Auto-memoize components that use Signals/Computeds.\n * Note: Does _not_ optimize components that use hook/class state.\n */\nComponent.prototype.shouldComponentUpdate = function (\n\tthis: AugmentedComponent,\n\tprops,\n\tstate\n) {\n\t// @todo: Once preactjs/preact#3671 lands, this could just use `currentUpdater`:\n\tconst updater = this._updater;\n\tconst hasSignals = updater && updater._sources !== undefined;\n\n\t// let reason;\n\t// if (!hasSignals && !hasComputeds.has(this)) {\n\t// \treason = \"no signals or computeds\";\n\t// } else if (hasPendingUpdate.has(this)) {\n\t// \treason = \"has pending update\";\n\t// } else if (hasHookState.has(this)) {\n\t// \treason = \"has hook state\";\n\t// }\n\t// if (reason) {\n\t// \tif (!this) reason += \" (`this` bug)\";\n\t// \tconsole.log(\"not optimizing\", this?.constructor?.name, \": \", reason, {\n\t// \t\tdetails: {\n\t// \t\t\thasSignals,\n\t// \t\t\thasComputeds: hasComputeds.has(this),\n\t// \t\t\thasPendingUpdate: hasPendingUpdate.has(this),\n\t// \t\t\thasHookState: hasHookState.has(this),\n\t// \t\t\tdeps: Array.from(updater._deps),\n\t// \t\t\tupdater,\n\t// \t\t},\n\t// \t});\n\t// }\n\n\t// if this component used no signals or computeds, update:\n\tif (!hasSignals && !(this._updateFlags & HAS_COMPUTEDS)) return true;\n\n\t// if there is a pending re-render triggered from Signals,\n\t// or if there is hook or class state, update:\n\tif (this._updateFlags & (HAS_PENDING_UPDATE | HAS_HOOK_STATE)) return true;\n\n\t// @ts-ignore\n\tfor (let i in state) return true;\n\n\t// if any non-Signal props changed, update:\n\tfor (let i in props) {\n\t\tif (i !== \"__source\" && props[i] !== this.props[i]) return true;\n\t}\n\tfor (let i in this.props) if (!(i in props)) return true;\n\n\t// this is a purely Signal-driven component, don't update:\n\treturn false;\n};\n\nexport function useSignal(value: T) {\n\treturn useMemo(() => signal(value), []);\n}\n\nexport function useComputed(compute: () => T) {\n\tconst $compute = useRef(compute);\n\t$compute.current = compute;\n\t(currentComponent as AugmentedComponent)._updateFlags |= HAS_COMPUTEDS;\n\treturn useMemo(() => computed(() => $compute.current()), []);\n}\n\nexport function useSignalEffect(cb: () => void | (() => void)) {\n\tconst callback = useRef(cb);\n\tcallback.current = cb;\n\n\tuseEffect(() => {\n\t\treturn effect(() => callback.current());\n\t}, []);\n}\n\n/**\n * @todo Determine which Reactive implementation we'll be using.\n * @internal\n */\n// export function useReactive(value: T): Reactive {\n// \treturn useMemo(() => reactive(value), []);\n// }\n\n/**\n * @internal\n * Update a Reactive's using the properties of an object or other Reactive.\n * Also works for Signals.\n * @example\n * // Update a Reactive with Object.assign()-like syntax:\n * const r = reactive({ name: \"Alice\" });\n * update(r, { name: \"Bob\" });\n * update(r, { age: 42 }); // property 'age' does not exist in type '{ name?: string }'\n * update(r, 2); // '2' has no properties in common with '{ name?: string }'\n * console.log(r.name.value); // \"Bob\"\n *\n * @example\n * // Update a Reactive with the properties of another Reactive:\n * const A = reactive({ name: \"Alice\" });\n * const B = reactive({ name: \"Bob\", age: 42 });\n * update(A, B);\n * console.log(`${A.name} is ${A.age}`); // \"Bob is 42\"\n *\n * @example\n * // Update a signal with assign()-like syntax:\n * const s = signal(42);\n * update(s, \"hi\"); // Argument type 'string' not assignable to type 'number'\n * update(s, {}); // Argument type '{}' not assignable to type 'number'\n * update(s, 43);\n * console.log(s.value); // 43\n *\n * @param obj The Reactive or Signal to be updated\n * @param update The value, Signal, object or Reactive to update `obj` to match\n * @param overwrite If `true`, any properties `obj` missing from `update` are set to `undefined`\n */\n/*\nexport function update(\n\tobj: T,\n\tupdate: Partial>,\n\toverwrite = false\n) {\n\tif (obj instanceof Signal) {\n\t\tobj.value = peekValue(update);\n\t} else {\n\t\tfor (let i in update) {\n\t\t\tif (i in obj) {\n\t\t\t\tobj[i].value = peekValue(update[i]);\n\t\t\t} else {\n\t\t\t\tlet sig = signal(peekValue(update[i]));\n\t\t\t\tsig[KEY] = i;\n\t\t\t\tobj[i] = sig;\n\t\t\t}\n\t\t}\n\t\tif (overwrite) {\n\t\t\tfor (let i in obj) {\n\t\t\t\tif (!(i in update)) {\n\t\t\t\t\tobj[i].value = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n*/\n","const namespaceStack: string[] = [];\n\nexport const getNamespace = () => namespaceStack.slice( -1 )[ 0 ];\n\nexport const setNamespace = ( namespace: string ) => {\n\tnamespaceStack.push( namespace );\n};\nexport const resetNamespace = () => {\n\tnamespaceStack.pop();\n};\n","/**\n * External dependencies\n */\nimport type { h as createElement, RefObject } from 'preact';\n\n/**\n * Internal dependencies\n */\nimport { getNamespace } from './namespaces';\nimport type { Evaluate } from './hooks';\n\nexport interface Scope {\n\tevaluate: Evaluate;\n\tcontext: object;\n\tserverContext: object;\n\tref: RefObject< HTMLElement >;\n\tattributes: createElement.JSX.HTMLAttributes;\n}\n\n// Store stacks for the current scope and the default namespaces and export APIs\n// to interact with them.\nconst scopeStack: Scope[] = [];\n\nexport const getScope = () => scopeStack.slice( -1 )[ 0 ];\n\nexport const setScope = ( scope: Scope ) => {\n\tscopeStack.push( scope );\n};\nexport const resetScope = () => {\n\tscopeStack.pop();\n};\n\n// Wrap the element props to prevent modifications.\nconst immutableMap = new WeakMap();\nconst immutableError = () => {\n\tthrow new Error(\n\t\t'Please use `data-wp-bind` to modify the attributes of an element.'\n\t);\n};\nconst immutableHandlers: ProxyHandler< object > = {\n\tget( target, key, receiver ) {\n\t\tconst value = Reflect.get( target, key, receiver );\n\t\treturn !! value && typeof value === 'object'\n\t\t\t? deepImmutable( value )\n\t\t\t: value;\n\t},\n\tset: immutableError,\n\tdeleteProperty: immutableError,\n};\nconst deepImmutable = < T extends object = {} >( target: T ): T => {\n\tif ( ! immutableMap.has( target ) ) {\n\t\timmutableMap.set( target, new Proxy( target, immutableHandlers ) );\n\t}\n\treturn immutableMap.get( target );\n};\n\n/**\n * Retrieves the context inherited by the element evaluating a function from the\n * store. The returned value depends on the element and the namespace where the\n * function calling `getContext()` exists.\n *\n * @param namespace Store namespace. By default, the namespace where the calling\n * function exists is used.\n * @return The context content.\n */\nexport const getContext = < T extends object >( namespace?: string ): T => {\n\tconst scope = getScope();\n\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\tif ( ! scope ) {\n\t\t\tthrow Error(\n\t\t\t\t'Cannot call `getContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.'\n\t\t\t);\n\t\t}\n\t}\n\treturn scope.context[ namespace || getNamespace() ];\n};\n\n/**\n * Retrieves a representation of the element where a function from the store\n * is being evalutated. Such representation is read-only, and contains a\n * reference to the DOM element, its props and a local reactive state.\n *\n * @return Element representation.\n */\nexport const getElement = () => {\n\tconst scope = getScope();\n\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\tif ( ! scope ) {\n\t\t\tthrow Error(\n\t\t\t\t'Cannot call `getElement()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.'\n\t\t\t);\n\t\t}\n\t}\n\tconst { ref, attributes } = scope;\n\treturn Object.freeze( {\n\t\tref: ref.current,\n\t\tattributes: deepImmutable( attributes ),\n\t} );\n};\n\n/**\n * Retrieves the part of the inherited context defined and updated from the\n * server.\n *\n * The object returned is read-only, and includes the context defined in PHP\n * with `wp_interactivity_data_wp_context()`, including the corresponding\n * inherited properties. When `actions.navigate()` is called, this object is\n * updated to reflect the changes in the new visited page, without affecting the\n * context returned by `getContext()`. Directives can subscribe to those changes\n * to update the context if needed.\n *\n * @example\n * ```js\n * store('...', {\n * callbacks: {\n * updateServerContext() {\n * const context = getContext();\n * const serverContext = getServerContext();\n * // Override some property with the new value that came from the server.\n * context.overridableProp = serverContext.overridableProp;\n * },\n * },\n * });\n * ```\n *\n * @param namespace Store namespace. By default, the namespace where the calling\n * function exists is used.\n * @return The server context content.\n */\nexport const getServerContext = < T extends object >(\n\tnamespace?: string\n): T => {\n\tconst scope = getScope();\n\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\tif ( ! scope ) {\n\t\t\tthrow Error(\n\t\t\t\t'Cannot call `getServerContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.'\n\t\t\t);\n\t\t}\n\t}\n\treturn scope.serverContext[ namespace || getNamespace() ];\n};\n","/**\n * External dependencies\n */\nimport {\n\tuseMemo as _useMemo,\n\tuseCallback as _useCallback,\n\tuseEffect as _useEffect,\n\tuseLayoutEffect as _useLayoutEffect,\n\ttype EffectCallback,\n\ttype Inputs,\n} from 'preact/hooks';\nimport { effect } from '@preact/signals';\n\n/**\n * Internal dependencies\n */\nimport { getScope, setScope, resetScope } from './scopes';\nimport { getNamespace, setNamespace, resetNamespace } from './namespaces';\n\ninterface Flusher {\n\treadonly flush: () => void;\n\treadonly dispose: () => void;\n}\n\n/**\n * Executes a callback function after the next frame is rendered.\n *\n * @param callback The callback function to be executed.\n * @return A promise that resolves after the callback function is executed.\n */\nconst afterNextFrame = ( callback: () => void ) => {\n\treturn new Promise< void >( ( resolve ) => {\n\t\tconst done = () => {\n\t\t\tclearTimeout( timeout );\n\t\t\twindow.cancelAnimationFrame( raf );\n\t\t\tsetTimeout( () => {\n\t\t\t\tcallback();\n\t\t\t\tresolve();\n\t\t\t} );\n\t\t};\n\t\tconst timeout = setTimeout( done, 100 );\n\t\tconst raf = window.requestAnimationFrame( done );\n\t} );\n};\n\n/**\n * Returns a promise that resolves after yielding to main.\n *\n * @return Promise\n */\nexport const splitTask = () => {\n\treturn new Promise( ( resolve ) => {\n\t\t// TODO: Use scheduler.yield() when available.\n\t\tsetTimeout( resolve, 0 );\n\t} );\n};\n\n/**\n * Creates a Flusher object that can be used to flush computed values and notify listeners.\n *\n * Using the mangled properties:\n * this.c: this._callback\n * this.x: this._compute\n * https://github.com/preactjs/signals/blob/main/mangle.json\n *\n * @param compute The function that computes the value to be flushed.\n * @param notify The function that notifies listeners when the value is flushed.\n * @return The Flusher object with `flush` and `dispose` properties.\n */\nfunction createFlusher( compute: () => unknown, notify: () => void ): Flusher {\n\tlet flush: () => void = () => undefined;\n\tconst dispose = effect( function ( this: any ) {\n\t\tflush = this.c.bind( this );\n\t\tthis.x = compute;\n\t\tthis.c = notify;\n\t\treturn compute();\n\t} );\n\treturn { flush, dispose } as const;\n}\n\n/**\n * Custom hook that executes a callback function whenever a signal is triggered.\n * Version of `useSignalEffect` with a `useEffect`-like execution. This hook\n * implementation comes from this PR, but we added short-cirtuiting to avoid\n * infinite loops: https://github.com/preactjs/signals/pull/290\n *\n * @param callback The callback function to be executed.\n */\nexport function useSignalEffect( callback: () => unknown ) {\n\t_useEffect( () => {\n\t\tlet eff: Flusher | null = null;\n\t\tlet isExecuting = false;\n\n\t\tconst notify = async () => {\n\t\t\tif ( eff && ! isExecuting ) {\n\t\t\t\tisExecuting = true;\n\t\t\t\tawait afterNextFrame( eff.flush );\n\t\t\t\tisExecuting = false;\n\t\t\t}\n\t\t};\n\n\t\teff = createFlusher( callback, notify );\n\t\treturn eff.dispose;\n\t}, [] );\n}\n\n/**\n * Returns the passed function wrapped with the current scope so it is\n * accessible whenever the function runs. This is primarily to make the scope\n * available inside hook callbacks.\n *\n * Asyncronous functions should use generators that yield promises instead of awaiting them.\n * See the documentation for details: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#the-store\n *\n * @param func The passed function.\n * @return The wrapped function.\n */\nexport function withScope<\n\tFunc extends ( ...args: any[] ) => Generator< any, any >,\n>(\n\tfunc: Func\n): (\n\t...args: Parameters< Func >\n) => ReturnType< Func > extends Generator< any, infer Return >\n\t? Promise< Return >\n\t: never;\nexport function withScope< Func extends Function >( func: Func ): Func;\nexport function withScope( func: ( ...args: unknown[] ) => unknown ) {\n\tconst scope = getScope();\n\tconst ns = getNamespace();\n\tif ( func?.constructor?.name === 'GeneratorFunction' ) {\n\t\treturn async ( ...args: Parameters< typeof func > ) => {\n\t\t\tconst gen = func( ...args ) as Generator;\n\t\t\tlet value: any;\n\t\t\tlet it: any;\n\t\t\twhile ( true ) {\n\t\t\t\tsetNamespace( ns );\n\t\t\t\tsetScope( scope );\n\t\t\t\ttry {\n\t\t\t\t\tit = gen.next( value );\n\t\t\t\t} finally {\n\t\t\t\t\tresetScope();\n\t\t\t\t\tresetNamespace();\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvalue = await it.value;\n\t\t\t\t} catch ( e ) {\n\t\t\t\t\tsetNamespace( ns );\n\t\t\t\t\tsetScope( scope );\n\t\t\t\t\tgen.throw( e );\n\t\t\t\t} finally {\n\t\t\t\t\tresetScope();\n\t\t\t\t\tresetNamespace();\n\t\t\t\t}\n\n\t\t\t\tif ( it.done ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn value;\n\t\t};\n\t}\n\treturn ( ...args: Parameters< typeof func > ) => {\n\t\tsetNamespace( ns );\n\t\tsetScope( scope );\n\t\ttry {\n\t\t\treturn func( ...args );\n\t\t} finally {\n\t\t\tresetNamespace();\n\t\t\tresetScope();\n\t\t}\n\t};\n}\n\n/**\n * Accepts a function that contains imperative code which runs whenever any of\n * the accessed _reactive_ properties (e.g., values from the global state or the\n * context) is modified.\n *\n * This hook makes the element's scope available so functions like\n * `getElement()` and `getContext()` can be used inside the passed callback.\n *\n * @param callback The hook callback.\n */\nexport function useWatch( callback: () => unknown ) {\n\tuseSignalEffect( withScope( callback ) );\n}\n\n/**\n * Accepts a function that contains imperative code which runs only after the\n * element's first render, mainly useful for intialization logic.\n *\n * This hook makes the element's scope available so functions like\n * `getElement()` and `getContext()` can be used inside the passed callback.\n *\n * @param callback The hook callback.\n */\nexport function useInit( callback: EffectCallback ) {\n\t_useEffect( withScope( callback ), [] );\n}\n\n/**\n * Accepts a function that contains imperative, possibly effectful code. The\n * effects run after browser paint, without blocking it.\n *\n * This hook is equivalent to Preact's `useEffect` and makes the element's scope\n * available so functions like `getElement()` and `getContext()` can be used\n * inside the passed callback.\n *\n * @param callback Imperative function that can return a cleanup\n * function.\n * @param inputs If present, effect will only activate if the\n * values in the list change (using `===`).\n */\nexport function useEffect( callback: EffectCallback, inputs: Inputs ) {\n\t_useEffect( withScope( callback ), inputs );\n}\n\n/**\n * Accepts a function that contains imperative, possibly effectful code. Use\n * this to read layout from the DOM and synchronously re-render.\n *\n * This hook is equivalent to Preact's `useLayoutEffect` and makes the element's\n * scope available so functions like `getElement()` and `getContext()` can be\n * used inside the passed callback.\n *\n * @param callback Imperative function that can return a cleanup\n * function.\n * @param inputs If present, effect will only activate if the\n * values in the list change (using `===`).\n */\nexport function useLayoutEffect( callback: EffectCallback, inputs: Inputs ) {\n\t_useLayoutEffect( withScope( callback ), inputs );\n}\n\n/**\n * Returns a memoized version of the callback that only changes if one of the\n * inputs has changed (using `===`).\n *\n * This hook is equivalent to Preact's `useCallback` and makes the element's\n * scope available so functions like `getElement()` and `getContext()` can be\n * used inside the passed callback.\n *\n * @param callback Callback function.\n * @param inputs If present, the callback will only be updated if the\n * values in the list change (using `===`).\n *\n * @return The callback function.\n */\nexport function useCallback< T extends Function >(\n\tcallback: T,\n\tinputs: Inputs\n): T {\n\treturn _useCallback< T >( withScope( callback ), inputs );\n}\n\n/**\n * Pass a factory function and an array of inputs. `useMemo` will only recompute\n * the memoized value when one of the inputs has changed.\n *\n * This hook is equivalent to Preact's `useMemo` and makes the element's scope\n * available so functions like `getElement()` and `getContext()` can be used\n * inside the passed factory function.\n *\n * @param factory Factory function that returns that value for memoization.\n * @param inputs If present, the factory will only be run to recompute if\n * the values in the list change (using `===`).\n *\n * @return The memoized value.\n */\nexport function useMemo< T >( factory: () => T, inputs: Inputs ): T {\n\treturn _useMemo( withScope( factory ), inputs );\n}\n\n/**\n * Creates a root fragment by replacing a node or an array of nodes in a parent element.\n * For wrapperless hydration.\n * See https://gist.github.com/developit/f4c67a2ede71dc2fab7f357f39cff28c\n *\n * @param parent The parent element where the nodes will be replaced.\n * @param replaceNode The node or array of nodes to replace in the parent element.\n * @return The created root fragment.\n */\nexport const createRootFragment = (\n\tparent: Element,\n\treplaceNode: Node | Node[]\n) => {\n\treplaceNode = ( [] as Node[] ).concat( replaceNode );\n\tconst sibling = replaceNode[ replaceNode.length - 1 ].nextSibling;\n\tfunction insert( child: any, root: any ) {\n\t\tparent.insertBefore( child, root || sibling );\n\t}\n\treturn ( ( parent as any ).__k = {\n\t\tnodeType: 1,\n\t\tparentNode: parent,\n\t\tfirstChild: replaceNode[ 0 ],\n\t\tchildNodes: replaceNode,\n\t\tinsertBefore: insert,\n\t\tappendChild: insert,\n\t\tremoveChild( c: Node ) {\n\t\t\tparent.removeChild( c );\n\t\t},\n\t} );\n};\n\n/**\n * Transforms a kebab-case string to camelCase.\n *\n * @param str The kebab-case string to transform to camelCase.\n * @return The transformed camelCase string.\n */\nexport function kebabToCamelCase( str: string ): string {\n\treturn str\n\t\t.replace( /^-+|-+$/g, '' )\n\t\t.toLowerCase()\n\t\t.replace( /-([a-z])/g, function ( _match, group1: string ) {\n\t\t\treturn group1.toUpperCase();\n\t\t} );\n}\n\nconst logged: Set< string > = new Set();\n\n/**\n * Shows a warning with `message` if environment is not `production`.\n *\n * Based on the `@wordpress/warning` package.\n *\n * @param message Message to show in the warning.\n */\nexport const warn = ( message: string ): void => {\n\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\tif ( logged.has( message ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn( message );\n\n\t\t// Throwing an error and catching it immediately to improve debugging\n\t\t// A consumer can use 'pause on caught exceptions'\n\t\ttry {\n\t\t\tthrow Error( message );\n\t\t} catch ( e ) {\n\t\t\t// Do nothing.\n\t\t}\n\t\tlogged.add( message );\n\t}\n};\n\n/**\n * Checks if the passed `candidate` is a plain object with just the `Object`\n * prototype.\n *\n * @param candidate The item to check.\n * @return Whether `candidate` is a plain object.\n */\nexport const isPlainObject = (\n\tcandidate: unknown\n): candidate is Record< string, unknown > =>\n\tBoolean(\n\t\tcandidate &&\n\t\t\ttypeof candidate === 'object' &&\n\t\t\tcandidate.constructor === Object\n\t);\n","/**\n * Proxies for each object.\n */\nconst objToProxy = new WeakMap< object, object >();\nconst proxyToObj = new WeakMap< object, object >();\n\n/**\n * Namespaces for each created proxy.\n */\nconst proxyToNs = new WeakMap< object, string >();\n\n/**\n * Object types that can be proxied.\n */\nconst supported = new Set( [ Object, Array ] );\n\n/**\n * Returns a proxy to the passed object with the given handlers, assigning the\n * specified namespace to it. If a proxy for the passed object was created\n * before, that proxy is returned.\n *\n * @param namespace The namespace that will be associated to this proxy.\n * @param obj The object to proxify.\n * @param handlers Handlers that the proxy will use.\n *\n * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to\n * check if a proxy can be created for a specific object.\n *\n * @return The created proxy.\n */\nexport const createProxy = < T extends object >(\n\tnamespace: string,\n\tobj: T,\n\thandlers: ProxyHandler< T >\n): T => {\n\tif ( ! shouldProxy( obj ) ) {\n\t\tthrow Error( 'This object cannot be proxified.' );\n\t}\n\tif ( ! objToProxy.has( obj ) ) {\n\t\tconst proxy = new Proxy( obj, handlers );\n\t\tobjToProxy.set( obj, proxy );\n\t\tproxyToObj.set( proxy, obj );\n\t\tproxyToNs.set( proxy, namespace );\n\t}\n\treturn objToProxy.get( obj ) as T;\n};\n\n/**\n * Returns the proxy for the given object. If there is no associated proxy, the\n * function returns `undefined`.\n *\n * @param obj Object from which to know the proxy.\n * @return Associated proxy or `undefined`.\n */\nexport const getProxyFromObject = < T extends object >(\n\tobj: T\n): T | undefined => objToProxy.get( obj ) as T;\n\n/**\n * Gets the namespace associated with the given proxy.\n *\n * Proxies have a namespace assigned upon creation. See {@link createProxy}.\n *\n * @param proxy Proxy.\n * @return Namespace.\n */\nexport const getNamespaceFromProxy = ( proxy: object ): string =>\n\tproxyToNs.get( proxy )!;\n\n/**\n * Checks if a given object can be proxied.\n *\n * @param candidate Object to know whether it can be proxied.\n * @return True if the passed instance can be proxied.\n */\nexport const shouldProxy = (\n\tcandidate: any\n): candidate is Object | Array< unknown > => {\n\tif ( typeof candidate !== 'object' || candidate === null ) {\n\t\treturn false;\n\t}\n\treturn (\n\t\t! proxyToNs.has( candidate ) && supported.has( candidate.constructor )\n\t);\n};\n\n/**\n * Returns the target object for the passed proxy. If the passed object is not a registered proxy, the\n * function returns `undefined`.\n *\n * @param proxy Proxy from which to know the target.\n * @return The target object or `undefined`.\n */\nexport const getObjectFromProxy = < T extends object >(\n\tproxy: T\n): T | undefined => proxyToObj.get( proxy ) as T;\n","/**\n * External dependencies\n */\nimport {\n\tcomputed,\n\tsignal,\n\tbatch,\n\ttype Signal,\n\ttype ReadonlySignal,\n} from '@preact/signals';\n\n/**\n * Internal dependencies\n */\nimport { getNamespaceFromProxy } from './registry';\nimport { getScope } from '../scopes';\nimport { setNamespace, resetNamespace } from '../namespaces';\nimport { withScope } from '../utils';\n\n/**\n * Identifier for property computeds not associated to any scope.\n */\nconst NO_SCOPE = {};\n\n/**\n * Structure that manages reactivity for a property in a state object. It uses\n * signals to keep track of property value or getter modifications.\n */\nexport class PropSignal {\n\t/**\n\t * Proxy that holds the property this PropSignal is associated with.\n\t */\n\tprivate owner: object;\n\n\t/**\n\t * Relation of computeds by scope. These computeds are read-only signals\n\t * that depend on whether the property is a value or a getter and,\n\t * therefore, can return different values depending on the scope in which\n\t * the getter is accessed.\n\t */\n\tprivate computedsByScope: WeakMap< WeakKey, ReadonlySignal >;\n\n\t/**\n\t * Signal with the value assigned to the related property.\n\t */\n\tprivate valueSignal?: Signal;\n\n\t/**\n\t * Signal with the getter assigned to the related property.\n\t */\n\tprivate getterSignal?: Signal< ( () => any ) | undefined >;\n\n\t/**\n\t * Structure that manages reactivity for a property in a state object, using\n\t * signals to keep track of property value or getter modifications.\n\t *\n\t * @param owner Proxy that holds the property this instance is associated\n\t * with.\n\t */\n\tconstructor( owner: object ) {\n\t\tthis.owner = owner;\n\t\tthis.computedsByScope = new WeakMap();\n\t}\n\n\t/**\n\t * Changes the internal value. If a getter was set before, it is set to\n\t * `undefined`.\n\t *\n\t * @param value New value.\n\t */\n\tpublic setValue( value: unknown ) {\n\t\tthis.update( { value } );\n\t}\n\n\t/**\n\t * Changes the internal getter. If a value was set before, it is set to\n\t * `undefined`.\n\t *\n\t * @param getter New getter.\n\t */\n\tpublic setGetter( getter: () => any ) {\n\t\tthis.update( { get: getter } );\n\t}\n\n\t/**\n\t * Returns the computed that holds the result of evaluating the prop in the\n\t * current scope.\n\t *\n\t * These computeds are read-only signals that depend on whether the property\n\t * is a value or a getter and, therefore, can return different values\n\t * depending on the scope in which the getter is accessed.\n\t *\n\t * @return Computed that depends on the scope.\n\t */\n\tpublic getComputed(): ReadonlySignal {\n\t\tconst scope = getScope() || NO_SCOPE;\n\n\t\tif ( ! this.valueSignal && ! this.getterSignal ) {\n\t\t\tthis.update( {} );\n\t\t}\n\n\t\tif ( ! this.computedsByScope.has( scope ) ) {\n\t\t\tconst callback = () => {\n\t\t\t\tconst getter = this.getterSignal?.value;\n\t\t\t\treturn getter\n\t\t\t\t\t? getter.call( this.owner )\n\t\t\t\t\t: this.valueSignal?.value;\n\t\t\t};\n\n\t\t\tsetNamespace( getNamespaceFromProxy( this.owner ) );\n\t\t\tthis.computedsByScope.set(\n\t\t\t\tscope,\n\t\t\t\tcomputed( withScope( callback ) )\n\t\t\t);\n\t\t\tresetNamespace();\n\t\t}\n\n\t\treturn this.computedsByScope.get( scope )!;\n\t}\n\n\t/**\n\t * Update the internal signals for the value and the getter of the\n\t * corresponding prop.\n\t *\n\t * @param param0\n\t * @param param0.get New getter.\n\t * @param param0.value New value.\n\t */\n\tprivate update( { get, value }: { get?: () => any; value?: unknown } ) {\n\t\tif ( ! this.valueSignal ) {\n\t\t\tthis.valueSignal = signal( value );\n\t\t\tthis.getterSignal = signal( get );\n\t\t} else if (\n\t\t\tvalue !== this.valueSignal.peek() ||\n\t\t\tget !== this.getterSignal!.peek()\n\t\t) {\n\t\t\tbatch( () => {\n\t\t\t\tthis.valueSignal!.value = value;\n\t\t\t\tthis.getterSignal!.value = get;\n\t\t\t} );\n\t\t}\n\t}\n}\n","/**\n * External dependencies\n */\nimport { batch, signal, type Signal } from '@preact/signals';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcreateProxy,\n\tgetProxyFromObject,\n\tgetNamespaceFromProxy,\n\tshouldProxy,\n\tgetObjectFromProxy,\n} from './registry';\nimport { PropSignal } from './signals';\nimport { setNamespace, resetNamespace } from '../namespaces';\nimport { isPlainObject } from '../utils';\n\n/**\n * Set of built-in symbols.\n */\nconst wellKnownSymbols = new Set(\n\tObject.getOwnPropertyNames( Symbol )\n\t\t.map( ( key ) => Symbol[ key ] )\n\t\t.filter( ( value ) => typeof value === 'symbol' )\n);\n\n/**\n * Relates each proxy with a map of {@link PropSignal} instances, representing\n * the proxy's accessed properties.\n */\nconst proxyToProps: WeakMap<\n\tobject,\n\tMap< string | symbol, PropSignal >\n> = new WeakMap();\n\n/**\n * Checks wether a {@link PropSignal | `PropSignal`} instance exists for the\n * given property in the passed proxy.\n *\n * @param proxy Proxy of a state object or array.\n * @param key The property key.\n * @return `true` when it exists; false otherwise.\n */\nexport const hasPropSignal = ( proxy: object, key: string ) =>\n\tproxyToProps.has( proxy ) && proxyToProps.get( proxy )!.has( key );\n\nconst readOnlyProxies = new WeakSet();\n\n/**\n * Returns the {@link PropSignal | `PropSignal`} instance associated with the\n * specified prop in the passed proxy.\n *\n * The `PropSignal` instance is generated if it doesn't exist yet, using the\n * `initial` parameter to initialize the internal signals.\n *\n * @param proxy Proxy of a state object or array.\n * @param key The property key.\n * @param initial Initial data for the `PropSignal` instance.\n * @return The `PropSignal` instance.\n */\nconst getPropSignal = (\n\tproxy: object,\n\tkey: string | number | symbol,\n\tinitial?: PropertyDescriptor\n) => {\n\tif ( ! proxyToProps.has( proxy ) ) {\n\t\tproxyToProps.set( proxy, new Map() );\n\t}\n\tkey = typeof key === 'number' ? `${ key }` : key;\n\tconst props = proxyToProps.get( proxy )!;\n\tif ( ! props.has( key ) ) {\n\t\tconst ns = getNamespaceFromProxy( proxy );\n\t\tconst prop = new PropSignal( proxy );\n\t\tprops.set( key, prop );\n\t\tif ( initial ) {\n\t\t\tconst { get, value } = initial;\n\t\t\tif ( get ) {\n\t\t\t\tprop.setGetter( get );\n\t\t\t} else {\n\t\t\t\tconst readOnly = readOnlyProxies.has( proxy );\n\t\t\t\tprop.setValue(\n\t\t\t\t\tshouldProxy( value )\n\t\t\t\t\t\t? proxifyState( ns, value, { readOnly } )\n\t\t\t\t\t\t: value\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\treturn props.get( key )!;\n};\n\n/**\n * Relates each proxied object (i.e., the original object) with a signal that\n * tracks changes in the number of properties.\n */\nconst objToIterable = new WeakMap< object, Signal< number > >();\n\n/**\n * When this flag is `true`, it avoids any signal subscription, overriding state\n * props' \"reactive\" behavior.\n */\nlet peeking = false;\n\n/**\n * Handlers for reactive objects and arrays in the state.\n */\nconst stateHandlers: ProxyHandler< object > = {\n\tget( target: object, key: string | symbol, receiver: object ): any {\n\t\t/*\n\t\t * The property should not be reactive for the following cases:\n\t\t * 1. While using the `peek` function to read the property.\n\t\t * 2. The property exists but comes from the Object or Array prototypes.\n\t\t * 3. The property key is a known symbol.\n\t\t */\n\t\tif (\n\t\t\tpeeking ||\n\t\t\t( ! target.hasOwnProperty( key ) && key in target ) ||\n\t\t\t( typeof key === 'symbol' && wellKnownSymbols.has( key ) )\n\t\t) {\n\t\t\treturn Reflect.get( target, key, receiver );\n\t\t}\n\n\t\t// At this point, the property should be reactive.\n\t\tconst desc = Object.getOwnPropertyDescriptor( target, key );\n\t\tconst prop = getPropSignal( receiver, key, desc );\n\t\tconst result = prop.getComputed().value;\n\n\t\t/*\n\t\t * Check if the property is a synchronous function. If it is, set the\n\t\t * default namespace. Synchronous functions always run in the proper scope,\n\t\t * which is set by the Directives component.\n\t\t */\n\t\tif ( typeof result === 'function' ) {\n\t\t\tconst ns = getNamespaceFromProxy( receiver );\n\t\t\treturn ( ...args: unknown[] ) => {\n\t\t\t\tsetNamespace( ns );\n\t\t\t\ttry {\n\t\t\t\t\treturn result.call( receiver, ...args );\n\t\t\t\t} finally {\n\t\t\t\t\tresetNamespace();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\treturn result;\n\t},\n\n\tset(\n\t\ttarget: object,\n\t\tkey: string,\n\t\tvalue: unknown,\n\t\treceiver: object\n\t): boolean {\n\t\tif ( readOnlyProxies.has( receiver ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tsetNamespace( getNamespaceFromProxy( receiver ) );\n\t\ttry {\n\t\t\treturn Reflect.set( target, key, value, receiver );\n\t\t} finally {\n\t\t\tresetNamespace();\n\t\t}\n\t},\n\n\tdefineProperty(\n\t\ttarget: object,\n\t\tkey: string,\n\t\tdesc: PropertyDescriptor\n\t): boolean {\n\t\tif ( readOnlyProxies.has( getProxyFromObject( target )! ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst isNew = ! ( key in target );\n\t\tconst result = Reflect.defineProperty( target, key, desc );\n\n\t\tif ( result ) {\n\t\t\tconst receiver = getProxyFromObject( target )!;\n\t\t\tconst prop = getPropSignal( receiver, key );\n\t\t\tconst { get, value } = desc;\n\t\t\tif ( get ) {\n\t\t\t\tprop.setGetter( get );\n\t\t\t} else {\n\t\t\t\tconst ns = getNamespaceFromProxy( receiver );\n\t\t\t\tprop.setValue(\n\t\t\t\t\tshouldProxy( value ) ? proxifyState( ns, value ) : value\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( isNew && objToIterable.has( target ) ) {\n\t\t\t\tobjToIterable.get( target )!.value++;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Modify the `length` property value only if the related\n\t\t\t * `PropSignal` exists, which means that there are subscriptions to\n\t\t\t * this property.\n\t\t\t */\n\t\t\tif (\n\t\t\t\tArray.isArray( target ) &&\n\t\t\t\tproxyToProps.get( receiver )?.has( 'length' )\n\t\t\t) {\n\t\t\t\tconst length = getPropSignal( receiver, 'length' );\n\t\t\t\tlength.setValue( target.length );\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t},\n\n\tdeleteProperty( target: object, key: string ): boolean {\n\t\tif ( readOnlyProxies.has( getProxyFromObject( target )! ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst result = Reflect.deleteProperty( target, key );\n\n\t\tif ( result ) {\n\t\t\tconst prop = getPropSignal( getProxyFromObject( target )!, key );\n\t\t\tprop.setValue( undefined );\n\n\t\t\tif ( objToIterable.has( target ) ) {\n\t\t\t\tobjToIterable.get( target )!.value++;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t},\n\n\townKeys( target: object ): ( string | symbol )[] {\n\t\tif ( ! objToIterable.has( target ) ) {\n\t\t\tobjToIterable.set( target, signal( 0 ) );\n\t\t}\n\t\t/*\n\t\t *This subscribes to the signal while preventing the minifier from\n\t\t * deleting this line in production.\n\t\t */\n\t\t( objToIterable as any )._ = objToIterable.get( target )!.value;\n\t\treturn Reflect.ownKeys( target );\n\t},\n};\n\n/**\n * Returns the proxy associated with the given state object, creating it if it\n * does not exist.\n *\n * @param namespace The namespace that will be associated to this proxy.\n * @param obj The object to proxify.\n * @param options Options.\n * @param options.readOnly Read-only.\n *\n * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to\n * check if a proxy can be created for a specific object.\n *\n * @return The associated proxy.\n */\nexport const proxifyState = < T extends object >(\n\tnamespace: string,\n\tobj: T,\n\toptions?: { readOnly?: boolean }\n): T => {\n\tconst proxy = createProxy( namespace, obj, stateHandlers ) as T;\n\tif ( options?.readOnly ) {\n\t\treadOnlyProxies.add( proxy );\n\t}\n\treturn proxy;\n};\n\n/**\n * Reads the value of the specified property without subscribing to it.\n *\n * @param obj The object to read the property from.\n * @param key The property key.\n * @return The property value.\n */\nexport const peek = < T extends object, K extends keyof T >(\n\tobj: T,\n\tkey: K\n): T[ K ] => {\n\tpeeking = true;\n\ttry {\n\t\treturn obj[ key ];\n\t} finally {\n\t\tpeeking = false;\n\t}\n};\n\n/**\n * Internal recursive implementation for {@link deepMerge | `deepMerge`}.\n *\n * @param target The target object.\n * @param source The source object containing new values and props.\n * @param override Whether existing props should be overwritten or not (`true`\n * by default).\n */\nconst deepMergeRecursive = (\n\ttarget: any,\n\tsource: any,\n\toverride: boolean = true\n) => {\n\tif ( isPlainObject( target ) && isPlainObject( source ) ) {\n\t\tlet hasNewKeys = false;\n\t\tfor ( const key in source ) {\n\t\t\tconst isNew = ! ( key in target );\n\t\t\thasNewKeys = hasNewKeys || isNew;\n\n\t\t\tconst desc = Object.getOwnPropertyDescriptor( source, key );\n\t\t\tif (\n\t\t\t\ttypeof desc?.get === 'function' ||\n\t\t\t\ttypeof desc?.set === 'function'\n\t\t\t) {\n\t\t\t\tif ( override || isNew ) {\n\t\t\t\t\tObject.defineProperty( target, key, {\n\t\t\t\t\t\t...desc,\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t} );\n\n\t\t\t\t\tconst proxy = getProxyFromObject( target );\n\t\t\t\t\tif ( desc?.get && proxy && hasPropSignal( proxy, key ) ) {\n\t\t\t\t\t\tconst propSignal = getPropSignal( proxy, key );\n\t\t\t\t\t\tpropSignal.setGetter( desc.get );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ( isPlainObject( source[ key ] ) ) {\n\t\t\t\tif ( isNew ) {\n\t\t\t\t\ttarget[ key ] = {};\n\t\t\t\t}\n\n\t\t\t\tdeepMergeRecursive( target[ key ], source[ key ], override );\n\t\t\t} else if ( override || isNew ) {\n\t\t\t\tObject.defineProperty( target, key, desc! );\n\n\t\t\t\tconst proxy = getProxyFromObject( target );\n\t\t\t\tif ( desc?.value && proxy && hasPropSignal( proxy, key ) ) {\n\t\t\t\t\tconst propSignal = getPropSignal( proxy, key );\n\t\t\t\t\tpropSignal.setValue( desc.value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( hasNewKeys && objToIterable.has( target ) ) {\n\t\t\tobjToIterable.get( target )!.value++;\n\t\t}\n\t}\n};\n\n/**\n * Recursively update prop values inside the passed `target` and nested plain\n * objects, using the values present in `source`. References to plain objects\n * are kept, only updating props containing primitives or arrays. Arrays are\n * replaced instead of merged or concatenated.\n *\n * If the `override` parameter is set to `false`, then all values in `target`\n * are preserved, and only new properties from `source` are added.\n *\n * @param target The target object.\n * @param source The source object containing new values and props.\n * @param override Whether existing props should be overwritten or not (`true`\n * by default).\n */\nexport const deepMerge = (\n\ttarget: any,\n\tsource: any,\n\toverride: boolean = true\n) =>\n\tbatch( () =>\n\t\tdeepMergeRecursive(\n\t\t\tgetObjectFromProxy( target ) || target,\n\t\t\tsource,\n\t\t\toverride\n\t\t)\n\t);\n","/**\n * Internal dependencies\n */\nimport { createProxy, getNamespaceFromProxy, shouldProxy } from './registry';\n/**\n * External dependencies\n */\nimport { setNamespace, resetNamespace } from '../namespaces';\nimport { withScope, isPlainObject } from '../utils';\n\n/**\n * Identifies the store proxies handling the root objects of each store.\n */\nconst storeRoots = new WeakSet();\n\n/**\n * Handlers for store proxies.\n */\nconst storeHandlers: ProxyHandler< object > = {\n\tget: ( target: any, key: string | symbol, receiver: any ) => {\n\t\tconst result = Reflect.get( target, key );\n\t\tconst ns = getNamespaceFromProxy( receiver );\n\n\t\t/*\n\t\t * Check if the proxy is the store root and no key with that name exist. In\n\t\t * that case, return an empty object for the requested key.\n\t\t */\n\t\tif ( typeof result === 'undefined' && storeRoots.has( receiver ) ) {\n\t\t\tconst obj = {};\n\t\t\tReflect.set( target, key, obj );\n\t\t\treturn proxifyStore( ns, obj, false );\n\t\t}\n\n\t\t/*\n\t\t * Check if the property is a function. If it is, add the store\n\t\t * namespace to the stack and wrap the function with the current scope.\n\t\t * The `withScope` util handles both synchronous functions and generator\n\t\t * functions.\n\t\t */\n\t\tif ( typeof result === 'function' ) {\n\t\t\tsetNamespace( ns );\n\t\t\tconst scoped = withScope( result );\n\t\t\tresetNamespace();\n\t\t\treturn scoped;\n\t\t}\n\n\t\t// Check if the property is an object. If it is, proxyify it.\n\t\tif ( isPlainObject( result ) && shouldProxy( result ) ) {\n\t\t\treturn proxifyStore( ns, result, false );\n\t\t}\n\n\t\treturn result;\n\t},\n};\n\n/**\n * Returns the proxy associated with the given store object, creating it if it\n * does not exist.\n *\n * @param namespace The namespace that will be associated to this proxy.\n * @param obj The object to proxify.\n *\n * @param isRoot Whether the passed object is the store root object.\n * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to\n * check if a proxy can be created for a specific object.\n *\n * @return The associated proxy.\n */\nexport const proxifyStore = < T extends object >(\n\tnamespace: string,\n\tobj: T,\n\tisRoot = true\n): T => {\n\tconst proxy = createProxy( namespace, obj, storeHandlers );\n\tif ( proxy && isRoot ) {\n\t\tstoreRoots.add( proxy );\n\t}\n\treturn proxy as T;\n};\n","const contextObjectToProxy = new WeakMap();\nconst contextObjectToFallback = new WeakMap();\nconst contextProxies = new WeakSet();\n\nconst descriptor = Reflect.getOwnPropertyDescriptor;\n\n// TODO: Use the proxy registry to avoid multiple proxies on the same object.\nconst contextHandlers: ProxyHandler< object > = {\n\tget: ( target, key ) => {\n\t\tconst fallback = contextObjectToFallback.get( target );\n\t\t// Always subscribe to prop changes in the current context.\n\t\tconst currentProp = target[ key ];\n\n\t\t/*\n\t\t * Return the value from `target` if it exists, or from `fallback`\n\t\t * otherwise. This way, in the case the property doesn't exist either in\n\t\t * `target` or `fallback`, it also subscribes to changes in the parent\n\t\t * context.\n\t\t */\n\t\treturn key in target ? currentProp : fallback[ key ];\n\t},\n\tset: ( target, key, value ) => {\n\t\tconst fallback = contextObjectToFallback.get( target );\n\n\t\t// If the property exists in the current context, modify it. Otherwise,\n\t\t// add it to the current context.\n\t\tconst obj = key in target || ! ( key in fallback ) ? target : fallback;\n\t\tobj[ key ] = value;\n\n\t\treturn true;\n\t},\n\townKeys: ( target ) => [\n\t\t...new Set( [\n\t\t\t...Object.keys( contextObjectToFallback.get( target ) ),\n\t\t\t...Object.keys( target ),\n\t\t] ),\n\t],\n\tgetOwnPropertyDescriptor: ( target, key ) =>\n\t\tdescriptor( target, key ) ||\n\t\tdescriptor( contextObjectToFallback.get( target ), key ),\n};\n\n/**\n * Wrap a context object with a proxy to reproduce the context stack. The proxy\n * uses the passed `inherited` context as a fallback to look up for properties\n * that don't exist in the given context. Also, updated properties are modified\n * where they are defined, or added to the main context when they don't exist.\n *\n * @param current Current context.\n * @param inherited Inherited context, used as fallback.\n *\n * @return The wrapped context object.\n */\nexport const proxifyContext = (\n\tcurrent: object,\n\tinherited: object = {}\n): object => {\n\tif ( contextProxies.has( current ) ) {\n\t\tthrow Error( 'This object cannot be proxified.' );\n\t}\n\t// Update the fallback object reference when it changes.\n\tcontextObjectToFallback.set( current, inherited );\n\tif ( ! contextObjectToProxy.has( current ) ) {\n\t\tconst proxy = new Proxy( current, contextHandlers );\n\t\tcontextObjectToProxy.set( current, proxy );\n\t\tcontextProxies.add( proxy );\n\t}\n\treturn contextObjectToProxy.get( current );\n};\n","/**\n * Internal dependencies\n */\nimport { proxifyState, proxifyStore, deepMerge } from './proxies';\n/**\n * External dependencies\n */\nimport { getNamespace } from './namespaces';\nimport { isPlainObject } from './utils';\n\nexport const stores = new Map();\nconst rawStores = new Map();\nconst storeLocks = new Map();\nconst storeConfigs = new Map();\nconst serverStates = new Map();\n\n/**\n * Get the defined config for the store with the passed namespace.\n *\n * @param namespace Store's namespace from which to retrieve the config.\n * @return Defined config for the given namespace.\n */\nexport const getConfig = ( namespace?: string ) =>\n\tstoreConfigs.get( namespace || getNamespace() ) || {};\n\n/**\n * Get the part of the state defined and updated from the server.\n *\n * The object returned is read-only, and includes the state defined in PHP with\n * `wp_interactivity_state()`. When using `actions.navigate()`, this object is\n * updated to reflect the changes in its properites, without affecting the state\n * returned by `store()`. Directives can subscribe to those changes to update\n * the state if needed.\n *\n * @example\n * ```js\n * const { state } = store('myStore', {\n * callbacks: {\n * updateServerState() {\n * const serverState = getServerState();\n * // Override some property with the new value that came from the server.\n * state.overridableProp = serverState.overridableProp;\n * },\n * },\n * });\n * ```\n *\n * @param namespace Store's namespace from which to retrieve the server state.\n * @return The server state for the given namespace.\n */\nexport const getServerState = ( namespace?: string ) => {\n\tconst ns = namespace || getNamespace();\n\tif ( ! serverStates.has( ns ) ) {\n\t\tserverStates.set( ns, proxifyState( ns, {}, { readOnly: true } ) );\n\t}\n\treturn serverStates.get( ns );\n};\n\ninterface StoreOptions {\n\t/**\n\t * Property to block/unblock private store namespaces.\n\t *\n\t * If the passed value is `true`, it blocks the given namespace, making it\n\t * accessible only trough the returned variables of the `store()` call. In\n\t * the case a lock string is passed, it also blocks the namespace, but can\n\t * be unblocked for other `store()` calls using the same lock string.\n\t *\n\t * @example\n\t * ```\n\t * // The store can only be accessed where the `state` const can.\n\t * const { state } = store( 'myblock/private', { ... }, { lock: true } );\n\t * ```\n\t *\n\t * @example\n\t * ```\n\t * // Other modules knowing `SECRET_LOCK_STRING` can access the namespace.\n\t * const { state } = store(\n\t * 'myblock/private',\n\t * { ... },\n\t * { lock: 'SECRET_LOCK_STRING' }\n\t * );\n\t * ```\n\t */\n\tlock?: boolean | string;\n}\n\nexport const universalUnlock =\n\t'I acknowledge that using a private store means my plugin will inevitably break on the next store release.';\n\n/**\n * Extends the Interactivity API global store adding the passed properties to\n * the given namespace. It also returns stable references to the namespace\n * content.\n *\n * These props typically consist of `state`, which is the reactive part of the\n * store ― which means that any directive referencing a state property will be\n * re-rendered anytime it changes ― and function properties like `actions` and\n * `callbacks`, mostly used for event handlers. These props can then be\n * referenced by any directive to make the HTML interactive.\n *\n * @example\n * ```js\n * const { state } = store( 'counter', {\n * state: {\n * value: 0,\n * get double() { return state.value * 2; },\n * },\n * actions: {\n * increment() {\n * state.value += 1;\n * },\n * },\n * } );\n * ```\n *\n * The code from the example above allows blocks to subscribe and interact with\n * the store by using directives in the HTML, e.g.:\n *\n * ```html\n *
\n * \n * 0\n * \n *
\n * ```\n * @param namespace The store namespace to interact with.\n * @param storePart Properties to add to the store namespace.\n * @param options Options for the given namespace.\n *\n * @return A reference to the namespace content.\n */\nexport function store< S extends object = {} >(\n\tnamespace: string,\n\tstorePart?: S,\n\toptions?: StoreOptions\n): S;\n\nexport function store< T extends object >(\n\tnamespace: string,\n\tstorePart?: T,\n\toptions?: StoreOptions\n): T;\n\nexport function store(\n\tnamespace: string,\n\t{ state = {}, ...block }: any = {},\n\t{ lock = false }: StoreOptions = {}\n) {\n\tif ( ! stores.has( namespace ) ) {\n\t\t// Lock the store if the passed lock is different from the universal\n\t\t// unlock. Once the lock is set (either false, true, or a given string),\n\t\t// it cannot change.\n\t\tif ( lock !== universalUnlock ) {\n\t\t\tstoreLocks.set( namespace, lock );\n\t\t}\n\t\tconst rawStore = {\n\t\t\tstate: proxifyState(\n\t\t\t\tnamespace,\n\t\t\t\tisPlainObject( state ) ? state : {}\n\t\t\t),\n\t\t\t...block,\n\t\t};\n\t\tconst proxifiedStore = proxifyStore( namespace, rawStore );\n\t\trawStores.set( namespace, rawStore );\n\t\tstores.set( namespace, proxifiedStore );\n\t} else {\n\t\t// Lock the store if it wasn't locked yet and the passed lock is\n\t\t// different from the universal unlock. If no lock is given, the store\n\t\t// will be public and won't accept any lock from now on.\n\t\tif ( lock !== universalUnlock && ! storeLocks.has( namespace ) ) {\n\t\t\tstoreLocks.set( namespace, lock );\n\t\t} else {\n\t\t\tconst storeLock = storeLocks.get( namespace );\n\t\t\tconst isLockValid =\n\t\t\t\tlock === universalUnlock ||\n\t\t\t\t( lock !== true && lock === storeLock );\n\n\t\t\tif ( ! isLockValid ) {\n\t\t\t\tif ( ! storeLock ) {\n\t\t\t\t\tthrow Error( 'Cannot lock a public store' );\n\t\t\t\t} else {\n\t\t\t\t\tthrow Error(\n\t\t\t\t\t\t'Cannot unlock a private store with an invalid lock code'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst target = rawStores.get( namespace );\n\t\tdeepMerge( target, block );\n\t\tdeepMerge( target.state, state );\n\t}\n\n\treturn stores.get( namespace );\n}\n\nexport const parseServerData = ( dom = document ) => {\n\tconst jsonDataScriptTag =\n\t\t// Preferred Script Module data passing form\n\t\tdom.getElementById(\n\t\t\t'wp-script-module-data-@wordpress/interactivity'\n\t\t) ??\n\t\t// Legacy form\n\t\tdom.getElementById( 'wp-interactivity-data' );\n\tif ( jsonDataScriptTag?.textContent ) {\n\t\ttry {\n\t\t\treturn JSON.parse( jsonDataScriptTag.textContent );\n\t\t} catch {}\n\t}\n\treturn {};\n};\n\nexport const populateServerData = ( data?: {\n\tstate?: Record< string, unknown >;\n\tconfig?: Record< string, unknown >;\n} ) => {\n\tif ( isPlainObject( data?.state ) ) {\n\t\tObject.entries( data!.state ).forEach( ( [ namespace, state ] ) => {\n\t\t\tconst st = store< any >( namespace, {}, { lock: universalUnlock } );\n\t\t\tdeepMerge( st.state, state, false );\n\t\t\tdeepMerge( getServerState( namespace ), state );\n\t\t} );\n\t}\n\tif ( isPlainObject( data?.config ) ) {\n\t\tObject.entries( data!.config ).forEach( ( [ namespace, config ] ) => {\n\t\t\tstoreConfigs.set( namespace, config );\n\t\t} );\n\t}\n};\n\n// Parse and populate the initial state and config.\nconst data = parseServerData();\npopulateServerData( data );\n","// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable react-hooks/exhaustive-deps */\n\n/**\n * External dependencies\n */\nimport {\n\th as createElement,\n\toptions,\n\tcreateContext,\n\tcloneElement,\n\ttype ComponentChildren,\n} from 'preact';\nimport { useRef, useCallback, useContext } from 'preact/hooks';\nimport type { VNode, Context } from 'preact';\n\n/**\n * Internal dependencies\n */\nimport { store, stores, universalUnlock } from './store';\nimport { warn } from './utils';\nimport { getScope, setScope, resetScope, type Scope } from './scopes';\nexport interface DirectiveEntry {\n\tvalue: string | object;\n\tnamespace: string;\n\tsuffix: string;\n}\n\ntype DirectiveEntries = Record< string, DirectiveEntry[] >;\n\ninterface DirectiveArgs {\n\t/**\n\t * Object map with the defined directives of the element being evaluated.\n\t */\n\tdirectives: DirectiveEntries;\n\t/**\n\t * Props present in the current element.\n\t */\n\tprops: { children?: ComponentChildren };\n\t/**\n\t * Virtual node representing the element.\n\t */\n\telement: VNode< {\n\t\tclass?: string;\n\t\tstyle?: string | Record< string, string | number >;\n\t\tcontent?: ComponentChildren;\n\t} >;\n\t/**\n\t * The inherited context.\n\t */\n\tcontext: Context< any >;\n\t/**\n\t * Function that resolves a given path to a value either in the store or the\n\t * context.\n\t */\n\tevaluate: Evaluate;\n}\n\ninterface DirectiveCallback {\n\t( args: DirectiveArgs ): VNode< any > | null | void;\n}\n\ninterface DirectiveOptions {\n\t/**\n\t * Value that specifies the priority to evaluate directives of this type.\n\t * Lower numbers correspond with earlier execution.\n\t *\n\t * @default 10\n\t */\n\tpriority?: number;\n}\n\nexport interface Evaluate {\n\t( entry: DirectiveEntry, ...args: any[] ): any;\n}\n\ninterface GetEvaluate {\n\t( args: { scope: Scope } ): Evaluate;\n}\n\ntype PriorityLevel = string[];\n\ninterface GetPriorityLevels {\n\t( directives: DirectiveEntries ): PriorityLevel[];\n}\n\ninterface DirectivesProps {\n\tdirectives: DirectiveEntries;\n\tpriorityLevels: PriorityLevel[];\n\telement: VNode;\n\toriginalProps: any;\n\tpreviousScope?: Scope;\n}\n\n// Main context.\nconst context = createContext< any >( { client: {}, server: {} } );\n\n// WordPress Directives.\nconst directiveCallbacks: Record< string, DirectiveCallback > = {};\nconst directivePriorities: Record< string, number > = {};\n\n/**\n * Register a new directive type in the Interactivity API runtime.\n *\n * @example\n * ```js\n * directive(\n * 'alert', // Name without the `data-wp-` prefix.\n * ( { directives: { alert }, element, evaluate } ) => {\n * const defaultEntry = alert.find( entry => entry.suffix === 'default' );\n * element.props.onclick = () => { alert( evaluate( defaultEntry ) ); }\n * }\n * )\n * ```\n *\n * The previous code registers a custom directive type for displaying an alert\n * message whenever an element using it is clicked. The message text is obtained\n * from the store under the inherited namespace, using `evaluate`.\n *\n * When the HTML is processed by the Interactivity API, any element containing\n * the `data-wp-alert` directive will have the `onclick` event handler, e.g.,\n *\n * ```html\n *
\n * \n *
\n * ```\n * Note that, in the previous example, the directive callback gets the path\n * value (`state.alert`) from the directive entry with suffix `default`. A\n * custom suffix can also be specified by appending `--` to the directive\n * attribute, followed by the suffix, like in the following HTML snippet:\n *\n * ```html\n *
\n * Click me!\n *
\n * ```\n *\n * This could be an hypothetical implementation of the custom directive used in\n * the snippet above.\n *\n * @example\n * ```js\n * directive(\n * 'color', // Name without prefix and suffix.\n * ( { directives: { color: colors }, ref, evaluate } ) =>\n * colors.forEach( ( color ) => {\n * if ( color.suffix = 'text' ) {\n * ref.style.setProperty(\n * 'color',\n * evaluate( color.text )\n * );\n * }\n * if ( color.suffix = 'background' ) {\n * ref.style.setProperty(\n * 'background-color',\n * evaluate( color.background )\n * );\n * }\n * } );\n * }\n * )\n * ```\n *\n * @param name Directive name, without the `data-wp-` prefix.\n * @param callback Function that runs the directive logic.\n * @param options Options object.\n * @param options.priority Option to control the directive execution order. The\n * lesser, the highest priority. Default is `10`.\n */\nexport const directive = (\n\tname: string,\n\tcallback: DirectiveCallback,\n\t{ priority = 10 }: DirectiveOptions = {}\n) => {\n\tdirectiveCallbacks[ name ] = callback;\n\tdirectivePriorities[ name ] = priority;\n};\n\n// Resolve the path to some property of the store object.\nconst resolve = ( path: string, namespace: string ) => {\n\tif ( ! namespace ) {\n\t\twarn(\n\t\t\t`Namespace missing for \"${ path }\". The value for that path won't be resolved.`\n\t\t);\n\t\treturn;\n\t}\n\tlet resolvedStore = stores.get( namespace );\n\tif ( typeof resolvedStore === 'undefined' ) {\n\t\tresolvedStore = store( namespace, undefined, {\n\t\t\tlock: universalUnlock,\n\t\t} );\n\t}\n\tconst current = {\n\t\t...resolvedStore,\n\t\tcontext: getScope().context[ namespace ],\n\t};\n\ttry {\n\t\t// TODO: Support lazy/dynamically initialized stores\n\t\treturn path.split( '.' ).reduce( ( acc, key ) => acc[ key ], current );\n\t} catch ( e ) {}\n};\n\n// Generate the evaluate function.\nexport const getEvaluate: GetEvaluate =\n\t( { scope } ) =>\n\t( entry, ...args ) => {\n\t\tlet { value: path, namespace } = entry;\n\t\tif ( typeof path !== 'string' ) {\n\t\t\tthrow new Error( 'The `value` prop should be a string path' );\n\t\t}\n\t\t// If path starts with !, remove it and save a flag.\n\t\tconst hasNegationOperator =\n\t\t\tpath[ 0 ] === '!' && !! ( path = path.slice( 1 ) );\n\t\tsetScope( scope );\n\t\tconst value = resolve( path, namespace );\n\t\tconst result = typeof value === 'function' ? value( ...args ) : value;\n\t\tresetScope();\n\t\treturn hasNegationOperator ? ! result : result;\n\t};\n\n// Separate directives by priority. The resulting array contains objects\n// of directives grouped by same priority, and sorted in ascending order.\nconst getPriorityLevels: GetPriorityLevels = ( directives ) => {\n\tconst byPriority = Object.keys( directives ).reduce<\n\t\tRecord< number, string[] >\n\t>( ( obj, name ) => {\n\t\tif ( directiveCallbacks[ name ] ) {\n\t\t\tconst priority = directivePriorities[ name ];\n\t\t\t( obj[ priority ] = obj[ priority ] || [] ).push( name );\n\t\t}\n\t\treturn obj;\n\t}, {} );\n\n\treturn Object.entries( byPriority )\n\t\t.sort( ( [ p1 ], [ p2 ] ) => parseInt( p1 ) - parseInt( p2 ) )\n\t\t.map( ( [ , arr ] ) => arr );\n};\n\n// Component that wraps each priority level of directives of an element.\nconst Directives = ( {\n\tdirectives,\n\tpriorityLevels: [ currentPriorityLevel, ...nextPriorityLevels ],\n\telement,\n\toriginalProps,\n\tpreviousScope,\n}: DirectivesProps ) => {\n\t// Initialize the scope of this element. These scopes are different per each\n\t// level because each level has a different context, but they share the same\n\t// element ref, state and props.\n\tconst scope = useRef< Scope >( {} as Scope ).current;\n\tscope.evaluate = useCallback( getEvaluate( { scope } ), [] );\n\tconst { client, server } = useContext( context );\n\tscope.context = client;\n\tscope.serverContext = server;\n\t/* eslint-disable react-hooks/rules-of-hooks */\n\tscope.ref = previousScope?.ref || useRef( null );\n\t/* eslint-enable react-hooks/rules-of-hooks */\n\n\t// Create a fresh copy of the vnode element and add the props to the scope,\n\t// named as attributes (HTML Attributes).\n\telement = cloneElement( element, { ref: scope.ref } );\n\tscope.attributes = element.props;\n\n\t// Recursively render the wrapper for the next priority level.\n\tconst children =\n\t\tnextPriorityLevels.length > 0\n\t\t\t? createElement( Directives, {\n\t\t\t\t\tdirectives,\n\t\t\t\t\tpriorityLevels: nextPriorityLevels,\n\t\t\t\t\telement,\n\t\t\t\t\toriginalProps,\n\t\t\t\t\tpreviousScope: scope,\n\t\t\t } )\n\t\t\t: element;\n\n\tconst props = { ...originalProps, children };\n\tconst directiveArgs = {\n\t\tdirectives,\n\t\tprops,\n\t\telement,\n\t\tcontext,\n\t\tevaluate: scope.evaluate,\n\t};\n\n\tsetScope( scope );\n\n\tfor ( const directiveName of currentPriorityLevel ) {\n\t\tconst wrapper = directiveCallbacks[ directiveName ]?.( directiveArgs );\n\t\tif ( wrapper !== undefined ) {\n\t\t\tprops.children = wrapper;\n\t\t}\n\t}\n\n\tresetScope();\n\n\treturn props.children;\n};\n\n// Preact Options Hook called each time a vnode is created.\nconst old = options.vnode;\noptions.vnode = ( vnode: VNode< any > ) => {\n\tif ( vnode.props.__directives ) {\n\t\tconst props = vnode.props;\n\t\tconst directives = props.__directives;\n\t\tif ( directives.key ) {\n\t\t\tvnode.key = directives.key.find(\n\t\t\t\t( { suffix } ) => suffix === 'default'\n\t\t\t).value;\n\t\t}\n\t\tdelete props.__directives;\n\t\tconst priorityLevels = getPriorityLevels( directives );\n\t\tif ( priorityLevels.length > 0 ) {\n\t\t\tvnode.props = {\n\t\t\t\tdirectives,\n\t\t\t\tpriorityLevels,\n\t\t\t\toriginalProps: props,\n\t\t\t\ttype: vnode.type,\n\t\t\t\telement: createElement( vnode.type as any, props ),\n\t\t\t\ttop: true,\n\t\t\t};\n\t\t\tvnode.type = Directives;\n\t\t}\n\t}\n\n\tif ( old ) {\n\t\told( vnode );\n\t}\n};\n","// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable react-hooks/exhaustive-deps */\n\n/**\n * External dependencies\n */\nimport { h as createElement, type RefObject } from 'preact';\nimport { useContext, useMemo, useRef } from 'preact/hooks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseWatch,\n\tuseInit,\n\tkebabToCamelCase,\n\twarn,\n\tsplitTask,\n\tisPlainObject,\n} from './utils';\nimport { directive, getEvaluate, type DirectiveEntry } from './hooks';\nimport { getScope } from './scopes';\nimport { proxifyState, proxifyContext, deepMerge } from './proxies';\n\n/**\n * Recursively clone the passed object.\n *\n * @param source Source object.\n * @return Cloned object.\n */\nfunction deepClone< T >( source: T ): T {\n\tif ( isPlainObject( source ) ) {\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries( source as object ).map( ( [ key, value ] ) => [\n\t\t\t\tkey,\n\t\t\t\tdeepClone( value ),\n\t\t\t] )\n\t\t) as T;\n\t}\n\tif ( Array.isArray( source ) ) {\n\t\treturn source.map( ( i ) => deepClone( i ) ) as T;\n\t}\n\treturn source;\n}\n\nconst newRule =\n\t/(?:([\\u0080-\\uFFFF\\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\\s*)/g;\nconst ruleClean = /\\/\\*[^]*?\\*\\/| +/g;\nconst ruleNewline = /\\n+/g;\nconst empty = ' ';\n\n/**\n * Convert a css style string into a object.\n *\n * Made by Cristian Bote (@cristianbote) for Goober.\n * https://unpkg.com/browse/goober@2.1.13/src/core/astish.js\n *\n * @param val CSS string.\n * @return CSS object.\n */\nconst cssStringToObject = (\n\tval: string\n): Record< string, string | number > => {\n\tconst tree = [ {} ];\n\tlet block, left;\n\n\twhile ( ( block = newRule.exec( val.replace( ruleClean, '' ) ) ) ) {\n\t\tif ( block[ 4 ] ) {\n\t\t\ttree.shift();\n\t\t} else if ( block[ 3 ] ) {\n\t\t\tleft = block[ 3 ].replace( ruleNewline, empty ).trim();\n\t\t\ttree.unshift( ( tree[ 0 ][ left ] = tree[ 0 ][ left ] || {} ) );\n\t\t} else {\n\t\t\ttree[ 0 ][ block[ 1 ] ] = block[ 2 ]\n\t\t\t\t.replace( ruleNewline, empty )\n\t\t\t\t.trim();\n\t\t}\n\t}\n\n\treturn tree[ 0 ];\n};\n\n/**\n * Creates a directive that adds an event listener to the global window or\n * document object.\n *\n * @param type 'window' or 'document'\n */\nconst getGlobalEventDirective = ( type: 'window' | 'document' ) => {\n\treturn ( { directives, evaluate } ) => {\n\t\tdirectives[ `on-${ type }` ]\n\t\t\t.filter( ( { suffix } ) => suffix !== 'default' )\n\t\t\t.forEach( ( entry: DirectiveEntry ) => {\n\t\t\t\tconst eventName = entry.suffix.split( '--', 1 )[ 0 ];\n\t\t\t\tuseInit( () => {\n\t\t\t\t\tconst cb = ( event: Event ) => evaluate( entry, event );\n\t\t\t\t\tconst globalVar = type === 'window' ? window : document;\n\t\t\t\t\tglobalVar.addEventListener( eventName, cb );\n\t\t\t\t\treturn () => globalVar.removeEventListener( eventName, cb );\n\t\t\t\t} );\n\t\t\t} );\n\t};\n};\n\n/**\n * Creates a directive that adds an async event listener to the global window or\n * document object.\n *\n * @param type 'window' or 'document'\n */\nconst getGlobalAsyncEventDirective = ( type: 'window' | 'document' ) => {\n\treturn ( { directives, evaluate } ) => {\n\t\tdirectives[ `on-async-${ type }` ]\n\t\t\t.filter( ( { suffix } ) => suffix !== 'default' )\n\t\t\t.forEach( ( entry: DirectiveEntry ) => {\n\t\t\t\tconst eventName = entry.suffix.split( '--', 1 )[ 0 ];\n\t\t\t\tuseInit( () => {\n\t\t\t\t\tconst cb = async ( event: Event ) => {\n\t\t\t\t\t\tawait splitTask();\n\t\t\t\t\t\tevaluate( entry, event );\n\t\t\t\t\t};\n\t\t\t\t\tconst globalVar = type === 'window' ? window : document;\n\t\t\t\t\tglobalVar.addEventListener( eventName, cb, {\n\t\t\t\t\t\tpassive: true,\n\t\t\t\t\t} );\n\t\t\t\t\treturn () => globalVar.removeEventListener( eventName, cb );\n\t\t\t\t} );\n\t\t\t} );\n\t};\n};\n\nexport default () => {\n\t// data-wp-context\n\tdirective(\n\t\t'context',\n\t\t( {\n\t\t\tdirectives: { context },\n\t\t\tprops: { children },\n\t\t\tcontext: inheritedContext,\n\t\t} ) => {\n\t\t\tconst { Provider } = inheritedContext;\n\t\t\tconst defaultEntry = context.find(\n\t\t\t\t( { suffix } ) => suffix === 'default'\n\t\t\t);\n\t\t\tconst { client: inheritedClient, server: inheritedServer } =\n\t\t\t\tuseContext( inheritedContext );\n\n\t\t\tconst ns = defaultEntry!.namespace;\n\t\t\tconst client = useRef( proxifyState( ns, {} ) );\n\t\t\tconst server = useRef( proxifyState( ns, {}, { readOnly: true } ) );\n\n\t\t\t// No change should be made if `defaultEntry` does not exist.\n\t\t\tconst contextStack = useMemo( () => {\n\t\t\t\tconst result = {\n\t\t\t\t\tclient: { ...inheritedClient },\n\t\t\t\t\tserver: { ...inheritedServer },\n\t\t\t\t};\n\t\t\t\tif ( defaultEntry ) {\n\t\t\t\t\tconst { namespace, value } = defaultEntry;\n\t\t\t\t\t// Check that the value is a JSON object. Send a console warning if not.\n\t\t\t\t\tif ( ! isPlainObject( value ) ) {\n\t\t\t\t\t\twarn(\n\t\t\t\t\t\t\t`The value of data-wp-context in \"${ namespace }\" store must be a valid stringified JSON object.`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tdeepMerge(\n\t\t\t\t\t\tclient.current,\n\t\t\t\t\t\tdeepClone( value ) as object,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t);\n\t\t\t\t\tdeepMerge( server.current, deepClone( value ) as object );\n\t\t\t\t\tresult.client[ namespace ] = proxifyContext(\n\t\t\t\t\t\tclient.current,\n\t\t\t\t\t\tinheritedClient[ namespace ]\n\t\t\t\t\t);\n\t\t\t\t\tresult.server[ namespace ] = proxifyContext(\n\t\t\t\t\t\tserver.current,\n\t\t\t\t\t\tinheritedServer[ namespace ]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}, [ defaultEntry, inheritedClient, inheritedServer ] );\n\n\t\t\treturn createElement( Provider, { value: contextStack }, children );\n\t\t},\n\t\t{ priority: 5 }\n\t);\n\n\t// data-wp-watch--[name]\n\tdirective( 'watch', ( { directives: { watch }, evaluate } ) => {\n\t\twatch.forEach( ( entry ) => {\n\t\t\tuseWatch( () => {\n\t\t\t\tlet start;\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t\t\t\t\tstart = performance.now();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst result = evaluate( entry );\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\tperformance.measure(\n\t\t\t\t\t\t\t`interactivity api watch ${ entry.namespace }`,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\t\tend: performance.now(),\n\t\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\t\tdevtools: {\n\t\t\t\t\t\t\t\t\t\ttrack: `IA: watch ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} );\n\t\t} );\n\t} );\n\n\t// data-wp-init--[name]\n\tdirective( 'init', ( { directives: { init }, evaluate } ) => {\n\t\tinit.forEach( ( entry ) => {\n\t\t\t// TODO: Replace with useEffect to prevent unneeded scopes.\n\t\t\tuseInit( () => {\n\t\t\t\tlet start;\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\tstart = performance.now();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst result = evaluate( entry );\n\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\tperformance.measure(\n\t\t\t\t\t\t\t`interactivity api init ${ entry.namespace }`,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// eslint-disable-next-line no-undef\n\t\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\t\tend: performance.now(),\n\t\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\t\tdevtools: {\n\t\t\t\t\t\t\t\t\t\ttrack: `IA: init ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} );\n\t\t} );\n\t} );\n\n\t// data-wp-on--[event]\n\tdirective( 'on', ( { directives: { on }, element, evaluate } ) => {\n\t\tconst events = new Map< string, Set< DirectiveEntry > >();\n\t\ton.filter( ( { suffix } ) => suffix !== 'default' ).forEach(\n\t\t\t( entry ) => {\n\t\t\t\tconst event = entry.suffix.split( '--' )[ 0 ];\n\t\t\t\tif ( ! events.has( event ) ) {\n\t\t\t\t\tevents.set( event, new Set< DirectiveEntry >() );\n\t\t\t\t}\n\t\t\t\tevents.get( event )!.add( entry );\n\t\t\t}\n\t\t);\n\n\t\tevents.forEach( ( entries, eventType ) => {\n\t\t\tconst existingHandler = element.props[ `on${ eventType }` ];\n\t\t\telement.props[ `on${ eventType }` ] = ( event: Event ) => {\n\t\t\t\tentries.forEach( ( entry ) => {\n\t\t\t\t\tif ( existingHandler ) {\n\t\t\t\t\t\texistingHandler( event );\n\t\t\t\t\t}\n\t\t\t\t\tlet start;\n\t\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\t\tstart = performance.now();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tevaluate( entry, event );\n\t\t\t\t\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t\t\t\t\tif ( globalThis.SCRIPT_DEBUG ) {\n\t\t\t\t\t\t\tperformance.measure(\n\t\t\t\t\t\t\t\t`interactivity api on ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line no-undef\n\t\t\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\t\t\tend: performance.now(),\n\t\t\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\t\t\tdevtools: {\n\t\t\t\t\t\t\t\t\t\t\ttrack: `IA: on ${ entry.namespace }`,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\t\t} );\n\t} );\n\n\t// data-wp-on-async--[event]\n\tdirective(\n\t\t'on-async',\n\t\t( { directives: { 'on-async': onAsync }, element, evaluate } ) => {\n\t\t\tconst events = new Map< string, Set< DirectiveEntry > >();\n\t\t\tonAsync\n\t\t\t\t.filter( ( { suffix } ) => suffix !== 'default' )\n\t\t\t\t.forEach( ( entry ) => {\n\t\t\t\t\tconst event = entry.suffix.split( '--' )[ 0 ];\n\t\t\t\t\tif ( ! events.has( event ) ) {\n\t\t\t\t\t\tevents.set( event, new Set< DirectiveEntry >() );\n\t\t\t\t\t}\n\t\t\t\t\tevents.get( event )!.add( entry );\n\t\t\t\t} );\n\n\t\t\tevents.forEach( ( entries, eventType ) => {\n\t\t\t\tconst existingHandler = element.props[ `on${ eventType }` ];\n\t\t\t\telement.props[ `on${ eventType }` ] = ( event: Event ) => {\n\t\t\t\t\tif ( existingHandler ) {\n\t\t\t\t\t\texistingHandler( event );\n\t\t\t\t\t}\n\t\t\t\t\tentries.forEach( async ( entry ) => {\n\t\t\t\t\t\tawait splitTask();\n\t\t\t\t\t\tevaluate( entry, event );\n\t\t\t\t\t} );\n\t\t\t\t};\n\t\t\t} );\n\t\t}\n\t);\n\n\t// data-wp-on-window--[event]\n\tdirective( 'on-window', getGlobalEventDirective( 'window' ) );\n\t// data-wp-on-document--[event]\n\tdirective( 'on-document', getGlobalEventDirective( 'document' ) );\n\n\t// data-wp-on-async-window--[event]\n\tdirective( 'on-async-window', getGlobalAsyncEventDirective( 'window' ) );\n\t// data-wp-on-async-document--[event]\n\tdirective(\n\t\t'on-async-document',\n\t\tgetGlobalAsyncEventDirective( 'document' )\n\t);\n\n\t// data-wp-class--[classname]\n\tdirective(\n\t\t'class',\n\t\t( { directives: { class: classNames }, element, evaluate } ) => {\n\t\t\tclassNames\n\t\t\t\t.filter( ( { suffix } ) => suffix !== 'default' )\n\t\t\t\t.forEach( ( entry ) => {\n\t\t\t\t\tconst className = entry.suffix;\n\t\t\t\t\tconst result = evaluate( entry );\n\t\t\t\t\tconst currentClass = element.props.class || '';\n\t\t\t\t\tconst classFinder = new RegExp(\n\t\t\t\t\t\t`(^|\\\\s)${ className }(\\\\s|$)`,\n\t\t\t\t\t\t'g'\n\t\t\t\t\t);\n\t\t\t\t\tif ( ! result ) {\n\t\t\t\t\t\telement.props.class = currentClass\n\t\t\t\t\t\t\t.replace( classFinder, ' ' )\n\t\t\t\t\t\t\t.trim();\n\t\t\t\t\t} else if ( ! classFinder.test( currentClass ) ) {\n\t\t\t\t\t\telement.props.class = currentClass\n\t\t\t\t\t\t\t? `${ currentClass } ${ className }`\n\t\t\t\t\t\t\t: className;\n\t\t\t\t\t}\n\n\t\t\t\t\tuseInit( () => {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * This seems necessary because Preact doesn't change the class\n\t\t\t\t\t\t * names on the hydration, so we have to do it manually. It doesn't\n\t\t\t\t\t\t * need deps because it only needs to do it the first time.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif ( ! result ) {\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\telement.ref as RefObject< HTMLElement >\n\t\t\t\t\t\t\t ).current!.classList.remove( className );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\telement.ref as RefObject< HTMLElement >\n\t\t\t\t\t\t\t ).current!.classList.add( className );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t}\n\t);\n\n\t// data-wp-style--[style-prop]\n\tdirective( 'style', ( { directives: { style }, element, evaluate } ) => {\n\t\tstyle\n\t\t\t.filter( ( { suffix } ) => suffix !== 'default' )\n\t\t\t.forEach( ( entry ) => {\n\t\t\t\tconst styleProp = entry.suffix;\n\t\t\t\tconst result = evaluate( entry );\n\t\t\t\telement.props.style = element.props.style || {};\n\t\t\t\tif ( typeof element.props.style === 'string' ) {\n\t\t\t\t\telement.props.style = cssStringToObject(\n\t\t\t\t\t\telement.props.style\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif ( ! result ) {\n\t\t\t\t\tdelete element.props.style[ styleProp ];\n\t\t\t\t} else {\n\t\t\t\t\telement.props.style[ styleProp ] = result;\n\t\t\t\t}\n\n\t\t\t\tuseInit( () => {\n\t\t\t\t\t/*\n\t\t\t\t\t * This seems necessary because Preact doesn't change the styles on\n\t\t\t\t\t * the hydration, so we have to do it manually. It doesn't need deps\n\t\t\t\t\t * because it only needs to do it the first time.\n\t\t\t\t\t */\n\t\t\t\t\tif ( ! result ) {\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\telement.ref as RefObject< HTMLElement >\n\t\t\t\t\t\t ).current!.style.removeProperty( styleProp );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\telement.ref as RefObject< HTMLElement >\n\t\t\t\t\t\t ).current!.style[ styleProp ] = result;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\t} );\n\n\t// data-wp-bind--[attribute]\n\tdirective( 'bind', ( { directives: { bind }, element, evaluate } ) => {\n\t\tbind.filter( ( { suffix } ) => suffix !== 'default' ).forEach(\n\t\t\t( entry ) => {\n\t\t\t\tconst attribute = entry.suffix;\n\t\t\t\tconst result = evaluate( entry );\n\t\t\t\telement.props[ attribute ] = result;\n\n\t\t\t\t/*\n\t\t\t\t * This is necessary because Preact doesn't change the attributes on the\n\t\t\t\t * hydration, so we have to do it manually. It only needs to do it the\n\t\t\t\t * first time. After that, Preact will handle the changes.\n\t\t\t\t */\n\t\t\t\tuseInit( () => {\n\t\t\t\t\tconst el = ( element.ref as RefObject< HTMLElement > )\n\t\t\t\t\t\t.current!;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * We set the value directly to the corresponding HTMLElement instance\n\t\t\t\t\t * property excluding the following special cases. We follow Preact's\n\t\t\t\t\t * logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L110-L129\n\t\t\t\t\t */\n\t\t\t\t\tif ( attribute === 'style' ) {\n\t\t\t\t\t\tif ( typeof result === 'string' ) {\n\t\t\t\t\t\t\tel.style.cssText = result;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else if (\n\t\t\t\t\t\tattribute !== 'width' &&\n\t\t\t\t\t\tattribute !== 'height' &&\n\t\t\t\t\t\tattribute !== 'href' &&\n\t\t\t\t\t\tattribute !== 'list' &&\n\t\t\t\t\t\tattribute !== 'form' &&\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * The value for `tabindex` follows the parsing rules for an\n\t\t\t\t\t\t * integer. If that fails, or if the attribute isn't present, then\n\t\t\t\t\t\t * the browsers should \"follow platform conventions to determine if\n\t\t\t\t\t\t * the element should be considered as a focusable area\",\n\t\t\t\t\t\t * practically meaning that most elements get a default of `-1` (not\n\t\t\t\t\t\t * focusable), but several also get a default of `0` (focusable in\n\t\t\t\t\t\t * order after all elements with a positive `tabindex` value).\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * @see https://html.spec.whatwg.org/#tabindex-value\n\t\t\t\t\t\t */\n\t\t\t\t\t\tattribute !== 'tabIndex' &&\n\t\t\t\t\t\tattribute !== 'download' &&\n\t\t\t\t\t\tattribute !== 'rowSpan' &&\n\t\t\t\t\t\tattribute !== 'colSpan' &&\n\t\t\t\t\t\tattribute !== 'role' &&\n\t\t\t\t\t\tattribute in el\n\t\t\t\t\t) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tel[ attribute ] =\n\t\t\t\t\t\t\t\tresult === null || result === undefined\n\t\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t\t: result;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} catch ( err ) {}\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\t * aria- and data- attributes have no boolean representation.\n\t\t\t\t\t * A `false` value is different from the attribute not being\n\t\t\t\t\t * present, so we can't remove it.\n\t\t\t\t\t * We follow Preact's logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L131C24-L136\n\t\t\t\t\t */\n\t\t\t\t\tif (\n\t\t\t\t\t\tresult !== null &&\n\t\t\t\t\t\tresult !== undefined &&\n\t\t\t\t\t\t( result !== false || attribute[ 4 ] === '-' )\n\t\t\t\t\t) {\n\t\t\t\t\t\tel.setAttribute( attribute, result );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tel.removeAttribute( attribute );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t);\n\t} );\n\n\t// data-wp-ignore\n\tdirective(\n\t\t'ignore',\n\t\t( {\n\t\t\telement: {\n\t\t\t\ttype: Type,\n\t\t\t\tprops: { innerHTML, ...rest },\n\t\t\t},\n\t\t}: {\n\t\t\telement: any;\n\t\t} ) => {\n\t\t\t// Preserve the initial inner HTML.\n\t\t\tconst cached = useMemo( () => innerHTML, [] );\n\t\t\treturn createElement( Type, {\n\t\t\t\tdangerouslySetInnerHTML: { __html: cached },\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t}\n\t);\n\n\t// data-wp-text\n\tdirective( 'text', ( { directives: { text }, element, evaluate } ) => {\n\t\tconst entry = text.find( ( { suffix } ) => suffix === 'default' );\n\t\tif ( ! entry ) {\n\t\t\telement.props.children = null;\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst result = evaluate( entry );\n\t\t\telement.props.children =\n\t\t\t\ttypeof result === 'object' ? null : result.toString();\n\t\t} catch ( e ) {\n\t\t\telement.props.children = null;\n\t\t}\n\t} );\n\n\t// data-wp-run\n\tdirective( 'run', ( { directives: { run }, evaluate } ) => {\n\t\trun.forEach( ( entry ) => evaluate( entry ) );\n\t} );\n\n\t// data-wp-each--[item]\n\tdirective(\n\t\t'each',\n\t\t( {\n\t\t\tdirectives: { each, 'each-key': eachKey },\n\t\t\tcontext: inheritedContext,\n\t\t\telement,\n\t\t\tevaluate,\n\t\t} ) => {\n\t\t\tif ( element.type !== 'template' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { Provider } = inheritedContext;\n\t\t\tconst inheritedValue = useContext( inheritedContext );\n\n\t\t\tconst [ entry ] = each;\n\t\t\tconst { namespace, suffix } = entry;\n\n\t\t\tconst list = evaluate( entry );\n\t\t\treturn list.map( ( item ) => {\n\t\t\t\tconst itemProp =\n\t\t\t\t\tsuffix === 'default' ? 'item' : kebabToCamelCase( suffix );\n\t\t\t\tconst itemContext = proxifyContext(\n\t\t\t\t\tproxifyState( namespace, {} ),\n\t\t\t\t\tinheritedValue.client[ namespace ]\n\t\t\t\t);\n\t\t\t\tconst mergedContext = {\n\t\t\t\t\tclient: {\n\t\t\t\t\t\t...inheritedValue.client,\n\t\t\t\t\t\t[ namespace ]: itemContext,\n\t\t\t\t\t},\n\t\t\t\t\tserver: { ...inheritedValue.server },\n\t\t\t\t};\n\n\t\t\t\t// Set the item after proxifying the context.\n\t\t\t\tmergedContext.client[ namespace ][ itemProp ] = item;\n\n\t\t\t\tconst scope = {\n\t\t\t\t\t...getScope(),\n\t\t\t\t\tcontext: mergedContext.client,\n\t\t\t\t\tserverContext: mergedContext.server,\n\t\t\t\t};\n\t\t\t\tconst key = eachKey\n\t\t\t\t\t? getEvaluate( { scope } )( eachKey[ 0 ] )\n\t\t\t\t\t: item;\n\n\t\t\t\treturn createElement(\n\t\t\t\t\tProvider,\n\t\t\t\t\t{ value: mergedContext, key },\n\t\t\t\t\telement.props.content\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t{ priority: 20 }\n\t);\n\n\tdirective( 'each-child', () => null, { priority: 1 } );\n};\n","export const directivePrefix: string = 'wp';\n","/**\n * External dependencies\n */\nimport { h, type ComponentChild, type JSX } from 'preact';\n/**\n * Internal dependencies\n */\nimport { directivePrefix as p } from './constants';\nimport { warn } from './utils';\n\nconst ignoreAttr = `data-${ p }-ignore`;\nconst islandAttr = `data-${ p }-interactive`;\nconst fullPrefix = `data-${ p }-`;\nconst namespaces: Array< string | null > = [];\nconst currentNamespace = () => namespaces[ namespaces.length - 1 ] ?? null;\nconst isObject = ( item: unknown ): item is Record< string, unknown > =>\n\tBoolean( item && typeof item === 'object' && item.constructor === Object );\n\n// Regular expression for directive parsing.\nconst directiveParser = new RegExp(\n\t`^data-${ p }-` + // ${p} must be a prefix string, like 'wp'.\n\t\t// Match alphanumeric characters including hyphen-separated\n\t\t// segments. It excludes underscore intentionally to prevent confusion.\n\t\t// E.g., \"custom-directive\".\n\t\t'([a-z0-9]+(?:-[a-z0-9]+)*)' +\n\t\t// (Optional) Match '--' followed by any alphanumeric charachters. It\n\t\t// excludes underscore intentionally to prevent confusion, but it can\n\t\t// contain multiple hyphens. E.g., \"--custom-prefix--with-more-info\".\n\t\t'(?:--([a-z0-9_-]+))?$',\n\t'i' // Case insensitive.\n);\n\n// Regular expression for reference parsing. It can contain a namespace before\n// the reference, separated by `::`, like `some-namespace::state.somePath`.\n// Namespaces can contain any alphanumeric characters, hyphens, underscores or\n// forward slashes. References don't have any restrictions.\nconst nsPathRegExp = /^([\\w_\\/-]+)::(.+)$/;\n\nexport const hydratedIslands = new WeakSet();\n\n/**\n * Recursive function that transforms a DOM tree into vDOM.\n *\n * @param root The root element or node to start traversing on.\n * @return The resulting vDOM tree.\n */\nexport function toVdom( root: Node ): Array< ComponentChild > {\n\tconst treeWalker = document.createTreeWalker(\n\t\troot,\n\t\t205 // TEXT + CDATA_SECTION + COMMENT + PROCESSING_INSTRUCTION + ELEMENT\n\t);\n\n\tfunction walk(\n\t\tnode: Node\n\t): [ ComponentChild ] | [ ComponentChild, Node | null ] {\n\t\tconst { nodeType } = node;\n\n\t\t// TEXT_NODE (3)\n\t\tif ( nodeType === 3 ) {\n\t\t\treturn [ ( node as Text ).data ];\n\t\t}\n\n\t\t// CDATA_SECTION_NODE (4)\n\t\tif ( nodeType === 4 ) {\n\t\t\tconst next = treeWalker.nextSibling();\n\t\t\t( node as CDATASection ).replaceWith(\n\t\t\t\tnew window.Text( ( node as CDATASection ).nodeValue ?? '' )\n\t\t\t);\n\t\t\treturn [ node.nodeValue, next ];\n\t\t}\n\n\t\t// COMMENT_NODE (8) || PROCESSING_INSTRUCTION_NODE (7)\n\t\tif ( nodeType === 8 || nodeType === 7 ) {\n\t\t\tconst next = treeWalker.nextSibling();\n\t\t\t( node as Comment | ProcessingInstruction ).remove();\n\t\t\treturn [ null, next ];\n\t\t}\n\n\t\tconst elementNode = node as HTMLElement;\n\t\tconst { attributes } = elementNode;\n\t\tconst localName = elementNode.localName as keyof JSX.IntrinsicElements;\n\n\t\tconst props: Record< string, any > = {};\n\t\tconst children: Array< ComponentChild > = [];\n\t\tconst directives: Array<\n\t\t\t[ name: string, namespace: string | null, value: unknown ]\n\t\t> = [];\n\t\tlet ignore = false;\n\t\tlet island = false;\n\n\t\tfor ( let i = 0; i < attributes.length; i++ ) {\n\t\t\tconst attributeName = attributes[ i ].name;\n\t\t\tconst attributeValue = attributes[ i ].value;\n\t\t\tif (\n\t\t\t\tattributeName[ fullPrefix.length ] &&\n\t\t\t\tattributeName.slice( 0, fullPrefix.length ) === fullPrefix\n\t\t\t) {\n\t\t\t\tif ( attributeName === ignoreAttr ) {\n\t\t\t\t\tignore = true;\n\t\t\t\t} else {\n\t\t\t\t\tconst regexResult = nsPathRegExp.exec( attributeValue );\n\t\t\t\t\tconst namespace = regexResult?.[ 1 ] ?? null;\n\t\t\t\t\tlet value: any = regexResult?.[ 2 ] ?? attributeValue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst parsedValue = JSON.parse( value );\n\t\t\t\t\t\tvalue = isObject( parsedValue ) ? parsedValue : value;\n\t\t\t\t\t} catch {}\n\t\t\t\t\tif ( attributeName === islandAttr ) {\n\t\t\t\t\t\tisland = true;\n\t\t\t\t\t\tconst islandNamespace =\n\t\t\t\t\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\t\t\t\t\ttypeof value === 'string'\n\t\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t\t: typeof value?.namespace === 'string'\n\t\t\t\t\t\t\t\t? value.namespace\n\t\t\t\t\t\t\t\t: null;\n\t\t\t\t\t\tnamespaces.push( islandNamespace );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdirectives.push( [ attributeName, namespace, value ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ( attributeName === 'ref' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprops[ attributeName ] = attributeValue;\n\t\t}\n\n\t\tif ( ignore && ! island ) {\n\t\t\treturn [\n\t\t\t\th< any, any >( localName, {\n\t\t\t\t\t...props,\n\t\t\t\t\tinnerHTML: elementNode.innerHTML,\n\t\t\t\t\t__directives: { ignore: true },\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t\tif ( island ) {\n\t\t\thydratedIslands.add( elementNode );\n\t\t}\n\n\t\tif ( directives.length ) {\n\t\t\tprops.__directives = directives.reduce(\n\t\t\t\t( obj, [ name, ns, value ] ) => {\n\t\t\t\t\tconst directiveMatch = directiveParser.exec( name );\n\t\t\t\t\tif ( directiveMatch === null ) {\n\t\t\t\t\t\twarn( `Found malformed directive name: ${ name }.` );\n\t\t\t\t\t\treturn obj;\n\t\t\t\t\t}\n\t\t\t\t\tconst prefix = directiveMatch[ 1 ] || '';\n\t\t\t\t\tconst suffix = directiveMatch[ 2 ] || 'default';\n\n\t\t\t\t\tobj[ prefix ] = obj[ prefix ] || [];\n\t\t\t\t\tobj[ prefix ].push( {\n\t\t\t\t\t\tnamespace: ns ?? currentNamespace(),\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tsuffix,\n\t\t\t\t\t} );\n\t\t\t\t\treturn obj;\n\t\t\t\t},\n\t\t\t\t{}\n\t\t\t);\n\t\t}\n\n\t\t// @ts-expect-error Fixed in upcoming preact release https://github.com/preactjs/preact/pull/4334\n\t\tif ( localName === 'template' ) {\n\t\t\tprops.content = [\n\t\t\t\t...( elementNode as HTMLTemplateElement ).content.childNodes,\n\t\t\t].map( ( childNode ) => toVdom( childNode ) );\n\t\t} else {\n\t\t\tlet child = treeWalker.firstChild();\n\t\t\tif ( child ) {\n\t\t\t\twhile ( child ) {\n\t\t\t\t\tconst [ vnode, nextChild ] = walk( child );\n\t\t\t\t\tif ( vnode ) {\n\t\t\t\t\t\tchildren.push( vnode );\n\t\t\t\t\t}\n\t\t\t\t\tchild = nextChild || treeWalker.nextSibling();\n\t\t\t\t}\n\t\t\t\ttreeWalker.parentNode();\n\t\t\t}\n\t\t}\n\n\t\t// Restore previous namespace.\n\t\tif ( island ) {\n\t\t\tnamespaces.pop();\n\t\t}\n\n\t\treturn [ h( localName, props, children ) ];\n\t}\n\n\treturn walk( treeWalker.currentNode );\n}\n","/**\n * External dependencies\n */\nimport { hydrate, type ContainerNode, type ComponentChild } from 'preact';\n/**\n * Internal dependencies\n */\nimport { toVdom, hydratedIslands } from './vdom';\nimport { createRootFragment, splitTask } from './utils';\nimport { directivePrefix } from './constants';\n\n// Keep the same root fragment for each interactive region node.\nconst regionRootFragments = new WeakMap();\nexport const getRegionRootFragment = ( region: Element ): ContainerNode => {\n\tif ( ! region.parentElement ) {\n\t\tthrow Error( 'The passed region should be an element with a parent.' );\n\t}\n\tif ( ! regionRootFragments.has( region ) ) {\n\t\tregionRootFragments.set(\n\t\t\tregion,\n\t\t\tcreateRootFragment( region.parentElement, region )\n\t\t);\n\t}\n\treturn regionRootFragments.get( region );\n};\n\n// Initial vDOM regions associated with its DOM element.\nexport const initialVdom = new WeakMap< Element, ComponentChild[] >();\n\n// Initialize the router with the initial DOM.\nexport const init = async () => {\n\tconst nodes = document.querySelectorAll(\n\t\t`[data-${ directivePrefix }-interactive]`\n\t);\n\n\tfor ( const node of nodes ) {\n\t\tif ( ! hydratedIslands.has( node ) ) {\n\t\t\tawait splitTask();\n\t\t\tconst fragment = getRegionRootFragment( node );\n\t\t\tconst vdom = toVdom( node );\n\t\t\tinitialVdom.set( node, vdom );\n\t\t\tawait splitTask();\n\t\t\thydrate( vdom, fragment );\n\t\t}\n\t}\n};\n","/**\n * External dependencies\n */\nimport { h, cloneElement, render } from 'preact';\nimport { batch } from '@preact/signals';\n\n/**\n * Internal dependencies\n */\nimport registerDirectives from './directives';\nimport { init, getRegionRootFragment, initialVdom } from './init';\nimport { directivePrefix } from './constants';\nimport { toVdom } from './vdom';\nimport { directive } from './hooks';\nimport { getNamespace } from './namespaces';\nimport { parseServerData, populateServerData } from './store';\nimport { proxifyState } from './proxies';\n\nexport { store, getConfig, getServerState } from './store';\nexport { getContext, getServerContext, getElement } from './scopes';\nexport {\n\twithScope,\n\tuseWatch,\n\tuseInit,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseCallback,\n\tuseMemo,\n\tsplitTask,\n} from './utils';\n\nexport { useState, useRef } from 'preact/hooks';\n\nconst requiredConsent =\n\t'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.';\n\nexport const privateApis = ( lock ): any => {\n\tif ( lock === requiredConsent ) {\n\t\treturn {\n\t\t\tdirectivePrefix,\n\t\t\tgetRegionRootFragment,\n\t\t\tinitialVdom,\n\t\t\ttoVdom,\n\t\t\tdirective,\n\t\t\tgetNamespace,\n\t\t\th,\n\t\t\tcloneElement,\n\t\t\trender,\n\t\t\tproxifyState,\n\t\t\tparseServerData,\n\t\t\tpopulateServerData,\n\t\t\tbatch,\n\t\t};\n\t}\n\n\tthrow new Error( 'Forbidden access.' );\n};\n\nregisterDirectives();\ninit();\n"],"names":["MODE_HYDRATE","slice","options","vnodeId","isValidElement","rerenderQueue","prevDebounce","defer","depthSort","i","EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","isArray","Array","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","key","ref","normalizedProps","arguments","length","call","defaultProps","createVNode","original","vnode","__k","__","__b","__e","__d","__c","constructor","__v","__i","__u","Fragment","BaseComponent","context","this","getDomSibling","childIndex","sibling","updateParentDomPointers","child","base","enqueueRender","c","push","process","debounceRendering","renderQueueLength","component","newVNode","oldVNode","oldDom","parentDom","commitQueue","refQueue","sort","shift","__P","diff","__n","ownerSVGElement","commitRoot","diffChildren","renderResult","newParentVNode","oldParentVNode","globalContext","isSvg","excessDomChildren","isHydrating","childVNode","newDom","firstChildDom","oldChildren","newChildrenLength","constructNewChildrenArray","applyRef","insert","nextSibling","skewedIndex","matchingIndex","oldChildrenLength","remainingOldChildren","skew","String","findMatchingIndex","unmount","parentVNode","insertBefore","x","y","setStyle","style","value","setProperty","test","dom","name","oldValue","useCapture","o","cssText","replace","toLowerCase","l","_attached","Date","now","addEventListener","eventProxyCapture","eventProxy","removeEventListener","e","removeAttribute","setAttribute","eventHandler","_dispatched","event","tmp","isNew","oldProps","oldState","snapshot","clearProcessingException","newProps","provider","componentContext","renderHook","count","newType","outer","contextType","__E","prototype","render","doRender","sub","state","__h","_sb","__s","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","forEach","componentWillUpdate","componentDidUpdate","__r","getChildContext","getSnapshotBeforeUpdate","indexOf","diffElementNodes","diffed","root","some","cb","newHtml","oldHtml","newChildren","inputValue","checked","nodeType","localName","document","createTextNode","createElementNS","is","data","childNodes","attributes","__html","innerHTML","current","skipRemove","r","componentWillUnmount","replaceNode","firstChild","hydrate","cloneElement","createContext","defaultValue","contextId","Consumer","contextValue","Provider","subs","ctx","_props","old","splice","error","errorInfo","ctor","handled","getDerivedStateFromError","setState","componentDidCatch","undefined","update","callback","s","forceUpdate","Promise","then","bind","resolve","setTimeout","a","b","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","d","definition","Object","defineProperty","enumerable","get","prop","hasOwnProperty","currentIndex","currentComponent","previousComponent","prevRaf","currentHook","afterPaintEffects","EMPTY","oldBeforeDiff","oldBeforeRender","oldAfterDiff","oldCommit","oldBeforeUnmount","getHookState","index","hooks","__H","__V","useState","initialState","useReducer","reducer","hookState","_reducer","invokeOrReturn","action","currentValue","__N","nextValue","_hasScuFromHooks","updateHookState","p","stateHooks","filter","every","prevScu","shouldUpdate","hookItem","prevCWU","useEffect","args","argsChanged","_pendingArgs","useRef","initialValue","useMemo","factory","useCallback","useContext","flushAfterPaintEffects","invokeCleanup","invokeEffect","requestAnimationFrame","afterNextFrame","hasErrored","HAS_RAF","raf","done","clearTimeout","timeout","cancelAnimationFrame","hook","comp","cleanup","oldArgs","newArgs","arg","f","cycleDetected","Error","endBatch","batchDepth","hasError","batchedEffect","effect","batchIteration","next","_nextBatchedEffect","_flags","needsToRecompute","_callback","err","batch","finishUpdate","evalContext","globalVersion","addDependency","signal","_node","_target","_version","_source","_prevSource","_sources","_nextSource","_prevTarget","_nextTarget","_rollbackNode","_subscribe","Signal","_value","_targets","target","_refresh","prepareSources","rollbackNode","cleanupSources","head","prev","_unsubscribe","Computed","compute","_compute","_globalVersion","computed","cleanupEffect","_cleanup","prevContext","disposeEffect","endEffect","Effect","_dispose","hookName","hookFn","setCurrentUpdater","updater","_start","SignalValue","_ref","_this","currentSignal","useSignal","v","_updateFlags","_updater","_this$base","peek","createPropUpdater","propSignal","setAsProperty","changeSignal","_update","newSignal","subscribe","fn","flag","valueOf","toString","toJSON","set","_notify","OUTDATED","finish","displayName","defineProperties","configurable","signalProps","__np","renderedProps","updaters","_updaters","Component","namespaceStack","getNamespace","setNamespace","namespace","resetNamespace","pop","scopeStack","getScope","setScope","scope","resetScope","immutableMap","WeakMap","immutableError","immutableHandlers","receiver","Reflect","deepImmutable","deleteProperty","has","Proxy","getContext","getElement","freeze","getServerContext","serverContext","window","splitTask","withScope","func","ns","async","gen","it","throw","useWatch","_useEffect","eff","isExecuting","notify","flush","dispose","createFlusher","useSignalEffect","useInit","inputs","useLayoutEffect","_useLayoutEffect","_useCallback","_useMemo","Set","isPlainObject","candidate","Boolean","objToProxy","proxyToObj","proxyToNs","supported","createProxy","handlers","shouldProxy","proxy","getProxyFromObject","getNamespaceFromProxy","NO_SCOPE","PropSignal","owner","computedsByScope","setValue","setGetter","getter","getComputed","valueSignal","getterSignal","wellKnownSymbols","getOwnPropertyNames","Symbol","map","proxyToProps","hasPropSignal","readOnlyProxies","WeakSet","getPropSignal","initial","Map","readOnly","proxifyState","objToIterable","stateHandlers","desc","getOwnPropertyDescriptor","result","ownKeys","_","add","deepMergeRecursive","source","override","hasNewKeys","deepMerge","storeRoots","storeHandlers","proxifyStore","scoped","isRoot","contextObjectToProxy","contextObjectToFallback","contextProxies","descriptor","contextHandlers","fallback","currentProp","keys","proxifyContext","inherited","stores","rawStores","storeLocks","storeConfigs","serverStates","getConfig","getServerState","universalUnlock","store","block","lock","storeLock","rawStore","proxifiedStore","parseServerData","_dom$getElementById","jsonDataScriptTag","getElementById","textContent","JSON","parse","populateServerData","entries","st","config","client","server","directiveCallbacks","directivePriorities","directive","priority","getEvaluate","entry","path","hasNegationOperator","resolvedStore","split","reduce","acc","Directives","directives","priorityLevels","currentPriorityLevel","nextPriorityLevels","element","originalProps","previousScope","evaluate","directiveArgs","directiveName","wrapper","deepClone","fromEntries","__directives","find","suffix","byPriority","p1","p2","parseInt","arr","getPriorityLevels","top","newRule","ruleClean","ruleNewline","getGlobalEventDirective","eventName","globalVar","getGlobalAsyncEventDirective","passive","directivePrefix","ignoreAttr","islandAttr","fullPrefix","namespaces","directiveParser","RegExp","nsPathRegExp","hydratedIslands","toVdom","treeWalker","createTreeWalker","walk","_nodeValue","replaceWith","Text","nodeValue","remove","elementNode","ignore","island","attributeName","attributeValue","_regexResult$","_regexResult$2","regexResult","exec","parsedValue","item","islandNamespace","h","directiveMatch","prefix","currentNamespace","_namespaces","content","childNode","nextChild","currentNode","regionRootFragments","getRegionRootFragment","region","parentElement","createRootFragment","parent","concat","appendChild","initialVdom","privateApis","inheritedContext","defaultEntry","inheritedClient","inheritedServer","contextStack","watch","init","on","events","eventType","existingHandler","onAsync","class","classNames","className","currentClass","classFinder","trim","classList","styleProp","val","tree","left","unshift","cssStringToObject","removeProperty","attribute","el","Type","rest","cached","dangerouslySetInnerHTML","text","run","each","eachKey","inheritedValue","itemProp","_match","group1","toUpperCase","itemContext","mergedContext","nodes","querySelectorAll","fragment","vdom"],"sourceRoot":""} \ No newline at end of file diff --git a/build/block-library/blocks/file.php b/build/block-library/blocks/file.php index b47094f7..ca21d49e 100644 --- a/build/block-library/blocks/file.php +++ b/build/block-library/blocks/file.php @@ -19,18 +19,7 @@ function gutenberg_render_block_core_file( $attributes, $content ) { // If it's interactive, enqueue the script module and add the directives. if ( ! empty( $attributes['displayPreview'] ) ) { - $suffix = wp_scripts_get_suffix(); - if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { - $module_url = gutenberg_url( '/build-module/block-library/file/view.min.js' ); - } - - wp_register_script_module( - '@wordpress/block-library/file', - isset( $module_url ) ? $module_url : includes_url( "blocks/file/view{$suffix}.js" ), - array( '@wordpress/interactivity' ), - defined( 'GUTENBERG_VERSION' ) ? GUTENBERG_VERSION : get_bloginfo( 'version' ) - ); - wp_enqueue_script_module( '@wordpress/block-library/file' ); + wp_enqueue_script_module( '@wordpress/block-library/file/view' ); $processor = new WP_HTML_Tag_Processor( $content ); $processor->next_tag(); diff --git a/build/block-library/blocks/image.php b/build/block-library/blocks/image.php index 01328266..a0699926 100644 --- a/build/block-library/blocks/image.php +++ b/build/block-library/blocks/image.php @@ -70,19 +70,7 @@ function gutenberg_render_block_core_image( $attributes, $content, $block ) { isset( $lightbox_settings['enabled'] ) && true === $lightbox_settings['enabled'] ) { - $suffix = wp_scripts_get_suffix(); - if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { - $module_url = gutenberg_url( '/build-module/block-library/image/view.min.js' ); - } - - wp_register_script_module( - '@wordpress/block-library/image', - isset( $module_url ) ? $module_url : includes_url( "blocks/image/view{$suffix}.js" ), - array( '@wordpress/interactivity' ), - defined( 'GUTENBERG_VERSION' ) ? GUTENBERG_VERSION : get_bloginfo( 'version' ) - ); - - wp_enqueue_script_module( '@wordpress/block-library/image' ); + wp_enqueue_script_module( '@wordpress/block-library/image/view' ); /* * This render needs to happen in a filter with priority 15 to ensure that diff --git a/build/block-library/blocks/navigation.php b/build/block-library/blocks/navigation.php index 8b9293f9..f6501527 100644 --- a/build/block-library/blocks/navigation.php +++ b/build/block-library/blocks/navigation.php @@ -622,18 +622,7 @@ private static function get_nav_element_directives( $is_interactive ) { */ private static function handle_view_script_module_loading( $attributes, $block, $inner_blocks ) { if ( static::is_interactive( $attributes, $inner_blocks ) ) { - $suffix = wp_scripts_get_suffix(); - if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { - $module_url = gutenberg_url( '/build-module/block-library/navigation/view.min.js' ); - } - - wp_register_script_module( - '@wordpress/block-library/navigation', - isset( $module_url ) ? $module_url : includes_url( "blocks/navigation/view{$suffix}.js" ), - array( '@wordpress/interactivity' ), - defined( 'GUTENBERG_VERSION' ) ? GUTENBERG_VERSION : get_bloginfo( 'version' ) - ); - wp_enqueue_script_module( '@wordpress/block-library/navigation' ); + wp_enqueue_script_module( '@wordpress/block-library/navigation/view' ); } } diff --git a/build/block-library/blocks/query.php b/build/block-library/blocks/query.php index 0882b49c..03a98b46 100644 --- a/build/block-library/blocks/query.php +++ b/build/block-library/blocks/query.php @@ -24,27 +24,7 @@ function gutenberg_render_block_core_query( $attributes, $content, $block ) { // Enqueue the script module and add the necessary directives if the block is // interactive. if ( $is_interactive ) { - $suffix = wp_scripts_get_suffix(); - if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { - $module_url = gutenberg_url( '/build-module/block-library/query/view.min.js' ); - } - - wp_register_script_module( - '@wordpress/block-library/query', - isset( $module_url ) ? $module_url : includes_url( "blocks/query/view{$suffix}.js" ), - array( - array( - 'id' => '@wordpress/interactivity', - 'import' => 'static', - ), - array( - 'id' => '@wordpress/interactivity-router', - 'import' => 'dynamic', - ), - ), - defined( 'GUTENBERG_VERSION' ) ? GUTENBERG_VERSION : get_bloginfo( 'version' ) - ); - wp_enqueue_script_module( '@wordpress/block-library/query' ); + wp_enqueue_script_module( '@wordpress/block-library/query/view' ); $p = new WP_HTML_Tag_Processor( $content ); if ( $p->next_tag() ) { diff --git a/build/block-library/blocks/search.php b/build/block-library/blocks/search.php index e83fbb26..607e9f9c 100644 --- a/build/block-library/blocks/search.php +++ b/build/block-library/blocks/search.php @@ -80,18 +80,7 @@ function gutenberg_render_block_core_search( $attributes ) { // If it's interactive, enqueue the script module and add the directives. $is_expandable_searchfield = 'button-only' === $button_position; if ( $is_expandable_searchfield ) { - $suffix = wp_scripts_get_suffix(); - if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { - $module_url = gutenberg_url( '/build-module/block-library/search/view.min.js' ); - } - - wp_register_script_module( - '@wordpress/block-library/search', - isset( $module_url ) ? $module_url : includes_url( "blocks/search/view{$suffix}.js" ), - array( '@wordpress/interactivity' ), - defined( 'GUTENBERG_VERSION' ) ? GUTENBERG_VERSION : get_bloginfo( 'version' ) - ); - wp_enqueue_script_module( '@wordpress/block-library/search' ); + wp_enqueue_script_module( '@wordpress/block-library/search/view' ); $input->set_attribute( 'data-wp-bind--aria-hidden', '!context.isSearchInputVisible' ); $input->set_attribute( 'data-wp-bind--tabindex', 'state.tabindex' ); diff --git a/gutenberg.php b/gutenberg.php index 98a822fa..a9a98a44 100644 --- a/gutenberg.php +++ b/gutenberg.php @@ -14,7 +14,7 @@ ### BEGIN AUTO-GENERATED DEFINES define( 'GUTENBERG_VERSION', '19.3.0' ); -define( 'GUTENBERG_GIT_COMMIT', '4baca3e1730c748936c26864aad39b9cc0b51e3c' ); +define( 'GUTENBERG_GIT_COMMIT', '8488c647734d0c2516488fc0cb919bec8f29357c' ); ### END AUTO-GENERATED DEFINES defined( 'GUTENBERG_MINIMUM_WP_VERSION' ) or define( 'GUTENBERG_MINIMUM_WP_VERSION', '6.5' ); diff --git a/lib/client-assets.php b/lib/client-assets.php index 62e874d6..2343530e 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -601,6 +601,56 @@ function gutenberg_register_vendor_scripts( $scripts ) { } add_action( 'wp_default_scripts', 'gutenberg_register_vendor_scripts' ); +/** + * Registers or re-registers Gutenberg Script Modules. + * + * Script modules that are registered by Core will be re-registered by Gutenberg. + * + * @since 19.3.0 + */ +function gutenberg_default_script_modules() { + /* + * Expects multidimensional array like: + * + * 'interactivity/index.min.js' => array('dependencies' => array(…), 'version' => '…'), + * 'interactivity/debug.min.js' => array('dependencies' => array(…), 'version' => '…'), + * 'interactivity-router/index.min.js' => … + */ + $assets = include gutenberg_dir_path() . '/build-module/assets.php'; + + foreach ( $assets as $file_name => $script_module_data ) { + /* + * Build the WordPress Script Module ID from the file name. + * Prepend `@wordpress/` and remove extensions and `/index` if present: + * - interactivity/index.min.js => @wordpress/interactivity + * - interactivity/debug.min.js => @wordpress/interactivity/debug + * - block-library/query/view.js => @wordpress/block-library/query/view + */ + $script_module_id = '@wordpress/' . preg_replace( '~(?:/index)?\.min\.js$~D', '', $file_name, 1 ); + switch ( $script_module_id ) { + /* + * Interactivity exposes two entrypoints, "/index" and "/debug". + * "/debug" should replalce "/index" in devlopment. + */ + case '@wordpress/interactivity/debug': + if ( ! SCRIPT_DEBUG ) { + continue 2; + } + $script_module_id = '@wordpress/interactivity'; + break; + case '@wordpress/interactivity': + if ( SCRIPT_DEBUG ) { + continue 2; + } + break; + } + + $path = gutenberg_url( "build-module/{$file_name}" ); + wp_register_script_module( $script_module_id, $path, $script_module_data['dependencies'], $script_module_data['version'] ); + } +} +remove_action( 'wp_default_scripts', 'wp_default_script_modules' ); +add_action( 'wp_default_scripts', 'gutenberg_default_script_modules' ); /* * Always remove the Core action hook while gutenberg_enqueue_stored_styles() exists to avoid styles being printed twice. diff --git a/lib/experimental/script-modules.php b/lib/experimental/script-modules.php index f65bc170..fe23786f 100644 --- a/lib/experimental/script-modules.php +++ b/lib/experimental/script-modules.php @@ -239,26 +239,5 @@ function gutenberg_a11y_script_module_html() { . '
' . '
'; } - -/** - * Registers Gutenberg Script Modules. - * - * @since 19.3 - */ -function gutenberg_register_script_modules() { - // When in production, use the plugin's version as the default asset version; - // else (for development or test) default to use the current time. - $default_version = defined( 'GUTENBERG_VERSION' ) && ! SCRIPT_DEBUG ? GUTENBERG_VERSION : time(); - - wp_deregister_script_module( '@wordpress/a11y' ); - wp_register_script_module( - '@wordpress/a11y', - gutenberg_url( 'build-module/a11y/index.min.js' ), - array(), - $default_version - ); - - add_action( 'wp_footer', 'gutenberg_a11y_script_module_html' ); - add_action( 'admin_footer', 'gutenberg_a11y_script_module_html' ); -} -add_action( 'init', 'gutenberg_register_script_modules' ); +add_action( 'wp_footer', 'gutenberg_a11y_script_module_html' ); +add_action( 'admin_footer', 'gutenberg_a11y_script_module_html' ); diff --git a/lib/interactivity-api.php b/lib/interactivity-api.php index c00d68bc..ff68936f 100644 --- a/lib/interactivity-api.php +++ b/lib/interactivity-api.php @@ -5,37 +5,6 @@ * @package gutenberg */ -/** - * Deregisters the Core Interactivity API Modules and replace them - * with the ones from the Gutenberg plugin. - */ -function gutenberg_reregister_interactivity_script_modules() { - $default_version = defined( 'GUTENBERG_VERSION' ) && ! SCRIPT_DEBUG ? GUTENBERG_VERSION : time(); - wp_deregister_script_module( '@wordpress/interactivity' ); - wp_deregister_script_module( '@wordpress/interactivity-router' ); - - wp_register_script_module( - '@wordpress/interactivity', - gutenberg_url( '/build-module/' . ( SCRIPT_DEBUG ? 'interactivity/debug.min.js' : 'interactivity/index.min.js' ) ), - array(), - $default_version - ); - - wp_register_script_module( - '@wordpress/interactivity-router', - gutenberg_url( '/build-module/interactivity-router/index.min.js' ), - array( - array( - 'id' => '@wordpress/a11y', - 'import' => 'dynamic', - ), - '@wordpress/interactivity', - ), - $default_version - ); -} -add_action( 'init', 'gutenberg_reregister_interactivity_script_modules' ); - /** * Adds script data to the interactivity-router script module. *
should have a
should have a