interactivity-router/index.js000064400000034037147207022110012430 0ustar00import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity"; /******/ var __webpack_modules__ = ({ /***/ 317: /***/ ((module) => { module.exports = import("@wordpress/a11y");; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { // EXPORTS __webpack_require__.d(__webpack_exports__, { o: () => (/* binding */ actions), w: () => (/* binding */ state) }); ;// CONCATENATED MODULE: external "@wordpress/interactivity" var x = (y) => { var x = {}; __webpack_require__.d(x, y); return x } var y = (x) => (() => (x)) const interactivity_namespaceObject = 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) }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity-router/build-module/index.js var _getConfig$navigation; /** * WordPress dependencies */ /** * Internal dependencies */ const { directivePrefix, getRegionRootFragment, initialVdom, toVdom, render, parseServerData, populateServerData, batch } = (0,interactivity_namespaceObject.privateApis)('I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.'); // Check if the navigation mode is full page or region based. const navigationMode = (_getConfig$navigation = (0,interactivity_namespaceObject.getConfig)('core/router').navigationMode) !== null && _getConfig$navigation !== void 0 ? _getConfig$navigation : 'regionBased'; // The cache of visited and prefetched pages, stylesheets and scripts. const pages = new Map(); const headElements = new Map(); // Helper to remove domain and hash from the URL. We are only interesting in // caching the path and the query. const getPagePath = url => { const u = new URL(url, window.location.href); return u.pathname + u.search; }; // Fetch a new page and convert it to a static virtual DOM. const fetchPage = async (url, { html }) => { try { if (!html) { const res = await window.fetch(url); if (res.status !== 200) { return false; } html = await res.text(); } const dom = new window.DOMParser().parseFromString(html, 'text/html'); return regionsToVdom(dom); } catch (e) { return false; } }; // Return an object with VDOM trees of those HTML regions marked with a // `router-region` directive. const regionsToVdom = async (dom, { vdom } = {}) => { const regions = { body: undefined }; let head; if (false) {} if (navigationMode === 'regionBased') { const attrName = `data-${directivePrefix}-router-region`; dom.querySelectorAll(`[${attrName}]`).forEach(region => { const id = region.getAttribute(attrName); regions[id] = vdom?.has(region) ? vdom.get(region) : toVdom(region); }); } const title = dom.querySelector('title')?.innerText; const initialData = parseServerData(dom); return { regions, head, title, initialData }; }; // Render all interactive regions contained in the given page. const renderRegions = page => { batch(() => { if (false) {} if (navigationMode === 'regionBased') { populateServerData(page.initialData); const attrName = `data-${directivePrefix}-router-region`; document.querySelectorAll(`[${attrName}]`).forEach(region => { const id = region.getAttribute(attrName); const fragment = getRegionRootFragment(region); render(page.regions[id], fragment); }); } if (page.title) { document.title = page.title; } }); }; /** * Load the given page forcing a full page reload. * * The function returns a promise that won't resolve, useful to prevent any * potential feedback indicating that the navigation has finished while the new * page is being loaded. * * @param href The page href. * @return Promise that never resolves. */ const forcePageReload = href => { window.location.assign(href); return new Promise(() => {}); }; // Listen to the back and forward buttons and restore the page if it's in the // cache. window.addEventListener('popstate', async () => { const pagePath = getPagePath(window.location.href); // Remove hash. const page = pages.has(pagePath) && (await pages.get(pagePath)); if (page) { renderRegions(page); // Update the URL in the state. state.url = window.location.href; } else { window.location.reload(); } }); // Initialize the router and cache the initial page using the initial vDOM. // Once this code is tested and more mature, the head should be updated for // region based navigation as well. if (false) {} pages.set(getPagePath(window.location.href), Promise.resolve(regionsToVdom(document, { vdom: initialVdom }))); // Check if the link is valid for client-side navigation. const isValidLink = ref => ref && ref instanceof window.HTMLAnchorElement && ref.href && (!ref.target || ref.target === '_self') && ref.origin === window.location.origin && !ref.pathname.startsWith('/wp-admin') && !ref.pathname.startsWith('/wp-login.php') && !ref.getAttribute('href').startsWith('#') && !new URL(ref.href).searchParams.has('_wpnonce'); // Check if the event is valid for client-side navigation. const isValidEvent = event => event && event.button === 0 && // Left clicks only. !event.metaKey && // Open in new tab (Mac). !event.ctrlKey && // Open in new tab (Windows). !event.altKey && // Download. !event.shiftKey && !event.defaultPrevented; // Variable to store the current navigation. let navigatingTo = ''; let hasLoadedNavigationTextsData = false; const navigationTexts = { loading: 'Loading page, please wait.', loaded: 'Page Loaded.' }; const { state, actions } = (0,interactivity_namespaceObject.store)('core/router', { state: { url: window.location.href, navigation: { hasStarted: false, hasFinished: false } }, actions: { /** * Navigates to the specified page. * * This function normalizes the passed href, fetchs the page HTML if * needed, and updates any interactive regions whose contents have * changed. It also creates a new entry in the browser session history. * * @param href The page href. * @param [options] Options object. * @param [options.force] If true, it forces re-fetching the URL. * @param [options.html] HTML string to be used instead of fetching the requested URL. * @param [options.replace] If true, it replaces the current entry in the browser session history. * @param [options.timeout] Time until the navigation is aborted, in milliseconds. Default is 10000. * @param [options.loadingAnimation] Whether an animation should be shown while navigating. Default to `true`. * @param [options.screenReaderAnnouncement] Whether a message for screen readers should be announced while navigating. Default to `true`. * * @return Promise that resolves once the navigation is completed or aborted. */ *navigate(href, options = {}) { const { clientNavigationDisabled } = (0,interactivity_namespaceObject.getConfig)(); if (clientNavigationDisabled) { yield forcePageReload(href); } const pagePath = getPagePath(href); const { navigation } = state; const { loadingAnimation = true, screenReaderAnnouncement = true, timeout = 10000 } = options; navigatingTo = href; actions.prefetch(pagePath, options); // Create a promise that resolves when the specified timeout ends. // The timeout value is 10 seconds by default. const timeoutPromise = new Promise(resolve => setTimeout(resolve, timeout)); // Don't update the navigation status immediately, wait 400 ms. const loadingTimeout = setTimeout(() => { if (navigatingTo !== href) { return; } if (loadingAnimation) { navigation.hasStarted = true; navigation.hasFinished = false; } if (screenReaderAnnouncement) { a11ySpeak('loading'); } }, 400); const page = yield Promise.race([pages.get(pagePath), timeoutPromise]); // Dismiss loading message if it hasn't been added yet. clearTimeout(loadingTimeout); // Once the page is fetched, the destination URL could have changed // (e.g., by clicking another link in the meantime). If so, bail // out, and let the newer execution to update the HTML. if (navigatingTo !== href) { return; } if (page && !page.initialData?.config?.['core/router']?.clientNavigationDisabled) { yield renderRegions(page); window.history[options.replace ? 'replaceState' : 'pushState']({}, '', href); // Update the URL in the state. state.url = href; // Update the navigation status once the the new page rendering // has been completed. if (loadingAnimation) { navigation.hasStarted = false; navigation.hasFinished = true; } if (screenReaderAnnouncement) { a11ySpeak('loaded'); } // Scroll to the anchor if exits in the link. const { hash } = new URL(href, window.location.href); if (hash) { document.querySelector(hash)?.scrollIntoView(); } } else { yield forcePageReload(href); } }, /** * Prefetchs the page with the passed URL. * * The function normalizes the URL and stores internally the fetch * promise, to avoid triggering a second fetch for an ongoing request. * * @param url The page URL. * @param [options] Options object. * @param [options.force] Force fetching the URL again. * @param [options.html] HTML string to be used instead of fetching the requested URL. */ prefetch(url, options = {}) { const { clientNavigationDisabled } = (0,interactivity_namespaceObject.getConfig)(); if (clientNavigationDisabled) { return; } const pagePath = getPagePath(url); if (options.force || !pages.has(pagePath)) { pages.set(pagePath, fetchPage(pagePath, { html: options.html })); } } } }); /** * Announces a message to screen readers. * * This is a wrapper around the `@wordpress/a11y` package's `speak` function. It handles importing * the package on demand and should be used instead of calling `ally.speak` direacly. * * @param messageKey The message to be announced by assistive technologies. */ function a11ySpeak(messageKey) { if (!hasLoadedNavigationTextsData) { hasLoadedNavigationTextsData = true; const content = document.getElementById('wp-script-module-data-@wordpress/interactivity-router')?.textContent; if (content) { try { const parsed = JSON.parse(content); if (typeof parsed?.i18n?.loading === 'string') { navigationTexts.loading = parsed.i18n.loading; } if (typeof parsed?.i18n?.loaded === 'string') { navigationTexts.loaded = parsed.i18n.loaded; } } catch {} } else { // Fallback to localized strings from Interactivity API state. // @todo This block is for Core < 6.7.0. Remove when support is dropped. // @ts-expect-error if (state.navigation.texts?.loading) { // @ts-expect-error navigationTexts.loading = state.navigation.texts.loading; } // @ts-expect-error if (state.navigation.texts?.loaded) { // @ts-expect-error navigationTexts.loaded = state.navigation.texts.loaded; } } } const message = navigationTexts[messageKey]; Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 317)).then(({ speak }) => speak(message), // Ignore failures to load the a11y module. () => {}); } // Add click and prefetch to all links. if (false) {} })(); var __webpack_exports__actions = __webpack_exports__.o; var __webpack_exports__state = __webpack_exports__.w; export { __webpack_exports__actions as actions, __webpack_exports__state as state }; interactivity-router/index.min.js000064400000007106147207022110013207 0ustar00import*as e from"@wordpress/interactivity";var t={317:e=>{e.exports=import("@wordpress/a11y")}},o={};function i(e){var n=o[e];if(void 0!==n)return n.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,i),a.exports}i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};(()=>{i.d(n,{o:()=>P,w:()=>S});const t=(e=>{var t={};return i.d(t,e),t})({getConfig:()=>e.getConfig,privateApis:()=>e.privateApis,store:()=>e.store});var o;const{directivePrefix:a,getRegionRootFragment:r,initialVdom:s,toVdom:d,render:l,parseServerData:c,populateServerData:g,batch:p}=(0,t.privateApis)("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),u=null!==(o=(0,t.getConfig)("core/router").navigationMode)&&void 0!==o?o:"regionBased",w=new Map,h=(new Map,e=>{const t=new URL(e,window.location.href);return t.pathname+t.search}),f=async(e,{vdom:t}={})=>{const o={body:void 0};if("regionBased"===u){const i=`data-${a}-router-region`;e.querySelectorAll(`[${i}]`).forEach((e=>{const n=e.getAttribute(i);o[n]=t?.has(e)?t.get(e):d(e)}))}const i=e.querySelector("title")?.innerText,n=c(e);return{regions:o,head:undefined,title:i,initialData:n}},v=e=>{p((()=>{if("regionBased"===u){g(e.initialData);const t=`data-${a}-router-region`;document.querySelectorAll(`[${t}]`).forEach((o=>{const i=o.getAttribute(t),n=r(o);l(e.regions[i],n)}))}e.title&&(document.title=e.title)}))},m=e=>(window.location.assign(e),new Promise((()=>{})));window.addEventListener("popstate",(async()=>{const e=h(window.location.href),t=w.has(e)&&await w.get(e);t?(v(t),S.url=window.location.href):window.location.reload()})),w.set(h(window.location.href),Promise.resolve(f(document,{vdom:s})));let y="",x=!1;const b={loading:"Loading page, please wait.",loaded:"Page Loaded."},{state:S,actions:P}=(0,t.store)("core/router",{state:{url:window.location.href,navigation:{hasStarted:!1,hasFinished:!1}},actions:{*navigate(e,o={}){const{clientNavigationDisabled:i}=(0,t.getConfig)();i&&(yield m(e));const n=h(e),{navigation:a}=S,{loadingAnimation:r=!0,screenReaderAnnouncement:s=!0,timeout:d=1e4}=o;y=e,P.prefetch(n,o);const l=new Promise((e=>setTimeout(e,d))),c=setTimeout((()=>{y===e&&(r&&(a.hasStarted=!0,a.hasFinished=!1),s&&A("loading"))}),400),g=yield Promise.race([w.get(n),l]);if(clearTimeout(c),y===e)if(g&&!g.initialData?.config?.["core/router"]?.clientNavigationDisabled){yield v(g),window.history[o.replace?"replaceState":"pushState"]({},"",e),S.url=e,r&&(a.hasStarted=!1,a.hasFinished=!0),s&&A("loaded");const{hash:t}=new URL(e,window.location.href);t&&document.querySelector(t)?.scrollIntoView()}else yield m(e)},prefetch(e,o={}){const{clientNavigationDisabled:i}=(0,t.getConfig)();if(i)return;const n=h(e);!o.force&&w.has(n)||w.set(n,(async(e,{html:t})=>{try{if(!t){const o=await window.fetch(e);if(200!==o.status)return!1;t=await o.text()}const o=(new window.DOMParser).parseFromString(t,"text/html");return f(o)}catch(e){return!1}})(n,{html:o.html}))}}});function A(e){if(!x){x=!0;const e=document.getElementById("wp-script-module-data-@wordpress/interactivity-router")?.textContent;if(e)try{const t=JSON.parse(e);"string"==typeof t?.i18n?.loading&&(b.loading=t.i18n.loading),"string"==typeof t?.i18n?.loaded&&(b.loaded=t.i18n.loaded)}catch{}else S.navigation.texts?.loading&&(b.loading=S.navigation.texts.loading),S.navigation.texts?.loaded&&(b.loaded=S.navigation.texts.loaded)}const t=b[e];Promise.resolve().then(i.bind(i,317)).then((({speak:e})=>e(t)),(()=>{}))}})();var a=n.o,r=n.w;export{a as actions,r as state};interactivity/debug.min.js000064400000132462147207022110011654 0ustar00var e={380:(e,t,n)=>{n.d(t,{zj:()=>ft,SD:()=>ve,V6:()=>ye,$K:()=>me,vT:()=>pt,jb:()=>Jt,yT:()=>we,M_:()=>dt,hb:()=>Oe,vJ:()=>Ee,ip:()=>xe,Nf:()=>Te,Kr:()=>Fe,li:()=>b,J0:()=>m,FH:()=>Se,v4:()=>ke});var r,o,i,s,a=n(622),u=0,l=[],c=a.fF,_=c.__b,f=c.__r,p=c.diffed,h=c.__c,d=c.unmount,v=c.__;function y(e,t){c.__h&&c.__h(o,e,u||t),u=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function m(e){return u=1,function(e,t,n){var i=y(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):N(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.u)){var s=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!a||a.call(this,e,t,n);var o=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&i.__c.props===e)&&(!a||a.call(this,e,t,n))};o.u=!0;var a=o.shouldComponentUpdate,u=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,s(e,t,n),a=r}u&&u.call(this,e,t,n)},o.shouldComponentUpdate=s}return i.__N||i.__}(N,e)}function g(e,t){var n=y(r++,3);!c.__s&&C(n.__H,t)&&(n.__=e,n.i=t,o.__H.__h.push(n))}function w(e,t){var n=y(r++,4);!c.__s&&C(n.__H,t)&&(n.__=e,n.i=t,o.__h.push(n))}function b(e){return u=5,k((function(){return{current:e}}),[])}function k(e,t){var n=y(r++,7);return C(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function S(e,t){return u=8,k((function(){return e}),t)}function x(e){var t=o.context[e.__c],n=y(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function E(){for(var e;e=l.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(F),e.__H.__h.forEach(P),e.__H.__h=[]}catch(t){e.__H.__h=[],c.__e(t,e.__v)}}c.__b=function(e){o=null,_&&_(e)},c.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),v&&v(e,t)},c.__r=function(e){f&&f(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(F),t.__h.forEach(P),t.__h=[],r=0)),i=o},c.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==l.push(t)&&s===c.requestAnimationFrame||((s=c.requestAnimationFrame)||O)(E)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),i=o=null},c.__c=function(e,t){t.some((function(e){try{e.__h.forEach(F),e.__h=e.__h.filter((function(e){return!e.__||P(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],c.__e(n,e.__v)}})),h&&h(e,t)},c.unmount=function(e){d&&d(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{F(e)}catch(e){t=e}})),n.__H=void 0,t&&c.__e(t,n.__v))};var T="function"==typeof requestAnimationFrame;function O(e){var t,n=function(){clearTimeout(r),T&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);T&&(t=requestAnimationFrame(n))}function F(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function P(e){var t=o;e.__c=e.__(),o=t}function C(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function N(e,t){return"function"==typeof t?t(e):t}var j=Symbol.for("preact-signals");function M(){if(W>1)W--;else{for(var e,t=!1;void 0!==A;){var n=A;for(A=void 0,L++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&V(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(L=0,W--,t)throw e}}function H(e){if(W>0)return e();W++;try{return e()}finally{M()}}var $=void 0;var U,A=void 0,W=0,L=0,D=0;function I(e){if(void 0!==$){var t=e.n;if(void 0===t||t.t!==$)return t={i:0,S:e,p:$.s,n:void 0,t:$,e:void 0,x:void 0,r:t},void 0!==$.s&&($.s.n=t),$.s=t,e.n=t,32&$.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=$.s,t.n=void 0,$.s.n=t,$.s=t),t}}function R(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function z(e){return new R(e)}function V(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function B(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function J(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function K(e){R.call(this,void 0),this.x=e,this.s=void 0,this.g=D-1,this.f=4}function q(e){return new K(e)}function Y(e){var t=e.u;if(e.u=void 0,"function"==typeof t){W++;var n=$;$=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,X(e),t}finally{$=n,M()}}}function X(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Y(e)}function G(e){if($!==this)throw new Error("Out-of-order effect");J(this),$=e,this.f&=-2,8&this.f&&X(this),M()}function Q(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function Z(e){var t=new Q(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function ee(e,t){a.fF[e]=t.bind(null,a.fF[e]||function(){})}function te(e){U&&U(),U=e&&e.S()}function ne(e){var t=this,n=e.data,r=function(e){return k((function(){return z(e)}),[])}(n);r.value=n;var o=k((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e;(0,a.zO)(o.peek())||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=o.peek()},q((function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return o.value}function re(e,t,n,r){var o=t in e&&void 0===e.ownerSVGElement,i=z(n);return{o:function(e,t){i.value=e,r=t},d:Z((function(){var n=i.value.value;r[t]!==n&&(r[t]=n,o?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}R.prototype.brand=j,R.prototype.h=function(){return!0},R.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},R.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},R.prototype.subscribe=function(e){var t=this;return Z((function(){var n=t.value,r=$;$=void 0;try{e(n)}finally{$=r}}))},R.prototype.valueOf=function(){return this.value},R.prototype.toString=function(){return this.value+""},R.prototype.toJSON=function(){return this.value},R.prototype.peek=function(){var e=$;$=void 0;try{return this.value}finally{$=e}},Object.defineProperty(R.prototype,"value",{get:function(){var e=I(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(L>100)throw new Error("Cycle detected");this.v=e,this.i++,D++,W++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{M()}}}}),(K.prototype=new R).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===D)return!0;if(this.g=D,this.f|=1,this.i>0&&!V(this))return this.f&=-2,!0;var e=$;try{B(this),$=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return $=e,J(this),this.f&=-2,!0},K.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}R.prototype.S.call(this,e)},K.prototype.U=function(e){if(void 0!==this.t&&(R.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},K.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(K.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=I(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Q.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},Q.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Y(this),B(this),W++;var e=$;return $=this,G.bind(this,e)},Q.prototype.N=function(){2&this.f||(this.f|=2,this.o=A,A=this)},Q.prototype.d=function(){this.f|=8,1&this.f||X(this)},ne.displayName="_st",Object.defineProperties(R.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ne},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),ee("__b",(function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var o in r)if("children"!==o){var i=r[o];i instanceof R&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)})),ee("__r",(function(e,t){te();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(e){var t;return Z((function(){t=this})),t.c=function(){r.__$f|=1,r.setState({})},t}())),r,te(n),e(t)})),ee("__e",(function(e,t,n,r){te(),void 0,e(t,n,r)})),ee("diffed",(function(e,t){var n;if(te(),void 0,"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var s in i){var a=i[s];void 0===a||s in r||(a.d(),i[s]=void 0)}else n.U=i={};for(var u in r){var l=i[u],c=r[u];void 0===l?(l=re(n,u,c,o),i[u]=l):l.o(c,o)}}}e(t)})),ee("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var i=r[o];i&&i.d()}}}else{var s=t.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}e(t)})),ee("__h",(function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)})),a.uA.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var r in t)return!0;for(var o in e)if("__source"!==o&&e[o]!==this.props[o])return!0;for(var i in this.props)if(!(i in e))return!0;return!1};const oe=[],ie=()=>oe.slice(-1)[0],se=e=>{oe.push(e)},ae=()=>{oe.pop()},ue=[],le=()=>ue.slice(-1)[0],ce=e=>{ue.push(e)},_e=()=>{ue.pop()},fe=new WeakMap,pe=()=>{throw new Error("Please use `data-wp-bind` to modify the attributes of an element.")},he={get(e,t,n){const r=Reflect.get(e,t,n);return r&&"object"==typeof r?de(r):r},set:pe,deleteProperty:pe},de=e=>(fe.has(e)||fe.set(e,new Proxy(e,he)),fe.get(e)),ve=e=>le().context[e||ie()],ye=()=>{const e=le();const{ref:t,attributes:n}=e;return Object.freeze({ref:t.current,attributes:de(n)})},me=e=>le().serverContext[e||ie()],ge=e=>new Promise((t=>{const n=()=>{clearTimeout(r),window.cancelAnimationFrame(o),setTimeout((()=>{e(),t()}))},r=setTimeout(n,100),o=window.requestAnimationFrame(n)})),we=()=>new Promise((e=>{setTimeout(e,0)}));function be(e){g((()=>{let t=null,n=!1;return t=function(e,t){let n=()=>{};const r=Z((function(){return n=this.c.bind(this),this.x=e,this.c=t,e()}));return{flush:n,dispose:r}}(e,(async()=>{t&&!n&&(n=!0,await ge(t.flush),n=!1)})),t.dispose}),[])}function ke(e){const t=le(),n=ie();return"GeneratorFunction"===e?.constructor?.name?async(...r)=>{const o=e(...r);let i,s;for(;;){se(n),ce(t);try{s=o.next(i)}finally{_e(),ae()}try{i=await s.value}catch(e){se(n),ce(t),o.throw(e)}finally{_e(),ae()}if(s.done)break}return i}:(...r)=>{se(n),ce(t);try{return e(...r)}finally{ae(),_e()}}}function Se(e){be(ke(e))}function xe(e){g(ke(e),[])}function Ee(e,t){g(ke(e),t)}function Te(e,t){w(ke(e),t)}function Oe(e,t){return S(ke(e),t)}function Fe(e,t){return k(ke(e),t)}new Set;const Pe=e=>{0},Ce=e=>Boolean(e&&"object"==typeof e&&e.constructor===Object),Ne=new WeakMap,je=new WeakMap,Me=new WeakMap,He=new Set([Object,Array]),$e=(e,t,n)=>{if(!We(t))throw Error("This object cannot be proxified.");if(!Ne.has(t)){const r=new Proxy(t,n);Ne.set(t,r),je.set(r,t),Me.set(r,e)}return Ne.get(t)},Ue=e=>Ne.get(e),Ae=e=>Me.get(e),We=e=>"object"==typeof e&&null!==e&&(!Me.has(e)&&He.has(e.constructor)),Le={};class De{constructor(e){this.owner=e,this.computedsByScope=new WeakMap}setValue(e){this.update({value:e})}setGetter(e){this.update({get:e})}getComputed(){const e=le()||Le;if(this.valueSignal||this.getterSignal||this.update({}),!this.computedsByScope.has(e)){const t=()=>{const e=this.getterSignal?.value;return e?e.call(this.owner):this.valueSignal?.value};se(Ae(this.owner)),this.computedsByScope.set(e,q(ke(t))),ae()}return this.computedsByScope.get(e)}update({get:e,value:t}){this.valueSignal?t===this.valueSignal.peek()&&e===this.getterSignal.peek()||H((()=>{this.valueSignal.value=t,this.getterSignal.value=e})):(this.valueSignal=z(t),this.getterSignal=z(e))}}const Ie=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter((e=>"symbol"==typeof e))),Re=new WeakMap,ze=(e,t)=>Re.has(e)&&Re.get(e).has(t),Ve=new WeakSet,Be=(e,t,n)=>{Re.has(e)||Re.set(e,new Map),t="number"==typeof t?`${t}`:t;const r=Re.get(e);if(!r.has(t)){const o=Ae(e),i=new De(e);if(r.set(t,i),n){const{get:t,value:r}=n;if(t)i.setGetter(t);else{const t=Ve.has(e);i.setValue(We(r)?Ye(o,r,{readOnly:t}):r)}}}return r.get(t)},Je=new WeakMap;let Ke=!1;const qe={get(e,t,n){if(Ke||!e.hasOwnProperty(t)&&t in e||"symbol"==typeof t&&Ie.has(t))return Reflect.get(e,t,n);const r=Object.getOwnPropertyDescriptor(e,t),o=Be(n,t,r).getComputed().value;if("function"==typeof o){const e=Ae(n);return(...t)=>{se(e);try{return o.call(n,...t)}finally{ae()}}}return o},set(e,t,n,r){if(Ve.has(r))return!1;se(Ae(r));try{return Reflect.set(e,t,n,r)}finally{ae()}},defineProperty(e,t,n){if(Ve.has(Ue(e)))return!1;const r=!(t in e),o=Reflect.defineProperty(e,t,n);if(o){const o=Ue(e),i=Be(o,t),{get:s,value:a}=n;if(s)i.setGetter(s);else{const e=Ae(o);i.setValue(We(a)?Ye(e,a):a)}if(r&&Je.has(e)&&Je.get(e).value++,Array.isArray(e)&&Re.get(o)?.has("length")){Be(o,"length").setValue(e.length)}}return o},deleteProperty(e,t){if(Ve.has(Ue(e)))return!1;const n=Reflect.deleteProperty(e,t);if(n){Be(Ue(e),t).setValue(void 0),Je.has(e)&&Je.get(e).value++}return n},ownKeys:e=>(Je.has(e)||Je.set(e,z(0)),Je._=Je.get(e).value,Reflect.ownKeys(e))},Ye=(e,t,n)=>{const r=$e(e,t,qe);return n?.readOnly&&Ve.add(r),r},Xe=(e,t,n=!0)=>{if(!Ce(e)||!Ce(t))return;let r=!1;for(const o in t){const i=!(o in e);r=r||i;const s=Object.getOwnPropertyDescriptor(t,o),a=Ue(e),u=!!a&&ze(a,o)&&Be(a,o);if("function"==typeof s.get||"function"==typeof s.set)(n||i)&&(Object.defineProperty(e,o,{...s,configurable:!0,enumerable:!0}),s.get&&u&&u.setGetter(s.get));else if(Ce(t[o])){if((i||n&&!Ce(e[o]))&&(e[o]={},u)){const t=Ae(a);u.setValue(Ye(t,e[o]))}Ce(e[o])&&Xe(e[o],t[o],n)}else if((n||i)&&(Object.defineProperty(e,o,s),u)){const{value:e}=s,t=Ae(a);u.setValue(We(e)?Ye(t,e):e)}}r&&Je.has(e)&&Je.get(e).value++},Ge=(e,t,n=!0)=>H((()=>{return Xe((r=e,je.get(r)||e),t,n);var r})),Qe=new WeakSet,Ze={get:(e,t,n)=>{const r=Reflect.get(e,t),o=Ae(n);if(void 0===r&&Qe.has(n)){const n={};return Reflect.set(e,t,n),et(o,n,!1)}if("function"==typeof r){se(o);const e=ke(r);return ae(),e}return Ce(r)&&We(r)?et(o,r,!1):r}},et=(e,t,n=!0)=>{const r=$e(e,t,Ze);return r&&n&&Qe.add(r),r},tt=new WeakMap,nt=new WeakMap,rt=new WeakSet,ot=Reflect.getOwnPropertyDescriptor,it={get:(e,t)=>{const n=nt.get(e),r=e[t];return t in e?r:n[t]},set:(e,t,n)=>{const r=nt.get(e);return(t in e||!(t in r)?e:r)[t]=n,!0},ownKeys:e=>[...new Set([...Object.keys(nt.get(e)),...Object.keys(e)])],getOwnPropertyDescriptor:(e,t)=>ot(e,t)||ot(nt.get(e),t)},st=(e,t={})=>{if(rt.has(e))throw Error("This object cannot be proxified.");if(nt.set(e,t),!tt.has(e)){const t=new Proxy(e,it);tt.set(e,t),rt.add(t)}return tt.get(e)},at=new Map,ut=new Map,lt=new Map,ct=new Map,_t=new Map,ft=e=>ct.get(e||ie())||{},pt=e=>{const t=e||ie();return _t.has(t)||_t.set(t,Ye(t,{},{readOnly:!0})),_t.get(t)},ht="I acknowledge that using a private store means my plugin will inevitably break on the next store release.";function dt(e,{state:t={},...n}={},{lock:r=!1}={}){if(at.has(e)){if(r===ht||lt.has(e)){const t=lt.get(e);if(!(r===ht||!0!==r&&r===t))throw t?Error("Cannot unlock a private store with an invalid lock code"):Error("Cannot lock a public store")}else lt.set(e,r);const o=ut.get(e);Ge(o,n),Ge(o.state,t)}else{r!==ht&<.set(e,r);const o={state:Ye(e,Ce(t)?t:{}),...n},i=et(e,o);ut.set(e,o),at.set(e,i)}return at.get(e)}const vt=(e=document)=>{var t;const n=null!==(t=e.getElementById("wp-script-module-data-@wordpress/interactivity"))&&void 0!==t?t:e.getElementById("wp-interactivity-data");if(n?.textContent)try{return JSON.parse(n.textContent)}catch{}return{}},yt=e=>{Ce(e?.state)&&Object.entries(e.state).forEach((([e,t])=>{const n=dt(e,{},{lock:ht});Ge(n.state,t,!1),Ge(pt(e),t)})),Ce(e?.config)&&Object.entries(e.config).forEach((([e,t])=>{ct.set(e,t)}))},mt=vt();function gt(e){return null!==e.suffix}function wt(e){return null===e.suffix}yt(mt);const bt=(0,a.q6)({client:{},server:{}}),kt={},St={},xt=(e,t,{priority:n=10}={})=>{kt[e]=t,St[e]=n},Et=({scope:e})=>(t,...n)=>{let{value:r,namespace:o}=t;if("string"!=typeof r)throw new Error("The `value` prop should be a string path");const i="!"===r[0]&&!!(r=r.slice(1));ce(e);const s=((e,t)=>{if(!t)return void Pe();let n=at.get(t);void 0===n&&(n=dt(t,void 0,{lock:ht}));const r={...n,context:le().context[t]};try{return e.split(".").reduce(((e,t)=>e[t]),r)}catch(e){}})(r,o),a="function"==typeof s?s(...n):s;return _e(),i?!a:a},Tt=({directives:e,priorityLevels:[t,...n],element:r,originalProps:o,previousScope:i})=>{const s=b({}).current;s.evaluate=S(Et({scope:s}),[]);const{client:u,server:l}=x(bt);s.context=u,s.serverContext=l,s.ref=i?.ref||b(null),r=(0,a.Ob)(r,{ref:s.ref}),s.attributes=r.props;const c=n.length>0?(0,a.h)(Tt,{directives:e,priorityLevels:n,element:r,originalProps:o,previousScope:s}):r,_={...o,children:c},f={directives:e,props:_,element:r,context:bt,evaluate:s.evaluate};ce(s);for(const e of t){const t=kt[e]?.(f);void 0!==t&&(_.children=t)}return _e(),_.children},Ot=a.fF.vnode;function Ft(e){return Ce(e)?Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Ft(t)]))):Array.isArray(e)?e.map((e=>Ft(e))):e}a.fF.vnode=e=>{if(e.props.__directives){const t=e.props,n=t.__directives;n.key&&(e.key=n.key.find(wt).value),delete t.__directives;const r=(e=>{const t=Object.keys(e).reduce(((e,t)=>{if(kt[t]){const n=St[t];(e[n]=e[n]||[]).push(t)}return e}),{});return Object.entries(t).sort((([e],[t])=>parseInt(e)-parseInt(t))).map((([,e])=>e))})(n);r.length>0&&(e.props={directives:n,priorityLevels:r,originalProps:t,type:e.type,element:(0,a.h)(e.type,t),top:!0},e.type=Tt)}Ot&&Ot(e)};const Pt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Ct=/\/\*[^]*?\*\/| +/g,Nt=/\n+/g,jt=e=>({directives:t,evaluate:n})=>{t[`on-${e}`].filter(gt).forEach((t=>{const r=t.suffix.split("--",1)[0];xe((()=>{const o=e=>n(t,e),i="window"===e?window:document;return i.addEventListener(r,o),()=>i.removeEventListener(r,o)}))}))},Mt=e=>({directives:t,evaluate:n})=>{t[`on-async-${e}`].filter(gt).forEach((t=>{const r=t.suffix.split("--",1)[0];xe((()=>{const o=async e=>{await we(),n(t,e)},i="window"===e?window:document;return i.addEventListener(r,o,{passive:!0}),()=>i.removeEventListener(r,o)}))}))},Ht="wp",$t=`data-${Ht}-ignore`,Ut=`data-${Ht}-interactive`,At=`data-${Ht}-`,Wt=[],Lt=new RegExp(`^data-${Ht}-([a-z0-9]+(?:-[a-z0-9]+)*)(?:--([a-z0-9_-]+))?$`,"i"),Dt=/^([\w_\/-]+)::(.+)$/,It=new WeakSet;function Rt(e){const t=document.createTreeWalker(e,205);return function e(n){const{nodeType:r}=n;if(3===r)return[n.data];if(4===r){var o;const e=t.nextSibling();return n.replaceWith(new window.Text(null!==(o=n.nodeValue)&&void 0!==o?o:"")),[n.nodeValue,e]}if(8===r||7===r){const e=t.nextSibling();return n.remove(),[null,e]}const i=n,{attributes:s}=i,u=i.localName,l={},c=[],_=[];let f=!1,p=!1;for(let e=0;e{const o=Lt.exec(t);if(null===o)return Pe(),e;const i=o[1]||"",s=o[2]||null;var a;return e[i]=e[i]||[],e[i].push({namespace:null!=n?n:null!==(a=Wt[Wt.length-1])&&void 0!==a?a:null,value:r,suffix:s}),e}),{})),"template"===u)l.content=[...i.content.childNodes].map((e=>Rt(e)));else{let n=t.firstChild();if(n){for(;n;){const[r,o]=e(n);r&&c.push(r),n=o||t.nextSibling()}t.parentNode()}}return p&&Wt.pop(),[(0,a.h)(u,l,c)]}(t.currentNode)}const zt=new WeakMap,Vt=e=>{if(!e.parentElement)throw Error("The passed region should be an element with a parent.");return zt.has(e)||zt.set(e,((e,t)=>{const n=(t=[].concat(t))[t.length-1].nextSibling;function r(t,r){e.insertBefore(t,r||n)}return e.__k={nodeType:1,parentNode:e,firstChild:t[0],childNodes:t,insertBefore:r,appendChild:r,removeChild(t){e.removeChild(t)}}})(e.parentElement,e)),zt.get(e)},Bt=new WeakMap,Jt=e=>{if("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."===e)return{directivePrefix:Ht,getRegionRootFragment:Vt,initialVdom:Bt,toVdom:Rt,directive:xt,getNamespace:ie,h:a.h,cloneElement:a.Ob,render:a.XX,proxifyState:Ye,parseServerData:vt,populateServerData:yt,batch:H};throw new Error("Forbidden access.")};xt("context",(({directives:{context:e},props:{children:t},context:n})=>{const{Provider:r}=n,o=e.find(wt),{client:i,server:s}=x(n),u=o.namespace,l=b(Ye(u,{})),c=b(Ye(u,{},{readOnly:!0})),_=k((()=>{const e={client:{...i},server:{...s}};if(o){const{namespace:t,value:n}=o;Ce(n)||Pe(),Ge(l.current,Ft(n),!1),Ge(c.current,Ft(n)),e.client[t]=st(l.current,i[t]),e.server[t]=st(c.current,s[t])}return e}),[o,i,s]);return(0,a.h)(r,{value:_},t)}),{priority:5}),xt("watch",(({directives:{watch:e},evaluate:t})=>{e.forEach((e=>{Se((()=>t(e)))}))})),xt("init",(({directives:{init:e},evaluate:t})=>{e.forEach((e=>{xe((()=>t(e)))}))})),xt("on",(({directives:{on:e},element:t,evaluate:n})=>{const r=new Map;e.filter(gt).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{e.forEach((e=>{o&&o(t),n(e,t)}))}}))})),xt("on-async",(({directives:{"on-async":e},element:t,evaluate:n})=>{const r=new Map;e.filter(gt).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{o&&o(t),e.forEach((async e=>{await we(),n(e,t)}))}}))})),xt("on-window",jt("window")),xt("on-document",jt("document")),xt("on-async-window",Mt("window")),xt("on-async-document",Mt("document")),xt("class",(({directives:{class:e},element:t,evaluate:n})=>{e.filter(gt).forEach((e=>{const r=e.suffix,o=n(e),i=t.props.class||"",s=new RegExp(`(^|\\s)${r}(\\s|$)`,"g");o?s.test(i)||(t.props.class=i?`${i} ${r}`:r):t.props.class=i.replace(s," ").trim(),xe((()=>{o?t.ref.current.classList.add(r):t.ref.current.classList.remove(r)}))}))})),xt("style",(({directives:{style:e},element:t,evaluate:n})=>{e.filter(gt).forEach((e=>{const r=e.suffix,o=n(e);t.props.style=t.props.style||{},"string"==typeof t.props.style&&(t.props.style=(e=>{const t=[{}];let n,r;for(;n=Pt.exec(e.replace(Ct,""));)n[4]?t.shift():n[3]?(r=n[3].replace(Nt," ").trim(),t.unshift(t[0][r]=t[0][r]||{})):t[0][n[1]]=n[2].replace(Nt," ").trim();return t[0]})(t.props.style)),o?t.props.style[r]=o:delete t.props.style[r],xe((()=>{o?t.ref.current.style[r]=o:t.ref.current.style.removeProperty(r)}))}))})),xt("bind",(({directives:{bind:e},element:t,evaluate:n})=>{e.filter(gt).forEach((e=>{const r=e.suffix,o=n(e);t.props[r]=o,xe((()=>{const e=t.ref.current;if("style"!==r){if("width"!==r&&"height"!==r&&"href"!==r&&"list"!==r&&"form"!==r&&"tabIndex"!==r&&"download"!==r&&"rowSpan"!==r&&"colSpan"!==r&&"role"!==r&&r in e)try{return void(e[r]=null==o?"":o)}catch(e){}null==o||!1===o&&"-"!==r[4]?e.removeAttribute(r):e.setAttribute(r,o)}else"string"==typeof o&&(e.style.cssText=o)}))}))})),xt("ignore",(({element:{type:e,props:{innerHTML:t,...n}}})=>{const r=k((()=>t),[]);return(0,a.h)(e,{dangerouslySetInnerHTML:{__html:r},...n})})),xt("text",(({directives:{text:e},element:t,evaluate:n})=>{const r=e.find(wt);if(r)try{const e=n(r);t.props.children="object"==typeof e?null:e.toString()}catch(e){t.props.children=null}else t.props.children=null})),xt("run",(({directives:{run:e},evaluate:t})=>{e.forEach((e=>t(e)))})),xt("each",(({directives:{each:e,"each-key":t},context:n,element:r,evaluate:o})=>{if("template"!==r.type)return;const{Provider:i}=n,s=x(n),[u]=e,{namespace:l}=u,c=o(u),_=gt(u)?u.suffix.replace(/^-+|-+$/g,"").toLowerCase().replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()})):"item";return c.map((e=>{const n=st(Ye(l,{}),s.client[l]),o={client:{...s.client,[l]:n},server:{...s.server}};o.client[l][_]=e;const u={...le(),context:o.client,serverContext:o.server},c=t?Et({scope:u})(t[0]):e;return(0,a.h)(i,{value:o,key:c},r.props.content)}))}),{priority:20}),xt("each-child",(()=>null),{priority:1}),(async()=>{const e=document.querySelectorAll(`[data-${Ht}-interactive]`);for(const t of e)if(!It.has(t)){await we();const e=Vt(t),n=Rt(t);Bt.set(t,n),await we(),(0,a.Qv)(n,e)}})()},622:(e,t,n)=>{n.d(t,{FK:()=>S,Ob:()=>V,Qv:()=>z,XX:()=>R,fF:()=>o,h:()=>b,q6:()=>B,uA:()=>x,zO:()=>s});var r,o,i,s,a,u,l,c,_,f,p,h,d={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function g(e,t){for(var n in t)e[n]=t[n];return e}function w(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function b(e,t,n){var o,i,s,a={};for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===a[s]&&(a[s]=e.defaultProps[s]);return k(e,a,o,i,null)}function k(e,t,n,r,s){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++i:s,__i:-1,__u:0};return null==s&&null!=o.vnode&&o.vnode(a),a}function S(e){return e.children}function x(e,t){this.props=e,this.context=t}function E(e,t){if(null==t)return e.__?E(e.__,e.__i+1):null;for(var n;tt&&a.sort(c));F.__r=0}function P(e,t,n,r,o,i,s,a,u,l,c){var _,f,p,h,y,m=r&&r.__k||v,g=t.length;for(n.__d=u,C(n,t,m),u=n.__d,_=0;_0?k(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,i=null,-1!==(a=o.__i=j(o,n,s,c))&&(c--,(i=n[a])&&(i.__u|=131072)),null==i||null===i.__v?(-1==a&&_--,"function"!=typeof o.type&&(o.__u|=65536)):a!==s&&(a==s-1?_--:a==s+1?_++:(a>s?_--:_++,o.__u|=65536))):o=e.__k[r]=null;if(c)for(r=0;r(null!=u&&0==(131072&u.__u)?1:0))for(;s>=0||a=0){if((u=t[s])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return s;s--}if(a2&&(u.children=arguments.length>3?r.call(arguments,2):n),k(e.type,u,o||e.key,i||e.ref,null)}function B(e,t){var n={__c:t="__cC"+h++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.forEach((function(e){e.__e=!0,O(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=v.slice,o={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},i=0,s=function(e){return null!=e&&null==e.constructor},x.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=g({},this.state),"function"==typeof e&&(e=e(g({},n),this.props)),e&&g(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),O(this))},x.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),O(this))},x.prototype.render=S,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},F.__r=0,_=0,f=$(!1),p=$(!0),h=0}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};(()=>{n.d(r,{zj:()=>w.zj,SD:()=>w.SD,V6:()=>w.V6,$K:()=>w.$K,vT:()=>w.vT,jb:()=>w.jb,yT:()=>w.yT,M_:()=>w.M_,hb:()=>w.hb,vJ:()=>w.vJ,ip:()=>w.ip,Nf:()=>w.Nf,Kr:()=>w.Kr,li:()=>w.li,J0:()=>w.J0,FH:()=>w.FH,v4:()=>w.v4});var e,t=n(622);null!=(e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&e.__PREACT_DEVTOOLS__&&e.__PREACT_DEVTOOLS__.attachPreact("10.24.3",t.fF,{Fragment:t.FK,Component:t.uA});var o={};function i(e){return e.type===t.FK?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var s=[],a=[];function u(){return s.length>0?s[s.length-1]:null}var l=!0;function c(e){return"function"==typeof e.type&&e.type!=t.FK}function _(e){for(var t=[e],n=e;null!=n.__o;)t.push(n.__o),n=n.__o;return t.reduce((function(e,t){e+=" in "+i(t);var n=t.__source;return n?e+=" (at "+n.fileName+":"+n.lineNumber+")":l&&console.warn("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."),l=!1,e+"\n"}),"")}var f="function"==typeof WeakMap;function p(e){var t=[];return e.__k?(e.__k.forEach((function(e){e&&"function"==typeof e.type?t.push.apply(t,p(e)):e&&"string"==typeof e.type&&t.push(e.type)})),t):t}function h(e){return e?"function"==typeof e.type?null==e.__?null!=e.__e&&null!=e.__e.parentNode?e.__e.parentNode.localName:"":h(e.__):e.type:""}var d=t.uA.prototype.setState;function v(e){return"table"===e||"tfoot"===e||"tbody"===e||"thead"===e||"td"===e||"tr"===e||"th"===e}t.uA.prototype.setState=function(e,t){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+_(u())),d.call(this,e,t)};var y=/^(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)$/,m=t.uA.prototype.forceUpdate;function g(e){var t=e.props,n=i(e),r="";for(var o in t)if(t.hasOwnProperty(o)&&"children"!==o){var s=t[o];"function"==typeof s&&(s="function "+(s.displayName||s.name)+"() {}"),s=Object(s)!==s||s.toString?s+"":Object.prototype.toString.call(s),r+=" "+o+"="+JSON.stringify(s)}var a=t.children;return"<"+n+r+(a&&a.length?">..":" />")}t.uA.prototype.forceUpdate=function(e){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+_(u())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+_(this.__v)),m.call(this,e)},t.fF.__m=function(e,t){var n=e.type,r=t.map((function(e){return e&&e.localName})).filter(Boolean);console.error("Expected a DOM node of type "+n+" but found "+r.join(", ")+"as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+_(e))},function(){!function(){var e=t.fF.__b,n=t.fF.diffed,r=t.fF.__,o=t.fF.vnode,i=t.fF.__r;t.fF.diffed=function(e){c(e)&&a.pop(),s.pop(),n&&n(e)},t.fF.__b=function(t){c(t)&&s.push(t),e&&e(t)},t.fF.__=function(e,t){a=[],r&&r(e,t)},t.fF.vnode=function(e){e.__o=a.length>0?a[a.length-1]:null,o&&o(e)},t.fF.__r=function(e){c(e)&&a.push(e),i&&i(e)}}();var e=!1,n=t.fF.__b,r=t.fF.diffed,u=t.fF.vnode,l=t.fF.__r,d=t.fF.__e,m=t.fF.__,w=t.fF.__h,b=f?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];t.fF.__e=function(e,t,n,r){if(t&&t.__c&&"function"==typeof e.then){var o=e;e=new Error("Missing Suspense. The throwing component was: "+i(t));for(var s=t;s;s=s.__)if(s.__c&&s.__c.__c){e=o;break}if(e instanceof Error)throw e}try{(r=r||{}).componentStack=_(t),d(e,t,n,r),"function"!=typeof e.then&&setTimeout((function(){throw e}))}catch(e){throw e}},t.fF.__=function(e,t){if(!t)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var n;switch(t.nodeType){case 1:case 11:case 9:n=!0;break;default:n=!1}if(!n){var r=i(e);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+t+" instead: render(<"+r+" />, "+t+");")}m&&m(e,t)},t.fF.__b=function(t){var r=t.type;if(e=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+g(t)+"\n\n"+_(t));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+i(t)+" = "+g(r)+";\n let vnode = ;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+_(t));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==t.ref&&"function"!=typeof t.ref&&"object"!=typeof t.ref&&!("$$typeof"in t))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof t.ref+"] instead\n"+g(t)+"\n\n"+_(t));if("string"==typeof t.type)for(var s in t.props)if("o"===s[0]&&"n"===s[1]&&"function"!=typeof t.props[s]&&null!=t.props[s])throw new Error("Component's \""+s+'" property should be a function, but got ['+typeof t.props[s]+"] instead\n"+g(t)+"\n\n"+_(t));if("function"==typeof t.type&&t.type.propTypes){if("Lazy"===t.type.displayName&&b&&!b.lazyPropTypes.has(t.type)){var a="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var u=t.type();b.lazyPropTypes.set(t.type,!0),console.warn(a+"Component wrapped in lazy() is "+i(u))}catch(e){console.warn(a+"We will log the wrapped component's name once it is loaded.")}}var l=t.props;t.type.__f&&delete(l=function(e,t){for(var n in t)e[n]=t[n];return e}({},l)).ref,function(e,t,n,r,i){Object.keys(e).forEach((function(n){var s;try{s=e[n](t,n,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){s=e}s&&!(s.message in o)&&(o[s.message]=!0,console.error("Failed prop type: "+s.message+(i&&"\n"+i()||"")))}))}(t.type.propTypes,l,0,i(t),(function(){return _(t)}))}n&&n(t)};var S,x=0;t.fF.__r=function(t){l&&l(t),e=!0;var n=t.__c;if(n===S?x++:x=1,x>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+i(t));S=n},t.fF.__h=function(t,n,r){if(!t||!e)throw new Error("Hook can only be invoked from render methods.");w&&w(t,n,r)};var E=function(e,t){return{get:function(){var n="get"+e+t;k&&k.indexOf(n)<0&&(k.push(n),console.warn("getting vnode."+e+" is deprecated, "+t))},set:function(){var n="set"+e+t;k&&k.indexOf(n)<0&&(k.push(n),console.warn("setting vnode."+e+" is not allowed, "+t))}}},T={nodeName:E("nodeName","use vnode.type"),attributes:E("attributes","use vnode.props"),children:E("children","use vnode.props.children")},O=Object.create({},T);t.fF.vnode=function(e){var t=e.props;if(null!==e.type&&null!=t&&("__source"in t||"__self"in t)){var n=e.props={};for(var r in t){var o=t[r];"__source"===r?e.__source=o:"__self"===r?e.__self=o:n[r]=o}}e.__proto__=O,u&&u(e)},t.fF.diffed=function(t){var n,o=t.type,s=t.__;if(t.__k&&t.__k.forEach((function(e){if("object"==typeof e&&e&&void 0===e.type){var n=Object.keys(e).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+n+"}.\n\n"+_(t))}})),t.__c===S&&(x=0),"string"==typeof o&&(v(o)||"p"===o||"a"===o||"button"===o)){var a=h(s);if(""!==a&&v(o))"table"===o&&"td"!==a&&v(a)?(console.log(a,s.__e),console.error("Improper nesting of table. Your should not have a table-node parent."+g(t)+"\n\n"+_(t))):"thead"!==o&&"tfoot"!==o&&"tbody"!==o||"table"===a?"tr"===o&&"thead"!==a&&"tfoot"!==a&&"tbody"!==a?console.error("Improper nesting of table. Your should have a parent."+g(t)+"\n\n"+_(t)):"td"===o&&"tr"!==a?console.error("Improper nesting of table. Your parent."+g(t)+"\n\n"+_(t)):"th"===o&&"tr"!==a&&console.error("Improper nesting of table. Your ."+g(t)+"\n\n"+_(t)):console.error("Improper nesting of table. Your should have a
should have a
should have a
parent."+g(t)+"\n\n"+_(t));else if("p"===o){var u=p(t).filter((function(e){return y.test(e)}));u.length&&console.error("Improper nesting of paragraph. Your

should not have "+u.join(", ")+"as child-elements."+g(t)+"\n\n"+_(t))}else"a"!==o&&"button"!==o||-1!==p(t).indexOf(o)&&console.error("Improper nesting of interactive content. Your <"+o+"> should not have other "+("a"===o?"anchor":"button")+" tags as child-elements."+g(t)+"\n\n"+_(t))}if(e=!1,r&&r(t),null!=t.__k)for(var l=[],c=0;c { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ob: () => (/* binding */ E), /* harmony export */ Qv: () => (/* binding */ D), /* harmony export */ XX: () => (/* binding */ B), /* harmony export */ fF: () => (/* binding */ l), /* harmony export */ h: () => (/* binding */ _), /* harmony export */ q6: () => (/* binding */ G), /* harmony export */ uA: () => (/* binding */ k), /* harmony export */ zO: () => (/* binding */ t) /* harmony export */ }); /* unused harmony exports Fragment, createElement, createRef, toChildArray */ var n,l,u,t,i,o,r,f,e,c,s,a,h={},v=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function w(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return g(l,f,i,o,null)}function g(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(f),f}function m(){return{current:null}}function b(n){return n.children}function k(n,l){this.props=n,this.context=l}function x(n,l){if(null==l)return n.__?x(n.__,n.__i+1):null;for(var u;lu&&i.sort(f));M.__r=0}function P(n,l,u,t,i,o,r,f,e,c,s){var a,p,y,d,w,_=t&&t.__k||v,g=l.length;for(u.__d=e,$(u,l,_),e=u.__d,a=0;a0?g(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=n,i.__b=n.__b+1,o=null,-1!==(f=i.__i=L(i,u,r,s))&&(s--,(o=u[f])&&(o.__u|=131072)),null==o||null===o.__v?(-1==f&&a--,"function"!=typeof i.type&&(i.__u|=65536)):f!==r&&(f==r-1?a--:f==r+1?a++:(f>r?a--:a++,i.__u|=65536))):i=n.__k[t]=null;if(s)for(t=0;t(null!=e&&0==(131072&e.__u)?1:0))for(;r>=0||f=0){if((e=l[r])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return r;r--}if(f2&&(e.children=arguments.length>3?n.call(arguments,2):t),g(l.type,e,i||l.key,o||l.ref,null)}function G(n,l){var u={__c:l="__cC"+a++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.forEach(function(n){n.__e=!0,S(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=v.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},k.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),S(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),S(this))},k.prototype.render=b,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},M.__r=0,e=0,c=F(!1),s=F(!0),a=0; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { // EXPORTS __webpack_require__.d(__webpack_exports__, { zj: () => (/* reexport */ getConfig), SD: () => (/* reexport */ getContext), V6: () => (/* reexport */ getElement), $K: () => (/* reexport */ getServerContext), vT: () => (/* reexport */ getServerState), jb: () => (/* binding */ privateApis), yT: () => (/* reexport */ splitTask), M_: () => (/* reexport */ store), hb: () => (/* reexport */ useCallback), vJ: () => (/* reexport */ useEffect), ip: () => (/* reexport */ useInit), Nf: () => (/* reexport */ useLayoutEffect), Kr: () => (/* reexport */ useMemo), li: () => (/* reexport */ A), J0: () => (/* reexport */ h), FH: () => (/* reexport */ useWatch), v4: () => (/* reexport */ withScope) }); // EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js var preact_module = __webpack_require__(622); ;// CONCATENATED MODULE: ./node_modules/preact/hooks/dist/hooks.module.js var hooks_module_t,r,hooks_module_u,i,hooks_module_o=0,hooks_module_f=[],hooks_module_c=preact_module/* options */.fF,e=hooks_module_c.__b,a=hooks_module_c.__r,v=hooks_module_c.diffed,l=hooks_module_c.__c,m=hooks_module_c.unmount,s=hooks_module_c.__;function d(n,t){hooks_module_c.__h&&hooks_module_c.__h(r,n,hooks_module_o||t),hooks_module_o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function h(n){return hooks_module_o=1,p(D,n)}function p(n,u,i){var o=d(hooks_module_t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=d(hooks_module_t++,3);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__H.__h.push(i))}function _(n,u){var i=d(hooks_module_t++,4);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__h.push(i))}function A(n){return hooks_module_o=5,T(function(){return{current:n}},[])}function F(n,t,r){hooks_module_o=6,_(function(){return"function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))}function T(n,r){var u=d(hooks_module_t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return hooks_module_o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=d(hooks_module_t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){hooks_module_c.useDebugValue&&hooks_module_c.useDebugValue(t?t(n):n)}function b(n){var u=d(hooks_module_t++,10),i=h();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=d(hooks_module_t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=hooks_module_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],hooks_module_c.__e(t,n.__v)}}hooks_module_c.__b=function(n){r=null,e&&e(n)},hooks_module_c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},hooks_module_c.__r=function(n){a&&a(n),hooks_module_t=0;var i=(r=n.__c).__H;i&&(hooks_module_u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],hooks_module_t=0)),hooks_module_u=r},hooks_module_c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==hooks_module_f.push(t)&&i===hooks_module_c.requestAnimationFrame||((i=hooks_module_c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),hooks_module_u=r=null},hooks_module_c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],hooks_module_c.__e(r,n.__v)}}),l&&l(n,t)},hooks_module_c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&hooks_module_c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t} ;// CONCATENATED MODULE: ./node_modules/@preact/signals-core/dist/signals-core.module.js var signals_core_module_i=Symbol.for("preact-signals");function signals_core_module_t(){if(!(signals_core_module_s>1)){var i,t=!1;while(void 0!==signals_core_module_h){var r=signals_core_module_h;signals_core_module_h=void 0;signals_core_module_f++;while(void 0!==r){var o=r.o;r.o=void 0;r.f&=-3;if(!(8&r.f)&&signals_core_module_c(r))try{r.c()}catch(r){if(!t){i=r;t=!0}}r=o}}signals_core_module_f=0;signals_core_module_s--;if(t)throw i}else signals_core_module_s--}function signals_core_module_r(i){if(signals_core_module_s>0)return i();signals_core_module_s++;try{return i()}finally{signals_core_module_t()}}var signals_core_module_o=void 0;function n(i){var t=signals_core_module_o;signals_core_module_o=void 0;try{return i()}finally{signals_core_module_o=t}}var signals_core_module_h=void 0,signals_core_module_s=0,signals_core_module_f=0,signals_core_module_v=0;function signals_core_module_e(i){if(void 0!==signals_core_module_o){var t=i.n;if(void 0===t||t.t!==signals_core_module_o){t={i:0,S:i,p:signals_core_module_o.s,n:void 0,t:signals_core_module_o,e:void 0,x:void 0,r:t};if(void 0!==signals_core_module_o.s)signals_core_module_o.s.n=t;signals_core_module_o.s=t;i.n=t;if(32&signals_core_module_o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=signals_core_module_o.s;t.n=void 0;signals_core_module_o.s.n=t;signals_core_module_o.s=t}return t}}}function signals_core_module_u(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0}signals_core_module_u.prototype.brand=signals_core_module_i;signals_core_module_u.prototype.h=function(){return!0};signals_core_module_u.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i}};signals_core_module_u.prototype.U=function(i){if(void 0!==this.t){var t=i.e,r=i.x;if(void 0!==t){t.x=r;i.e=void 0}if(void 0!==r){r.e=t;i.x=void 0}if(i===this.t)this.t=r}};signals_core_module_u.prototype.subscribe=function(i){var t=this;return E(function(){var r=t.value,n=signals_core_module_o;signals_core_module_o=void 0;try{i(r)}finally{signals_core_module_o=n}})};signals_core_module_u.prototype.valueOf=function(){return this.value};signals_core_module_u.prototype.toString=function(){return this.value+""};signals_core_module_u.prototype.toJSON=function(){return this.value};signals_core_module_u.prototype.peek=function(){var i=signals_core_module_o;signals_core_module_o=void 0;try{return this.value}finally{signals_core_module_o=i}};Object.defineProperty(signals_core_module_u.prototype,"value",{get:function(){var i=signals_core_module_e(this);if(void 0!==i)i.i=this.i;return this.v},set:function(i){if(i!==this.v){if(signals_core_module_f>100)throw new Error("Cycle detected");this.v=i;this.i++;signals_core_module_v++;signals_core_module_s++;try{for(var r=this.t;void 0!==r;r=r.x)r.t.N()}finally{signals_core_module_t()}}}});function signals_core_module_d(i){return new signals_core_module_u(i)}function signals_core_module_c(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function signals_core_module_a(i){for(var t=i.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r)t.r=r;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function signals_core_module_l(i){var t=i.s,r=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o}else r=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o}i.s=r}function signals_core_module_y(i){signals_core_module_u.call(this,void 0);this.x=i;this.s=void 0;this.g=signals_core_module_v-1;this.f=4}(signals_core_module_y.prototype=new signals_core_module_u).h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===signals_core_module_v)return!0;this.g=signals_core_module_v;this.f|=1;if(this.i>0&&!signals_core_module_c(this)){this.f&=-2;return!0}var i=signals_core_module_o;try{signals_core_module_a(this);signals_core_module_o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}signals_core_module_o=i;signals_core_module_l(this);this.f&=-2;return!0};signals_core_module_y.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}signals_core_module_u.prototype.S.call(this,i)};signals_core_module_y.prototype.U=function(i){if(void 0!==this.t){signals_core_module_u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};signals_core_module_y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N()}};Object.defineProperty(signals_core_module_y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var i=signals_core_module_e(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function signals_core_module_w(i){return new signals_core_module_y(i)}function signals_core_module_(i){var r=i.u;i.u=void 0;if("function"==typeof r){signals_core_module_s++;var n=signals_core_module_o;signals_core_module_o=void 0;try{r()}catch(t){i.f&=-2;i.f|=8;signals_core_module_g(i);throw t}finally{signals_core_module_o=n;signals_core_module_t()}}}function signals_core_module_g(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;signals_core_module_(i)}function signals_core_module_p(i){if(signals_core_module_o!==this)throw new Error("Out-of-order effect");signals_core_module_l(this);signals_core_module_o=i;this.f&=-2;if(8&this.f)signals_core_module_g(this);signals_core_module_t()}function signals_core_module_b(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}signals_core_module_b.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{i()}};signals_core_module_b.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;signals_core_module_(this);signals_core_module_a(this);signals_core_module_s++;var i=signals_core_module_o;signals_core_module_o=this;return signals_core_module_p.bind(this,i)};signals_core_module_b.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=signals_core_module_h;signals_core_module_h=this}};signals_core_module_b.prototype.d=function(){this.f|=8;if(!(1&this.f))signals_core_module_g(this)};function E(i){var t=new signals_core_module_b(i);try{t.c()}catch(i){t.d();throw i}return t.d.bind(t)} ;// CONCATENATED MODULE: ./node_modules/@preact/signals/dist/signals.module.js var signals_module_v,signals_module_s;function signals_module_l(n,i){preact_module/* options */.fF[n]=i.bind(null,preact_module/* options */.fF[n]||function(){})}function signals_module_d(n){if(signals_module_s)signals_module_s();signals_module_s=n&&n.S()}function signals_module_p(n){var r=this,f=n.data,o=useSignal(f);o.value=f;var e=T(function(){var n=r.__v;while(n=n.__)if(n.__c){n.__c.__$f|=4;break}r.__$u.c=function(){var n;if(!(0,preact_module/* isValidElement */.zO)(e.peek())&&3===(null==(n=r.base)?void 0:n.nodeType))r.base.data=e.peek();else{r.__$f|=1;r.setState({})}};return signals_core_module_w(function(){var n=o.value.value;return 0===n?0:!0===n?"":n||""})},[]);return e.value}signals_module_p.displayName="_st";Object.defineProperties(signals_core_module_u.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:signals_module_p},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});signals_module_l("__b",function(n,r){if("string"==typeof r.type){var i,t=r.props;for(var f in t)if("children"!==f){var o=t[f];if(o instanceof signals_core_module_u){if(!i)r.__np=i={};i[f]=o;t[f]=o.peek()}}}n(r)});signals_module_l("__r",function(n,r){signals_module_d();var i,t=r.__c;if(t){t.__$f&=-2;if(void 0===(i=t.__$u))t.__$u=i=function(n){var r;E(function(){r=this});r.c=function(){t.__$f|=1;t.setState({})};return r}()}signals_module_v=t;signals_module_d(i);n(r)});signals_module_l("__e",function(n,r,i,t){signals_module_d();signals_module_v=void 0;n(r,i,t)});signals_module_l("diffed",function(n,r){signals_module_d();signals_module_v=void 0;var i;if("string"==typeof r.type&&(i=r.__e)){var t=r.__np,f=r.props;if(t){var o=i.U;if(o)for(var e in o){var u=o[e];if(void 0!==u&&!(e in t)){u.d();o[e]=void 0}}else i.U=o={};for(var a in t){var c=o[a],s=t[a];if(void 0===c){c=signals_module_(i,a,s,f);o[a]=c}else c.o(s,f)}}}n(r)});function signals_module_(n,r,i,t){var f=r in n&&void 0===n.ownerSVGElement,o=signals_core_module_d(i);return{o:function(n,r){o.value=n;t=r},d:E(function(){var i=o.value.value;if(t[r]!==i){t[r]=i;if(f)n[r]=i;else if(i)n.setAttribute(r,i);else n.removeAttribute(r)}})}}signals_module_l("unmount",function(n,r){if("string"==typeof r.type){var i=r.__e;if(i){var t=i.U;if(t){i.U=void 0;for(var f in t){var o=t[f];if(o)o.d()}}}}else{var e=r.__c;if(e){var u=e.__$u;if(u){e.__$u=void 0;u.d()}}}n(r)});signals_module_l("__h",function(n,r,i,t){if(t<3||9===t)r.__$f|=2;n(r,i,t)});preact_module/* Component */.uA.prototype.shouldComponentUpdate=function(n,r){var i=this.__$u;if(!(i&&void 0!==i.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var t in r)return!0;for(var f in n)if("__source"!==f&&n[f]!==this.props[f])return!0;for(var o in this.props)if(!(o in n))return!0;return!1};function useSignal(n){return T(function(){return signals_core_module_d(n)},[])}function useComputed(n){var r=f(n);r.current=n;signals_module_v.__$f|=4;return t(function(){return u(function(){return r.current()})},[])}function useSignalEffect(n){var r=f(n);r.current=n;o(function(){return c(function(){return r.current()})},[])} ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/namespaces.js const namespaceStack = []; const getNamespace = () => namespaceStack.slice(-1)[0]; const setNamespace = namespace => { namespaceStack.push(namespace); }; const resetNamespace = () => { namespaceStack.pop(); }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/scopes.js /** * External dependencies */ /** * Internal dependencies */ // Store stacks for the current scope and the default namespaces and export APIs // to interact with them. const scopeStack = []; const getScope = () => scopeStack.slice(-1)[0]; const setScope = scope => { scopeStack.push(scope); }; const resetScope = () => { scopeStack.pop(); }; // Wrap the element props to prevent modifications. const immutableMap = new WeakMap(); const immutableError = () => { throw new Error('Please use `data-wp-bind` to modify the attributes of an element.'); }; const immutableHandlers = { get(target, key, receiver) { const value = Reflect.get(target, key, receiver); return !!value && typeof value === 'object' ? deepImmutable(value) : value; }, set: immutableError, deleteProperty: immutableError }; const deepImmutable = target => { if (!immutableMap.has(target)) { immutableMap.set(target, new Proxy(target, immutableHandlers)); } return immutableMap.get(target); }; /** * Retrieves the context inherited by the element evaluating a function from the * store. The returned value depends on the element and the namespace where the * function calling `getContext()` exists. * * @param namespace Store namespace. By default, the namespace where the calling * function exists is used. * @return The context content. */ const getContext = namespace => { const scope = getScope(); if (true) { if (!scope) { throw Error('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)`.'); } } return scope.context[namespace || getNamespace()]; }; /** * Retrieves a representation of the element where a function from the store * is being evalutated. Such representation is read-only, and contains a * reference to the DOM element, its props and a local reactive state. * * @return Element representation. */ const getElement = () => { const scope = getScope(); if (true) { if (!scope) { throw Error('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)`.'); } } const { ref, attributes } = scope; return Object.freeze({ ref: ref.current, attributes: deepImmutable(attributes) }); }; /** * Retrieves the part of the inherited context defined and updated from the * server. * * The object returned is read-only, and includes the context defined in PHP * with `wp_interactivity_data_wp_context()`, including the corresponding * inherited properties. When `actions.navigate()` is called, this object is * updated to reflect the changes in the new visited page, without affecting the * context returned by `getContext()`. Directives can subscribe to those changes * to update the context if needed. * * @example * ```js * store('...', { * callbacks: { * updateServerContext() { * const context = getContext(); * const serverContext = getServerContext(); * // Override some property with the new value that came from the server. * context.overridableProp = serverContext.overridableProp; * }, * }, * }); * ``` * * @param namespace Store namespace. By default, the namespace where the calling * function exists is used. * @return The server context content. */ const getServerContext = namespace => { const scope = getScope(); if (true) { if (!scope) { throw Error('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)`.'); } } return scope.serverContext[namespace || getNamespace()]; }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/utils.js /** * External dependencies */ /** * Internal dependencies */ /** * Executes a callback function after the next frame is rendered. * * @param callback The callback function to be executed. * @return A promise that resolves after the callback function is executed. */ const afterNextFrame = callback => { return new Promise(resolve => { const done = () => { clearTimeout(timeout); window.cancelAnimationFrame(raf); setTimeout(() => { callback(); resolve(); }); }; const timeout = setTimeout(done, 100); const raf = window.requestAnimationFrame(done); }); }; /** * Returns a promise that resolves after yielding to main. * * @return Promise */ const splitTask = () => { return new Promise(resolve => { // TODO: Use scheduler.yield() when available. setTimeout(resolve, 0); }); }; /** * Creates a Flusher object that can be used to flush computed values and notify listeners. * * Using the mangled properties: * this.c: this._callback * this.x: this._compute * https://github.com/preactjs/signals/blob/main/mangle.json * * @param compute The function that computes the value to be flushed. * @param notify The function that notifies listeners when the value is flushed. * @return The Flusher object with `flush` and `dispose` properties. */ function createFlusher(compute, notify) { let flush = () => undefined; const dispose = E(function () { flush = this.c.bind(this); this.x = compute; this.c = notify; return compute(); }); return { flush, dispose }; } /** * Custom hook that executes a callback function whenever a signal is triggered. * Version of `useSignalEffect` with a `useEffect`-like execution. This hook * implementation comes from this PR, but we added short-cirtuiting to avoid * infinite loops: https://github.com/preactjs/signals/pull/290 * * @param callback The callback function to be executed. */ function utils_useSignalEffect(callback) { y(() => { let eff = null; let isExecuting = false; const notify = async () => { if (eff && !isExecuting) { isExecuting = true; await afterNextFrame(eff.flush); isExecuting = false; } }; eff = createFlusher(callback, notify); return eff.dispose; }, []); } /** * Returns the passed function wrapped with the current scope so it is * accessible whenever the function runs. This is primarily to make the scope * available inside hook callbacks. * * Asyncronous functions should use generators that yield promises instead of awaiting them. * See the documentation for details: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#the-store * * @param func The passed function. * @return The wrapped function. */ function withScope(func) { const scope = getScope(); const ns = getNamespace(); if (func?.constructor?.name === 'GeneratorFunction') { return async (...args) => { const gen = func(...args); let value; let it; while (true) { setNamespace(ns); setScope(scope); try { it = gen.next(value); } finally { resetScope(); resetNamespace(); } try { value = await it.value; } catch (e) { setNamespace(ns); setScope(scope); gen.throw(e); } finally { resetScope(); resetNamespace(); } if (it.done) { break; } } return value; }; } return (...args) => { setNamespace(ns); setScope(scope); try { return func(...args); } finally { resetNamespace(); resetScope(); } }; } /** * Accepts a function that contains imperative code which runs whenever any of * the accessed _reactive_ properties (e.g., values from the global state or the * context) is modified. * * This hook makes the element's scope available so functions like * `getElement()` and `getContext()` can be used inside the passed callback. * * @param callback The hook callback. */ function useWatch(callback) { utils_useSignalEffect(withScope(callback)); } /** * Accepts a function that contains imperative code which runs only after the * element's first render, mainly useful for intialization logic. * * This hook makes the element's scope available so functions like * `getElement()` and `getContext()` can be used inside the passed callback. * * @param callback The hook callback. */ function useInit(callback) { y(withScope(callback), []); } /** * Accepts a function that contains imperative, possibly effectful code. The * effects run after browser paint, without blocking it. * * This hook is equivalent to Preact's `useEffect` and makes the element's scope * available so functions like `getElement()` and `getContext()` can be used * inside the passed callback. * * @param callback Imperative function that can return a cleanup * function. * @param inputs If present, effect will only activate if the * values in the list change (using `===`). */ function useEffect(callback, inputs) { y(withScope(callback), inputs); } /** * Accepts a function that contains imperative, possibly effectful code. Use * this to read layout from the DOM and synchronously re-render. * * This hook is equivalent to Preact's `useLayoutEffect` and makes the element's * scope available so functions like `getElement()` and `getContext()` can be * used inside the passed callback. * * @param callback Imperative function that can return a cleanup * function. * @param inputs If present, effect will only activate if the * values in the list change (using `===`). */ function useLayoutEffect(callback, inputs) { _(withScope(callback), inputs); } /** * Returns a memoized version of the callback that only changes if one of the * inputs has changed (using `===`). * * This hook is equivalent to Preact's `useCallback` and makes the element's * scope available so functions like `getElement()` and `getContext()` can be * used inside the passed callback. * * @param callback Callback function. * @param inputs If present, the callback will only be updated if the * values in the list change (using `===`). * * @return The callback function. */ function useCallback(callback, inputs) { return q(withScope(callback), inputs); } /** * Pass a factory function and an array of inputs. `useMemo` will only recompute * the memoized value when one of the inputs has changed. * * This hook is equivalent to Preact's `useMemo` and makes the element's scope * available so functions like `getElement()` and `getContext()` can be used * inside the passed factory function. * * @param factory Factory function that returns that value for memoization. * @param inputs If present, the factory will only be run to recompute if * the values in the list change (using `===`). * * @return The memoized value. */ function useMemo(factory, inputs) { return T(withScope(factory), inputs); } /** * Creates a root fragment by replacing a node or an array of nodes in a parent element. * For wrapperless hydration. * See https://gist.github.com/developit/f4c67a2ede71dc2fab7f357f39cff28c * * @param parent The parent element where the nodes will be replaced. * @param replaceNode The node or array of nodes to replace in the parent element. * @return The created root fragment. */ const createRootFragment = (parent, replaceNode) => { replaceNode = [].concat(replaceNode); const sibling = replaceNode[replaceNode.length - 1].nextSibling; function insert(child, root) { parent.insertBefore(child, root || sibling); } return parent.__k = { nodeType: 1, parentNode: parent, firstChild: replaceNode[0], childNodes: replaceNode, insertBefore: insert, appendChild: insert, removeChild(c) { parent.removeChild(c); } }; }; /** * Transforms a kebab-case string to camelCase. * * @param str The kebab-case string to transform to camelCase. * @return The transformed camelCase string. */ function kebabToCamelCase(str) { return str.replace(/^-+|-+$/g, '').toLowerCase().replace(/-([a-z])/g, function (_match, group1) { return group1.toUpperCase(); }); } const logged = new Set(); /** * Shows a warning with `message` if environment is not `production`. * * Based on the `@wordpress/warning` package. * * @param message Message to show in the warning. */ const warn = message => { if (true) { if (logged.has(message)) { return; } // eslint-disable-next-line no-console console.warn(message); // Throwing an error and catching it immediately to improve debugging // A consumer can use 'pause on caught exceptions' try { throw Error(message); } catch (e) { // Do nothing. } logged.add(message); } }; /** * Checks if the passed `candidate` is a plain object with just the `Object` * prototype. * * @param candidate The item to check. * @return Whether `candidate` is a plain object. */ const isPlainObject = candidate => Boolean(candidate && typeof candidate === 'object' && candidate.constructor === Object); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/registry.js /** * Proxies for each object. */ const objToProxy = new WeakMap(); const proxyToObj = new WeakMap(); /** * Namespaces for each created proxy. */ const proxyToNs = new WeakMap(); /** * Object types that can be proxied. */ const supported = new Set([Object, Array]); /** * Returns a proxy to the passed object with the given handlers, assigning the * specified namespace to it. If a proxy for the passed object was created * before, that proxy is returned. * * @param namespace The namespace that will be associated to this proxy. * @param obj The object to proxify. * @param handlers Handlers that the proxy will use. * * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to * check if a proxy can be created for a specific object. * * @return The created proxy. */ const createProxy = (namespace, obj, handlers) => { if (!shouldProxy(obj)) { throw Error('This object cannot be proxified.'); } if (!objToProxy.has(obj)) { const proxy = new Proxy(obj, handlers); objToProxy.set(obj, proxy); proxyToObj.set(proxy, obj); proxyToNs.set(proxy, namespace); } return objToProxy.get(obj); }; /** * Returns the proxy for the given object. If there is no associated proxy, the * function returns `undefined`. * * @param obj Object from which to know the proxy. * @return Associated proxy or `undefined`. */ const getProxyFromObject = obj => objToProxy.get(obj); /** * Gets the namespace associated with the given proxy. * * Proxies have a namespace assigned upon creation. See {@link createProxy}. * * @param proxy Proxy. * @return Namespace. */ const getNamespaceFromProxy = proxy => proxyToNs.get(proxy); /** * Checks if a given object can be proxied. * * @param candidate Object to know whether it can be proxied. * @return True if the passed instance can be proxied. */ const shouldProxy = candidate => { if (typeof candidate !== 'object' || candidate === null) { return false; } return !proxyToNs.has(candidate) && supported.has(candidate.constructor); }; /** * Returns the target object for the passed proxy. If the passed object is not a registered proxy, the * function returns `undefined`. * * @param proxy Proxy from which to know the target. * @return The target object or `undefined`. */ const getObjectFromProxy = proxy => proxyToObj.get(proxy); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/signals.js /** * External dependencies */ /** * Internal dependencies */ /** * Identifier for property computeds not associated to any scope. */ const NO_SCOPE = {}; /** * Structure that manages reactivity for a property in a state object. It uses * signals to keep track of property value or getter modifications. */ class PropSignal { /** * Proxy that holds the property this PropSignal is associated with. */ /** * Relation of computeds by scope. These computeds are read-only signals * that depend on whether the property is a value or a getter and, * therefore, can return different values depending on the scope in which * the getter is accessed. */ /** * Signal with the value assigned to the related property. */ /** * Signal with the getter assigned to the related property. */ /** * Structure that manages reactivity for a property in a state object, using * signals to keep track of property value or getter modifications. * * @param owner Proxy that holds the property this instance is associated * with. */ constructor(owner) { this.owner = owner; this.computedsByScope = new WeakMap(); } /** * Changes the internal value. If a getter was set before, it is set to * `undefined`. * * @param value New value. */ setValue(value) { this.update({ value }); } /** * Changes the internal getter. If a value was set before, it is set to * `undefined`. * * @param getter New getter. */ setGetter(getter) { this.update({ get: getter }); } /** * Returns the computed that holds the result of evaluating the prop in the * current scope. * * These computeds are read-only signals that depend on whether the property * is a value or a getter and, therefore, can return different values * depending on the scope in which the getter is accessed. * * @return Computed that depends on the scope. */ getComputed() { const scope = getScope() || NO_SCOPE; if (!this.valueSignal && !this.getterSignal) { this.update({}); } if (!this.computedsByScope.has(scope)) { const callback = () => { const getter = this.getterSignal?.value; return getter ? getter.call(this.owner) : this.valueSignal?.value; }; setNamespace(getNamespaceFromProxy(this.owner)); this.computedsByScope.set(scope, signals_core_module_w(withScope(callback))); resetNamespace(); } return this.computedsByScope.get(scope); } /** * Update the internal signals for the value and the getter of the * corresponding prop. * * @param param0 * @param param0.get New getter. * @param param0.value New value. */ update({ get, value }) { if (!this.valueSignal) { this.valueSignal = signals_core_module_d(value); this.getterSignal = signals_core_module_d(get); } else if (value !== this.valueSignal.peek() || get !== this.getterSignal.peek()) { signals_core_module_r(() => { this.valueSignal.value = value; this.getterSignal.value = get; }); } } } ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/state.js /** * External dependencies */ /** * Internal dependencies */ /** * Set of built-in symbols. */ const wellKnownSymbols = new Set(Object.getOwnPropertyNames(Symbol).map(key => Symbol[key]).filter(value => typeof value === 'symbol')); /** * Relates each proxy with a map of {@link PropSignal} instances, representing * the proxy's accessed properties. */ const proxyToProps = new WeakMap(); /** * Checks wether a {@link PropSignal | `PropSignal`} instance exists for the * given property in the passed proxy. * * @param proxy Proxy of a state object or array. * @param key The property key. * @return `true` when it exists; false otherwise. */ const hasPropSignal = (proxy, key) => proxyToProps.has(proxy) && proxyToProps.get(proxy).has(key); const readOnlyProxies = new WeakSet(); /** * Returns the {@link PropSignal | `PropSignal`} instance associated with the * specified prop in the passed proxy. * * The `PropSignal` instance is generated if it doesn't exist yet, using the * `initial` parameter to initialize the internal signals. * * @param proxy Proxy of a state object or array. * @param key The property key. * @param initial Initial data for the `PropSignal` instance. * @return The `PropSignal` instance. */ const getPropSignal = (proxy, key, initial) => { if (!proxyToProps.has(proxy)) { proxyToProps.set(proxy, new Map()); } key = typeof key === 'number' ? `${key}` : key; const props = proxyToProps.get(proxy); if (!props.has(key)) { const ns = getNamespaceFromProxy(proxy); const prop = new PropSignal(proxy); props.set(key, prop); if (initial) { const { get, value } = initial; if (get) { prop.setGetter(get); } else { const readOnly = readOnlyProxies.has(proxy); prop.setValue(shouldProxy(value) ? proxifyState(ns, value, { readOnly }) : value); } } } return props.get(key); }; /** * Relates each proxied object (i.e., the original object) with a signal that * tracks changes in the number of properties. */ const objToIterable = new WeakMap(); /** * When this flag is `true`, it avoids any signal subscription, overriding state * props' "reactive" behavior. */ let peeking = false; /** * Handlers for reactive objects and arrays in the state. */ const stateHandlers = { get(target, key, receiver) { /* * The property should not be reactive for the following cases: * 1. While using the `peek` function to read the property. * 2. The property exists but comes from the Object or Array prototypes. * 3. The property key is a known symbol. */ if (peeking || !target.hasOwnProperty(key) && key in target || typeof key === 'symbol' && wellKnownSymbols.has(key)) { return Reflect.get(target, key, receiver); } // At this point, the property should be reactive. const desc = Object.getOwnPropertyDescriptor(target, key); const prop = getPropSignal(receiver, key, desc); const result = prop.getComputed().value; /* * Check if the property is a synchronous function. If it is, set the * default namespace. Synchronous functions always run in the proper scope, * which is set by the Directives component. */ if (typeof result === 'function') { const ns = getNamespaceFromProxy(receiver); return (...args) => { setNamespace(ns); try { return result.call(receiver, ...args); } finally { resetNamespace(); } }; } return result; }, set(target, key, value, receiver) { if (readOnlyProxies.has(receiver)) { return false; } setNamespace(getNamespaceFromProxy(receiver)); try { return Reflect.set(target, key, value, receiver); } finally { resetNamespace(); } }, defineProperty(target, key, desc) { if (readOnlyProxies.has(getProxyFromObject(target))) { return false; } const isNew = !(key in target); const result = Reflect.defineProperty(target, key, desc); if (result) { const receiver = getProxyFromObject(target); const prop = getPropSignal(receiver, key); const { get, value } = desc; if (get) { prop.setGetter(get); } else { const ns = getNamespaceFromProxy(receiver); prop.setValue(shouldProxy(value) ? proxifyState(ns, value) : value); } if (isNew && objToIterable.has(target)) { objToIterable.get(target).value++; } /* * Modify the `length` property value only if the related * `PropSignal` exists, which means that there are subscriptions to * this property. */ if (Array.isArray(target) && proxyToProps.get(receiver)?.has('length')) { const length = getPropSignal(receiver, 'length'); length.setValue(target.length); } } return result; }, deleteProperty(target, key) { if (readOnlyProxies.has(getProxyFromObject(target))) { return false; } const result = Reflect.deleteProperty(target, key); if (result) { const prop = getPropSignal(getProxyFromObject(target), key); prop.setValue(undefined); if (objToIterable.has(target)) { objToIterable.get(target).value++; } } return result; }, ownKeys(target) { if (!objToIterable.has(target)) { objToIterable.set(target, signals_core_module_d(0)); } /* *This subscribes to the signal while preventing the minifier from * deleting this line in production. */ objToIterable._ = objToIterable.get(target).value; return Reflect.ownKeys(target); } }; /** * Returns the proxy associated with the given state object, creating it if it * does not exist. * * @param namespace The namespace that will be associated to this proxy. * @param obj The object to proxify. * @param options Options. * @param options.readOnly Read-only. * * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to * check if a proxy can be created for a specific object. * * @return The associated proxy. */ const proxifyState = (namespace, obj, options) => { const proxy = createProxy(namespace, obj, stateHandlers); if (options?.readOnly) { readOnlyProxies.add(proxy); } return proxy; }; /** * Reads the value of the specified property without subscribing to it. * * @param obj The object to read the property from. * @param key The property key. * @return The property value. */ const peek = (obj, key) => { peeking = true; try { return obj[key]; } finally { peeking = false; } }; /** * Internal recursive implementation for {@link deepMerge | `deepMerge`}. * * @param target The target object. * @param source The source object containing new values and props. * @param override Whether existing props should be overwritten or not (`true` * by default). */ const deepMergeRecursive = (target, source, override = true) => { if (!(isPlainObject(target) && isPlainObject(source))) { return; } let hasNewKeys = false; for (const key in source) { const isNew = !(key in target); hasNewKeys = hasNewKeys || isNew; const desc = Object.getOwnPropertyDescriptor(source, key); const proxy = getProxyFromObject(target); const propSignal = !!proxy && hasPropSignal(proxy, key) && getPropSignal(proxy, key); if (typeof desc.get === 'function' || typeof desc.set === 'function') { if (override || isNew) { Object.defineProperty(target, key, { ...desc, configurable: true, enumerable: true }); if (desc.get && propSignal) { propSignal.setGetter(desc.get); } } } else if (isPlainObject(source[key])) { if (isNew || override && !isPlainObject(target[key])) { target[key] = {}; if (propSignal) { const ns = getNamespaceFromProxy(proxy); propSignal.setValue(proxifyState(ns, target[key])); } } if (isPlainObject(target[key])) { deepMergeRecursive(target[key], source[key], override); } } else if (override || isNew) { Object.defineProperty(target, key, desc); if (propSignal) { const { value } = desc; const ns = getNamespaceFromProxy(proxy); propSignal.setValue(shouldProxy(value) ? proxifyState(ns, value) : value); } } } if (hasNewKeys && objToIterable.has(target)) { objToIterable.get(target).value++; } }; /** * Recursively update prop values inside the passed `target` and nested plain * objects, using the values present in `source`. References to plain objects * are kept, only updating props containing primitives or arrays. Arrays are * replaced instead of merged or concatenated. * * If the `override` parameter is set to `false`, then all values in `target` * are preserved, and only new properties from `source` are added. * * @param target The target object. * @param source The source object containing new values and props. * @param override Whether existing props should be overwritten or not (`true` * by default). */ const deepMerge = (target, source, override = true) => signals_core_module_r(() => deepMergeRecursive(getObjectFromProxy(target) || target, source, override)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/store.js /** * Internal dependencies */ /** * External dependencies */ /** * Identifies the store proxies handling the root objects of each store. */ const storeRoots = new WeakSet(); /** * Handlers for store proxies. */ const storeHandlers = { get: (target, key, receiver) => { const result = Reflect.get(target, key); const ns = getNamespaceFromProxy(receiver); /* * Check if the proxy is the store root and no key with that name exist. In * that case, return an empty object for the requested key. */ if (typeof result === 'undefined' && storeRoots.has(receiver)) { const obj = {}; Reflect.set(target, key, obj); return proxifyStore(ns, obj, false); } /* * Check if the property is a function. If it is, add the store * namespace to the stack and wrap the function with the current scope. * The `withScope` util handles both synchronous functions and generator * functions. */ if (typeof result === 'function') { setNamespace(ns); const scoped = withScope(result); resetNamespace(); return scoped; } // Check if the property is an object. If it is, proxyify it. if (isPlainObject(result) && shouldProxy(result)) { return proxifyStore(ns, result, false); } return result; } }; /** * Returns the proxy associated with the given store object, creating it if it * does not exist. * * @param namespace The namespace that will be associated to this proxy. * @param obj The object to proxify. * * @param isRoot Whether the passed object is the store root object. * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to * check if a proxy can be created for a specific object. * * @return The associated proxy. */ const proxifyStore = (namespace, obj, isRoot = true) => { const proxy = createProxy(namespace, obj, storeHandlers); if (proxy && isRoot) { storeRoots.add(proxy); } return proxy; }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/context.js const contextObjectToProxy = new WeakMap(); const contextObjectToFallback = new WeakMap(); const contextProxies = new WeakSet(); const descriptor = Reflect.getOwnPropertyDescriptor; // TODO: Use the proxy registry to avoid multiple proxies on the same object. const contextHandlers = { get: (target, key) => { const fallback = contextObjectToFallback.get(target); // Always subscribe to prop changes in the current context. const currentProp = target[key]; /* * Return the value from `target` if it exists, or from `fallback` * otherwise. This way, in the case the property doesn't exist either in * `target` or `fallback`, it also subscribes to changes in the parent * context. */ return key in target ? currentProp : fallback[key]; }, set: (target, key, value) => { const fallback = contextObjectToFallback.get(target); // If the property exists in the current context, modify it. Otherwise, // add it to the current context. const obj = key in target || !(key in fallback) ? target : fallback; obj[key] = value; return true; }, ownKeys: target => [...new Set([...Object.keys(contextObjectToFallback.get(target)), ...Object.keys(target)])], getOwnPropertyDescriptor: (target, key) => descriptor(target, key) || descriptor(contextObjectToFallback.get(target), key) }; /** * Wrap a context object with a proxy to reproduce the context stack. The proxy * uses the passed `inherited` context as a fallback to look up for properties * that don't exist in the given context. Also, updated properties are modified * where they are defined, or added to the main context when they don't exist. * * @param current Current context. * @param inherited Inherited context, used as fallback. * * @return The wrapped context object. */ const proxifyContext = (current, inherited = {}) => { if (contextProxies.has(current)) { throw Error('This object cannot be proxified.'); } // Update the fallback object reference when it changes. contextObjectToFallback.set(current, inherited); if (!contextObjectToProxy.has(current)) { const proxy = new Proxy(current, contextHandlers); contextObjectToProxy.set(current, proxy); contextProxies.add(proxy); } return contextObjectToProxy.get(current); }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/index.js /** * Internal dependencies */ ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/store.js /** * Internal dependencies */ /** * External dependencies */ const stores = new Map(); const rawStores = new Map(); const storeLocks = new Map(); const storeConfigs = new Map(); const serverStates = new Map(); /** * Get the defined config for the store with the passed namespace. * * @param namespace Store's namespace from which to retrieve the config. * @return Defined config for the given namespace. */ const getConfig = namespace => storeConfigs.get(namespace || getNamespace()) || {}; /** * Get the part of the state defined and updated from the server. * * The object returned is read-only, and includes the state defined in PHP with * `wp_interactivity_state()`. When using `actions.navigate()`, this object is * updated to reflect the changes in its properites, without affecting the state * returned by `store()`. Directives can subscribe to those changes to update * the state if needed. * * @example * ```js * const { state } = store('myStore', { * callbacks: { * updateServerState() { * const serverState = getServerState(); * // Override some property with the new value that came from the server. * state.overridableProp = serverState.overridableProp; * }, * }, * }); * ``` * * @param namespace Store's namespace from which to retrieve the server state. * @return The server state for the given namespace. */ const getServerState = namespace => { const ns = namespace || getNamespace(); if (!serverStates.has(ns)) { serverStates.set(ns, proxifyState(ns, {}, { readOnly: true })); } return serverStates.get(ns); }; const universalUnlock = 'I acknowledge that using a private store means my plugin will inevitably break on the next store release.'; /** * Extends the Interactivity API global store adding the passed properties to * the given namespace. It also returns stable references to the namespace * content. * * These props typically consist of `state`, which is the reactive part of the * store ― which means that any directive referencing a state property will be * re-rendered anytime it changes ― and function properties like `actions` and * `callbacks`, mostly used for event handlers. These props can then be * referenced by any directive to make the HTML interactive. * * @example * ```js * const { state } = store( 'counter', { * state: { * value: 0, * get double() { return state.value * 2; }, * }, * actions: { * increment() { * state.value += 1; * }, * }, * } ); * ``` * * The code from the example above allows blocks to subscribe and interact with * the store by using directives in the HTML, e.g.: * * ```html *

* *
* ``` * @param namespace The store namespace to interact with. * @param storePart Properties to add to the store namespace. * @param options Options for the given namespace. * * @return A reference to the namespace content. */ function store(namespace, { state = {}, ...block } = {}, { lock = false } = {}) { if (!stores.has(namespace)) { // Lock the store if the passed lock is different from the universal // unlock. Once the lock is set (either false, true, or a given string), // it cannot change. if (lock !== universalUnlock) { storeLocks.set(namespace, lock); } const rawStore = { state: proxifyState(namespace, isPlainObject(state) ? state : {}), ...block }; const proxifiedStore = proxifyStore(namespace, rawStore); rawStores.set(namespace, rawStore); stores.set(namespace, proxifiedStore); } else { // Lock the store if it wasn't locked yet and the passed lock is // different from the universal unlock. If no lock is given, the store // will be public and won't accept any lock from now on. if (lock !== universalUnlock && !storeLocks.has(namespace)) { storeLocks.set(namespace, lock); } else { const storeLock = storeLocks.get(namespace); const isLockValid = lock === universalUnlock || lock !== true && lock === storeLock; if (!isLockValid) { if (!storeLock) { throw Error('Cannot lock a public store'); } else { throw Error('Cannot unlock a private store with an invalid lock code'); } } } const target = rawStores.get(namespace); deepMerge(target, block); deepMerge(target.state, state); } return stores.get(namespace); } const parseServerData = (dom = document) => { var _dom$getElementById; const jsonDataScriptTag = // Preferred Script Module data passing form (_dom$getElementById = dom.getElementById('wp-script-module-data-@wordpress/interactivity')) !== null && _dom$getElementById !== void 0 ? _dom$getElementById : // Legacy form dom.getElementById('wp-interactivity-data'); if (jsonDataScriptTag?.textContent) { try { return JSON.parse(jsonDataScriptTag.textContent); } catch {} } return {}; }; const populateServerData = data => { if (isPlainObject(data?.state)) { Object.entries(data.state).forEach(([namespace, state]) => { const st = store(namespace, {}, { lock: universalUnlock }); deepMerge(st.state, state, false); deepMerge(getServerState(namespace), state); }); } if (isPlainObject(data?.config)) { Object.entries(data.config).forEach(([namespace, config]) => { storeConfigs.set(namespace, config); }); } }; // Parse and populate the initial state and config. const data = parseServerData(); populateServerData(data); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/hooks.js // eslint-disable-next-line eslint-comments/disable-enable-pair /* eslint-disable react-hooks/exhaustive-deps */ /** * External dependencies */ /** * Internal dependencies */ function isNonDefaultDirectiveSuffix(entry) { return entry.suffix !== null; } function isDefaultDirectiveSuffix(entry) { return entry.suffix === null; } // Main context. const context = (0,preact_module/* createContext */.q6)({ client: {}, server: {} }); // WordPress Directives. const directiveCallbacks = {}; const directivePriorities = {}; /** * Register a new directive type in the Interactivity API runtime. * * @example * ```js * directive( * 'alert', // Name without the `data-wp-` prefix. * ( { directives: { alert }, element, evaluate } ) => { * const defaultEntry = alert.find( isDefaultDirectiveSuffix ); * element.props.onclick = () => { alert( evaluate( defaultEntry ) ); } * } * ) * ``` * * The previous code registers a custom directive type for displaying an alert * message whenever an element using it is clicked. The message text is obtained * from the store under the inherited namespace, using `evaluate`. * * When the HTML is processed by the Interactivity API, any element containing * the `data-wp-alert` directive will have the `onclick` event handler, e.g., * * ```html *
* *
* ``` * Note that, in the previous example, the directive callback gets the path * value (`state.alert`) from the directive entry with suffix `null`. A * custom suffix can also be specified by appending `--` to the directive * attribute, followed by the suffix, like in the following HTML snippet: * * ```html *
* *
* ``` * * This could be an hypothetical implementation of the custom directive used in * the snippet above. * * @example * ```js * directive( * 'color', // Name without prefix and suffix. * ( { directives: { color: colors }, ref, evaluate } ) => * colors.forEach( ( color ) => { * if ( color.suffix = 'text' ) { * ref.style.setProperty( * 'color', * evaluate( color.text ) * ); * } * if ( color.suffix = 'background' ) { * ref.style.setProperty( * 'background-color', * evaluate( color.background ) * ); * } * } ); * } * ) * ``` * * @param name Directive name, without the `data-wp-` prefix. * @param callback Function that runs the directive logic. * @param options Options object. * @param options.priority Option to control the directive execution order. The * lesser, the highest priority. Default is `10`. */ const directive = (name, callback, { priority = 10 } = {}) => { directiveCallbacks[name] = callback; directivePriorities[name] = priority; }; // Resolve the path to some property of the store object. const resolve = (path, namespace) => { if (!namespace) { warn(`Namespace missing for "${path}". The value for that path won't be resolved.`); return; } let resolvedStore = stores.get(namespace); if (typeof resolvedStore === 'undefined') { resolvedStore = store(namespace, undefined, { lock: universalUnlock }); } const current = { ...resolvedStore, context: getScope().context[namespace] }; try { // TODO: Support lazy/dynamically initialized stores return path.split('.').reduce((acc, key) => acc[key], current); } catch (e) {} }; // Generate the evaluate function. const getEvaluate = ({ scope }) => (entry, ...args) => { let { value: path, namespace } = entry; if (typeof path !== 'string') { throw new Error('The `value` prop should be a string path'); } // If path starts with !, remove it and save a flag. const hasNegationOperator = path[0] === '!' && !!(path = path.slice(1)); setScope(scope); const value = resolve(path, namespace); const result = typeof value === 'function' ? value(...args) : value; resetScope(); return hasNegationOperator ? !result : result; }; // Separate directives by priority. The resulting array contains objects // of directives grouped by same priority, and sorted in ascending order. const getPriorityLevels = directives => { const byPriority = Object.keys(directives).reduce((obj, name) => { if (directiveCallbacks[name]) { const priority = directivePriorities[name]; (obj[priority] = obj[priority] || []).push(name); } return obj; }, {}); return Object.entries(byPriority).sort(([p1], [p2]) => parseInt(p1) - parseInt(p2)).map(([, arr]) => arr); }; // Component that wraps each priority level of directives of an element. const Directives = ({ directives, priorityLevels: [currentPriorityLevel, ...nextPriorityLevels], element, originalProps, previousScope }) => { // Initialize the scope of this element. These scopes are different per each // level because each level has a different context, but they share the same // element ref, state and props. const scope = A({}).current; scope.evaluate = q(getEvaluate({ scope }), []); const { client, server } = x(context); scope.context = client; scope.serverContext = server; /* eslint-disable react-hooks/rules-of-hooks */ scope.ref = previousScope?.ref || A(null); /* eslint-enable react-hooks/rules-of-hooks */ // Create a fresh copy of the vnode element and add the props to the scope, // named as attributes (HTML Attributes). element = (0,preact_module/* cloneElement */.Ob)(element, { ref: scope.ref }); scope.attributes = element.props; // Recursively render the wrapper for the next priority level. const children = nextPriorityLevels.length > 0 ? (0,preact_module.h)(Directives, { directives, priorityLevels: nextPriorityLevels, element, originalProps, previousScope: scope }) : element; const props = { ...originalProps, children }; const directiveArgs = { directives, props, element, context, evaluate: scope.evaluate }; setScope(scope); for (const directiveName of currentPriorityLevel) { const wrapper = directiveCallbacks[directiveName]?.(directiveArgs); if (wrapper !== undefined) { props.children = wrapper; } } resetScope(); return props.children; }; // Preact Options Hook called each time a vnode is created. const old = preact_module/* options */.fF.vnode; preact_module/* options */.fF.vnode = vnode => { if (vnode.props.__directives) { const props = vnode.props; const directives = props.__directives; if (directives.key) { vnode.key = directives.key.find(isDefaultDirectiveSuffix).value; } delete props.__directives; const priorityLevels = getPriorityLevels(directives); if (priorityLevels.length > 0) { vnode.props = { directives, priorityLevels, originalProps: props, type: vnode.type, element: (0,preact_module.h)(vnode.type, props), top: true }; vnode.type = Directives; } } if (old) { old(vnode); } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/directives.js // eslint-disable-next-line eslint-comments/disable-enable-pair /* eslint-disable react-hooks/exhaustive-deps */ /** * External dependencies */ /** * Internal dependencies */ /** * Recursively clone the passed object. * * @param source Source object. * @return Cloned object. */ function deepClone(source) { if (isPlainObject(source)) { return Object.fromEntries(Object.entries(source).map(([key, value]) => [key, deepClone(value)])); } if (Array.isArray(source)) { return source.map(i => deepClone(i)); } return source; } const newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g; const ruleClean = /\/\*[^]*?\*\/| +/g; const ruleNewline = /\n+/g; const empty = ' '; /** * Convert a css style string into a object. * * Made by Cristian Bote (@cristianbote) for Goober. * https://unpkg.com/browse/goober@2.1.13/src/core/astish.js * * @param val CSS string. * @return CSS object. */ const cssStringToObject = val => { const tree = [{}]; let block, left; while (block = newRule.exec(val.replace(ruleClean, ''))) { if (block[4]) { tree.shift(); } else if (block[3]) { left = block[3].replace(ruleNewline, empty).trim(); tree.unshift(tree[0][left] = tree[0][left] || {}); } else { tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim(); } } return tree[0]; }; /** * Creates a directive that adds an event listener to the global window or * document object. * * @param type 'window' or 'document' */ const getGlobalEventDirective = type => { return ({ directives, evaluate }) => { directives[`on-${type}`].filter(isNonDefaultDirectiveSuffix).forEach(entry => { const eventName = entry.suffix.split('--', 1)[0]; useInit(() => { const cb = event => evaluate(entry, event); const globalVar = type === 'window' ? window : document; globalVar.addEventListener(eventName, cb); return () => globalVar.removeEventListener(eventName, cb); }); }); }; }; /** * Creates a directive that adds an async event listener to the global window or * document object. * * @param type 'window' or 'document' */ const getGlobalAsyncEventDirective = type => { return ({ directives, evaluate }) => { directives[`on-async-${type}`].filter(isNonDefaultDirectiveSuffix).forEach(entry => { const eventName = entry.suffix.split('--', 1)[0]; useInit(() => { const cb = async event => { await splitTask(); evaluate(entry, event); }; const globalVar = type === 'window' ? window : document; globalVar.addEventListener(eventName, cb, { passive: true }); return () => globalVar.removeEventListener(eventName, cb); }); }); }; }; /* harmony default export */ const directives = (() => { // data-wp-context directive('context', ({ directives: { context }, props: { children }, context: inheritedContext }) => { const { Provider } = inheritedContext; const defaultEntry = context.find(isDefaultDirectiveSuffix); const { client: inheritedClient, server: inheritedServer } = x(inheritedContext); const ns = defaultEntry.namespace; const client = A(proxifyState(ns, {})); const server = A(proxifyState(ns, {}, { readOnly: true })); // No change should be made if `defaultEntry` does not exist. const contextStack = T(() => { const result = { client: { ...inheritedClient }, server: { ...inheritedServer } }; if (defaultEntry) { const { namespace, value } = defaultEntry; // Check that the value is a JSON object. Send a console warning if not. if (!isPlainObject(value)) { warn(`The value of data-wp-context in "${namespace}" store must be a valid stringified JSON object.`); } deepMerge(client.current, deepClone(value), false); deepMerge(server.current, deepClone(value)); result.client[namespace] = proxifyContext(client.current, inheritedClient[namespace]); result.server[namespace] = proxifyContext(server.current, inheritedServer[namespace]); } return result; }, [defaultEntry, inheritedClient, inheritedServer]); return (0,preact_module.h)(Provider, { value: contextStack }, children); }, { priority: 5 }); // data-wp-watch--[name] directive('watch', ({ directives: { watch }, evaluate }) => { watch.forEach(entry => { useWatch(() => { let start; if (false) {} const result = evaluate(entry); if (false) {} return result; }); }); }); // data-wp-init--[name] directive('init', ({ directives: { init }, evaluate }) => { init.forEach(entry => { // TODO: Replace with useEffect to prevent unneeded scopes. useInit(() => { let start; if (false) {} const result = evaluate(entry); if (false) {} return result; }); }); }); // data-wp-on--[event] directive('on', ({ directives: { on }, element, evaluate }) => { const events = new Map(); on.filter(isNonDefaultDirectiveSuffix).forEach(entry => { const event = entry.suffix.split('--')[0]; if (!events.has(event)) { events.set(event, new Set()); } events.get(event).add(entry); }); events.forEach((entries, eventType) => { const existingHandler = element.props[`on${eventType}`]; element.props[`on${eventType}`] = event => { entries.forEach(entry => { if (existingHandler) { existingHandler(event); } let start; if (false) {} evaluate(entry, event); if (false) {} }); }; }); }); // data-wp-on-async--[event] directive('on-async', ({ directives: { 'on-async': onAsync }, element, evaluate }) => { const events = new Map(); onAsync.filter(isNonDefaultDirectiveSuffix).forEach(entry => { const event = entry.suffix.split('--')[0]; if (!events.has(event)) { events.set(event, new Set()); } events.get(event).add(entry); }); events.forEach((entries, eventType) => { const existingHandler = element.props[`on${eventType}`]; element.props[`on${eventType}`] = event => { if (existingHandler) { existingHandler(event); } entries.forEach(async entry => { await splitTask(); evaluate(entry, event); }); }; }); }); // data-wp-on-window--[event] directive('on-window', getGlobalEventDirective('window')); // data-wp-on-document--[event] directive('on-document', getGlobalEventDirective('document')); // data-wp-on-async-window--[event] directive('on-async-window', getGlobalAsyncEventDirective('window')); // data-wp-on-async-document--[event] directive('on-async-document', getGlobalAsyncEventDirective('document')); // data-wp-class--[classname] directive('class', ({ directives: { class: classNames }, element, evaluate }) => { classNames.filter(isNonDefaultDirectiveSuffix).forEach(entry => { const className = entry.suffix; const result = evaluate(entry); const currentClass = element.props.class || ''; const classFinder = new RegExp(`(^|\\s)${className}(\\s|$)`, 'g'); if (!result) { element.props.class = currentClass.replace(classFinder, ' ').trim(); } else if (!classFinder.test(currentClass)) { element.props.class = currentClass ? `${currentClass} ${className}` : className; } useInit(() => { /* * This seems necessary because Preact doesn't change the class * names on the hydration, so we have to do it manually. It doesn't * need deps because it only needs to do it the first time. */ if (!result) { element.ref.current.classList.remove(className); } else { element.ref.current.classList.add(className); } }); }); }); // data-wp-style--[style-prop] directive('style', ({ directives: { style }, element, evaluate }) => { style.filter(isNonDefaultDirectiveSuffix).forEach(entry => { const styleProp = entry.suffix; const result = evaluate(entry); element.props.style = element.props.style || {}; if (typeof element.props.style === 'string') { element.props.style = cssStringToObject(element.props.style); } if (!result) { delete element.props.style[styleProp]; } else { element.props.style[styleProp] = result; } useInit(() => { /* * This seems necessary because Preact doesn't change the styles on * the hydration, so we have to do it manually. It doesn't need deps * because it only needs to do it the first time. */ if (!result) { element.ref.current.style.removeProperty(styleProp); } else { element.ref.current.style[styleProp] = result; } }); }); }); // data-wp-bind--[attribute] directive('bind', ({ directives: { bind }, element, evaluate }) => { bind.filter(isNonDefaultDirectiveSuffix).forEach(entry => { const attribute = entry.suffix; const result = evaluate(entry); element.props[attribute] = result; /* * This is necessary because Preact doesn't change the attributes on the * hydration, so we have to do it manually. It only needs to do it the * first time. After that, Preact will handle the changes. */ useInit(() => { const el = element.ref.current; /* * We set the value directly to the corresponding HTMLElement instance * property excluding the following special cases. We follow Preact's * logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L110-L129 */ if (attribute === 'style') { if (typeof result === 'string') { el.style.cssText = result; } return; } else if (attribute !== 'width' && attribute !== 'height' && attribute !== 'href' && attribute !== 'list' && attribute !== 'form' && /* * The value for `tabindex` follows the parsing rules for an * integer. If that fails, or if the attribute isn't present, then * the browsers should "follow platform conventions to determine if * the element should be considered as a focusable area", * practically meaning that most elements get a default of `-1` (not * focusable), but several also get a default of `0` (focusable in * order after all elements with a positive `tabindex` value). * * @see https://html.spec.whatwg.org/#tabindex-value */ attribute !== 'tabIndex' && attribute !== 'download' && attribute !== 'rowSpan' && attribute !== 'colSpan' && attribute !== 'role' && attribute in el) { try { el[attribute] = result === null || result === undefined ? '' : result; return; } catch (err) {} } /* * aria- and data- attributes have no boolean representation. * A `false` value is different from the attribute not being * present, so we can't remove it. * We follow Preact's logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L131C24-L136 */ if (result !== null && result !== undefined && (result !== false || attribute[4] === '-')) { el.setAttribute(attribute, result); } else { el.removeAttribute(attribute); } }); }); }); // data-wp-ignore directive('ignore', ({ element: { type: Type, props: { innerHTML, ...rest } } }) => { // Preserve the initial inner HTML. const cached = T(() => innerHTML, []); return (0,preact_module.h)(Type, { dangerouslySetInnerHTML: { __html: cached }, ...rest }); }); // data-wp-text directive('text', ({ directives: { text }, element, evaluate }) => { const entry = text.find(isDefaultDirectiveSuffix); if (!entry) { element.props.children = null; return; } try { const result = evaluate(entry); element.props.children = typeof result === 'object' ? null : result.toString(); } catch (e) { element.props.children = null; } }); // data-wp-run directive('run', ({ directives: { run }, evaluate }) => { run.forEach(entry => evaluate(entry)); }); // data-wp-each--[item] directive('each', ({ directives: { each, 'each-key': eachKey }, context: inheritedContext, element, evaluate }) => { if (element.type !== 'template') { return; } const { Provider } = inheritedContext; const inheritedValue = x(inheritedContext); const [entry] = each; const { namespace } = entry; const list = evaluate(entry); const itemProp = isNonDefaultDirectiveSuffix(entry) ? kebabToCamelCase(entry.suffix) : 'item'; return list.map(item => { const itemContext = proxifyContext(proxifyState(namespace, {}), inheritedValue.client[namespace]); const mergedContext = { client: { ...inheritedValue.client, [namespace]: itemContext }, server: { ...inheritedValue.server } }; // Set the item after proxifying the context. mergedContext.client[namespace][itemProp] = item; const scope = { ...getScope(), context: mergedContext.client, serverContext: mergedContext.server }; const key = eachKey ? getEvaluate({ scope })(eachKey[0]) : item; return (0,preact_module.h)(Provider, { value: mergedContext, key }, element.props.content); }); }, { priority: 20 }); directive('each-child', () => null, { priority: 1 }); }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/constants.js const directivePrefix = 'wp'; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/vdom.js /** * External dependencies */ /** * Internal dependencies */ const ignoreAttr = `data-${directivePrefix}-ignore`; const islandAttr = `data-${directivePrefix}-interactive`; const fullPrefix = `data-${directivePrefix}-`; const namespaces = []; const currentNamespace = () => { var _namespaces; return (_namespaces = namespaces[namespaces.length - 1]) !== null && _namespaces !== void 0 ? _namespaces : null; }; const isObject = item => Boolean(item && typeof item === 'object' && item.constructor === Object); // Regular expression for directive parsing. const directiveParser = new RegExp(`^data-${directivePrefix}-` + // ${p} must be a prefix string, like 'wp'. // Match alphanumeric characters including hyphen-separated // segments. It excludes underscore intentionally to prevent confusion. // E.g., "custom-directive". '([a-z0-9]+(?:-[a-z0-9]+)*)' + // (Optional) Match '--' followed by any alphanumeric charachters. It // excludes underscore intentionally to prevent confusion, but it can // contain multiple hyphens. E.g., "--custom-prefix--with-more-info". '(?:--([a-z0-9_-]+))?$', 'i' // Case insensitive. ); // Regular expression for reference parsing. It can contain a namespace before // the reference, separated by `::`, like `some-namespace::state.somePath`. // Namespaces can contain any alphanumeric characters, hyphens, underscores or // forward slashes. References don't have any restrictions. const nsPathRegExp = /^([\w_\/-]+)::(.+)$/; const hydratedIslands = new WeakSet(); /** * Recursive function that transforms a DOM tree into vDOM. * * @param root The root element or node to start traversing on. * @return The resulting vDOM tree. */ function toVdom(root) { const treeWalker = document.createTreeWalker(root, 205 // TEXT + CDATA_SECTION + COMMENT + PROCESSING_INSTRUCTION + ELEMENT ); function walk(node) { const { nodeType } = node; // TEXT_NODE (3) if (nodeType === 3) { return [node.data]; } // CDATA_SECTION_NODE (4) if (nodeType === 4) { var _nodeValue; const next = treeWalker.nextSibling(); node.replaceWith(new window.Text((_nodeValue = node.nodeValue) !== null && _nodeValue !== void 0 ? _nodeValue : '')); return [node.nodeValue, next]; } // COMMENT_NODE (8) || PROCESSING_INSTRUCTION_NODE (7) if (nodeType === 8 || nodeType === 7) { const next = treeWalker.nextSibling(); node.remove(); return [null, next]; } const elementNode = node; const { attributes } = elementNode; const localName = elementNode.localName; const props = {}; const children = []; const directives = []; let ignore = false; let island = false; for (let i = 0; i < attributes.length; i++) { const attributeName = attributes[i].name; const attributeValue = attributes[i].value; if (attributeName[fullPrefix.length] && attributeName.slice(0, fullPrefix.length) === fullPrefix) { if (attributeName === ignoreAttr) { ignore = true; } else { var _regexResult$, _regexResult$2; const regexResult = nsPathRegExp.exec(attributeValue); const namespace = (_regexResult$ = regexResult?.[1]) !== null && _regexResult$ !== void 0 ? _regexResult$ : null; let value = (_regexResult$2 = regexResult?.[2]) !== null && _regexResult$2 !== void 0 ? _regexResult$2 : attributeValue; try { const parsedValue = JSON.parse(value); value = isObject(parsedValue) ? parsedValue : value; } catch {} if (attributeName === islandAttr) { island = true; const islandNamespace = // eslint-disable-next-line no-nested-ternary typeof value === 'string' ? value : typeof value?.namespace === 'string' ? value.namespace : null; namespaces.push(islandNamespace); } else { directives.push([attributeName, namespace, value]); } } } else if (attributeName === 'ref') { continue; } props[attributeName] = attributeValue; } if (ignore && !island) { return [(0,preact_module.h)(localName, { ...props, innerHTML: elementNode.innerHTML, __directives: { ignore: true } })]; } if (island) { hydratedIslands.add(elementNode); } if (directives.length) { props.__directives = directives.reduce((obj, [name, ns, value]) => { const directiveMatch = directiveParser.exec(name); if (directiveMatch === null) { warn(`Found malformed directive name: ${name}.`); return obj; } const prefix = directiveMatch[1] || ''; const suffix = directiveMatch[2] || null; obj[prefix] = obj[prefix] || []; obj[prefix].push({ namespace: ns !== null && ns !== void 0 ? ns : currentNamespace(), value: value, suffix }); return obj; }, {}); } // @ts-expect-error Fixed in upcoming preact release https://github.com/preactjs/preact/pull/4334 if (localName === 'template') { props.content = [...elementNode.content.childNodes].map(childNode => toVdom(childNode)); } else { let child = treeWalker.firstChild(); if (child) { while (child) { const [vnode, nextChild] = walk(child); if (vnode) { children.push(vnode); } child = nextChild || treeWalker.nextSibling(); } treeWalker.parentNode(); } } // Restore previous namespace. if (island) { namespaces.pop(); } return [(0,preact_module.h)(localName, props, children)]; } return walk(treeWalker.currentNode); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/init.js /** * External dependencies */ /** * Internal dependencies */ // Keep the same root fragment for each interactive region node. const regionRootFragments = new WeakMap(); const getRegionRootFragment = region => { if (!region.parentElement) { throw Error('The passed region should be an element with a parent.'); } if (!regionRootFragments.has(region)) { regionRootFragments.set(region, createRootFragment(region.parentElement, region)); } return regionRootFragments.get(region); }; // Initial vDOM regions associated with its DOM element. const initialVdom = new WeakMap(); // Initialize the router with the initial DOM. const init = async () => { const nodes = document.querySelectorAll(`[data-${directivePrefix}-interactive]`); for (const node of nodes) { if (!hydratedIslands.has(node)) { await splitTask(); const fragment = getRegionRootFragment(node); const vdom = toVdom(node); initialVdom.set(node, vdom); await splitTask(); (0,preact_module/* hydrate */.Qv)(vdom, fragment); } } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/index.js /** * External dependencies */ /** * Internal dependencies */ const requiredConsent = 'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.'; const privateApis = lock => { if (lock === requiredConsent) { return { directivePrefix: directivePrefix, getRegionRootFragment: getRegionRootFragment, initialVdom: initialVdom, toVdom: toVdom, directive: directive, getNamespace: getNamespace, h: preact_module.h, cloneElement: preact_module/* cloneElement */.Ob, render: preact_module/* render */.XX, proxifyState: proxifyState, parseServerData: parseServerData, populateServerData: populateServerData, batch: signals_core_module_r }; } throw new Error('Forbidden access.'); }; directives(); init(); })(); var __webpack_exports__getConfig = __webpack_exports__.zj; var __webpack_exports__getContext = __webpack_exports__.SD; var __webpack_exports__getElement = __webpack_exports__.V6; var __webpack_exports__getServerContext = __webpack_exports__.$K; var __webpack_exports__getServerState = __webpack_exports__.vT; var __webpack_exports__privateApis = __webpack_exports__.jb; var __webpack_exports__splitTask = __webpack_exports__.yT; var __webpack_exports__store = __webpack_exports__.M_; var __webpack_exports__useCallback = __webpack_exports__.hb; var __webpack_exports__useEffect = __webpack_exports__.vJ; var __webpack_exports__useInit = __webpack_exports__.ip; var __webpack_exports__useLayoutEffect = __webpack_exports__.Nf; var __webpack_exports__useMemo = __webpack_exports__.Kr; var __webpack_exports__useRef = __webpack_exports__.li; var __webpack_exports__useState = __webpack_exports__.J0; var __webpack_exports__useWatch = __webpack_exports__.FH; var __webpack_exports__withScope = __webpack_exports__.v4; export { __webpack_exports__getConfig as getConfig, __webpack_exports__getContext as getContext, __webpack_exports__getElement as getElement, __webpack_exports__getServerContext as getServerContext, __webpack_exports__getServerState as getServerState, __webpack_exports__privateApis as privateApis, __webpack_exports__splitTask as splitTask, __webpack_exports__store as store, __webpack_exports__useCallback as useCallback, __webpack_exports__useEffect as useEffect, __webpack_exports__useInit as useInit, __webpack_exports__useLayoutEffect as useLayoutEffect, __webpack_exports__useMemo as useMemo, __webpack_exports__useRef as useRef, __webpack_exports__useState as useState, __webpack_exports__useWatch as useWatch, __webpack_exports__withScope as withScope }; interactivity/debug.js000064400000333452147207022110011074 0ustar00/******/ var __webpack_modules__ = ({ /***/ 380: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { // EXPORTS __webpack_require__.d(__webpack_exports__, { zj: () => (/* reexport */ getConfig), SD: () => (/* reexport */ getContext), V6: () => (/* reexport */ getElement), $K: () => (/* reexport */ getServerContext), vT: () => (/* reexport */ getServerState), jb: () => (/* binding */ privateApis), yT: () => (/* reexport */ splitTask), M_: () => (/* reexport */ store), hb: () => (/* reexport */ useCallback), vJ: () => (/* reexport */ useEffect), ip: () => (/* reexport */ useInit), Nf: () => (/* reexport */ useLayoutEffect), Kr: () => (/* reexport */ useMemo), li: () => (/* reexport */ A), J0: () => (/* reexport */ h), FH: () => (/* reexport */ useWatch), v4: () => (/* reexport */ withScope) }); // EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js var preact_module = __webpack_require__(622); ;// CONCATENATED MODULE: ./node_modules/preact/hooks/dist/hooks.module.js var hooks_module_t,r,hooks_module_u,i,hooks_module_o=0,hooks_module_f=[],hooks_module_c=preact_module/* options */.fF,e=hooks_module_c.__b,a=hooks_module_c.__r,v=hooks_module_c.diffed,l=hooks_module_c.__c,m=hooks_module_c.unmount,s=hooks_module_c.__;function d(n,t){hooks_module_c.__h&&hooks_module_c.__h(r,n,hooks_module_o||t),hooks_module_o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function h(n){return hooks_module_o=1,p(D,n)}function p(n,u,i){var o=d(hooks_module_t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=d(hooks_module_t++,3);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__H.__h.push(i))}function _(n,u){var i=d(hooks_module_t++,4);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__h.push(i))}function A(n){return hooks_module_o=5,T(function(){return{current:n}},[])}function F(n,t,r){hooks_module_o=6,_(function(){return"function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))}function T(n,r){var u=d(hooks_module_t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return hooks_module_o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=d(hooks_module_t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){hooks_module_c.useDebugValue&&hooks_module_c.useDebugValue(t?t(n):n)}function b(n){var u=d(hooks_module_t++,10),i=h();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=d(hooks_module_t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=hooks_module_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],hooks_module_c.__e(t,n.__v)}}hooks_module_c.__b=function(n){r=null,e&&e(n)},hooks_module_c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},hooks_module_c.__r=function(n){a&&a(n),hooks_module_t=0;var i=(r=n.__c).__H;i&&(hooks_module_u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],hooks_module_t=0)),hooks_module_u=r},hooks_module_c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==hooks_module_f.push(t)&&i===hooks_module_c.requestAnimationFrame||((i=hooks_module_c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),hooks_module_u=r=null},hooks_module_c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],hooks_module_c.__e(r,n.__v)}}),l&&l(n,t)},hooks_module_c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&hooks_module_c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t} ;// CONCATENATED MODULE: ./node_modules/@preact/signals-core/dist/signals-core.module.js var signals_core_module_i=Symbol.for("preact-signals");function signals_core_module_t(){if(!(signals_core_module_s>1)){var i,t=!1;while(void 0!==signals_core_module_h){var r=signals_core_module_h;signals_core_module_h=void 0;signals_core_module_f++;while(void 0!==r){var o=r.o;r.o=void 0;r.f&=-3;if(!(8&r.f)&&signals_core_module_c(r))try{r.c()}catch(r){if(!t){i=r;t=!0}}r=o}}signals_core_module_f=0;signals_core_module_s--;if(t)throw i}else signals_core_module_s--}function signals_core_module_r(i){if(signals_core_module_s>0)return i();signals_core_module_s++;try{return i()}finally{signals_core_module_t()}}var signals_core_module_o=void 0;function n(i){var t=signals_core_module_o;signals_core_module_o=void 0;try{return i()}finally{signals_core_module_o=t}}var signals_core_module_h=void 0,signals_core_module_s=0,signals_core_module_f=0,signals_core_module_v=0;function signals_core_module_e(i){if(void 0!==signals_core_module_o){var t=i.n;if(void 0===t||t.t!==signals_core_module_o){t={i:0,S:i,p:signals_core_module_o.s,n:void 0,t:signals_core_module_o,e:void 0,x:void 0,r:t};if(void 0!==signals_core_module_o.s)signals_core_module_o.s.n=t;signals_core_module_o.s=t;i.n=t;if(32&signals_core_module_o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=signals_core_module_o.s;t.n=void 0;signals_core_module_o.s.n=t;signals_core_module_o.s=t}return t}}}function signals_core_module_u(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0}signals_core_module_u.prototype.brand=signals_core_module_i;signals_core_module_u.prototype.h=function(){return!0};signals_core_module_u.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i}};signals_core_module_u.prototype.U=function(i){if(void 0!==this.t){var t=i.e,r=i.x;if(void 0!==t){t.x=r;i.e=void 0}if(void 0!==r){r.e=t;i.x=void 0}if(i===this.t)this.t=r}};signals_core_module_u.prototype.subscribe=function(i){var t=this;return E(function(){var r=t.value,n=signals_core_module_o;signals_core_module_o=void 0;try{i(r)}finally{signals_core_module_o=n}})};signals_core_module_u.prototype.valueOf=function(){return this.value};signals_core_module_u.prototype.toString=function(){return this.value+""};signals_core_module_u.prototype.toJSON=function(){return this.value};signals_core_module_u.prototype.peek=function(){var i=signals_core_module_o;signals_core_module_o=void 0;try{return this.value}finally{signals_core_module_o=i}};Object.defineProperty(signals_core_module_u.prototype,"value",{get:function(){var i=signals_core_module_e(this);if(void 0!==i)i.i=this.i;return this.v},set:function(i){if(i!==this.v){if(signals_core_module_f>100)throw new Error("Cycle detected");this.v=i;this.i++;signals_core_module_v++;signals_core_module_s++;try{for(var r=this.t;void 0!==r;r=r.x)r.t.N()}finally{signals_core_module_t()}}}});function signals_core_module_d(i){return new signals_core_module_u(i)}function signals_core_module_c(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function signals_core_module_a(i){for(var t=i.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r)t.r=r;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function signals_core_module_l(i){var t=i.s,r=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o}else r=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o}i.s=r}function signals_core_module_y(i){signals_core_module_u.call(this,void 0);this.x=i;this.s=void 0;this.g=signals_core_module_v-1;this.f=4}(signals_core_module_y.prototype=new signals_core_module_u).h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===signals_core_module_v)return!0;this.g=signals_core_module_v;this.f|=1;if(this.i>0&&!signals_core_module_c(this)){this.f&=-2;return!0}var i=signals_core_module_o;try{signals_core_module_a(this);signals_core_module_o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}signals_core_module_o=i;signals_core_module_l(this);this.f&=-2;return!0};signals_core_module_y.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}signals_core_module_u.prototype.S.call(this,i)};signals_core_module_y.prototype.U=function(i){if(void 0!==this.t){signals_core_module_u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};signals_core_module_y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N()}};Object.defineProperty(signals_core_module_y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var i=signals_core_module_e(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function signals_core_module_w(i){return new signals_core_module_y(i)}function signals_core_module_(i){var r=i.u;i.u=void 0;if("function"==typeof r){signals_core_module_s++;var n=signals_core_module_o;signals_core_module_o=void 0;try{r()}catch(t){i.f&=-2;i.f|=8;signals_core_module_g(i);throw t}finally{signals_core_module_o=n;signals_core_module_t()}}}function signals_core_module_g(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;signals_core_module_(i)}function signals_core_module_p(i){if(signals_core_module_o!==this)throw new Error("Out-of-order effect");signals_core_module_l(this);signals_core_module_o=i;this.f&=-2;if(8&this.f)signals_core_module_g(this);signals_core_module_t()}function signals_core_module_b(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}signals_core_module_b.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{i()}};signals_core_module_b.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;signals_core_module_(this);signals_core_module_a(this);signals_core_module_s++;var i=signals_core_module_o;signals_core_module_o=this;return signals_core_module_p.bind(this,i)};signals_core_module_b.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=signals_core_module_h;signals_core_module_h=this}};signals_core_module_b.prototype.d=function(){this.f|=8;if(!(1&this.f))signals_core_module_g(this)};function E(i){var t=new signals_core_module_b(i);try{t.c()}catch(i){t.d();throw i}return t.d.bind(t)} ;// CONCATENATED MODULE: ./node_modules/@preact/signals/dist/signals.module.js var signals_module_v,signals_module_s;function signals_module_l(n,i){preact_module/* options */.fF[n]=i.bind(null,preact_module/* options */.fF[n]||function(){})}function signals_module_d(n){if(signals_module_s)signals_module_s();signals_module_s=n&&n.S()}function signals_module_p(n){var r=this,f=n.data,o=useSignal(f);o.value=f;var e=T(function(){var n=r.__v;while(n=n.__)if(n.__c){n.__c.__$f|=4;break}r.__$u.c=function(){var n;if(!(0,preact_module/* isValidElement */.zO)(e.peek())&&3===(null==(n=r.base)?void 0:n.nodeType))r.base.data=e.peek();else{r.__$f|=1;r.setState({})}};return signals_core_module_w(function(){var n=o.value.value;return 0===n?0:!0===n?"":n||""})},[]);return e.value}signals_module_p.displayName="_st";Object.defineProperties(signals_core_module_u.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:signals_module_p},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});signals_module_l("__b",function(n,r){if("string"==typeof r.type){var i,t=r.props;for(var f in t)if("children"!==f){var o=t[f];if(o instanceof signals_core_module_u){if(!i)r.__np=i={};i[f]=o;t[f]=o.peek()}}}n(r)});signals_module_l("__r",function(n,r){signals_module_d();var i,t=r.__c;if(t){t.__$f&=-2;if(void 0===(i=t.__$u))t.__$u=i=function(n){var r;E(function(){r=this});r.c=function(){t.__$f|=1;t.setState({})};return r}()}signals_module_v=t;signals_module_d(i);n(r)});signals_module_l("__e",function(n,r,i,t){signals_module_d();signals_module_v=void 0;n(r,i,t)});signals_module_l("diffed",function(n,r){signals_module_d();signals_module_v=void 0;var i;if("string"==typeof r.type&&(i=r.__e)){var t=r.__np,f=r.props;if(t){var o=i.U;if(o)for(var e in o){var u=o[e];if(void 0!==u&&!(e in t)){u.d();o[e]=void 0}}else i.U=o={};for(var a in t){var c=o[a],s=t[a];if(void 0===c){c=signals_module_(i,a,s,f);o[a]=c}else c.o(s,f)}}}n(r)});function signals_module_(n,r,i,t){var f=r in n&&void 0===n.ownerSVGElement,o=signals_core_module_d(i);return{o:function(n,r){o.value=n;t=r},d:E(function(){var i=o.value.value;if(t[r]!==i){t[r]=i;if(f)n[r]=i;else if(i)n.setAttribute(r,i);else n.removeAttribute(r)}})}}signals_module_l("unmount",function(n,r){if("string"==typeof r.type){var i=r.__e;if(i){var t=i.U;if(t){i.U=void 0;for(var f in t){var o=t[f];if(o)o.d()}}}}else{var e=r.__c;if(e){var u=e.__$u;if(u){e.__$u=void 0;u.d()}}}n(r)});signals_module_l("__h",function(n,r,i,t){if(t<3||9===t)r.__$f|=2;n(r,i,t)});preact_module/* Component */.uA.prototype.shouldComponentUpdate=function(n,r){var i=this.__$u;if(!(i&&void 0!==i.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var t in r)return!0;for(var f in n)if("__source"!==f&&n[f]!==this.props[f])return!0;for(var o in this.props)if(!(o in n))return!0;return!1};function useSignal(n){return T(function(){return signals_core_module_d(n)},[])}function useComputed(n){var r=f(n);r.current=n;signals_module_v.__$f|=4;return t(function(){return u(function(){return r.current()})},[])}function useSignalEffect(n){var r=f(n);r.current=n;o(function(){return c(function(){return r.current()})},[])} ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/namespaces.js const namespaceStack = []; const getNamespace = () => namespaceStack.slice(-1)[0]; const setNamespace = namespace => { namespaceStack.push(namespace); }; const resetNamespace = () => { namespaceStack.pop(); }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/scopes.js /** * External dependencies */ /** * Internal dependencies */ // Store stacks for the current scope and the default namespaces and export APIs // to interact with them. const scopeStack = []; const getScope = () => scopeStack.slice(-1)[0]; const setScope = scope => { scopeStack.push(scope); }; const resetScope = () => { scopeStack.pop(); }; // Wrap the element props to prevent modifications. const immutableMap = new WeakMap(); const immutableError = () => { throw new Error('Please use `data-wp-bind` to modify the attributes of an element.'); }; const immutableHandlers = { get(target, key, receiver) { const value = Reflect.get(target, key, receiver); return !!value && typeof value === 'object' ? deepImmutable(value) : value; }, set: immutableError, deleteProperty: immutableError }; const deepImmutable = target => { if (!immutableMap.has(target)) { immutableMap.set(target, new Proxy(target, immutableHandlers)); } return immutableMap.get(target); }; /** * Retrieves the context inherited by the element evaluating a function from the * store. The returned value depends on the element and the namespace where the * function calling `getContext()` exists. * * @param namespace Store namespace. By default, the namespace where the calling * function exists is used. * @return The context content. */ const getContext = namespace => { const scope = getScope(); if (true) { if (!scope) { throw Error('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)`.'); } } return scope.context[namespace || getNamespace()]; }; /** * Retrieves a representation of the element where a function from the store * is being evalutated. Such representation is read-only, and contains a * reference to the DOM element, its props and a local reactive state. * * @return Element representation. */ const getElement = () => { const scope = getScope(); if (true) { if (!scope) { throw Error('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)`.'); } } const { ref, attributes } = scope; return Object.freeze({ ref: ref.current, attributes: deepImmutable(attributes) }); }; /** * Retrieves the part of the inherited context defined and updated from the * server. * * The object returned is read-only, and includes the context defined in PHP * with `wp_interactivity_data_wp_context()`, including the corresponding * inherited properties. When `actions.navigate()` is called, this object is * updated to reflect the changes in the new visited page, without affecting the * context returned by `getContext()`. Directives can subscribe to those changes * to update the context if needed. * * @example * ```js * store('...', { * callbacks: { * updateServerContext() { * const context = getContext(); * const serverContext = getServerContext(); * // Override some property with the new value that came from the server. * context.overridableProp = serverContext.overridableProp; * }, * }, * }); * ``` * * @param namespace Store namespace. By default, the namespace where the calling * function exists is used. * @return The server context content. */ const getServerContext = namespace => { const scope = getScope(); if (true) { if (!scope) { throw Error('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)`.'); } } return scope.serverContext[namespace || getNamespace()]; }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/utils.js /** * External dependencies */ /** * Internal dependencies */ /** * Executes a callback function after the next frame is rendered. * * @param callback The callback function to be executed. * @return A promise that resolves after the callback function is executed. */ const afterNextFrame = callback => { return new Promise(resolve => { const done = () => { clearTimeout(timeout); window.cancelAnimationFrame(raf); setTimeout(() => { callback(); resolve(); }); }; const timeout = setTimeout(done, 100); const raf = window.requestAnimationFrame(done); }); }; /** * Returns a promise that resolves after yielding to main. * * @return Promise */ const splitTask = () => { return new Promise(resolve => { // TODO: Use scheduler.yield() when available. setTimeout(resolve, 0); }); }; /** * Creates a Flusher object that can be used to flush computed values and notify listeners. * * Using the mangled properties: * this.c: this._callback * this.x: this._compute * https://github.com/preactjs/signals/blob/main/mangle.json * * @param compute The function that computes the value to be flushed. * @param notify The function that notifies listeners when the value is flushed. * @return The Flusher object with `flush` and `dispose` properties. */ function createFlusher(compute, notify) { let flush = () => undefined; const dispose = E(function () { flush = this.c.bind(this); this.x = compute; this.c = notify; return compute(); }); return { flush, dispose }; } /** * Custom hook that executes a callback function whenever a signal is triggered. * Version of `useSignalEffect` with a `useEffect`-like execution. This hook * implementation comes from this PR, but we added short-cirtuiting to avoid * infinite loops: https://github.com/preactjs/signals/pull/290 * * @param callback The callback function to be executed. */ function utils_useSignalEffect(callback) { y(() => { let eff = null; let isExecuting = false; const notify = async () => { if (eff && !isExecuting) { isExecuting = true; await afterNextFrame(eff.flush); isExecuting = false; } }; eff = createFlusher(callback, notify); return eff.dispose; }, []); } /** * Returns the passed function wrapped with the current scope so it is * accessible whenever the function runs. This is primarily to make the scope * available inside hook callbacks. * * Asyncronous functions should use generators that yield promises instead of awaiting them. * See the documentation for details: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#the-store * * @param func The passed function. * @return The wrapped function. */ function withScope(func) { const scope = getScope(); const ns = getNamespace(); if (func?.constructor?.name === 'GeneratorFunction') { return async (...args) => { const gen = func(...args); let value; let it; while (true) { setNamespace(ns); setScope(scope); try { it = gen.next(value); } finally { resetScope(); resetNamespace(); } try { value = await it.value; } catch (e) { setNamespace(ns); setScope(scope); gen.throw(e); } finally { resetScope(); resetNamespace(); } if (it.done) { break; } } return value; }; } return (...args) => { setNamespace(ns); setScope(scope); try { return func(...args); } finally { resetNamespace(); resetScope(); } }; } /** * Accepts a function that contains imperative code which runs whenever any of * the accessed _reactive_ properties (e.g., values from the global state or the * context) is modified. * * This hook makes the element's scope available so functions like * `getElement()` and `getContext()` can be used inside the passed callback. * * @param callback The hook callback. */ function useWatch(callback) { utils_useSignalEffect(withScope(callback)); } /** * Accepts a function that contains imperative code which runs only after the * element's first render, mainly useful for intialization logic. * * This hook makes the element's scope available so functions like * `getElement()` and `getContext()` can be used inside the passed callback. * * @param callback The hook callback. */ function useInit(callback) { y(withScope(callback), []); } /** * Accepts a function that contains imperative, possibly effectful code. The * effects run after browser paint, without blocking it. * * This hook is equivalent to Preact's `useEffect` and makes the element's scope * available so functions like `getElement()` and `getContext()` can be used * inside the passed callback. * * @param callback Imperative function that can return a cleanup * function. * @param inputs If present, effect will only activate if the * values in the list change (using `===`). */ function useEffect(callback, inputs) { y(withScope(callback), inputs); } /** * Accepts a function that contains imperative, possibly effectful code. Use * this to read layout from the DOM and synchronously re-render. * * This hook is equivalent to Preact's `useLayoutEffect` and makes the element's * scope available so functions like `getElement()` and `getContext()` can be * used inside the passed callback. * * @param callback Imperative function that can return a cleanup * function. * @param inputs If present, effect will only activate if the * values in the list change (using `===`). */ function useLayoutEffect(callback, inputs) { _(withScope(callback), inputs); } /** * Returns a memoized version of the callback that only changes if one of the * inputs has changed (using `===`). * * This hook is equivalent to Preact's `useCallback` and makes the element's * scope available so functions like `getElement()` and `getContext()` can be * used inside the passed callback. * * @param callback Callback function. * @param inputs If present, the callback will only be updated if the * values in the list change (using `===`). * * @return The callback function. */ function useCallback(callback, inputs) { return q(withScope(callback), inputs); } /** * Pass a factory function and an array of inputs. `useMemo` will only recompute * the memoized value when one of the inputs has changed. * * This hook is equivalent to Preact's `useMemo` and makes the element's scope * available so functions like `getElement()` and `getContext()` can be used * inside the passed factory function. * * @param factory Factory function that returns that value for memoization. * @param inputs If present, the factory will only be run to recompute if * the values in the list change (using `===`). * * @return The memoized value. */ function useMemo(factory, inputs) { return T(withScope(factory), inputs); } /** * Creates a root fragment by replacing a node or an array of nodes in a parent element. * For wrapperless hydration. * See https://gist.github.com/developit/f4c67a2ede71dc2fab7f357f39cff28c * * @param parent The parent element where the nodes will be replaced. * @param replaceNode The node or array of nodes to replace in the parent element. * @return The created root fragment. */ const createRootFragment = (parent, replaceNode) => { replaceNode = [].concat(replaceNode); const sibling = replaceNode[replaceNode.length - 1].nextSibling; function insert(child, root) { parent.insertBefore(child, root || sibling); } return parent.__k = { nodeType: 1, parentNode: parent, firstChild: replaceNode[0], childNodes: replaceNode, insertBefore: insert, appendChild: insert, removeChild(c) { parent.removeChild(c); } }; }; /** * Transforms a kebab-case string to camelCase. * * @param str The kebab-case string to transform to camelCase. * @return The transformed camelCase string. */ function kebabToCamelCase(str) { return str.replace(/^-+|-+$/g, '').toLowerCase().replace(/-([a-z])/g, function (_match, group1) { return group1.toUpperCase(); }); } const logged = new Set(); /** * Shows a warning with `message` if environment is not `production`. * * Based on the `@wordpress/warning` package. * * @param message Message to show in the warning. */ const warn = message => { if (true) { if (logged.has(message)) { return; } // eslint-disable-next-line no-console console.warn(message); // Throwing an error and catching it immediately to improve debugging // A consumer can use 'pause on caught exceptions' try { throw Error(message); } catch (e) { // Do nothing. } logged.add(message); } }; /** * Checks if the passed `candidate` is a plain object with just the `Object` * prototype. * * @param candidate The item to check. * @return Whether `candidate` is a plain object. */ const isPlainObject = candidate => Boolean(candidate && typeof candidate === 'object' && candidate.constructor === Object); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/registry.js /** * Proxies for each object. */ const objToProxy = new WeakMap(); const proxyToObj = new WeakMap(); /** * Namespaces for each created proxy. */ const proxyToNs = new WeakMap(); /** * Object types that can be proxied. */ const supported = new Set([Object, Array]); /** * Returns a proxy to the passed object with the given handlers, assigning the * specified namespace to it. If a proxy for the passed object was created * before, that proxy is returned. * * @param namespace The namespace that will be associated to this proxy. * @param obj The object to proxify. * @param handlers Handlers that the proxy will use. * * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to * check if a proxy can be created for a specific object. * * @return The created proxy. */ const createProxy = (namespace, obj, handlers) => { if (!shouldProxy(obj)) { throw Error('This object cannot be proxified.'); } if (!objToProxy.has(obj)) { const proxy = new Proxy(obj, handlers); objToProxy.set(obj, proxy); proxyToObj.set(proxy, obj); proxyToNs.set(proxy, namespace); } return objToProxy.get(obj); }; /** * Returns the proxy for the given object. If there is no associated proxy, the * function returns `undefined`. * * @param obj Object from which to know the proxy. * @return Associated proxy or `undefined`. */ const getProxyFromObject = obj => objToProxy.get(obj); /** * Gets the namespace associated with the given proxy. * * Proxies have a namespace assigned upon creation. See {@link createProxy}. * * @param proxy Proxy. * @return Namespace. */ const getNamespaceFromProxy = proxy => proxyToNs.get(proxy); /** * Checks if a given object can be proxied. * * @param candidate Object to know whether it can be proxied. * @return True if the passed instance can be proxied. */ const shouldProxy = candidate => { if (typeof candidate !== 'object' || candidate === null) { return false; } return !proxyToNs.has(candidate) && supported.has(candidate.constructor); }; /** * Returns the target object for the passed proxy. If the passed object is not a registered proxy, the * function returns `undefined`. * * @param proxy Proxy from which to know the target. * @return The target object or `undefined`. */ const getObjectFromProxy = proxy => proxyToObj.get(proxy); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/signals.js /** * External dependencies */ /** * Internal dependencies */ /** * Identifier for property computeds not associated to any scope. */ const NO_SCOPE = {}; /** * Structure that manages reactivity for a property in a state object. It uses * signals to keep track of property value or getter modifications. */ class PropSignal { /** * Proxy that holds the property this PropSignal is associated with. */ /** * Relation of computeds by scope. These computeds are read-only signals * that depend on whether the property is a value or a getter and, * therefore, can return different values depending on the scope in which * the getter is accessed. */ /** * Signal with the value assigned to the related property. */ /** * Signal with the getter assigned to the related property. */ /** * Structure that manages reactivity for a property in a state object, using * signals to keep track of property value or getter modifications. * * @param owner Proxy that holds the property this instance is associated * with. */ constructor(owner) { this.owner = owner; this.computedsByScope = new WeakMap(); } /** * Changes the internal value. If a getter was set before, it is set to * `undefined`. * * @param value New value. */ setValue(value) { this.update({ value }); } /** * Changes the internal getter. If a value was set before, it is set to * `undefined`. * * @param getter New getter. */ setGetter(getter) { this.update({ get: getter }); } /** * Returns the computed that holds the result of evaluating the prop in the * current scope. * * These computeds are read-only signals that depend on whether the property * is a value or a getter and, therefore, can return different values * depending on the scope in which the getter is accessed. * * @return Computed that depends on the scope. */ getComputed() { const scope = getScope() || NO_SCOPE; if (!this.valueSignal && !this.getterSignal) { this.update({}); } if (!this.computedsByScope.has(scope)) { const callback = () => { const getter = this.getterSignal?.value; return getter ? getter.call(this.owner) : this.valueSignal?.value; }; setNamespace(getNamespaceFromProxy(this.owner)); this.computedsByScope.set(scope, signals_core_module_w(withScope(callback))); resetNamespace(); } return this.computedsByScope.get(scope); } /** * Update the internal signals for the value and the getter of the * corresponding prop. * * @param param0 * @param param0.get New getter. * @param param0.value New value. */ update({ get, value }) { if (!this.valueSignal) { this.valueSignal = signals_core_module_d(value); this.getterSignal = signals_core_module_d(get); } else if (value !== this.valueSignal.peek() || get !== this.getterSignal.peek()) { signals_core_module_r(() => { this.valueSignal.value = value; this.getterSignal.value = get; }); } } } ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/state.js /** * External dependencies */ /** * Internal dependencies */ /** * Set of built-in symbols. */ const wellKnownSymbols = new Set(Object.getOwnPropertyNames(Symbol).map(key => Symbol[key]).filter(value => typeof value === 'symbol')); /** * Relates each proxy with a map of {@link PropSignal} instances, representing * the proxy's accessed properties. */ const proxyToProps = new WeakMap(); /** * Checks wether a {@link PropSignal | `PropSignal`} instance exists for the * given property in the passed proxy. * * @param proxy Proxy of a state object or array. * @param key The property key. * @return `true` when it exists; false otherwise. */ const hasPropSignal = (proxy, key) => proxyToProps.has(proxy) && proxyToProps.get(proxy).has(key); const readOnlyProxies = new WeakSet(); /** * Returns the {@link PropSignal | `PropSignal`} instance associated with the * specified prop in the passed proxy. * * The `PropSignal` instance is generated if it doesn't exist yet, using the * `initial` parameter to initialize the internal signals. * * @param proxy Proxy of a state object or array. * @param key The property key. * @param initial Initial data for the `PropSignal` instance. * @return The `PropSignal` instance. */ const getPropSignal = (proxy, key, initial) => { if (!proxyToProps.has(proxy)) { proxyToProps.set(proxy, new Map()); } key = typeof key === 'number' ? `${key}` : key; const props = proxyToProps.get(proxy); if (!props.has(key)) { const ns = getNamespaceFromProxy(proxy); const prop = new PropSignal(proxy); props.set(key, prop); if (initial) { const { get, value } = initial; if (get) { prop.setGetter(get); } else { const readOnly = readOnlyProxies.has(proxy); prop.setValue(shouldProxy(value) ? proxifyState(ns, value, { readOnly }) : value); } } } return props.get(key); }; /** * Relates each proxied object (i.e., the original object) with a signal that * tracks changes in the number of properties. */ const objToIterable = new WeakMap(); /** * When this flag is `true`, it avoids any signal subscription, overriding state * props' "reactive" behavior. */ let peeking = false; /** * Handlers for reactive objects and arrays in the state. */ const stateHandlers = { get(target, key, receiver) { /* * The property should not be reactive for the following cases: * 1. While using the `peek` function to read the property. * 2. The property exists but comes from the Object or Array prototypes. * 3. The property key is a known symbol. */ if (peeking || !target.hasOwnProperty(key) && key in target || typeof key === 'symbol' && wellKnownSymbols.has(key)) { return Reflect.get(target, key, receiver); } // At this point, the property should be reactive. const desc = Object.getOwnPropertyDescriptor(target, key); const prop = getPropSignal(receiver, key, desc); const result = prop.getComputed().value; /* * Check if the property is a synchronous function. If it is, set the * default namespace. Synchronous functions always run in the proper scope, * which is set by the Directives component. */ if (typeof result === 'function') { const ns = getNamespaceFromProxy(receiver); return (...args) => { setNamespace(ns); try { return result.call(receiver, ...args); } finally { resetNamespace(); } }; } return result; }, set(target, key, value, receiver) { if (readOnlyProxies.has(receiver)) { return false; } setNamespace(getNamespaceFromProxy(receiver)); try { return Reflect.set(target, key, value, receiver); } finally { resetNamespace(); } }, defineProperty(target, key, desc) { if (readOnlyProxies.has(getProxyFromObject(target))) { return false; } const isNew = !(key in target); const result = Reflect.defineProperty(target, key, desc); if (result) { const receiver = getProxyFromObject(target); const prop = getPropSignal(receiver, key); const { get, value } = desc; if (get) { prop.setGetter(get); } else { const ns = getNamespaceFromProxy(receiver); prop.setValue(shouldProxy(value) ? proxifyState(ns, value) : value); } if (isNew && objToIterable.has(target)) { objToIterable.get(target).value++; } /* * Modify the `length` property value only if the related * `PropSignal` exists, which means that there are subscriptions to * this property. */ if (Array.isArray(target) && proxyToProps.get(receiver)?.has('length')) { const length = getPropSignal(receiver, 'length'); length.setValue(target.length); } } return result; }, deleteProperty(target, key) { if (readOnlyProxies.has(getProxyFromObject(target))) { return false; } const result = Reflect.deleteProperty(target, key); if (result) { const prop = getPropSignal(getProxyFromObject(target), key); prop.setValue(undefined); if (objToIterable.has(target)) { objToIterable.get(target).value++; } } return result; }, ownKeys(target) { if (!objToIterable.has(target)) { objToIterable.set(target, signals_core_module_d(0)); } /* *This subscribes to the signal while preventing the minifier from * deleting this line in production. */ objToIterable._ = objToIterable.get(target).value; return Reflect.ownKeys(target); } }; /** * Returns the proxy associated with the given state object, creating it if it * does not exist. * * @param namespace The namespace that will be associated to this proxy. * @param obj The object to proxify. * @param options Options. * @param options.readOnly Read-only. * * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to * check if a proxy can be created for a specific object. * * @return The associated proxy. */ const proxifyState = (namespace, obj, options) => { const proxy = createProxy(namespace, obj, stateHandlers); if (options?.readOnly) { readOnlyProxies.add(proxy); } return proxy; }; /** * Reads the value of the specified property without subscribing to it. * * @param obj The object to read the property from. * @param key The property key. * @return The property value. */ const peek = (obj, key) => { peeking = true; try { return obj[key]; } finally { peeking = false; } }; /** * Internal recursive implementation for {@link deepMerge | `deepMerge`}. * * @param target The target object. * @param source The source object containing new values and props. * @param override Whether existing props should be overwritten or not (`true` * by default). */ const deepMergeRecursive = (target, source, override = true) => { if (!(isPlainObject(target) && isPlainObject(source))) { return; } let hasNewKeys = false; for (const key in source) { const isNew = !(key in target); hasNewKeys = hasNewKeys || isNew; const desc = Object.getOwnPropertyDescriptor(source, key); const proxy = getProxyFromObject(target); const propSignal = !!proxy && hasPropSignal(proxy, key) && getPropSignal(proxy, key); if (typeof desc.get === 'function' || typeof desc.set === 'function') { if (override || isNew) { Object.defineProperty(target, key, { ...desc, configurable: true, enumerable: true }); if (desc.get && propSignal) { propSignal.setGetter(desc.get); } } } else if (isPlainObject(source[key])) { if (isNew || override && !isPlainObject(target[key])) { target[key] = {}; if (propSignal) { const ns = getNamespaceFromProxy(proxy); propSignal.setValue(proxifyState(ns, target[key])); } } if (isPlainObject(target[key])) { deepMergeRecursive(target[key], source[key], override); } } else if (override || isNew) { Object.defineProperty(target, key, desc); if (propSignal) { const { value } = desc; const ns = getNamespaceFromProxy(proxy); propSignal.setValue(shouldProxy(value) ? proxifyState(ns, value) : value); } } } if (hasNewKeys && objToIterable.has(target)) { objToIterable.get(target).value++; } }; /** * Recursively update prop values inside the passed `target` and nested plain * objects, using the values present in `source`. References to plain objects * are kept, only updating props containing primitives or arrays. Arrays are * replaced instead of merged or concatenated. * * If the `override` parameter is set to `false`, then all values in `target` * are preserved, and only new properties from `source` are added. * * @param target The target object. * @param source The source object containing new values and props. * @param override Whether existing props should be overwritten or not (`true` * by default). */ const deepMerge = (target, source, override = true) => signals_core_module_r(() => deepMergeRecursive(getObjectFromProxy(target) || target, source, override)); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/store.js /** * Internal dependencies */ /** * External dependencies */ /** * Identifies the store proxies handling the root objects of each store. */ const storeRoots = new WeakSet(); /** * Handlers for store proxies. */ const storeHandlers = { get: (target, key, receiver) => { const result = Reflect.get(target, key); const ns = getNamespaceFromProxy(receiver); /* * Check if the proxy is the store root and no key with that name exist. In * that case, return an empty object for the requested key. */ if (typeof result === 'undefined' && storeRoots.has(receiver)) { const obj = {}; Reflect.set(target, key, obj); return proxifyStore(ns, obj, false); } /* * Check if the property is a function. If it is, add the store * namespace to the stack and wrap the function with the current scope. * The `withScope` util handles both synchronous functions and generator * functions. */ if (typeof result === 'function') { setNamespace(ns); const scoped = withScope(result); resetNamespace(); return scoped; } // Check if the property is an object. If it is, proxyify it. if (isPlainObject(result) && shouldProxy(result)) { return proxifyStore(ns, result, false); } return result; } }; /** * Returns the proxy associated with the given store object, creating it if it * does not exist. * * @param namespace The namespace that will be associated to this proxy. * @param obj The object to proxify. * * @param isRoot Whether the passed object is the store root object. * @throws Error if the object cannot be proxified. Use {@link shouldProxy} to * check if a proxy can be created for a specific object. * * @return The associated proxy. */ const proxifyStore = (namespace, obj, isRoot = true) => { const proxy = createProxy(namespace, obj, storeHandlers); if (proxy && isRoot) { storeRoots.add(proxy); } return proxy; }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/context.js const contextObjectToProxy = new WeakMap(); const contextObjectToFallback = new WeakMap(); const contextProxies = new WeakSet(); const descriptor = Reflect.getOwnPropertyDescriptor; // TODO: Use the proxy registry to avoid multiple proxies on the same object. const contextHandlers = { get: (target, key) => { const fallback = contextObjectToFallback.get(target); // Always subscribe to prop changes in the current context. const currentProp = target[key]; /* * Return the value from `target` if it exists, or from `fallback` * otherwise. This way, in the case the property doesn't exist either in * `target` or `fallback`, it also subscribes to changes in the parent * context. */ return key in target ? currentProp : fallback[key]; }, set: (target, key, value) => { const fallback = contextObjectToFallback.get(target); // If the property exists in the current context, modify it. Otherwise, // add it to the current context. const obj = key in target || !(key in fallback) ? target : fallback; obj[key] = value; return true; }, ownKeys: target => [...new Set([...Object.keys(contextObjectToFallback.get(target)), ...Object.keys(target)])], getOwnPropertyDescriptor: (target, key) => descriptor(target, key) || descriptor(contextObjectToFallback.get(target), key) }; /** * Wrap a context object with a proxy to reproduce the context stack. The proxy * uses the passed `inherited` context as a fallback to look up for properties * that don't exist in the given context. Also, updated properties are modified * where they are defined, or added to the main context when they don't exist. * * @param current Current context. * @param inherited Inherited context, used as fallback. * * @return The wrapped context object. */ const proxifyContext = (current, inherited = {}) => { if (contextProxies.has(current)) { throw Error('This object cannot be proxified.'); } // Update the fallback object reference when it changes. contextObjectToFallback.set(current, inherited); if (!contextObjectToProxy.has(current)) { const proxy = new Proxy(current, contextHandlers); contextObjectToProxy.set(current, proxy); contextProxies.add(proxy); } return contextObjectToProxy.get(current); }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/proxies/index.js /** * Internal dependencies */ ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/store.js /** * Internal dependencies */ /** * External dependencies */ const stores = new Map(); const rawStores = new Map(); const storeLocks = new Map(); const storeConfigs = new Map(); const serverStates = new Map(); /** * Get the defined config for the store with the passed namespace. * * @param namespace Store's namespace from which to retrieve the config. * @return Defined config for the given namespace. */ const getConfig = namespace => storeConfigs.get(namespace || getNamespace()) || {}; /** * Get the part of the state defined and updated from the server. * * The object returned is read-only, and includes the state defined in PHP with * `wp_interactivity_state()`. When using `actions.navigate()`, this object is * updated to reflect the changes in its properites, without affecting the state * returned by `store()`. Directives can subscribe to those changes to update * the state if needed. * * @example * ```js * const { state } = store('myStore', { * callbacks: { * updateServerState() { * const serverState = getServerState(); * // Override some property with the new value that came from the server. * state.overridableProp = serverState.overridableProp; * }, * }, * }); * ``` * * @param namespace Store's namespace from which to retrieve the server state. * @return The server state for the given namespace. */ const getServerState = namespace => { const ns = namespace || getNamespace(); if (!serverStates.has(ns)) { serverStates.set(ns, proxifyState(ns, {}, { readOnly: true })); } return serverStates.get(ns); }; const universalUnlock = 'I acknowledge that using a private store means my plugin will inevitably break on the next store release.'; /** * Extends the Interactivity API global store adding the passed properties to * the given namespace. It also returns stable references to the namespace * content. * * These props typically consist of `state`, which is the reactive part of the * store ― which means that any directive referencing a state property will be * re-rendered anytime it changes ― and function properties like `actions` and * `callbacks`, mostly used for event handlers. These props can then be * referenced by any directive to make the HTML interactive. * * @example * ```js * const { state } = store( 'counter', { * state: { * value: 0, * get double() { return state.value * 2; }, * }, * actions: { * increment() { * state.value += 1; * }, * }, * } ); * ``` * * The code from the example above allows blocks to subscribe and interact with * the store by using directives in the HTML, e.g.: * * ```html *
* *
* ``` * @param namespace The store namespace to interact with. * @param storePart Properties to add to the store namespace. * @param options Options for the given namespace. * * @return A reference to the namespace content. */ function store(namespace, { state = {}, ...block } = {}, { lock = false } = {}) { if (!stores.has(namespace)) { // Lock the store if the passed lock is different from the universal // unlock. Once the lock is set (either false, true, or a given string), // it cannot change. if (lock !== universalUnlock) { storeLocks.set(namespace, lock); } const rawStore = { state: proxifyState(namespace, isPlainObject(state) ? state : {}), ...block }; const proxifiedStore = proxifyStore(namespace, rawStore); rawStores.set(namespace, rawStore); stores.set(namespace, proxifiedStore); } else { // Lock the store if it wasn't locked yet and the passed lock is // different from the universal unlock. If no lock is given, the store // will be public and won't accept any lock from now on. if (lock !== universalUnlock && !storeLocks.has(namespace)) { storeLocks.set(namespace, lock); } else { const storeLock = storeLocks.get(namespace); const isLockValid = lock === universalUnlock || lock !== true && lock === storeLock; if (!isLockValid) { if (!storeLock) { throw Error('Cannot lock a public store'); } else { throw Error('Cannot unlock a private store with an invalid lock code'); } } } const target = rawStores.get(namespace); deepMerge(target, block); deepMerge(target.state, state); } return stores.get(namespace); } const parseServerData = (dom = document) => { var _dom$getElementById; const jsonDataScriptTag = // Preferred Script Module data passing form (_dom$getElementById = dom.getElementById('wp-script-module-data-@wordpress/interactivity')) !== null && _dom$getElementById !== void 0 ? _dom$getElementById : // Legacy form dom.getElementById('wp-interactivity-data'); if (jsonDataScriptTag?.textContent) { try { return JSON.parse(jsonDataScriptTag.textContent); } catch {} } return {}; }; const populateServerData = data => { if (isPlainObject(data?.state)) { Object.entries(data.state).forEach(([namespace, state]) => { const st = store(namespace, {}, { lock: universalUnlock }); deepMerge(st.state, state, false); deepMerge(getServerState(namespace), state); }); } if (isPlainObject(data?.config)) { Object.entries(data.config).forEach(([namespace, config]) => { storeConfigs.set(namespace, config); }); } }; // Parse and populate the initial state and config. const data = parseServerData(); populateServerData(data); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/hooks.js // eslint-disable-next-line eslint-comments/disable-enable-pair /* eslint-disable react-hooks/exhaustive-deps */ /** * External dependencies */ /** * Internal dependencies */ function isNonDefaultDirectiveSuffix(entry) { return entry.suffix !== null; } function isDefaultDirectiveSuffix(entry) { return entry.suffix === null; } // Main context. const context = (0,preact_module/* createContext */.q6)({ client: {}, server: {} }); // WordPress Directives. const directiveCallbacks = {}; const directivePriorities = {}; /** * Register a new directive type in the Interactivity API runtime. * * @example * ```js * directive( * 'alert', // Name without the `data-wp-` prefix. * ( { directives: { alert }, element, evaluate } ) => { * const defaultEntry = alert.find( isDefaultDirectiveSuffix ); * element.props.onclick = () => { alert( evaluate( defaultEntry ) ); } * } * ) * ``` * * The previous code registers a custom directive type for displaying an alert * message whenever an element using it is clicked. The message text is obtained * from the store under the inherited namespace, using `evaluate`. * * When the HTML is processed by the Interactivity API, any element containing * the `data-wp-alert` directive will have the `onclick` event handler, e.g., * * ```html *
* *
* ``` * Note that, in the previous example, the directive callback gets the path * value (`state.alert`) from the directive entry with suffix `null`. A * custom suffix can also be specified by appending `--` to the directive * attribute, followed by the suffix, like in the following HTML snippet: * * ```html *
* *
* ``` * * This could be an hypothetical implementation of the custom directive used in * the snippet above. * * @example * ```js * directive( * 'color', // Name without prefix and suffix. * ( { directives: { color: colors }, ref, evaluate } ) => * colors.forEach( ( color ) => { * if ( color.suffix = 'text' ) { * ref.style.setProperty( * 'color', * evaluate( color.text ) * ); * } * if ( color.suffix = 'background' ) { * ref.style.setProperty( * 'background-color', * evaluate( color.background ) * ); * } * } ); * } * ) * ``` * * @param name Directive name, without the `data-wp-` prefix. * @param callback Function that runs the directive logic. * @param options Options object. * @param options.priority Option to control the directive execution order. The * lesser, the highest priority. Default is `10`. */ const directive = (name, callback, { priority = 10 } = {}) => { directiveCallbacks[name] = callback; directivePriorities[name] = priority; }; // Resolve the path to some property of the store object. const resolve = (path, namespace) => { if (!namespace) { warn(`Namespace missing for "${path}". The value for that path won't be resolved.`); return; } let resolvedStore = stores.get(namespace); if (typeof resolvedStore === 'undefined') { resolvedStore = store(namespace, undefined, { lock: universalUnlock }); } const current = { ...resolvedStore, context: getScope().context[namespace] }; try { // TODO: Support lazy/dynamically initialized stores return path.split('.').reduce((acc, key) => acc[key], current); } catch (e) {} }; // Generate the evaluate function. const getEvaluate = ({ scope }) => (entry, ...args) => { let { value: path, namespace } = entry; if (typeof path !== 'string') { throw new Error('The `value` prop should be a string path'); } // If path starts with !, remove it and save a flag. const hasNegationOperator = path[0] === '!' && !!(path = path.slice(1)); setScope(scope); const value = resolve(path, namespace); const result = typeof value === 'function' ? value(...args) : value; resetScope(); return hasNegationOperator ? !result : result; }; // Separate directives by priority. The resulting array contains objects // of directives grouped by same priority, and sorted in ascending order. const getPriorityLevels = directives => { const byPriority = Object.keys(directives).reduce((obj, name) => { if (directiveCallbacks[name]) { const priority = directivePriorities[name]; (obj[priority] = obj[priority] || []).push(name); } return obj; }, {}); return Object.entries(byPriority).sort(([p1], [p2]) => parseInt(p1) - parseInt(p2)).map(([, arr]) => arr); }; // Component that wraps each priority level of directives of an element. const Directives = ({ directives, priorityLevels: [currentPriorityLevel, ...nextPriorityLevels], element, originalProps, previousScope }) => { // Initialize the scope of this element. These scopes are different per each // level because each level has a different context, but they share the same // element ref, state and props. const scope = A({}).current; scope.evaluate = q(getEvaluate({ scope }), []); const { client, server } = x(context); scope.context = client; scope.serverContext = server; /* eslint-disable react-hooks/rules-of-hooks */ scope.ref = previousScope?.ref || A(null); /* eslint-enable react-hooks/rules-of-hooks */ // Create a fresh copy of the vnode element and add the props to the scope, // named as attributes (HTML Attributes). element = (0,preact_module/* cloneElement */.Ob)(element, { ref: scope.ref }); scope.attributes = element.props; // Recursively render the wrapper for the next priority level. const children = nextPriorityLevels.length > 0 ? (0,preact_module.h)(Directives, { directives, priorityLevels: nextPriorityLevels, element, originalProps, previousScope: scope }) : element; const props = { ...originalProps, children }; const directiveArgs = { directives, props, element, context, evaluate: scope.evaluate }; setScope(scope); for (const directiveName of currentPriorityLevel) { const wrapper = directiveCallbacks[directiveName]?.(directiveArgs); if (wrapper !== undefined) { props.children = wrapper; } } resetScope(); return props.children; }; // Preact Options Hook called each time a vnode is created. const old = preact_module/* options */.fF.vnode; preact_module/* options */.fF.vnode = vnode => { if (vnode.props.__directives) { const props = vnode.props; const directives = props.__directives; if (directives.key) { vnode.key = directives.key.find(isDefaultDirectiveSuffix).value; } delete props.__directives; const priorityLevels = getPriorityLevels(directives); if (priorityLevels.length > 0) { vnode.props = { directives, priorityLevels, originalProps: props, type: vnode.type, element: (0,preact_module.h)(vnode.type, props), top: true }; vnode.type = Directives; } } if (old) { old(vnode); } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/directives.js // eslint-disable-next-line eslint-comments/disable-enable-pair /* eslint-disable react-hooks/exhaustive-deps */ /** * External dependencies */ /** * Internal dependencies */ /** * Recursively clone the passed object. * * @param source Source object. * @return Cloned object. */ function deepClone(source) { if (isPlainObject(source)) { return Object.fromEntries(Object.entries(source).map(([key, value]) => [key, deepClone(value)])); } if (Array.isArray(source)) { return source.map(i => deepClone(i)); } return source; } const newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g; const ruleClean = /\/\*[^]*?\*\/| +/g; const ruleNewline = /\n+/g; const empty = ' '; /** * Convert a css style string into a object. * * Made by Cristian Bote (@cristianbote) for Goober. * https://unpkg.com/browse/goober@2.1.13/src/core/astish.js * * @param val CSS string. * @return CSS object. */ const cssStringToObject = val => { const tree = [{}]; let block, left; while (block = newRule.exec(val.replace(ruleClean, ''))) { if (block[4]) { tree.shift(); } else if (block[3]) { left = block[3].replace(ruleNewline, empty).trim(); tree.unshift(tree[0][left] = tree[0][left] || {}); } else { tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim(); } } return tree[0]; }; /** * Creates a directive that adds an event listener to the global window or * document object. * * @param type 'window' or 'document' */ const getGlobalEventDirective = type => { return ({ directives, evaluate }) => { directives[`on-${type}`].filter(isNonDefaultDirectiveSuffix).forEach(entry => { const eventName = entry.suffix.split('--', 1)[0]; useInit(() => { const cb = event => evaluate(entry, event); const globalVar = type === 'window' ? window : document; globalVar.addEventListener(eventName, cb); return () => globalVar.removeEventListener(eventName, cb); }); }); }; }; /** * Creates a directive that adds an async event listener to the global window or * document object. * * @param type 'window' or 'document' */ const getGlobalAsyncEventDirective = type => { return ({ directives, evaluate }) => { directives[`on-async-${type}`].filter(isNonDefaultDirectiveSuffix).forEach(entry => { const eventName = entry.suffix.split('--', 1)[0]; useInit(() => { const cb = async event => { await splitTask(); evaluate(entry, event); }; const globalVar = type === 'window' ? window : document; globalVar.addEventListener(eventName, cb, { passive: true }); return () => globalVar.removeEventListener(eventName, cb); }); }); }; }; /* harmony default export */ const directives = (() => { // data-wp-context directive('context', ({ directives: { context }, props: { children }, context: inheritedContext }) => { const { Provider } = inheritedContext; const defaultEntry = context.find(isDefaultDirectiveSuffix); const { client: inheritedClient, server: inheritedServer } = x(inheritedContext); const ns = defaultEntry.namespace; const client = A(proxifyState(ns, {})); const server = A(proxifyState(ns, {}, { readOnly: true })); // No change should be made if `defaultEntry` does not exist. const contextStack = T(() => { const result = { client: { ...inheritedClient }, server: { ...inheritedServer } }; if (defaultEntry) { const { namespace, value } = defaultEntry; // Check that the value is a JSON object. Send a console warning if not. if (!isPlainObject(value)) { warn(`The value of data-wp-context in "${namespace}" store must be a valid stringified JSON object.`); } deepMerge(client.current, deepClone(value), false); deepMerge(server.current, deepClone(value)); result.client[namespace] = proxifyContext(client.current, inheritedClient[namespace]); result.server[namespace] = proxifyContext(server.current, inheritedServer[namespace]); } return result; }, [defaultEntry, inheritedClient, inheritedServer]); return (0,preact_module.h)(Provider, { value: contextStack }, children); }, { priority: 5 }); // data-wp-watch--[name] directive('watch', ({ directives: { watch }, evaluate }) => { watch.forEach(entry => { useWatch(() => { let start; if (false) {} const result = evaluate(entry); if (false) {} return result; }); }); }); // data-wp-init--[name] directive('init', ({ directives: { init }, evaluate }) => { init.forEach(entry => { // TODO: Replace with useEffect to prevent unneeded scopes. useInit(() => { let start; if (false) {} const result = evaluate(entry); if (false) {} return result; }); }); }); // data-wp-on--[event] directive('on', ({ directives: { on }, element, evaluate }) => { const events = new Map(); on.filter(isNonDefaultDirectiveSuffix).forEach(entry => { const event = entry.suffix.split('--')[0]; if (!events.has(event)) { events.set(event, new Set()); } events.get(event).add(entry); }); events.forEach((entries, eventType) => { const existingHandler = element.props[`on${eventType}`]; element.props[`on${eventType}`] = event => { entries.forEach(entry => { if (existingHandler) { existingHandler(event); } let start; if (false) {} evaluate(entry, event); if (false) {} }); }; }); }); // data-wp-on-async--[event] directive('on-async', ({ directives: { 'on-async': onAsync }, element, evaluate }) => { const events = new Map(); onAsync.filter(isNonDefaultDirectiveSuffix).forEach(entry => { const event = entry.suffix.split('--')[0]; if (!events.has(event)) { events.set(event, new Set()); } events.get(event).add(entry); }); events.forEach((entries, eventType) => { const existingHandler = element.props[`on${eventType}`]; element.props[`on${eventType}`] = event => { if (existingHandler) { existingHandler(event); } entries.forEach(async entry => { await splitTask(); evaluate(entry, event); }); }; }); }); // data-wp-on-window--[event] directive('on-window', getGlobalEventDirective('window')); // data-wp-on-document--[event] directive('on-document', getGlobalEventDirective('document')); // data-wp-on-async-window--[event] directive('on-async-window', getGlobalAsyncEventDirective('window')); // data-wp-on-async-document--[event] directive('on-async-document', getGlobalAsyncEventDirective('document')); // data-wp-class--[classname] directive('class', ({ directives: { class: classNames }, element, evaluate }) => { classNames.filter(isNonDefaultDirectiveSuffix).forEach(entry => { const className = entry.suffix; const result = evaluate(entry); const currentClass = element.props.class || ''; const classFinder = new RegExp(`(^|\\s)${className}(\\s|$)`, 'g'); if (!result) { element.props.class = currentClass.replace(classFinder, ' ').trim(); } else if (!classFinder.test(currentClass)) { element.props.class = currentClass ? `${currentClass} ${className}` : className; } useInit(() => { /* * This seems necessary because Preact doesn't change the class * names on the hydration, so we have to do it manually. It doesn't * need deps because it only needs to do it the first time. */ if (!result) { element.ref.current.classList.remove(className); } else { element.ref.current.classList.add(className); } }); }); }); // data-wp-style--[style-prop] directive('style', ({ directives: { style }, element, evaluate }) => { style.filter(isNonDefaultDirectiveSuffix).forEach(entry => { const styleProp = entry.suffix; const result = evaluate(entry); element.props.style = element.props.style || {}; if (typeof element.props.style === 'string') { element.props.style = cssStringToObject(element.props.style); } if (!result) { delete element.props.style[styleProp]; } else { element.props.style[styleProp] = result; } useInit(() => { /* * This seems necessary because Preact doesn't change the styles on * the hydration, so we have to do it manually. It doesn't need deps * because it only needs to do it the first time. */ if (!result) { element.ref.current.style.removeProperty(styleProp); } else { element.ref.current.style[styleProp] = result; } }); }); }); // data-wp-bind--[attribute] directive('bind', ({ directives: { bind }, element, evaluate }) => { bind.filter(isNonDefaultDirectiveSuffix).forEach(entry => { const attribute = entry.suffix; const result = evaluate(entry); element.props[attribute] = result; /* * This is necessary because Preact doesn't change the attributes on the * hydration, so we have to do it manually. It only needs to do it the * first time. After that, Preact will handle the changes. */ useInit(() => { const el = element.ref.current; /* * We set the value directly to the corresponding HTMLElement instance * property excluding the following special cases. We follow Preact's * logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L110-L129 */ if (attribute === 'style') { if (typeof result === 'string') { el.style.cssText = result; } return; } else if (attribute !== 'width' && attribute !== 'height' && attribute !== 'href' && attribute !== 'list' && attribute !== 'form' && /* * The value for `tabindex` follows the parsing rules for an * integer. If that fails, or if the attribute isn't present, then * the browsers should "follow platform conventions to determine if * the element should be considered as a focusable area", * practically meaning that most elements get a default of `-1` (not * focusable), but several also get a default of `0` (focusable in * order after all elements with a positive `tabindex` value). * * @see https://html.spec.whatwg.org/#tabindex-value */ attribute !== 'tabIndex' && attribute !== 'download' && attribute !== 'rowSpan' && attribute !== 'colSpan' && attribute !== 'role' && attribute in el) { try { el[attribute] = result === null || result === undefined ? '' : result; return; } catch (err) {} } /* * aria- and data- attributes have no boolean representation. * A `false` value is different from the attribute not being * present, so we can't remove it. * We follow Preact's logic: https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L131C24-L136 */ if (result !== null && result !== undefined && (result !== false || attribute[4] === '-')) { el.setAttribute(attribute, result); } else { el.removeAttribute(attribute); } }); }); }); // data-wp-ignore directive('ignore', ({ element: { type: Type, props: { innerHTML, ...rest } } }) => { // Preserve the initial inner HTML. const cached = T(() => innerHTML, []); return (0,preact_module.h)(Type, { dangerouslySetInnerHTML: { __html: cached }, ...rest }); }); // data-wp-text directive('text', ({ directives: { text }, element, evaluate }) => { const entry = text.find(isDefaultDirectiveSuffix); if (!entry) { element.props.children = null; return; } try { const result = evaluate(entry); element.props.children = typeof result === 'object' ? null : result.toString(); } catch (e) { element.props.children = null; } }); // data-wp-run directive('run', ({ directives: { run }, evaluate }) => { run.forEach(entry => evaluate(entry)); }); // data-wp-each--[item] directive('each', ({ directives: { each, 'each-key': eachKey }, context: inheritedContext, element, evaluate }) => { if (element.type !== 'template') { return; } const { Provider } = inheritedContext; const inheritedValue = x(inheritedContext); const [entry] = each; const { namespace } = entry; const list = evaluate(entry); const itemProp = isNonDefaultDirectiveSuffix(entry) ? kebabToCamelCase(entry.suffix) : 'item'; return list.map(item => { const itemContext = proxifyContext(proxifyState(namespace, {}), inheritedValue.client[namespace]); const mergedContext = { client: { ...inheritedValue.client, [namespace]: itemContext }, server: { ...inheritedValue.server } }; // Set the item after proxifying the context. mergedContext.client[namespace][itemProp] = item; const scope = { ...getScope(), context: mergedContext.client, serverContext: mergedContext.server }; const key = eachKey ? getEvaluate({ scope })(eachKey[0]) : item; return (0,preact_module.h)(Provider, { value: mergedContext, key }, element.props.content); }); }, { priority: 20 }); directive('each-child', () => null, { priority: 1 }); }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/constants.js const directivePrefix = 'wp'; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/vdom.js /** * External dependencies */ /** * Internal dependencies */ const ignoreAttr = `data-${directivePrefix}-ignore`; const islandAttr = `data-${directivePrefix}-interactive`; const fullPrefix = `data-${directivePrefix}-`; const namespaces = []; const currentNamespace = () => { var _namespaces; return (_namespaces = namespaces[namespaces.length - 1]) !== null && _namespaces !== void 0 ? _namespaces : null; }; const isObject = item => Boolean(item && typeof item === 'object' && item.constructor === Object); // Regular expression for directive parsing. const directiveParser = new RegExp(`^data-${directivePrefix}-` + // ${p} must be a prefix string, like 'wp'. // Match alphanumeric characters including hyphen-separated // segments. It excludes underscore intentionally to prevent confusion. // E.g., "custom-directive". '([a-z0-9]+(?:-[a-z0-9]+)*)' + // (Optional) Match '--' followed by any alphanumeric charachters. It // excludes underscore intentionally to prevent confusion, but it can // contain multiple hyphens. E.g., "--custom-prefix--with-more-info". '(?:--([a-z0-9_-]+))?$', 'i' // Case insensitive. ); // Regular expression for reference parsing. It can contain a namespace before // the reference, separated by `::`, like `some-namespace::state.somePath`. // Namespaces can contain any alphanumeric characters, hyphens, underscores or // forward slashes. References don't have any restrictions. const nsPathRegExp = /^([\w_\/-]+)::(.+)$/; const hydratedIslands = new WeakSet(); /** * Recursive function that transforms a DOM tree into vDOM. * * @param root The root element or node to start traversing on. * @return The resulting vDOM tree. */ function toVdom(root) { const treeWalker = document.createTreeWalker(root, 205 // TEXT + CDATA_SECTION + COMMENT + PROCESSING_INSTRUCTION + ELEMENT ); function walk(node) { const { nodeType } = node; // TEXT_NODE (3) if (nodeType === 3) { return [node.data]; } // CDATA_SECTION_NODE (4) if (nodeType === 4) { var _nodeValue; const next = treeWalker.nextSibling(); node.replaceWith(new window.Text((_nodeValue = node.nodeValue) !== null && _nodeValue !== void 0 ? _nodeValue : '')); return [node.nodeValue, next]; } // COMMENT_NODE (8) || PROCESSING_INSTRUCTION_NODE (7) if (nodeType === 8 || nodeType === 7) { const next = treeWalker.nextSibling(); node.remove(); return [null, next]; } const elementNode = node; const { attributes } = elementNode; const localName = elementNode.localName; const props = {}; const children = []; const directives = []; let ignore = false; let island = false; for (let i = 0; i < attributes.length; i++) { const attributeName = attributes[i].name; const attributeValue = attributes[i].value; if (attributeName[fullPrefix.length] && attributeName.slice(0, fullPrefix.length) === fullPrefix) { if (attributeName === ignoreAttr) { ignore = true; } else { var _regexResult$, _regexResult$2; const regexResult = nsPathRegExp.exec(attributeValue); const namespace = (_regexResult$ = regexResult?.[1]) !== null && _regexResult$ !== void 0 ? _regexResult$ : null; let value = (_regexResult$2 = regexResult?.[2]) !== null && _regexResult$2 !== void 0 ? _regexResult$2 : attributeValue; try { const parsedValue = JSON.parse(value); value = isObject(parsedValue) ? parsedValue : value; } catch {} if (attributeName === islandAttr) { island = true; const islandNamespace = // eslint-disable-next-line no-nested-ternary typeof value === 'string' ? value : typeof value?.namespace === 'string' ? value.namespace : null; namespaces.push(islandNamespace); } else { directives.push([attributeName, namespace, value]); } } } else if (attributeName === 'ref') { continue; } props[attributeName] = attributeValue; } if (ignore && !island) { return [(0,preact_module.h)(localName, { ...props, innerHTML: elementNode.innerHTML, __directives: { ignore: true } })]; } if (island) { hydratedIslands.add(elementNode); } if (directives.length) { props.__directives = directives.reduce((obj, [name, ns, value]) => { const directiveMatch = directiveParser.exec(name); if (directiveMatch === null) { warn(`Found malformed directive name: ${name}.`); return obj; } const prefix = directiveMatch[1] || ''; const suffix = directiveMatch[2] || null; obj[prefix] = obj[prefix] || []; obj[prefix].push({ namespace: ns !== null && ns !== void 0 ? ns : currentNamespace(), value: value, suffix }); return obj; }, {}); } // @ts-expect-error Fixed in upcoming preact release https://github.com/preactjs/preact/pull/4334 if (localName === 'template') { props.content = [...elementNode.content.childNodes].map(childNode => toVdom(childNode)); } else { let child = treeWalker.firstChild(); if (child) { while (child) { const [vnode, nextChild] = walk(child); if (vnode) { children.push(vnode); } child = nextChild || treeWalker.nextSibling(); } treeWalker.parentNode(); } } // Restore previous namespace. if (island) { namespaces.pop(); } return [(0,preact_module.h)(localName, props, children)]; } return walk(treeWalker.currentNode); } ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/init.js /** * External dependencies */ /** * Internal dependencies */ // Keep the same root fragment for each interactive region node. const regionRootFragments = new WeakMap(); const getRegionRootFragment = region => { if (!region.parentElement) { throw Error('The passed region should be an element with a parent.'); } if (!regionRootFragments.has(region)) { regionRootFragments.set(region, createRootFragment(region.parentElement, region)); } return regionRootFragments.get(region); }; // Initial vDOM regions associated with its DOM element. const initialVdom = new WeakMap(); // Initialize the router with the initial DOM. const init = async () => { const nodes = document.querySelectorAll(`[data-${directivePrefix}-interactive]`); for (const node of nodes) { if (!hydratedIslands.has(node)) { await splitTask(); const fragment = getRegionRootFragment(node); const vdom = toVdom(node); initialVdom.set(node, vdom); await splitTask(); (0,preact_module/* hydrate */.Qv)(vdom, fragment); } } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/interactivity/build-module/index.js /** * External dependencies */ /** * Internal dependencies */ const requiredConsent = 'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.'; const privateApis = lock => { if (lock === requiredConsent) { return { directivePrefix: directivePrefix, getRegionRootFragment: getRegionRootFragment, initialVdom: initialVdom, toVdom: toVdom, directive: directive, getNamespace: getNamespace, h: preact_module.h, cloneElement: preact_module/* cloneElement */.Ob, render: preact_module/* render */.XX, proxifyState: proxifyState, parseServerData: parseServerData, populateServerData: populateServerData, batch: signals_core_module_r }; } throw new Error('Forbidden access.'); }; directives(); init(); /***/ }), /***/ 622: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FK: () => (/* binding */ b), /* harmony export */ Ob: () => (/* binding */ E), /* harmony export */ Qv: () => (/* binding */ D), /* harmony export */ XX: () => (/* binding */ B), /* harmony export */ fF: () => (/* binding */ l), /* harmony export */ h: () => (/* binding */ _), /* harmony export */ q6: () => (/* binding */ G), /* harmony export */ uA: () => (/* binding */ k), /* harmony export */ zO: () => (/* binding */ t) /* harmony export */ }); /* unused harmony exports createElement, createRef, toChildArray */ var n,l,u,t,i,o,r,f,e,c,s,a,h={},v=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function w(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return g(l,f,i,o,null)}function g(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(f),f}function m(){return{current:null}}function b(n){return n.children}function k(n,l){this.props=n,this.context=l}function x(n,l){if(null==l)return n.__?x(n.__,n.__i+1):null;for(var u;lu&&i.sort(f));M.__r=0}function P(n,l,u,t,i,o,r,f,e,c,s){var a,p,y,d,w,_=t&&t.__k||v,g=l.length;for(u.__d=e,$(u,l,_),e=u.__d,a=0;a0?g(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=n,i.__b=n.__b+1,o=null,-1!==(f=i.__i=L(i,u,r,s))&&(s--,(o=u[f])&&(o.__u|=131072)),null==o||null===o.__v?(-1==f&&a--,"function"!=typeof i.type&&(i.__u|=65536)):f!==r&&(f==r-1?a--:f==r+1?a++:(f>r?a--:a++,i.__u|=65536))):i=n.__k[t]=null;if(s)for(t=0;t(null!=e&&0==(131072&e.__u)?1:0))for(;r>=0||f=0){if((e=l[r])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return r;r--}if(f2&&(e.children=arguments.length>3?n.call(arguments,2):t),g(l.type,e,i||l.key,o||l.ref,null)}function G(n,l){var u={__c:l="__cC"+a++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.forEach(function(n){n.__e=!0,S(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=v.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},k.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),S(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),S(this))},k.prototype.render=b,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},M.__r=0,e=0,c=F(!1),s=F(!0),a=0; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { // EXPORTS __webpack_require__.d(__webpack_exports__, { zj: () => (/* reexport */ build_module/* getConfig */.zj), SD: () => (/* reexport */ build_module/* getContext */.SD), V6: () => (/* reexport */ build_module/* getElement */.V6), $K: () => (/* reexport */ build_module/* getServerContext */.$K), vT: () => (/* reexport */ build_module/* getServerState */.vT), jb: () => (/* reexport */ build_module/* privateApis */.jb), yT: () => (/* reexport */ build_module/* splitTask */.yT), M_: () => (/* reexport */ build_module/* store */.M_), hb: () => (/* reexport */ build_module/* useCallback */.hb), vJ: () => (/* reexport */ build_module/* useEffect */.vJ), ip: () => (/* reexport */ build_module/* useInit */.ip), Nf: () => (/* reexport */ build_module/* useLayoutEffect */.Nf), Kr: () => (/* reexport */ build_module/* useMemo */.Kr), li: () => (/* reexport */ build_module/* useRef */.li), J0: () => (/* reexport */ build_module/* useState */.J0), FH: () => (/* reexport */ build_module/* useWatch */.FH), v4: () => (/* reexport */ build_module/* withScope */.v4) }); // EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js var preact_module = __webpack_require__(622); ;// CONCATENATED MODULE: ./node_modules/preact/devtools/dist/devtools.module.js var i;function t(o,e){return n.__a&&n.__a(e),o}null!=(i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&i.__PREACT_DEVTOOLS__&&i.__PREACT_DEVTOOLS__.attachPreact("10.24.3",preact_module/* options */.fF,{Fragment:preact_module/* Fragment */.FK,Component:preact_module/* Component */.uA}); ;// CONCATENATED MODULE: ./node_modules/preact/debug/dist/debug.module.js var debug_module_t={};function r(){debug_module_t={}}function a(e){return e.type===preact_module/* Fragment */.FK?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var debug_module_i=[],s=[];function c(){return debug_module_i.length>0?debug_module_i[debug_module_i.length-1]:null}var l=!0;function u(e){return"function"==typeof e.type&&e.type!=preact_module/* Fragment */.FK}function f(n){for(var e=[n],o=n;null!=o.__o;)e.push(o.__o),o=o.__o;return e.reduce(function(n,e){n+=" in "+a(e);var o=e.__source;return o?n+=" (at "+o.fileName+":"+o.lineNumber+")":l&&console.warn("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."),l=!1,n+"\n"},"")}var d="function"==typeof WeakMap;function p(n){var e=[];return n.__k?(n.__k.forEach(function(n){n&&"function"==typeof n.type?e.push.apply(e,p(n)):n&&"string"==typeof n.type&&e.push(n.type)}),e):e}function h(n){return n?"function"==typeof n.type?null==n.__?null!=n.__e&&null!=n.__e.parentNode?n.__e.parentNode.localName:"":h(n.__):n.type:""}var v=preact_module/* Component */.uA.prototype.setState;function y(n){return"table"===n||"tfoot"===n||"tbody"===n||"thead"===n||"td"===n||"tr"===n||"th"===n}preact_module/* Component */.uA.prototype.setState=function(n,e){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+f(c())),v.call(this,n,e)};var m=/^(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)$/,b=preact_module/* Component */.uA.prototype.forceUpdate;function w(n){var e=n.props,o=a(n),t="";for(var r in e)if(e.hasOwnProperty(r)&&"children"!==r){var i=e[r];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),t+=" "+r+"="+JSON.stringify(i)}var s=e.children;return"<"+o+t+(s&&s.length?">..":" />")}preact_module/* Component */.uA.prototype.forceUpdate=function(n){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+f(c())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+f(this.__v)),b.call(this,n)},preact_module/* options */.fF.__m=function(n,e){var o=n.type,t=e.map(function(n){return n&&n.localName}).filter(Boolean);console.error("Expected a DOM node of type "+o+" but found "+t.join(", ")+"as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+f(n))},function(){!function(){var n=preact_module/* options */.fF.__b,o=preact_module/* options */.fF.diffed,t=preact_module/* options */.fF.__,r=preact_module/* options */.fF.vnode,a=preact_module/* options */.fF.__r;preact_module/* options */.fF.diffed=function(n){u(n)&&s.pop(),debug_module_i.pop(),o&&o(n)},preact_module/* options */.fF.__b=function(e){u(e)&&debug_module_i.push(e),n&&n(e)},preact_module/* options */.fF.__=function(n,e){s=[],t&&t(n,e)},preact_module/* options */.fF.vnode=function(n){n.__o=s.length>0?s[s.length-1]:null,r&&r(n)},preact_module/* options */.fF.__r=function(n){u(n)&&s.push(n),a&&a(n)}}();var n=!1,o=preact_module/* options */.fF.__b,r=preact_module/* options */.fF.diffed,c=preact_module/* options */.fF.vnode,l=preact_module/* options */.fF.__r,v=preact_module/* options */.fF.__e,b=preact_module/* options */.fF.__,g=preact_module/* options */.fF.__h,E=d?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];preact_module/* options */.fF.__e=function(n,e,o,t){if(e&&e.__c&&"function"==typeof n.then){var r=n;n=new Error("Missing Suspense. The throwing component was: "+a(e));for(var i=e;i;i=i.__)if(i.__c&&i.__c.__c){n=r;break}if(n instanceof Error)throw n}try{(t=t||{}).componentStack=f(e),v(n,e,o,t),"function"!=typeof n.then&&setTimeout(function(){throw n})}catch(n){throw n}},preact_module/* options */.fF.__=function(n,e){if(!e)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var o;switch(e.nodeType){case 1:case 11:case 9:o=!0;break;default:o=!1}if(!o){var t=a(n);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+e+" instead: render(<"+t+" />, "+e+");")}b&&b(n,e)},preact_module/* options */.fF.__b=function(e){var r=e.type;if(n=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+w(e)+"\n\n"+f(e));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+a(e)+" = "+w(r)+";\n let vnode = ;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+f(e));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==e.ref&&"function"!=typeof e.ref&&"object"!=typeof e.ref&&!("$$typeof"in e))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof e.ref+"] instead\n"+w(e)+"\n\n"+f(e));if("string"==typeof e.type)for(var i in e.props)if("o"===i[0]&&"n"===i[1]&&"function"!=typeof e.props[i]&&null!=e.props[i])throw new Error("Component's \""+i+'" property should be a function, but got ['+typeof e.props[i]+"] instead\n"+w(e)+"\n\n"+f(e));if("function"==typeof e.type&&e.type.propTypes){if("Lazy"===e.type.displayName&&E&&!E.lazyPropTypes.has(e.type)){var s="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var c=e.type();E.lazyPropTypes.set(e.type,!0),console.warn(s+"Component wrapped in lazy() is "+a(c))}catch(n){console.warn(s+"We will log the wrapped component's name once it is loaded.")}}var l=e.props;e.type.__f&&delete(l=function(n,e){for(var o in e)n[o]=e[o];return n}({},l)).ref,function(n,e,o,r,a){Object.keys(n).forEach(function(o){var i;try{i=n[o](e,o,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(n){i=n}i&&!(i.message in debug_module_t)&&(debug_module_t[i.message]=!0,console.error("Failed prop type: "+i.message+(a&&"\n"+a()||"")))})}(e.type.propTypes,l,0,a(e),function(){return f(e)})}o&&o(e)};var T,_=0;preact_module/* options */.fF.__r=function(e){l&&l(e),n=!0;var o=e.__c;if(o===T?_++:_=1,_>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+a(e));T=o},preact_module/* options */.fF.__h=function(e,o,t){if(!e||!n)throw new Error("Hook can only be invoked from render methods.");g&&g(e,o,t)};var O=function(n,e){return{get:function(){var o="get"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("getting vnode."+n+" is deprecated, "+e))},set:function(){var o="set"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("setting vnode."+n+" is not allowed, "+e))}}},I={nodeName:O("nodeName","use vnode.type"),attributes:O("attributes","use vnode.props"),children:O("children","use vnode.props.children")},M=Object.create({},I);preact_module/* options */.fF.vnode=function(n){var e=n.props;if(null!==n.type&&null!=e&&("__source"in e||"__self"in e)){var o=n.props={};for(var t in e){var r=e[t];"__source"===t?n.__source=r:"__self"===t?n.__self=r:o[t]=r}}n.__proto__=M,c&&c(n)},preact_module/* options */.fF.diffed=function(e){var o,t=e.type,i=e.__;if(e.__k&&e.__k.forEach(function(n){if("object"==typeof n&&n&&void 0===n.type){var o=Object.keys(n).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+o+"}.\n\n"+f(e))}}),e.__c===T&&(_=0),"string"==typeof t&&(y(t)||"p"===t||"a"===t||"button"===t)){var s=h(i);if(""!==s&&y(t))"table"===t&&"td"!==s&&y(s)?(console.log(s,i.__e),console.error("Improper nesting of table. Your
should not have a table-node parent."+w(e)+"\n\n"+f(e))):"thead"!==t&&"tfoot"!==t&&"tbody"!==t||"table"===s?"tr"===t&&"thead"!==s&&"tfoot"!==s&&"tbody"!==s?console.error("Improper nesting of table. Your should have a parent."+w(e)+"\n\n"+f(e)):"td"===t&&"tr"!==s?console.error("Improper nesting of table. Your parent."+w(e)+"\n\n"+f(e)):"th"===t&&"tr"!==s&&console.error("Improper nesting of table. Your ."+w(e)+"\n\n"+f(e)):console.error("Improper nesting of table. Your should have a
should have a
should have a
parent."+w(e)+"\n\n"+f(e));else if("p"===t){var c=p(e).filter(function(n){return m.test(n)});c.length&&console.error("Improper nesting of paragraph. Your

should not have "+c.join(", ")+"as child-elements."+w(e)+"\n\n"+f(e))}else"a"!==t&&"button"!==t||-1!==p(e).indexOf(t)&&console.error("Improper nesting of interactive content. Your <"+t+"> should not have other "+("a"===t?"anchor":"button")+" tags as child-elements."+w(e)+"\n\n"+f(e))}if(n=!1,r&&r(e),null!=e.__k)for(var l=[],u=0;u{n.d(t,{Ob:()=>B,Qv:()=>V,XX:()=>I,fF:()=>o,h:()=>b,q6:()=>z,uA:()=>k,zO:()=>s});var r,o,i,s,u,_,c,l,a,f,p,h,v={},d=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function m(e,t){for(var n in t)e[n]=t[n];return e}function w(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function b(e,t,n){var o,i,s,u={};for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:u[s]=t[s];if(arguments.length>2&&(u.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===u[s]&&(u[s]=e.defaultProps[s]);return x(e,u,o,i,null)}function x(e,t,n,r,s){var u={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++i:s,__i:-1,__u:0};return null==s&&null!=o.vnode&&o.vnode(u),u}function S(e){return e.children}function k(e,t){this.props=e,this.context=t}function E(e,t){if(null==t)return e.__?E(e.__,e.__i+1):null;for(var n;tt&&u.sort(l));O.__r=0}function T(e,t,n,r,o,i,s,u,_,c,l){var a,f,p,h,y,g=r&&r.__k||d,m=t.length;for(n.__d=_,$(n,t,g),_=n.__d,a=0;a0?x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,i=null,-1!==(u=o.__i=N(o,n,s,l))&&(l--,(i=n[u])&&(i.__u|=131072)),null==i||null===i.__v?(-1==u&&a--,"function"!=typeof o.type&&(o.__u|=65536)):u!==s&&(u==s-1?a--:u==s+1?a++:(u>s?a--:a++,o.__u|=65536))):o=e.__k[r]=null;if(l)for(r=0;r(null!=_&&0==(131072&_.__u)?1:0))for(;s>=0||u=0){if((_=t[s])&&0==(131072&_.__u)&&o==_.key&&i===_.type)return s;s--}if(u2&&(_.children=arguments.length>3?r.call(arguments,2):n),x(e.type,_,o||e.key,i||e.ref,null)}function z(e,t){var n={__c:t="__cC"+h++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.forEach((function(e){e.__e=!0,C(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=d.slice,o={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},i=0,s=function(e){return null!=e&&null==e.constructor},k.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof e&&(e=e(m({},n),this.props)),e&&m(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),C(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),C(this))},k.prototype.render=S,u=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,a=0,f=U(!1),p=U(!0),h=0}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};(()=>{n.d(r,{zj:()=>at,SD:()=>ve,V6:()=>de,$K:()=>ye,vT:()=>ft,jb:()=>zt,yT:()=>me,M_:()=>ht,hb:()=>Pe,vJ:()=>ke,ip:()=>Se,Nf:()=>Ee,Kr:()=>Ce,li:()=>w,J0:()=>y,FH:()=>xe,v4:()=>be});var e,t,o,i,s=n(622),u=0,_=[],c=s.fF,l=c.__b,a=c.__r,f=c.diffed,p=c.__c,h=c.unmount,v=c.__;function d(e,n){c.__h&&c.__h(t,e,u||n),u=0;var r=t.__H||(t.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function y(n){return u=1,function(n,r,o){var i=d(e++,2);if(i.t=n,!i.__c&&(i.__=[o?o(r):$(void 0,r),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=t,!t.u)){var s=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!u||u.call(this,e,t,n);var o=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&i.__c.props===e)&&(!u||u.call(this,e,t,n))};t.u=!0;var u=t.shouldComponentUpdate,_=t.componentWillUpdate;t.componentWillUpdate=function(e,t,n){if(this.__e){var r=u;u=void 0,s(e,t,n),u=r}_&&_.call(this,e,t,n)},t.shouldComponentUpdate=s}return i.__N||i.__}($,n)}function g(n,r){var o=d(e++,3);!c.__s&&T(o.__H,r)&&(o.__=n,o.i=r,t.__H.__h.push(o))}function m(n,r){var o=d(e++,4);!c.__s&&T(o.__H,r)&&(o.__=n,o.i=r,t.__h.push(o))}function w(e){return u=5,b((function(){return{current:e}}),[])}function b(t,n){var r=d(e++,7);return T(r.__H,n)&&(r.__=t(),r.__H=n,r.__h=t),r.__}function x(e,t){return u=8,b((function(){return e}),t)}function S(n){var r=t.context[n.__c],o=d(e++,9);return o.c=n,r?(null==o.__&&(o.__=!0,r.sub(t)),r.props.value):n.__}function k(){for(var e;e=_.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(C),e.__H.__h.forEach(O),e.__H.__h=[]}catch(t){e.__H.__h=[],c.__e(t,e.__v)}}c.__b=function(e){t=null,l&&l(e)},c.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),v&&v(e,t)},c.__r=function(n){a&&a(n),e=0;var r=(t=n.__c).__H;r&&(o===t?(r.__h=[],t.__h=[],r.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(r.__h.forEach(C),r.__h.forEach(O),r.__h=[],e=0)),o=t},c.diffed=function(e){f&&f(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(1!==_.push(n)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||P)(k)),n.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),o=t=null},c.__c=function(e,t){t.some((function(e){try{e.__h.forEach(C),e.__h=e.__h.filter((function(e){return!e.__||O(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],c.__e(n,e.__v)}})),p&&p(e,t)},c.unmount=function(e){h&&h(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{C(e)}catch(e){t=e}})),n.__H=void 0,t&&c.__e(t,n.__v))};var E="function"==typeof requestAnimationFrame;function P(e){var t,n=function(){clearTimeout(r),E&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);E&&(t=requestAnimationFrame(n))}function C(e){var n=t,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),t=n}function O(e){var n=t;e.__c=e.__(),t=n}function T(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function $(e,t){return"function"==typeof t?t(e):t}var M=Symbol.for("preact-signals");function N(){if(F>1)F--;else{for(var e,t=!1;void 0!==W;){var n=W;for(W=void 0,A++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&V(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(A=0,F--,t)throw e}}function j(e){if(F>0)return e();F++;try{return e()}finally{N()}}var H=void 0;var U,W=void 0,F=0,A=0,L=0;function D(e){if(void 0!==H){var t=e.n;if(void 0===t||t.t!==H)return t={i:0,S:e,p:H.s,n:void 0,t:H,e:void 0,x:void 0,r:t},void 0!==H.s&&(H.s.n=t),H.s=t,e.n=t,32&H.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=H.s,t.n=void 0,H.s.n=t,H.s=t),t}}function R(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function I(e){return new R(e)}function V(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function B(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function z(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function q(e){R.call(this,void 0),this.x=e,this.s=void 0,this.g=L-1,this.f=4}function J(e){return new q(e)}function K(e){var t=e.u;if(e.u=void 0,"function"==typeof t){F++;var n=H;H=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,G(e),t}finally{H=n,N()}}}function G(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,K(e)}function X(e){if(H!==this)throw new Error("Out-of-order effect");z(this),H=e,this.f&=-2,8&this.f&&G(this),N()}function Q(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function Y(e){var t=new Q(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function Z(e,t){s.fF[e]=t.bind(null,s.fF[e]||function(){})}function ee(e){U&&U(),U=e&&e.S()}function te(e){var t=this,n=e.data,r=function(e){return b((function(){return I(e)}),[])}(n);r.value=n;var o=b((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e;(0,s.zO)(o.peek())||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=o.peek()},J((function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return o.value}function ne(e,t,n,r){var o=t in e&&void 0===e.ownerSVGElement,i=I(n);return{o:function(e,t){i.value=e,r=t},d:Y((function(){var n=i.value.value;r[t]!==n&&(r[t]=n,o?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}R.prototype.brand=M,R.prototype.h=function(){return!0},R.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},R.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},R.prototype.subscribe=function(e){var t=this;return Y((function(){var n=t.value,r=H;H=void 0;try{e(n)}finally{H=r}}))},R.prototype.valueOf=function(){return this.value},R.prototype.toString=function(){return this.value+""},R.prototype.toJSON=function(){return this.value},R.prototype.peek=function(){var e=H;H=void 0;try{return this.value}finally{H=e}},Object.defineProperty(R.prototype,"value",{get:function(){var e=D(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(A>100)throw new Error("Cycle detected");this.v=e,this.i++,L++,F++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{N()}}}}),(q.prototype=new R).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===L)return!0;if(this.g=L,this.f|=1,this.i>0&&!V(this))return this.f&=-2,!0;var e=H;try{B(this),H=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return H=e,z(this),this.f&=-2,!0},q.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}R.prototype.S.call(this,e)},q.prototype.U=function(e){if(void 0!==this.t&&(R.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},q.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(q.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=D(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Q.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},Q.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,K(this),B(this),F++;var e=H;return H=this,X.bind(this,e)},Q.prototype.N=function(){2&this.f||(this.f|=2,this.o=W,W=this)},Q.prototype.d=function(){this.f|=8,1&this.f||G(this)},te.displayName="_st",Object.defineProperties(R.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:te},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),Z("__b",(function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var o in r)if("children"!==o){var i=r[o];i instanceof R&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)})),Z("__r",(function(e,t){ee();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(e){var t;return Y((function(){t=this})),t.c=function(){r.__$f|=1,r.setState({})},t}())),r,ee(n),e(t)})),Z("__e",(function(e,t,n,r){ee(),void 0,e(t,n,r)})),Z("diffed",(function(e,t){var n;if(ee(),void 0,"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var s in i){var u=i[s];void 0===u||s in r||(u.d(),i[s]=void 0)}else n.U=i={};for(var _ in r){var c=i[_],l=r[_];void 0===c?(c=ne(n,_,l,o),i[_]=c):c.o(l,o)}}}e(t)})),Z("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var i=r[o];i&&i.d()}}}else{var s=t.__c;if(s){var u=s.__$u;u&&(s.__$u=void 0,u.d())}}e(t)})),Z("__h",(function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)})),s.uA.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var r in t)return!0;for(var o in e)if("__source"!==o&&e[o]!==this.props[o])return!0;for(var i in this.props)if(!(i in e))return!0;return!1};const re=[],oe=()=>re.slice(-1)[0],ie=e=>{re.push(e)},se=()=>{re.pop()},ue=[],_e=()=>ue.slice(-1)[0],ce=e=>{ue.push(e)},le=()=>{ue.pop()},ae=new WeakMap,fe=()=>{throw new Error("Please use `data-wp-bind` to modify the attributes of an element.")},pe={get(e,t,n){const r=Reflect.get(e,t,n);return r&&"object"==typeof r?he(r):r},set:fe,deleteProperty:fe},he=e=>(ae.has(e)||ae.set(e,new Proxy(e,pe)),ae.get(e)),ve=e=>_e().context[e||oe()],de=()=>{const e=_e();const{ref:t,attributes:n}=e;return Object.freeze({ref:t.current,attributes:he(n)})},ye=e=>_e().serverContext[e||oe()],ge=e=>new Promise((t=>{const n=()=>{clearTimeout(r),window.cancelAnimationFrame(o),setTimeout((()=>{e(),t()}))},r=setTimeout(n,100),o=window.requestAnimationFrame(n)})),me=()=>new Promise((e=>{setTimeout(e,0)}));function we(e){g((()=>{let t=null,n=!1;return t=function(e,t){let n=()=>{};const r=Y((function(){return n=this.c.bind(this),this.x=e,this.c=t,e()}));return{flush:n,dispose:r}}(e,(async()=>{t&&!n&&(n=!0,await ge(t.flush),n=!1)})),t.dispose}),[])}function be(e){const t=_e(),n=oe();return"GeneratorFunction"===e?.constructor?.name?async(...r)=>{const o=e(...r);let i,s;for(;;){ie(n),ce(t);try{s=o.next(i)}finally{le(),se()}try{i=await s.value}catch(e){ie(n),ce(t),o.throw(e)}finally{le(),se()}if(s.done)break}return i}:(...r)=>{ie(n),ce(t);try{return e(...r)}finally{se(),le()}}}function xe(e){we(be(e))}function Se(e){g(be(e),[])}function ke(e,t){g(be(e),t)}function Ee(e,t){m(be(e),t)}function Pe(e,t){return x(be(e),t)}function Ce(e,t){return b(be(e),t)}new Set;const Oe=e=>{0},Te=e=>Boolean(e&&"object"==typeof e&&e.constructor===Object),$e=new WeakMap,Me=new WeakMap,Ne=new WeakMap,je=new Set([Object,Array]),He=(e,t,n)=>{if(!Fe(t))throw Error("This object cannot be proxified.");if(!$e.has(t)){const r=new Proxy(t,n);$e.set(t,r),Me.set(r,t),Ne.set(r,e)}return $e.get(t)},Ue=e=>$e.get(e),We=e=>Ne.get(e),Fe=e=>"object"==typeof e&&null!==e&&(!Ne.has(e)&&je.has(e.constructor)),Ae={};class Le{constructor(e){this.owner=e,this.computedsByScope=new WeakMap}setValue(e){this.update({value:e})}setGetter(e){this.update({get:e})}getComputed(){const e=_e()||Ae;if(this.valueSignal||this.getterSignal||this.update({}),!this.computedsByScope.has(e)){const t=()=>{const e=this.getterSignal?.value;return e?e.call(this.owner):this.valueSignal?.value};ie(We(this.owner)),this.computedsByScope.set(e,J(be(t))),se()}return this.computedsByScope.get(e)}update({get:e,value:t}){this.valueSignal?t===this.valueSignal.peek()&&e===this.getterSignal.peek()||j((()=>{this.valueSignal.value=t,this.getterSignal.value=e})):(this.valueSignal=I(t),this.getterSignal=I(e))}}const De=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter((e=>"symbol"==typeof e))),Re=new WeakMap,Ie=(e,t)=>Re.has(e)&&Re.get(e).has(t),Ve=new WeakSet,Be=(e,t,n)=>{Re.has(e)||Re.set(e,new Map),t="number"==typeof t?`${t}`:t;const r=Re.get(e);if(!r.has(t)){const o=We(e),i=new Le(e);if(r.set(t,i),n){const{get:t,value:r}=n;if(t)i.setGetter(t);else{const t=Ve.has(e);i.setValue(Fe(r)?Ke(o,r,{readOnly:t}):r)}}}return r.get(t)},ze=new WeakMap;let qe=!1;const Je={get(e,t,n){if(qe||!e.hasOwnProperty(t)&&t in e||"symbol"==typeof t&&De.has(t))return Reflect.get(e,t,n);const r=Object.getOwnPropertyDescriptor(e,t),o=Be(n,t,r).getComputed().value;if("function"==typeof o){const e=We(n);return(...t)=>{ie(e);try{return o.call(n,...t)}finally{se()}}}return o},set(e,t,n,r){if(Ve.has(r))return!1;ie(We(r));try{return Reflect.set(e,t,n,r)}finally{se()}},defineProperty(e,t,n){if(Ve.has(Ue(e)))return!1;const r=!(t in e),o=Reflect.defineProperty(e,t,n);if(o){const o=Ue(e),i=Be(o,t),{get:s,value:u}=n;if(s)i.setGetter(s);else{const e=We(o);i.setValue(Fe(u)?Ke(e,u):u)}if(r&&ze.has(e)&&ze.get(e).value++,Array.isArray(e)&&Re.get(o)?.has("length")){Be(o,"length").setValue(e.length)}}return o},deleteProperty(e,t){if(Ve.has(Ue(e)))return!1;const n=Reflect.deleteProperty(e,t);if(n){Be(Ue(e),t).setValue(void 0),ze.has(e)&&ze.get(e).value++}return n},ownKeys:e=>(ze.has(e)||ze.set(e,I(0)),ze._=ze.get(e).value,Reflect.ownKeys(e))},Ke=(e,t,n)=>{const r=He(e,t,Je);return n?.readOnly&&Ve.add(r),r},Ge=(e,t,n=!0)=>{if(!Te(e)||!Te(t))return;let r=!1;for(const o in t){const i=!(o in e);r=r||i;const s=Object.getOwnPropertyDescriptor(t,o),u=Ue(e),_=!!u&&Ie(u,o)&&Be(u,o);if("function"==typeof s.get||"function"==typeof s.set)(n||i)&&(Object.defineProperty(e,o,{...s,configurable:!0,enumerable:!0}),s.get&&_&&_.setGetter(s.get));else if(Te(t[o])){if((i||n&&!Te(e[o]))&&(e[o]={},_)){const t=We(u);_.setValue(Ke(t,e[o]))}Te(e[o])&&Ge(e[o],t[o],n)}else if((n||i)&&(Object.defineProperty(e,o,s),_)){const{value:e}=s,t=We(u);_.setValue(Fe(e)?Ke(t,e):e)}}r&&ze.has(e)&&ze.get(e).value++},Xe=(e,t,n=!0)=>j((()=>{return Ge((r=e,Me.get(r)||e),t,n);var r})),Qe=new WeakSet,Ye={get:(e,t,n)=>{const r=Reflect.get(e,t),o=We(n);if(void 0===r&&Qe.has(n)){const n={};return Reflect.set(e,t,n),Ze(o,n,!1)}if("function"==typeof r){ie(o);const e=be(r);return se(),e}return Te(r)&&Fe(r)?Ze(o,r,!1):r}},Ze=(e,t,n=!0)=>{const r=He(e,t,Ye);return r&&n&&Qe.add(r),r},et=new WeakMap,tt=new WeakMap,nt=new WeakSet,rt=Reflect.getOwnPropertyDescriptor,ot={get:(e,t)=>{const n=tt.get(e),r=e[t];return t in e?r:n[t]},set:(e,t,n)=>{const r=tt.get(e);return(t in e||!(t in r)?e:r)[t]=n,!0},ownKeys:e=>[...new Set([...Object.keys(tt.get(e)),...Object.keys(e)])],getOwnPropertyDescriptor:(e,t)=>rt(e,t)||rt(tt.get(e),t)},it=(e,t={})=>{if(nt.has(e))throw Error("This object cannot be proxified.");if(tt.set(e,t),!et.has(e)){const t=new Proxy(e,ot);et.set(e,t),nt.add(t)}return et.get(e)},st=new Map,ut=new Map,_t=new Map,ct=new Map,lt=new Map,at=e=>ct.get(e||oe())||{},ft=e=>{const t=e||oe();return lt.has(t)||lt.set(t,Ke(t,{},{readOnly:!0})),lt.get(t)},pt="I acknowledge that using a private store means my plugin will inevitably break on the next store release.";function ht(e,{state:t={},...n}={},{lock:r=!1}={}){if(st.has(e)){if(r===pt||_t.has(e)){const t=_t.get(e);if(!(r===pt||!0!==r&&r===t))throw t?Error("Cannot unlock a private store with an invalid lock code"):Error("Cannot lock a public store")}else _t.set(e,r);const o=ut.get(e);Xe(o,n),Xe(o.state,t)}else{r!==pt&&_t.set(e,r);const o={state:Ke(e,Te(t)?t:{}),...n},i=Ze(e,o);ut.set(e,o),st.set(e,i)}return st.get(e)}const vt=(e=document)=>{var t;const n=null!==(t=e.getElementById("wp-script-module-data-@wordpress/interactivity"))&&void 0!==t?t:e.getElementById("wp-interactivity-data");if(n?.textContent)try{return JSON.parse(n.textContent)}catch{}return{}},dt=e=>{Te(e?.state)&&Object.entries(e.state).forEach((([e,t])=>{const n=ht(e,{},{lock:pt});Xe(n.state,t,!1),Xe(ft(e),t)})),Te(e?.config)&&Object.entries(e.config).forEach((([e,t])=>{ct.set(e,t)}))},yt=vt();function gt(e){return null!==e.suffix}function mt(e){return null===e.suffix}dt(yt);const wt=(0,s.q6)({client:{},server:{}}),bt={},xt={},St=(e,t,{priority:n=10}={})=>{bt[e]=t,xt[e]=n},kt=({scope:e})=>(t,...n)=>{let{value:r,namespace:o}=t;if("string"!=typeof r)throw new Error("The `value` prop should be a string path");const i="!"===r[0]&&!!(r=r.slice(1));ce(e);const s=((e,t)=>{if(!t)return void Oe();let n=st.get(t);void 0===n&&(n=ht(t,void 0,{lock:pt}));const r={...n,context:_e().context[t]};try{return e.split(".").reduce(((e,t)=>e[t]),r)}catch(e){}})(r,o),u="function"==typeof s?s(...n):s;return le(),i?!u:u},Et=({directives:e,priorityLevels:[t,...n],element:r,originalProps:o,previousScope:i})=>{const u=w({}).current;u.evaluate=x(kt({scope:u}),[]);const{client:_,server:c}=S(wt);u.context=_,u.serverContext=c,u.ref=i?.ref||w(null),r=(0,s.Ob)(r,{ref:u.ref}),u.attributes=r.props;const l=n.length>0?(0,s.h)(Et,{directives:e,priorityLevels:n,element:r,originalProps:o,previousScope:u}):r,a={...o,children:l},f={directives:e,props:a,element:r,context:wt,evaluate:u.evaluate};ce(u);for(const e of t){const t=bt[e]?.(f);void 0!==t&&(a.children=t)}return le(),a.children},Pt=s.fF.vnode;function Ct(e){return Te(e)?Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Ct(t)]))):Array.isArray(e)?e.map((e=>Ct(e))):e}s.fF.vnode=e=>{if(e.props.__directives){const t=e.props,n=t.__directives;n.key&&(e.key=n.key.find(mt).value),delete t.__directives;const r=(e=>{const t=Object.keys(e).reduce(((e,t)=>{if(bt[t]){const n=xt[t];(e[n]=e[n]||[]).push(t)}return e}),{});return Object.entries(t).sort((([e],[t])=>parseInt(e)-parseInt(t))).map((([,e])=>e))})(n);r.length>0&&(e.props={directives:n,priorityLevels:r,originalProps:t,type:e.type,element:(0,s.h)(e.type,t),top:!0},e.type=Et)}Pt&&Pt(e)};const Ot=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Tt=/\/\*[^]*?\*\/| +/g,$t=/\n+/g,Mt=e=>({directives:t,evaluate:n})=>{t[`on-${e}`].filter(gt).forEach((t=>{const r=t.suffix.split("--",1)[0];Se((()=>{const o=e=>n(t,e),i="window"===e?window:document;return i.addEventListener(r,o),()=>i.removeEventListener(r,o)}))}))},Nt=e=>({directives:t,evaluate:n})=>{t[`on-async-${e}`].filter(gt).forEach((t=>{const r=t.suffix.split("--",1)[0];Se((()=>{const o=async e=>{await me(),n(t,e)},i="window"===e?window:document;return i.addEventListener(r,o,{passive:!0}),()=>i.removeEventListener(r,o)}))}))},jt="wp",Ht=`data-${jt}-ignore`,Ut=`data-${jt}-interactive`,Wt=`data-${jt}-`,Ft=[],At=new RegExp(`^data-${jt}-([a-z0-9]+(?:-[a-z0-9]+)*)(?:--([a-z0-9_-]+))?$`,"i"),Lt=/^([\w_\/-]+)::(.+)$/,Dt=new WeakSet;function Rt(e){const t=document.createTreeWalker(e,205);return function e(n){const{nodeType:r}=n;if(3===r)return[n.data];if(4===r){var o;const e=t.nextSibling();return n.replaceWith(new window.Text(null!==(o=n.nodeValue)&&void 0!==o?o:"")),[n.nodeValue,e]}if(8===r||7===r){const e=t.nextSibling();return n.remove(),[null,e]}const i=n,{attributes:u}=i,_=i.localName,c={},l=[],a=[];let f=!1,p=!1;for(let e=0;e{const o=At.exec(t);if(null===o)return Oe(),e;const i=o[1]||"",s=o[2]||null;var u;return e[i]=e[i]||[],e[i].push({namespace:null!=n?n:null!==(u=Ft[Ft.length-1])&&void 0!==u?u:null,value:r,suffix:s}),e}),{})),"template"===_)c.content=[...i.content.childNodes].map((e=>Rt(e)));else{let n=t.firstChild();if(n){for(;n;){const[r,o]=e(n);r&&l.push(r),n=o||t.nextSibling()}t.parentNode()}}return p&&Ft.pop(),[(0,s.h)(_,c,l)]}(t.currentNode)}const It=new WeakMap,Vt=e=>{if(!e.parentElement)throw Error("The passed region should be an element with a parent.");return It.has(e)||It.set(e,((e,t)=>{const n=(t=[].concat(t))[t.length-1].nextSibling;function r(t,r){e.insertBefore(t,r||n)}return e.__k={nodeType:1,parentNode:e,firstChild:t[0],childNodes:t,insertBefore:r,appendChild:r,removeChild(t){e.removeChild(t)}}})(e.parentElement,e)),It.get(e)},Bt=new WeakMap,zt=e=>{if("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."===e)return{directivePrefix:jt,getRegionRootFragment:Vt,initialVdom:Bt,toVdom:Rt,directive:St,getNamespace:oe,h:s.h,cloneElement:s.Ob,render:s.XX,proxifyState:Ke,parseServerData:vt,populateServerData:dt,batch:j};throw new Error("Forbidden access.")};St("context",(({directives:{context:e},props:{children:t},context:n})=>{const{Provider:r}=n,o=e.find(mt),{client:i,server:u}=S(n),_=o.namespace,c=w(Ke(_,{})),l=w(Ke(_,{},{readOnly:!0})),a=b((()=>{const e={client:{...i},server:{...u}};if(o){const{namespace:t,value:n}=o;Te(n)||Oe(),Xe(c.current,Ct(n),!1),Xe(l.current,Ct(n)),e.client[t]=it(c.current,i[t]),e.server[t]=it(l.current,u[t])}return e}),[o,i,u]);return(0,s.h)(r,{value:a},t)}),{priority:5}),St("watch",(({directives:{watch:e},evaluate:t})=>{e.forEach((e=>{xe((()=>t(e)))}))})),St("init",(({directives:{init:e},evaluate:t})=>{e.forEach((e=>{Se((()=>t(e)))}))})),St("on",(({directives:{on:e},element:t,evaluate:n})=>{const r=new Map;e.filter(gt).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{e.forEach((e=>{o&&o(t),n(e,t)}))}}))})),St("on-async",(({directives:{"on-async":e},element:t,evaluate:n})=>{const r=new Map;e.filter(gt).forEach((e=>{const t=e.suffix.split("--")[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{o&&o(t),e.forEach((async e=>{await me(),n(e,t)}))}}))})),St("on-window",Mt("window")),St("on-document",Mt("document")),St("on-async-window",Nt("window")),St("on-async-document",Nt("document")),St("class",(({directives:{class:e},element:t,evaluate:n})=>{e.filter(gt).forEach((e=>{const r=e.suffix,o=n(e),i=t.props.class||"",s=new RegExp(`(^|\\s)${r}(\\s|$)`,"g");o?s.test(i)||(t.props.class=i?`${i} ${r}`:r):t.props.class=i.replace(s," ").trim(),Se((()=>{o?t.ref.current.classList.add(r):t.ref.current.classList.remove(r)}))}))})),St("style",(({directives:{style:e},element:t,evaluate:n})=>{e.filter(gt).forEach((e=>{const r=e.suffix,o=n(e);t.props.style=t.props.style||{},"string"==typeof t.props.style&&(t.props.style=(e=>{const t=[{}];let n,r;for(;n=Ot.exec(e.replace(Tt,""));)n[4]?t.shift():n[3]?(r=n[3].replace($t," ").trim(),t.unshift(t[0][r]=t[0][r]||{})):t[0][n[1]]=n[2].replace($t," ").trim();return t[0]})(t.props.style)),o?t.props.style[r]=o:delete t.props.style[r],Se((()=>{o?t.ref.current.style[r]=o:t.ref.current.style.removeProperty(r)}))}))})),St("bind",(({directives:{bind:e},element:t,evaluate:n})=>{e.filter(gt).forEach((e=>{const r=e.suffix,o=n(e);t.props[r]=o,Se((()=>{const e=t.ref.current;if("style"!==r){if("width"!==r&&"height"!==r&&"href"!==r&&"list"!==r&&"form"!==r&&"tabIndex"!==r&&"download"!==r&&"rowSpan"!==r&&"colSpan"!==r&&"role"!==r&&r in e)try{return void(e[r]=null==o?"":o)}catch(e){}null==o||!1===o&&"-"!==r[4]?e.removeAttribute(r):e.setAttribute(r,o)}else"string"==typeof o&&(e.style.cssText=o)}))}))})),St("ignore",(({element:{type:e,props:{innerHTML:t,...n}}})=>{const r=b((()=>t),[]);return(0,s.h)(e,{dangerouslySetInnerHTML:{__html:r},...n})})),St("text",(({directives:{text:e},element:t,evaluate:n})=>{const r=e.find(mt);if(r)try{const e=n(r);t.props.children="object"==typeof e?null:e.toString()}catch(e){t.props.children=null}else t.props.children=null})),St("run",(({directives:{run:e},evaluate:t})=>{e.forEach((e=>t(e)))})),St("each",(({directives:{each:e,"each-key":t},context:n,element:r,evaluate:o})=>{if("template"!==r.type)return;const{Provider:i}=n,u=S(n),[_]=e,{namespace:c}=_,l=o(_),a=gt(_)?_.suffix.replace(/^-+|-+$/g,"").toLowerCase().replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()})):"item";return l.map((e=>{const n=it(Ke(c,{}),u.client[c]),o={client:{...u.client,[c]:n},server:{...u.server}};o.client[c][a]=e;const _={..._e(),context:o.client,serverContext:o.server},l=t?kt({scope:_})(t[0]):e;return(0,s.h)(i,{value:o,key:l},r.props.content)}))}),{priority:20}),St("each-child",(()=>null),{priority:1}),(async()=>{const e=document.querySelectorAll(`[data-${jt}-interactive]`);for(const t of e)if(!Dt.has(t)){await me();const e=Vt(t),n=Rt(t);Bt.set(t,n),await me(),(0,s.Qv)(n,e)}})()})();var o=r.zj,i=r.SD,s=r.V6,u=r.$K,_=r.vT,c=r.jb,l=r.yT,a=r.M_,f=r.hb,p=r.vJ,h=r.ip,v=r.Nf,d=r.Kr,y=r.li,g=r.J0,m=r.FH,w=r.v4;export{o as getConfig,i as getContext,s as getElement,u as getServerContext,_ as getServerState,c as privateApis,l as splitTask,a as store,f as useCallback,p as useEffect,h as useInit,v as useLayoutEffect,d as useMemo,y as useRef,g as useState,m as useWatch,w as withScope};block-library/image/view.js000064400000043201147207022110011666 0ustar00import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; ;// CONCATENATED MODULE: external "@wordpress/interactivity" var x = (y) => { var x = {}; __webpack_require__.d(x, y); return x } var y = (x) => (() => (x)) const interactivity_namespaceObject = 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) }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/view.js /** * WordPress dependencies */ /** * Tracks whether user is touching screen; used to differentiate behavior for * touch and mouse input. * * @type {boolean} */ let isTouching = false; /** * Tracks the last time the screen was touched; used to differentiate behavior * for touch and mouse input. * * @type {number} */ let lastTouchTime = 0; const { state, actions, callbacks } = (0,interactivity_namespaceObject.store)('core/image', { state: { currentImageId: null, get currentImage() { return state.metadata[state.currentImageId]; }, get overlayOpened() { return state.currentImageId !== null; }, get roleAttribute() { return state.overlayOpened ? 'dialog' : null; }, get ariaModal() { return state.overlayOpened ? 'true' : null; }, get enlargedSrc() { return state.currentImage.uploadedSrc || 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='; }, get figureStyles() { return state.overlayOpened && `${state.currentImage.figureStyles?.replace(/margin[^;]*;?/g, '')};`; }, get imgStyles() { return state.overlayOpened && `${state.currentImage.imgStyles?.replace(/;$/, '')}; object-fit:cover;`; }, get imageButtonRight() { const { imageId } = (0,interactivity_namespaceObject.getContext)(); return state.metadata[imageId].imageButtonRight; }, get imageButtonTop() { const { imageId } = (0,interactivity_namespaceObject.getContext)(); return state.metadata[imageId].imageButtonTop; }, get isContentHidden() { const ctx = (0,interactivity_namespaceObject.getContext)(); return state.overlayEnabled && state.currentImageId === ctx.imageId; }, get isContentVisible() { const ctx = (0,interactivity_namespaceObject.getContext)(); return !state.overlayEnabled && state.currentImageId === ctx.imageId; } }, actions: { showLightbox() { const { imageId } = (0,interactivity_namespaceObject.getContext)(); // Bails out if the image has not loaded yet. if (!state.metadata[imageId].imageRef?.complete) { return; } // Stores the positions of the scroll to fix it until the overlay is // closed. state.scrollTopReset = document.documentElement.scrollTop; state.scrollLeftReset = document.documentElement.scrollLeft; // Sets the current expanded image in the state and enables the overlay. state.overlayEnabled = true; state.currentImageId = imageId; // Computes the styles of the overlay for the animation. callbacks.setOverlayStyles(); }, hideLightbox() { if (state.overlayEnabled) { // Starts the overlay closing animation. The showClosingAnimation // class is used to avoid showing it on page load. state.showClosingAnimation = true; state.overlayEnabled = false; // Waits until the close animation has completed before allowing a // user to scroll again. The duration of this animation is defined in // the `styles.scss` file, but in any case we should wait a few // milliseconds longer than the duration, otherwise a user may scroll // too soon and cause the animation to look sloppy. setTimeout(function () { // Delays before changing the focus. Otherwise the focus ring will // appear on Firefox before the image has finished animating, which // looks broken. state.currentImage.buttonRef.focus({ preventScroll: true }); // Resets the current image id to mark the overlay as closed. state.currentImageId = null; }, 450); } }, handleKeydown(event) { if (state.overlayEnabled) { // Focuses the close button when the user presses the tab key. if (event.key === 'Tab') { event.preventDefault(); const { ref } = (0,interactivity_namespaceObject.getElement)(); ref.querySelector('button').focus(); } // Closes the lightbox when the user presses the escape key. if (event.key === 'Escape') { actions.hideLightbox(); } } }, handleTouchMove(event) { // On mobile devices, prevents triggering the scroll event because // otherwise the page jumps around when it resets the scroll position. // This also means that closing the lightbox requires that a user // perform a simple tap. This may be changed in the future if there is a // better alternative to override or reset the scroll position during // swipe actions. if (state.overlayEnabled) { event.preventDefault(); } }, handleTouchStart() { isTouching = true; }, handleTouchEnd() { // Waits a few milliseconds before resetting to ensure that pinch to // zoom works consistently on mobile devices when the lightbox is open. lastTouchTime = Date.now(); isTouching = false; }, handleScroll() { // Prevents scrolling behaviors that trigger content shift while the // lightbox is open. It would be better to accomplish through CSS alone, // but using overflow: hidden is currently the only way to do so and // that causes a layout to shift and prevents the zoom animation from // working in some cases because it's not possible to account for the // layout shift when doing the animation calculations. Instead, it uses // JavaScript to prevent and reset the scrolling behavior. if (state.overlayOpened) { // Avoids overriding the scroll behavior on mobile devices because // doing so breaks the pinch to zoom functionality, and users should // be able to zoom in further on the high-res image. if (!isTouching && Date.now() - lastTouchTime > 450) { // It doesn't rely on `event.preventDefault()` to prevent scrolling // because the scroll event can't be canceled, so it resets the // position instead. window.scrollTo(state.scrollLeftReset, state.scrollTopReset); } } } }, callbacks: { setOverlayStyles() { if (!state.overlayEnabled) { return; } let { naturalWidth, naturalHeight, offsetWidth: originalWidth, offsetHeight: originalHeight } = state.currentImage.imageRef; let { x: screenPosX, y: screenPosY } = state.currentImage.imageRef.getBoundingClientRect(); // Natural ratio of the image clicked to open the lightbox. const naturalRatio = naturalWidth / naturalHeight; // Original ratio of the image clicked to open the lightbox. let originalRatio = originalWidth / originalHeight; // If it has object-fit: contain, recalculates the original sizes // and the screen position without the blank spaces. if (state.currentImage.scaleAttr === 'contain') { if (naturalRatio > originalRatio) { const heightWithoutSpace = originalWidth / naturalRatio; // Recalculates screen position without the top space. screenPosY += (originalHeight - heightWithoutSpace) / 2; originalHeight = heightWithoutSpace; } else { const widthWithoutSpace = originalHeight * naturalRatio; // Recalculates screen position without the left space. screenPosX += (originalWidth - widthWithoutSpace) / 2; originalWidth = widthWithoutSpace; } } originalRatio = originalWidth / originalHeight; // Typically, it uses the image's full-sized dimensions. If those // dimensions have not been set (i.e. an external image with only one // size), the image's dimensions in the lightbox are the same // as those of the image in the content. let imgMaxWidth = parseFloat(state.currentImage.targetWidth !== 'none' ? state.currentImage.targetWidth : naturalWidth); let imgMaxHeight = parseFloat(state.currentImage.targetHeight !== 'none' ? state.currentImage.targetHeight : naturalHeight); // Ratio of the biggest image stored in the database. let imgRatio = imgMaxWidth / imgMaxHeight; let containerMaxWidth = imgMaxWidth; let containerMaxHeight = imgMaxHeight; let containerWidth = imgMaxWidth; let containerHeight = imgMaxHeight; // Checks if the target image has a different ratio than the original // one (thumbnail). Recalculates the width and height. if (naturalRatio.toFixed(2) !== imgRatio.toFixed(2)) { if (naturalRatio > imgRatio) { // If the width is reached before the height, it keeps the maxWidth // and recalculates the height unless the difference between the // maxHeight and the reducedHeight is higher than the maxWidth, // where it keeps the reducedHeight and recalculate the width. const reducedHeight = imgMaxWidth / naturalRatio; if (imgMaxHeight - reducedHeight > imgMaxWidth) { imgMaxHeight = reducedHeight; imgMaxWidth = reducedHeight * naturalRatio; } else { imgMaxHeight = imgMaxWidth / naturalRatio; } } else { // If the height is reached before the width, it keeps the maxHeight // and recalculate the width unlesss the difference between the // maxWidth and the reducedWidth is higher than the maxHeight, where // it keeps the reducedWidth and recalculate the height. const reducedWidth = imgMaxHeight * naturalRatio; if (imgMaxWidth - reducedWidth > imgMaxHeight) { imgMaxWidth = reducedWidth; imgMaxHeight = reducedWidth / naturalRatio; } else { imgMaxWidth = imgMaxHeight * naturalRatio; } } containerWidth = imgMaxWidth; containerHeight = imgMaxHeight; imgRatio = imgMaxWidth / imgMaxHeight; // Calculates the max size of the container. if (originalRatio > imgRatio) { containerMaxWidth = imgMaxWidth; containerMaxHeight = containerMaxWidth / originalRatio; } else { containerMaxHeight = imgMaxHeight; containerMaxWidth = containerMaxHeight * originalRatio; } } // If the image has been pixelated on purpose, it keeps that size. if (originalWidth > containerWidth || originalHeight > containerHeight) { containerWidth = originalWidth; containerHeight = originalHeight; } // Calculates the final lightbox image size and the scale factor. // MaxWidth is either the window container (accounting for padding) or // the image resolution. let horizontalPadding = 0; if (window.innerWidth > 480) { horizontalPadding = 80; } else if (window.innerWidth > 1920) { horizontalPadding = 160; } const verticalPadding = 80; const targetMaxWidth = Math.min(window.innerWidth - horizontalPadding, containerWidth); const targetMaxHeight = Math.min(window.innerHeight - verticalPadding, containerHeight); const targetContainerRatio = targetMaxWidth / targetMaxHeight; if (originalRatio > targetContainerRatio) { // If targetMaxWidth is reached before targetMaxHeight. containerWidth = targetMaxWidth; containerHeight = containerWidth / originalRatio; } else { // If targetMaxHeight is reached before targetMaxWidth. containerHeight = targetMaxHeight; containerWidth = containerHeight * originalRatio; } const containerScale = originalWidth / containerWidth; const lightboxImgWidth = imgMaxWidth * (containerWidth / containerMaxWidth); const lightboxImgHeight = imgMaxHeight * (containerHeight / containerMaxHeight); // As of this writing, using the calculations above will render the // lightbox with a small, erroneous whitespace on the left side of the // image in iOS Safari, perhaps due to an inconsistency in how browsers // handle absolute positioning and CSS transformation. In any case, // adding 1 pixel to the container width and height solves the problem, // though this can be removed if the issue is fixed in the future. state.overlayStyles = ` :root { --wp--lightbox-initial-top-position: ${screenPosY}px; --wp--lightbox-initial-left-position: ${screenPosX}px; --wp--lightbox-container-width: ${containerWidth + 1}px; --wp--lightbox-container-height: ${containerHeight + 1}px; --wp--lightbox-image-width: ${lightboxImgWidth}px; --wp--lightbox-image-height: ${lightboxImgHeight}px; --wp--lightbox-scale: ${containerScale}; --wp--lightbox-scrollbar-width: ${window.innerWidth - document.documentElement.clientWidth}px; } `; }, setButtonStyles() { const { imageId } = (0,interactivity_namespaceObject.getContext)(); const { ref } = (0,interactivity_namespaceObject.getElement)(); state.metadata[imageId].imageRef = ref; state.metadata[imageId].currentSrc = ref.currentSrc; const { naturalWidth, naturalHeight, offsetWidth, offsetHeight } = ref; // If the image isn't loaded yet, it can't calculate where the button // should be. if (naturalWidth === 0 || naturalHeight === 0) { return; } const figure = ref.parentElement; const figureWidth = ref.parentElement.clientWidth; // It needs special handling for the height because a caption will cause // the figure to be taller than the image, which means it needs to // account for that when calculating the placement of the button in the // top right corner of the image. let figureHeight = ref.parentElement.clientHeight; const caption = figure.querySelector('figcaption'); if (caption) { const captionComputedStyle = window.getComputedStyle(caption); if (!['absolute', 'fixed'].includes(captionComputedStyle.position)) { figureHeight = figureHeight - caption.offsetHeight - parseFloat(captionComputedStyle.marginTop) - parseFloat(captionComputedStyle.marginBottom); } } const buttonOffsetTop = figureHeight - offsetHeight; const buttonOffsetRight = figureWidth - offsetWidth; let imageButtonTop = buttonOffsetTop + 16; let imageButtonRight = buttonOffsetRight + 16; // In the case of an image with object-fit: contain, the size of the // element can be larger than the image itself, so it needs to // calculate where to place the button. if (state.metadata[imageId].scaleAttr === 'contain') { // Natural ratio of the image. const naturalRatio = naturalWidth / naturalHeight; // Offset ratio of the image. const offsetRatio = offsetWidth / offsetHeight; if (naturalRatio >= offsetRatio) { // If it reaches the width first, it keeps the width and compute the // height. const referenceHeight = offsetWidth / naturalRatio; imageButtonTop = (offsetHeight - referenceHeight) / 2 + buttonOffsetTop + 16; imageButtonRight = buttonOffsetRight + 16; } else { // If it reaches the height first, it keeps the height and compute // the width. const referenceWidth = offsetHeight * naturalRatio; imageButtonTop = buttonOffsetTop + 16; imageButtonRight = (offsetWidth - referenceWidth) / 2 + buttonOffsetRight + 16; } } state.metadata[imageId].imageButtonTop = imageButtonTop; state.metadata[imageId].imageButtonRight = imageButtonRight; }, setOverlayFocus() { if (state.overlayEnabled) { // Moves the focus to the dialog when it opens. const { ref } = (0,interactivity_namespaceObject.getElement)(); ref.focus(); } }, initTriggerButton() { const { imageId } = (0,interactivity_namespaceObject.getContext)(); const { ref } = (0,interactivity_namespaceObject.getElement)(); state.metadata[imageId].buttonRef = ref; } } }, { lock: true }); block-library/image/view.min.js000064400000010763147207022110012457 0ustar00import*as t from"@wordpress/interactivity";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const n=(t=>{var n={};return e.d(n,t),n})({getContext:()=>t.getContext,getElement:()=>t.getElement,store:()=>t.store});let o=!1,a=0;const{state:r,actions:i,callbacks:l}=(0,n.store)("core/image",{state:{currentImageId:null,get currentImage(){return r.metadata[r.currentImageId]},get overlayOpened(){return null!==r.currentImageId},get roleAttribute(){return r.overlayOpened?"dialog":null},get ariaModal(){return r.overlayOpened?"true":null},get enlargedSrc(){return r.currentImage.uploadedSrc||"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},get figureStyles(){return r.overlayOpened&&`${r.currentImage.figureStyles?.replace(/margin[^;]*;?/g,"")};`},get imgStyles(){return r.overlayOpened&&`${r.currentImage.imgStyles?.replace(/;$/,"")}; object-fit:cover;`},get imageButtonRight(){const{imageId:t}=(0,n.getContext)();return r.metadata[t].imageButtonRight},get imageButtonTop(){const{imageId:t}=(0,n.getContext)();return r.metadata[t].imageButtonTop},get isContentHidden(){const t=(0,n.getContext)();return r.overlayEnabled&&r.currentImageId===t.imageId},get isContentVisible(){const t=(0,n.getContext)();return!r.overlayEnabled&&r.currentImageId===t.imageId}},actions:{showLightbox(){const{imageId:t}=(0,n.getContext)();r.metadata[t].imageRef?.complete&&(r.scrollTopReset=document.documentElement.scrollTop,r.scrollLeftReset=document.documentElement.scrollLeft,r.overlayEnabled=!0,r.currentImageId=t,l.setOverlayStyles())},hideLightbox(){r.overlayEnabled&&(r.showClosingAnimation=!0,r.overlayEnabled=!1,setTimeout((function(){r.currentImage.buttonRef.focus({preventScroll:!0}),r.currentImageId=null}),450))},handleKeydown(t){if(r.overlayEnabled){if("Tab"===t.key){t.preventDefault();const{ref:e}=(0,n.getElement)();e.querySelector("button").focus()}"Escape"===t.key&&i.hideLightbox()}},handleTouchMove(t){r.overlayEnabled&&t.preventDefault()},handleTouchStart(){o=!0},handleTouchEnd(){a=Date.now(),o=!1},handleScroll(){r.overlayOpened&&!o&&Date.now()-a>450&&window.scrollTo(r.scrollLeftReset,r.scrollTopReset)}},callbacks:{setOverlayStyles(){if(!r.overlayEnabled)return;let{naturalWidth:t,naturalHeight:e,offsetWidth:n,offsetHeight:o}=r.currentImage.imageRef,{x:a,y:i}=r.currentImage.imageRef.getBoundingClientRect();const l=t/e;let g=n/o;if("contain"===r.currentImage.scaleAttr)if(l>g){const t=n/l;i+=(o-t)/2,o=t}else{const t=o*l;a+=(n-t)/2,n=t}g=n/o;let c=parseFloat("none"!==r.currentImage.targetWidth?r.currentImage.targetWidth:t),s=parseFloat("none"!==r.currentImage.targetHeight?r.currentImage.targetHeight:e),d=c/s,u=c,m=s,h=c,p=s;if(l.toFixed(2)!==d.toFixed(2)){if(l>d){const t=c/l;s-t>c?(s=t,c=t*l):s=c/l}else{const t=s*l;c-t>s?(c=t,s=t/l):c=s*l}h=c,p=s,d=c/s,g>d?(u=c,m=u/g):(m=s,u=m*g)}(n>h||o>p)&&(h=n,p=o);let f=0;window.innerWidth>480?f=80:window.innerWidth>1920&&(f=160);const y=Math.min(window.innerWidth-f,h),b=Math.min(window.innerHeight-80,p);g>y/b?(h=y,p=h/g):(p=b,h=p*g);const w=n/h,I=c*(h/u),x=s*(p/m);r.overlayStyles=`\n\t\t\t\t:root {\n\t\t\t\t\t--wp--lightbox-initial-top-position: ${i}px;\n\t\t\t\t\t--wp--lightbox-initial-left-position: ${a}px;\n\t\t\t\t\t--wp--lightbox-container-width: ${h+1}px;\n\t\t\t\t\t--wp--lightbox-container-height: ${p+1}px;\n\t\t\t\t\t--wp--lightbox-image-width: ${I}px;\n\t\t\t\t\t--wp--lightbox-image-height: ${x}px;\n\t\t\t\t\t--wp--lightbox-scale: ${w};\n\t\t\t\t\t--wp--lightbox-scrollbar-width: ${window.innerWidth-document.documentElement.clientWidth}px;\n\t\t\t\t}\n\t\t\t`},setButtonStyles(){const{imageId:t}=(0,n.getContext)(),{ref:e}=(0,n.getElement)();r.metadata[t].imageRef=e,r.metadata[t].currentSrc=e.currentSrc;const{naturalWidth:o,naturalHeight:a,offsetWidth:i,offsetHeight:l}=e;if(0===o||0===a)return;const g=e.parentElement,c=e.parentElement.clientWidth;let s=e.parentElement.clientHeight;const d=g.querySelector("figcaption");if(d){const t=window.getComputedStyle(d);["absolute","fixed"].includes(t.position)||(s=s-d.offsetHeight-parseFloat(t.marginTop)-parseFloat(t.marginBottom))}const u=s-l,m=c-i;let h=u+16,p=m+16;if("contain"===r.metadata[t].scaleAttr){const t=o/a;if(t>=i/l){h=(l-i/t)/2+u+16,p=m+16}else{h=u+16,p=(i-l*t)/2+m+16}}r.metadata[t].imageButtonTop=h,r.metadata[t].imageButtonRight=p},setOverlayFocus(){if(r.overlayEnabled){const{ref:t}=(0,n.getElement)();t.focus()}},initTriggerButton(){const{imageId:t}=(0,n.getContext)(),{ref:e}=(0,n.getElement)();r.metadata[t].buttonRef=e}}},{lock:!0});block-library/file/view.js000064400000006145147207022110011531 0ustar00import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; ;// CONCATENATED MODULE: external "@wordpress/interactivity" var x = (y) => { var x = {}; __webpack_require__.d(x, y); return x } var y = (x) => (() => (x)) const interactivity_namespaceObject = x({ ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils/index.js /** * Uses a combination of user agent matching and feature detection to determine whether * the current browser supports rendering PDFs inline. * * @return {boolean} Whether or not the browser supports inline PDFs. */ const browserSupportsPdfs = () => { // Most mobile devices include "Mobi" in their UA. if (window.navigator.userAgent.indexOf('Mobi') > -1) { return false; } // Android tablets are the noteable exception. if (window.navigator.userAgent.indexOf('Android') > -1) { return false; } // iPad pretends to be a Mac. if (window.navigator.userAgent.indexOf('Macintosh') > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) { return false; } // IE only supports PDFs when there's an ActiveX object available for it. if (!!(window.ActiveXObject || 'ActiveXObject' in window) && !(createActiveXObject('AcroPDF.PDF') || createActiveXObject('PDF.PdfCtrl'))) { return false; } return true; }; /** * Helper function for creating ActiveX objects, catching any errors that are thrown * when it's generated. * * @param {string} type The name of the ActiveX object to create. * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed. */ const createActiveXObject = type => { let ax; try { ax = new window.ActiveXObject(type); } catch (e) { ax = undefined; } return ax; }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/view.js /** * WordPress dependencies */ /** * Internal dependencies */ (0,interactivity_namespaceObject.store)('core/file', { state: { get hasPdfPreview() { return browserSupportsPdfs(); } } }, { lock: true }); block-library/file/view.min.js000064400000001315147207022110012305 0ustar00import*as e from"@wordpress/interactivity";var t={d:(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const o=(e=>{var o={};return t.d(o,e),o})({store:()=>e.store}),r=e=>{let t;try{t=new window.ActiveXObject(e)}catch(e){t=void 0}return t};(0,o.store)("core/file",{state:{get hasPdfPreview(){return!(window.navigator.userAgent.indexOf("Mobi")>-1||window.navigator.userAgent.indexOf("Android")>-1||window.navigator.userAgent.indexOf("Macintosh")>-1&&window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>2||(window.ActiveXObject||"ActiveXObject"in window)&&!r("AcroPDF.PDF")&&!r("PDF.PdfCtrl"))}}},{lock:!0});block-library/search/view.js000064400000007611147207022110012056 0ustar00import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; ;// CONCATENATED MODULE: external "@wordpress/interactivity" var x = (y) => { var x = {}; __webpack_require__.d(x, y); return x } var y = (x) => (() => (x)) const interactivity_namespaceObject = 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) }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/view.js /** * WordPress dependencies */ const { actions } = (0,interactivity_namespaceObject.store)('core/search', { state: { get ariaLabel() { const { isSearchInputVisible, ariaLabelCollapsed, ariaLabelExpanded } = (0,interactivity_namespaceObject.getContext)(); return isSearchInputVisible ? ariaLabelExpanded : ariaLabelCollapsed; }, get ariaControls() { const { isSearchInputVisible, inputId } = (0,interactivity_namespaceObject.getContext)(); return isSearchInputVisible ? null : inputId; }, get type() { const { isSearchInputVisible } = (0,interactivity_namespaceObject.getContext)(); return isSearchInputVisible ? 'submit' : 'button'; }, get tabindex() { const { isSearchInputVisible } = (0,interactivity_namespaceObject.getContext)(); return isSearchInputVisible ? '0' : '-1'; } }, actions: { openSearchInput(event) { const ctx = (0,interactivity_namespaceObject.getContext)(); const { ref } = (0,interactivity_namespaceObject.getElement)(); if (!ctx.isSearchInputVisible) { event.preventDefault(); ctx.isSearchInputVisible = true; ref.parentElement.querySelector('input').focus(); } }, closeSearchInput() { const ctx = (0,interactivity_namespaceObject.getContext)(); ctx.isSearchInputVisible = false; }, handleSearchKeydown(event) { const { ref } = (0,interactivity_namespaceObject.getElement)(); // If Escape close the menu. if (event?.key === 'Escape') { actions.closeSearchInput(); ref.querySelector('button').focus(); } }, handleSearchFocusout(event) { const { ref } = (0,interactivity_namespaceObject.getElement)(); // If focus is outside search form, and in the document, close menu // event.target === The element losing focus // event.relatedTarget === The element receiving focus (if any) // When focusout is outside the document, // `window.document.activeElement` doesn't change. if (!ref.contains(event.relatedTarget) && event.target !== window.document.activeElement) { actions.closeSearchInput(); } } } }, { lock: true }); block-library/search/view.min.js000064400000002437147207022110012641 0ustar00import*as e from"@wordpress/interactivity";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const n=(e=>{var n={};return t.d(n,e),n})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store}),{actions:r}=(0,n.store)("core/search",{state:{get ariaLabel(){const{isSearchInputVisible:e,ariaLabelCollapsed:t,ariaLabelExpanded:r}=(0,n.getContext)();return e?r:t},get ariaControls(){const{isSearchInputVisible:e,inputId:t}=(0,n.getContext)();return e?null:t},get type(){const{isSearchInputVisible:e}=(0,n.getContext)();return e?"submit":"button"},get tabindex(){const{isSearchInputVisible:e}=(0,n.getContext)();return e?"0":"-1"}},actions:{openSearchInput(e){const t=(0,n.getContext)(),{ref:r}=(0,n.getElement)();t.isSearchInputVisible||(e.preventDefault(),t.isSearchInputVisible=!0,r.parentElement.querySelector("input").focus())},closeSearchInput(){(0,n.getContext)().isSearchInputVisible=!1},handleSearchKeydown(e){const{ref:t}=(0,n.getElement)();"Escape"===e?.key&&(r.closeSearchInput(),t.querySelector("button").focus())},handleSearchFocusout(e){const{ref:t}=(0,n.getElement)();t.contains(e.relatedTarget)||e.target===window.document.activeElement||r.closeSearchInput()}}},{lock:!0});block-library/navigation/view.js000064400000020331147207022110012742 0ustar00import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; ;// CONCATENATED MODULE: external "@wordpress/interactivity" var x = (y) => { var x = {}; __webpack_require__.d(x, y); return x } var y = (x) => (() => (x)) const interactivity_namespaceObject = 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) }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/view.js /** * WordPress dependencies */ const focusableSelectors = ['a[href]', 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])', 'select:not([disabled]):not([aria-hidden])', 'textarea:not([disabled]):not([aria-hidden])', 'button:not([disabled]):not([aria-hidden])', '[contenteditable]', '[tabindex]:not([tabindex^="-"])']; // This is a fix for Safari in iOS/iPadOS. Without it, Safari doesn't focus out // when the user taps in the body. It can be removed once we add an overlay to // capture the clicks, instead of relying on the focusout event. document.addEventListener('click', () => {}); const { state, actions } = (0,interactivity_namespaceObject.store)('core/navigation', { state: { get roleAttribute() { const ctx = (0,interactivity_namespaceObject.getContext)(); return ctx.type === 'overlay' && state.isMenuOpen ? 'dialog' : null; }, get ariaModal() { const ctx = (0,interactivity_namespaceObject.getContext)(); return ctx.type === 'overlay' && state.isMenuOpen ? 'true' : null; }, get ariaLabel() { const ctx = (0,interactivity_namespaceObject.getContext)(); return ctx.type === 'overlay' && state.isMenuOpen ? ctx.ariaLabel : null; }, get isMenuOpen() { // The menu is opened if either `click`, `hover` or `focus` is true. return Object.values(state.menuOpenedBy).filter(Boolean).length > 0; }, get menuOpenedBy() { const ctx = (0,interactivity_namespaceObject.getContext)(); return ctx.type === 'overlay' ? ctx.overlayOpenedBy : ctx.submenuOpenedBy; } }, actions: { openMenuOnHover() { const { type, overlayOpenedBy } = (0,interactivity_namespaceObject.getContext)(); if (type === 'submenu' && // Only open on hover if the overlay is closed. Object.values(overlayOpenedBy || {}).filter(Boolean).length === 0) { actions.openMenu('hover'); } }, closeMenuOnHover() { const { type, overlayOpenedBy } = (0,interactivity_namespaceObject.getContext)(); if (type === 'submenu' && // Only close on hover if the overlay is closed. Object.values(overlayOpenedBy || {}).filter(Boolean).length === 0) { actions.closeMenu('hover'); } }, openMenuOnClick() { const ctx = (0,interactivity_namespaceObject.getContext)(); const { ref } = (0,interactivity_namespaceObject.getElement)(); ctx.previousFocus = ref; actions.openMenu('click'); }, closeMenuOnClick() { actions.closeMenu('click'); actions.closeMenu('focus'); }, openMenuOnFocus() { actions.openMenu('focus'); }, toggleMenuOnClick() { const ctx = (0,interactivity_namespaceObject.getContext)(); const { ref } = (0,interactivity_namespaceObject.getElement)(); // 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 if (window.document.activeElement !== ref) { ref.focus(); } const { menuOpenedBy } = state; if (menuOpenedBy.click || menuOpenedBy.focus) { actions.closeMenu('click'); actions.closeMenu('focus'); } else { ctx.previousFocus = ref; actions.openMenu('click'); } }, handleMenuKeydown(event) { const { type, firstFocusableElement, lastFocusableElement } = (0,interactivity_namespaceObject.getContext)(); if (state.menuOpenedBy.click) { // If Escape close the menu. if (event?.key === 'Escape') { actions.closeMenu('click'); actions.closeMenu('focus'); return; } // Trap focus if it is an overlay (main menu). if (type === 'overlay' && event.key === 'Tab') { // If shift + tab it change the direction. if (event.shiftKey && window.document.activeElement === firstFocusableElement) { event.preventDefault(); lastFocusableElement.focus(); } else if (!event.shiftKey && window.document.activeElement === lastFocusableElement) { event.preventDefault(); firstFocusableElement.focus(); } } } }, handleMenuFocusout(event) { const { modal, type } = (0,interactivity_namespaceObject.getContext)(); // If focus is outside modal, and in the document, close menu // event.target === The element losing focus // event.relatedTarget === The element receiving focus (if any) // When focusout is outside the document, // `window.document.activeElement` doesn't change. // The event.relatedTarget is null when something outside the navigation menu is clicked. This is only necessary for Safari. if (event.relatedTarget === null || !modal?.contains(event.relatedTarget) && event.target !== window.document.activeElement && type === 'submenu') { actions.closeMenu('click'); actions.closeMenu('focus'); } }, openMenu(menuOpenedOn = 'click') { const { type } = (0,interactivity_namespaceObject.getContext)(); state.menuOpenedBy[menuOpenedOn] = true; if (type === 'overlay') { // Add a `has-modal-open` class to the root. document.documentElement.classList.add('has-modal-open'); } }, closeMenu(menuClosedOn = 'click') { const ctx = (0,interactivity_namespaceObject.getContext)(); state.menuOpenedBy[menuClosedOn] = false; // Check if the menu is still open or not. if (!state.isMenuOpen) { if (ctx.modal?.contains(window.document.activeElement)) { ctx.previousFocus?.focus(); } ctx.modal = null; ctx.previousFocus = null; if (ctx.type === 'overlay') { document.documentElement.classList.remove('has-modal-open'); } } } }, callbacks: { initMenu() { const ctx = (0,interactivity_namespaceObject.getContext)(); const { ref } = (0,interactivity_namespaceObject.getElement)(); if (state.isMenuOpen) { const focusableElements = ref.querySelectorAll(focusableSelectors); ctx.modal = ref; ctx.firstFocusableElement = focusableElements[0]; ctx.lastFocusableElement = focusableElements[focusableElements.length - 1]; } }, focusFirstElement() { const { ref } = (0,interactivity_namespaceObject.getElement)(); if (state.isMenuOpen) { const focusableElements = ref.querySelectorAll(focusableSelectors); focusableElements?.[0]?.focus(); } } } }, { lock: true }); block-library/navigation/view.min.js000064400000006344147207022110013534 0ustar00import*as e from"@wordpress/interactivity";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const n=(e=>{var n={};return t.d(n,e),n})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store}),o=["a[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","[contenteditable]",'[tabindex]:not([tabindex^="-"])'];document.addEventListener("click",(()=>{}));const{state:l,actions:c}=(0,n.store)("core/navigation",{state:{get roleAttribute(){return"overlay"===(0,n.getContext)().type&&l.isMenuOpen?"dialog":null},get ariaModal(){return"overlay"===(0,n.getContext)().type&&l.isMenuOpen?"true":null},get ariaLabel(){const e=(0,n.getContext)();return"overlay"===e.type&&l.isMenuOpen?e.ariaLabel:null},get isMenuOpen(){return Object.values(l.menuOpenedBy).filter(Boolean).length>0},get menuOpenedBy(){const e=(0,n.getContext)();return"overlay"===e.type?e.overlayOpenedBy:e.submenuOpenedBy}},actions:{openMenuOnHover(){const{type:e,overlayOpenedBy:t}=(0,n.getContext)();"submenu"===e&&0===Object.values(t||{}).filter(Boolean).length&&c.openMenu("hover")},closeMenuOnHover(){const{type:e,overlayOpenedBy:t}=(0,n.getContext)();"submenu"===e&&0===Object.values(t||{}).filter(Boolean).length&&c.closeMenu("hover")},openMenuOnClick(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();e.previousFocus=t,c.openMenu("click")},closeMenuOnClick(){c.closeMenu("click"),c.closeMenu("focus")},openMenuOnFocus(){c.openMenu("focus")},toggleMenuOnClick(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();window.document.activeElement!==t&&t.focus();const{menuOpenedBy:o}=l;o.click||o.focus?(c.closeMenu("click"),c.closeMenu("focus")):(e.previousFocus=t,c.openMenu("click"))},handleMenuKeydown(e){const{type:t,firstFocusableElement:o,lastFocusableElement:u}=(0,n.getContext)();if(l.menuOpenedBy.click){if("Escape"===e?.key)return c.closeMenu("click"),void c.closeMenu("focus");"overlay"===t&&"Tab"===e.key&&(e.shiftKey&&window.document.activeElement===o?(e.preventDefault(),u.focus()):e.shiftKey||window.document.activeElement!==u||(e.preventDefault(),o.focus()))}},handleMenuFocusout(e){const{modal:t,type:o}=(0,n.getContext)();(null===e.relatedTarget||!t?.contains(e.relatedTarget)&&e.target!==window.document.activeElement&&"submenu"===o)&&(c.closeMenu("click"),c.closeMenu("focus"))},openMenu(e="click"){const{type:t}=(0,n.getContext)();l.menuOpenedBy[e]=!0,"overlay"===t&&document.documentElement.classList.add("has-modal-open")},closeMenu(e="click"){const t=(0,n.getContext)();l.menuOpenedBy[e]=!1,l.isMenuOpen||(t.modal?.contains(window.document.activeElement)&&t.previousFocus?.focus(),t.modal=null,t.previousFocus=null,"overlay"===t.type&&document.documentElement.classList.remove("has-modal-open"))}},callbacks:{initMenu(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();if(l.isMenuOpen){const n=t.querySelectorAll(o);e.modal=t,e.firstFocusableElement=n[0],e.lastFocusableElement=n[n.length-1]}},focusFirstElement(){const{ref:e}=(0,n.getElement)();if(l.isMenuOpen){const t=e.querySelectorAll(o);t?.[0]?.focus()}}}},{lock:!0});block-library/query/view.js000064400000011305147207022110011751 0ustar00import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity"; /******/ var __webpack_modules__ = ({ /***/ 438: /***/ ((module) => { module.exports = import("@wordpress/interactivity-router");; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { ;// CONCATENATED MODULE: external "@wordpress/interactivity" var x = (y) => { var x = {}; __webpack_require__.d(x, y); return x } var y = (x) => (() => (x)) const interactivity_namespaceObject = 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) }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/view.js /** * WordPress dependencies */ const isValidLink = ref => ref && ref instanceof window.HTMLAnchorElement && ref.href && (!ref.target || ref.target === '_self') && ref.origin === window.location.origin; const isValidEvent = event => event.button === 0 && // Left clicks only. !event.metaKey && // Open in new tab (Mac). !event.ctrlKey && // Open in new tab (Windows). !event.altKey && // Download. !event.shiftKey && !event.defaultPrevented; (0,interactivity_namespaceObject.store)('core/query', { actions: { *navigate(event) { const ctx = (0,interactivity_namespaceObject.getContext)(); const { ref } = (0,interactivity_namespaceObject.getElement)(); const queryRef = ref.closest('.wp-block-query[data-wp-router-region]'); if (isValidLink(ref) && isValidEvent(event)) { event.preventDefault(); const { actions } = yield Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 438)); yield actions.navigate(ref.href); ctx.url = ref.href; // Focus the first anchor of the Query block. const firstAnchor = `.wp-block-post-template a[href]`; queryRef.querySelector(firstAnchor)?.focus(); } }, *prefetch() { const { ref } = (0,interactivity_namespaceObject.getElement)(); if (isValidLink(ref)) { const { actions } = yield Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 438)); yield actions.prefetch(ref.href); } } }, callbacks: { *prefetch() { const { url } = (0,interactivity_namespaceObject.getContext)(); const { ref } = (0,interactivity_namespaceObject.getElement)(); if (url && isValidLink(ref)) { const { actions } = yield Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 438)); yield actions.prefetch(ref.href); } } } }, { lock: true }); })(); block-library/query/view.min.js000064400000002614147207022110012536 0ustar00import*as e from"@wordpress/interactivity";var t={438:e=>{e.exports=import("@wordpress/interactivity-router")}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const t=(e=>{var t={};return o.d(t,e),t})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store}),r=e=>e&&e instanceof window.HTMLAnchorElement&&e.href&&(!e.target||"_self"===e.target)&&e.origin===window.location.origin;(0,t.store)("core/query",{actions:{*navigate(e){const n=(0,t.getContext)(),{ref:i}=(0,t.getElement)(),s=i.closest(".wp-block-query[data-wp-router-region]");if(r(i)&&(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.defaultPrevented))(e)){e.preventDefault();const{actions:t}=yield Promise.resolve().then(o.bind(o,438));yield t.navigate(i.href),n.url=i.href;const r=".wp-block-post-template a[href]";s.querySelector(r)?.focus()}},*prefetch(){const{ref:e}=(0,t.getElement)();if(r(e)){const{actions:t}=yield Promise.resolve().then(o.bind(o,438));yield t.prefetch(e.href)}}},callbacks:{*prefetch(){const{url:e}=(0,t.getContext)(),{ref:n}=(0,t.getElement)();if(e&&r(n)){const{actions:e}=yield Promise.resolve().then(o.bind(o,438));yield e.prefetch(n.href)}}}},{lock:!0})})();a11y/index.js000064400000011436147207022110006765 0ustar00/******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // EXPORTS __webpack_require__.d(__webpack_exports__, { m: () => (/* binding */ setup), L: () => (/* reexport */ speak) }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/shared/clear.js /** * Clears the a11y-speak-region elements and hides the explanatory text. */ function clear() { const regions = document.getElementsByClassName('a11y-speak-region'); const introText = document.getElementById('a11y-speak-intro-text'); for (let i = 0; i < regions.length; i++) { regions[i].textContent = ''; } // Make sure the explanatory text is hidden from assistive technologies. if (introText) { introText.setAttribute('hidden', 'hidden'); } } ;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/shared/filter-message.js let previousMessage = ''; /** * Filter the message to be announced to the screenreader. * * @param {string} message The message to be announced. * * @return {string} The filtered message. */ function filterMessage(message) { /* * Strip HTML tags (if any) from the message string. Ideally, messages should * be simple strings, carefully crafted for specific use with A11ySpeak. * When re-using already existing strings this will ensure simple HTML to be * stripped out and replaced with a space. Browsers will collapse multiple * spaces natively. */ message = message.replace(/<[^<>]+>/g, ' '); /* * Safari + VoiceOver don't announce repeated, identical strings. We use * a `no-break space` to force them to think identical strings are different. */ if (previousMessage === message) { message += '\u00A0'; } previousMessage = message; return message; } ;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/shared/index.js /** * Internal dependencies */ /** * Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions. * This module is inspired by the `speak` function in `wp-a11y.js`. * * @param {string} message The message to be announced by assistive technologies. * @param {'polite'|'assertive'} [ariaLive] The politeness level for aria-live; default: 'polite'. * * @example * ```js * import { speak } from '@wordpress/a11y'; * * // For polite messages that shouldn't interrupt what screen readers are currently announcing. * speak( 'The message you want to send to the ARIA live region' ); * * // For assertive messages that should interrupt what screen readers are currently announcing. * speak( 'The message you want to send to the ARIA live region', 'assertive' ); * ``` */ function speak(message, ariaLive) { /* * Clear previous messages to allow repeated strings being read out and hide * the explanatory text from assistive technologies. */ clear(); message = filterMessage(message); const introText = document.getElementById('a11y-speak-intro-text'); const containerAssertive = document.getElementById('a11y-speak-assertive'); const containerPolite = document.getElementById('a11y-speak-polite'); if (containerAssertive && ariaLive === 'assertive') { containerAssertive.textContent = message; } else if (containerPolite) { containerPolite.textContent = message; } /* * Make the explanatory text available to assistive technologies by removing * the 'hidden' HTML attribute. */ if (introText) { introText.removeAttribute('hidden'); } } ;// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/module/index.js /** * Internal dependencies */ /** * This no-op function is exported to provide compatibility with the `wp-a11y` Script. * * Filters should inject the relevant HTML on page load instead of requiring setup. */ const setup = () => {}; var __webpack_exports__setup = __webpack_exports__.m; var __webpack_exports__speak = __webpack_exports__.L; export { __webpack_exports__setup as setup, __webpack_exports__speak as speak }; a11y/index.min.js000064400000001443147207022110007544 0ustar00var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{m:()=>a,L:()=>o});let n="";function o(e,t){!function(){const e=document.getElementsByClassName("a11y-speak-region"),t=document.getElementById("a11y-speak-intro-text");for(let t=0;t]+>/g," "),n===e&&(e+=" "),n=e,e}(e);const o=document.getElementById("a11y-speak-intro-text"),a=document.getElementById("a11y-speak-assertive"),r=document.getElementById("a11y-speak-polite");a&&"assertive"===t?a.textContent=e:r&&(r.textContent=e),o&&o.removeAttribute("hidden")}const a=()=>{};var r=t.m,s=t.L;export{r as setup,s as speak};